mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
Starting working on interaction, halfway through red on confirming board wipe conditions
This commit is contained in:
parent
3344218410
commit
8400613a15
3 changed files with 467 additions and 103 deletions
194
settings.py
194
settings.py
|
@ -1,5 +1,5 @@
|
|||
artifact_tokens = ['Blood', 'Clue', 'Food', 'Gold', 'Incubator',
|
||||
'Junk','Map','Powerstone', 'Treasure']
|
||||
'Junk','Map','Powerstone', 'Treasure']
|
||||
|
||||
banned_cards = ['Ancestral Recall', 'Balance', 'Biorhythm', 'Black Lotus',
|
||||
'Braids, Cabal Minion', 'Chaos Orb', 'Coalition Victory',
|
||||
|
@ -18,119 +18,119 @@ banned_cards = ['Ancestral Recall', 'Balance', 'Biorhythm', 'Black Lotus',
|
|||
'Trade Secrets', 'Upheaval', 'Yawgmoth\'s Bargain']
|
||||
|
||||
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',
|
||||
'sacrifices the rest']
|
||||
'exile all', 'exile each', 'creatures get -X/-X', 'sacrifices all', 'sacrifices each',
|
||||
'sacrifices the rest']
|
||||
|
||||
csv_directory = 'csv_files'
|
||||
|
||||
colors = ['colorless', 'white', 'blue', 'black', 'red', 'green',
|
||||
'azorius', 'orzhov', 'selesnya', 'boros', 'dimir',
|
||||
'simic', 'izzet', 'golgari', 'rakdos', 'gruul',
|
||||
'bant', 'esper', 'grixis', 'jund', 'naya',
|
||||
'abzan', 'jeskai', 'mardu', 'sultai', 'temur',
|
||||
'dune', 'glint', 'ink', 'witch', 'yore', 'wubrg',
|
||||
'commander']
|
||||
'azorius', 'orzhov', 'selesnya', 'boros', 'dimir',
|
||||
'simic', 'izzet', 'golgari', 'rakdos', 'gruul',
|
||||
'bant', 'esper', 'grixis', 'jund', 'naya',
|
||||
'abzan', 'jeskai', 'mardu', 'sultai', 'temur',
|
||||
'dune', 'glint', 'ink', 'witch', 'yore', 'wubrg',
|
||||
'commander']
|
||||
|
||||
counter_types = ['+0/+1', '+0/+2', '+1/+0', '+1/+2', '+2/+0', '+2/+2',
|
||||
'-0/-1', '-0/-2', '-1/-0', '-1/-2', '-2/-0', '-2/-2',
|
||||
'Acorn', 'Aegis', 'Age', 'Aim', 'Arrow', 'Arrowhead','Awakening',
|
||||
'Bait', 'Blaze', 'Blessing', 'Blight',' Blood', 'Bloddline',
|
||||
'Bloodstain', 'Book', 'Bounty', 'Brain', 'Bribery', 'Brick',
|
||||
'Burden', 'Cage', 'Carrion', 'Charge', 'Coin', 'Collection',
|
||||
'Component', 'Contested', 'Corruption', 'CRANK!', 'Credit',
|
||||
'Croak', 'Corpse', 'Crystal', 'Cube', 'Currency', 'Death',
|
||||
'Defense', 'Delay', 'Depletion', 'Descent', 'Despair', 'Devotion',
|
||||
'Divinity', 'Doom', 'Dream', 'Duty', 'Echo', 'Egg', 'Elixir',
|
||||
'Ember', 'Energy', 'Enlightened', 'Eon', 'Eruption', 'Everything',
|
||||
'Experience', 'Eyeball', 'Eyestalk', 'Fade', 'Fate', 'Feather',
|
||||
'Feeding', 'Fellowship', 'Fetch', 'Filibuster', 'Finality', 'Flame',
|
||||
'Flood', 'Foreshadow', 'Fungus', 'Fury', 'Fuse', 'Gem', 'Ghostform',
|
||||
'Glpyh', 'Gold', 'Growth', 'Hack', 'Harmony', 'Hatching', 'Hatchling',
|
||||
'Healing', 'Hit', 'Hope',' Hone', 'Hoofprint', 'Hour', 'Hourglass',
|
||||
'Hunger', 'Ice', 'Imposter', 'Incarnation', 'Incubation', 'Infection',
|
||||
'Influence', 'Ingenuity', 'Intel', 'Intervention', 'Invitation',
|
||||
'Isolation', 'Javelin', 'Judgment', 'Keyword', 'Ki', 'Kick',
|
||||
'Knickknack', 'Knowledge', 'Landmark', 'Level', 'Loot', 'Lore',
|
||||
'Loyalty', 'Luck', 'Magnet', 'Manabond', 'Manifestation', 'Mannequin',
|
||||
'Mask', 'Matrix', 'Memory', 'Midway', 'Mine', 'Mining', 'Mire',
|
||||
'Music', 'Muster', 'Necrodermis', 'Nest', 'Net', 'Night', 'Oil',
|
||||
'Omen', 'Ore', 'Page', 'Pain', 'Palliation', 'Paralyzing', 'Pause',
|
||||
'Petal', 'Petrification', 'Phyresis', 'Phylatery', 'Pin', 'Plague',
|
||||
'Plot', 'Point', 'Poison', 'Polyp', 'Possession', 'Pressure', 'Prey',
|
||||
'Pupa', 'Quest', 'Rad', 'Rejection', 'Reprieve', 'Rev', 'Revival',
|
||||
'Ribbon', 'Ritual', 'Rope', 'Rust', 'Scream', 'Scroll', 'Shell',
|
||||
'Shield', 'Silver', 'Shred', 'Sleep', 'Sleight', 'Slime', 'Slumber',
|
||||
'Soot', 'Soul', 'Spark', 'Spite', 'Spore', 'Stash', 'Storage',
|
||||
'Story', 'Strife', 'Study', 'Stun', 'Supply', 'Suspect', 'Takeover',
|
||||
'Task', 'Ticket', 'Tide', 'Time', 'Tower', 'Training', 'Trap',
|
||||
'Treasure', 'Unity', 'Unlock', 'Valor', 'Velocity', 'Verse',
|
||||
'Vitality', 'Void', 'Volatile', 'Vortex', 'Vow', 'Voyage', 'Wage',
|
||||
'Winch', 'Wind', 'Wish']
|
||||
'-0/-1', '-0/-2', '-1/-0', '-1/-2', '-2/-0', '-2/-2',
|
||||
'Acorn', 'Aegis', 'Age', 'Aim', 'Arrow', 'Arrowhead','Awakening',
|
||||
'Bait', 'Blaze', 'Blessing', 'Blight',' Blood', 'Bloddline',
|
||||
'Bloodstain', 'Book', 'Bounty', 'Brain', 'Bribery', 'Brick',
|
||||
'Burden', 'Cage', 'Carrion', 'Charge', 'Coin', 'Collection',
|
||||
'Component', 'Contested', 'Corruption', 'CRANK!', 'Credit',
|
||||
'Croak', 'Corpse', 'Crystal', 'Cube', 'Currency', 'Death',
|
||||
'Defense', 'Delay', 'Depletion', 'Descent', 'Despair', 'Devotion',
|
||||
'Divinity', 'Doom', 'Dream', 'Duty', 'Echo', 'Egg', 'Elixir',
|
||||
'Ember', 'Energy', 'Enlightened', 'Eon', 'Eruption', 'Everything',
|
||||
'Experience', 'Eyeball', 'Eyestalk', 'Fade', 'Fate', 'Feather',
|
||||
'Feeding', 'Fellowship', 'Fetch', 'Filibuster', 'Finality', 'Flame',
|
||||
'Flood', 'Foreshadow', 'Fungus', 'Fury', 'Fuse', 'Gem', 'Ghostform',
|
||||
'Glpyh', 'Gold', 'Growth', 'Hack', 'Harmony', 'Hatching', 'Hatchling',
|
||||
'Healing', 'Hit', 'Hope',' Hone', 'Hoofprint', 'Hour', 'Hourglass',
|
||||
'Hunger', 'Ice', 'Imposter', 'Incarnation', 'Incubation', 'Infection',
|
||||
'Influence', 'Ingenuity', 'Intel', 'Intervention', 'Invitation',
|
||||
'Isolation', 'Javelin', 'Judgment', 'Keyword', 'Ki', 'Kick',
|
||||
'Knickknack', 'Knowledge', 'Landmark', 'Level', 'Loot', 'Lore',
|
||||
'Loyalty', 'Luck', 'Magnet', 'Manabond', 'Manifestation', 'Mannequin',
|
||||
'Mask', 'Matrix', 'Memory', 'Midway', 'Mine', 'Mining', 'Mire',
|
||||
'Music', 'Muster', 'Necrodermis', 'Nest', 'Net', 'Night', 'Oil',
|
||||
'Omen', 'Ore', 'Page', 'Pain', 'Palliation', 'Paralyzing', 'Pause',
|
||||
'Petal', 'Petrification', 'Phyresis', 'Phylatery', 'Pin', 'Plague',
|
||||
'Plot', 'Point', 'Poison', 'Polyp', 'Possession', 'Pressure', 'Prey',
|
||||
'Pupa', 'Quest', 'Rad', 'Rejection', 'Reprieve', 'Rev', 'Revival',
|
||||
'Ribbon', 'Ritual', 'Rope', 'Rust', 'Scream', 'Scroll', 'Shell',
|
||||
'Shield', 'Silver', 'Shred', 'Sleep', 'Sleight', 'Slime', 'Slumber',
|
||||
'Soot', 'Soul', 'Spark', 'Spite', 'Spore', 'Stash', 'Storage',
|
||||
'Story', 'Strife', 'Study', 'Stun', 'Supply', 'Suspect', 'Takeover',
|
||||
'Task', 'Ticket', 'Tide', 'Time', 'Tower', 'Training', 'Trap',
|
||||
'Treasure', 'Unity', 'Unlock', 'Valor', 'Velocity', 'Verse',
|
||||
'Vitality', 'Void', 'Volatile', 'Vortex', 'Vow', 'Voyage', 'Wage',
|
||||
'Winch', 'Wind', 'Wish']
|
||||
|
||||
creature_types = ['Advisor', 'Aetherborn', 'Alien', 'Ally', 'Angel', 'Antelope', 'Ape', 'Archer', 'Archon', 'Armadillo',
|
||||
'Army', 'Artificer', 'Assassin', 'Assembly-Worker', 'Astartes', 'Atog', 'Aurochs', 'Automaton',
|
||||
'Avatar', 'Azra', 'Badger', 'Balloon', 'Barbarian', 'Bard', 'Basilisk', 'Bat', 'Bear', 'Beast', 'Beaver',
|
||||
'Beeble', 'Beholder', 'Berserker', 'Bird', 'Blinkmoth', 'Boar', 'Brainiac', 'Bringer', 'Brushwagg',
|
||||
'C\'tan', 'Camarid', 'Camel', 'Capybara', 'Caribou', 'Carrier', 'Cat', 'Centaur', 'Chicken', 'Child',
|
||||
'Chimera', 'Citizen', 'Cleric', 'Clown', 'Cockatrice', 'Construct', 'Coward', 'Coyote', 'Crab', 'Crocodile',
|
||||
'Custodes', 'Cyberman', 'Cyclops', 'Dalek', 'Dauthi', 'Demigod', 'Demon', 'Deserter', 'Detective', 'Devil',
|
||||
'Dinosaur', 'Djinn', 'Doctor', 'Dog', 'Dragon', 'Drake', 'Dreadnought', 'Drone', 'Druid', 'Dryad', 'Dwarf',
|
||||
'Efreet', 'Egg', 'Elder', 'Eldrazi', 'Elemental', 'Elephant', 'Elf', 'Elk', 'Employee', 'Eye', 'Faerie',
|
||||
'Ferret', 'Fish', 'Flagbearer', 'Fox', 'Fractal', 'Frog', 'Fungus', 'Gamer', 'Gargoyle', 'Germ', 'Giant',
|
||||
'Gith', 'Glimmer', 'Gnoll', 'Gnome', 'Goat', 'Goblin', 'God', 'Golem', 'Gorgon', 'Graveborn', 'Gremlin',
|
||||
'Griffin', 'Guest', 'Hag', 'Halfling', 'Hamster', 'Harpy', 'Head', 'Hellion', 'Hero', 'Hippo', 'Hippogriff',
|
||||
'Homarid', 'Homunculus', 'Hornet', 'Horror', 'Horse', 'Human', 'Hydra', 'Hyena', 'Illusion', 'Imp',
|
||||
'Incarnation', 'Inkling', 'Inquisitor', 'Insect', 'Jackal', 'Jellyfish', 'Juggernaut', 'Kavu', 'Kirin',
|
||||
'Kithkin', 'Knight', 'Kobold', 'Kor', 'Kraken', 'Lamia', 'Lammasu', 'Leech', 'Leviathan', 'Lhurgoyf',
|
||||
'Licid', 'Lizard', 'Manticore', 'Masticore', 'Mercenary', 'Merfolk', 'Metathran', 'Minion', 'Minotaur',
|
||||
'Mite', 'Mole', 'Monger', 'Mongoose', 'Monk', 'Monkey', 'Moonfolk', 'Mount', 'Mouse', 'Mutant', 'Myr',
|
||||
'Mystic', 'Naga', 'Nautilus', 'Necron', 'Nephilim', 'Nightmare', 'Nightstalker', 'Ninja', 'Noble', 'Noggle',
|
||||
'Nomad', 'Nymph', 'Octopus', 'Ogre', 'Ooze', 'Orb', 'Orc', 'Orgg', 'Otter', 'Ouphe', 'Ox', 'Oyster', 'Pangolin',
|
||||
'Peasant', 'Pegasus', 'Pentavite', 'Performer', 'Pest', 'Phelddagrif', 'Phoenix', 'Phyrexian', 'Pilot',
|
||||
'Pincher', 'Pirate', 'Plant', 'Porcupine', 'Possum', 'Praetor', 'Primarch', 'Prism', 'Processor', 'Rabbit',
|
||||
'Raccoon', 'Ranger', 'Rat', 'Rebel', 'Reflection', 'Reveler', 'Rhino', 'Rigger', 'Robot', 'Rogue', 'Rukh',
|
||||
'Sable', 'Salamander', 'Samurai', 'Sand', 'Saproling', 'Satyr', 'Scarecrow', 'Scientist', 'Scion', 'Scorpion',
|
||||
'Scout', 'Sculpture', 'Serf', 'Serpent', 'Servo', 'Shade', 'Shaman', 'Shapeshifter', 'Shark', 'Sheep', 'Siren',
|
||||
'Skeleton', 'Skunk', 'Slith', 'Sliver', 'Sloth', 'Slug', 'Snail', 'Snake', 'Soldier', 'Soltari', 'Spawn',
|
||||
'Specter', 'Spellshaper', 'Sphinx', 'Spider', 'Spike', 'Spirit', 'Splinter', 'Sponge', 'Spy', 'Squid',
|
||||
'Squirrel', 'Starfish', 'Surrakar', 'Survivor', 'Synth', 'Teddy', 'Tentacle', 'Tetravite', 'Thalakos',
|
||||
'Thopter', 'Thrull', 'Tiefling', 'Time Lord', 'Toy', 'Treefolk', 'Trilobite', 'Triskelavite', 'Troll',
|
||||
'Turtle', 'Tyranid', 'Unicorn', 'Urzan', 'Vampire', 'Varmint', 'Vedalken', 'Volver', 'Wall', 'Walrus',
|
||||
'Warlock', 'Warrior', 'Wasp', 'Weasel', 'Weird', 'Werewolf', 'Whale', 'Wizard', 'Wolf', 'Wolverine', 'Wombat',
|
||||
'Worm', 'Wraith', 'Wurm', 'Yeti', 'Zombie', 'Zubera']
|
||||
'Army', 'Artificer', 'Assassin', 'Assembly-Worker', 'Astartes', 'Atog', 'Aurochs', 'Automaton',
|
||||
'Avatar', 'Azra', 'Badger', 'Balloon', 'Barbarian', 'Bard', 'Basilisk', 'Bat', 'Bear', 'Beast', 'Beaver',
|
||||
'Beeble', 'Beholder', 'Berserker', 'Bird', 'Blinkmoth', 'Boar', 'Brainiac', 'Bringer', 'Brushwagg',
|
||||
'C\'tan', 'Camarid', 'Camel', 'Capybara', 'Caribou', 'Carrier', 'Cat', 'Centaur', 'Chicken', 'Child',
|
||||
'Chimera', 'Citizen', 'Cleric', 'Clown', 'Cockatrice', 'Construct', 'Coward', 'Coyote', 'Crab', 'Crocodile',
|
||||
'Custodes', 'Cyberman', 'Cyclops', 'Dalek', 'Dauthi', 'Demigod', 'Demon', 'Deserter', 'Detective', 'Devil',
|
||||
'Dinosaur', 'Djinn', 'Doctor', 'Dog', 'Dragon', 'Drake', 'Dreadnought', 'Drone', 'Druid', 'Dryad', 'Dwarf',
|
||||
'Efreet', 'Egg', 'Elder', 'Eldrazi', 'Elemental', 'Elephant', 'Elf', 'Elk', 'Employee', 'Eye', 'Faerie',
|
||||
'Ferret', 'Fish', 'Flagbearer', 'Fox', 'Fractal', 'Frog', 'Fungus', 'Gamer', 'Gargoyle', 'Germ', 'Giant',
|
||||
'Gith', 'Glimmer', 'Gnoll', 'Gnome', 'Goat', 'Goblin', 'God', 'Golem', 'Gorgon', 'Graveborn', 'Gremlin',
|
||||
'Griffin', 'Guest', 'Hag', 'Halfling', 'Hamster', 'Harpy', 'Head', 'Hellion', 'Hero', 'Hippo', 'Hippogriff',
|
||||
'Homarid', 'Homunculus', 'Hornet', 'Horror', 'Horse', 'Human', 'Hydra', 'Hyena', 'Illusion', 'Imp',
|
||||
'Incarnation', 'Inkling', 'Inquisitor', 'Insect', 'Jackal', 'Jellyfish', 'Juggernaut', 'Kavu', 'Kirin',
|
||||
'Kithkin', 'Knight', 'Kobold', 'Kor', 'Kraken', 'Lamia', 'Lammasu', 'Leech', 'Leviathan', 'Lhurgoyf',
|
||||
'Licid', 'Lizard', 'Manticore', 'Masticore', 'Mercenary', 'Merfolk', 'Metathran', 'Minion', 'Minotaur',
|
||||
'Mite', 'Mole', 'Monger', 'Mongoose', 'Monk', 'Monkey', 'Moonfolk', 'Mount', 'Mouse', 'Mutant', 'Myr',
|
||||
'Mystic', 'Naga', 'Nautilus', 'Necron', 'Nephilim', 'Nightmare', 'Nightstalker', 'Ninja', 'Noble', 'Noggle',
|
||||
'Nomad', 'Nymph', 'Octopus', 'Ogre', 'Ooze', 'Orb', 'Orc', 'Orgg', 'Otter', 'Ouphe', 'Ox', 'Oyster', 'Pangolin',
|
||||
'Peasant', 'Pegasus', 'Pentavite', 'Performer', 'Pest', 'Phelddagrif', 'Phoenix', 'Phyrexian', 'Pilot',
|
||||
'Pincher', 'Pirate', 'Plant', 'Porcupine', 'Possum', 'Praetor', 'Primarch', 'Prism', 'Processor', 'Rabbit',
|
||||
'Raccoon', 'Ranger', 'Rat', 'Rebel', 'Reflection', 'Reveler', 'Rhino', 'Rigger', 'Robot', 'Rogue', 'Rukh',
|
||||
'Sable', 'Salamander', 'Samurai', 'Sand', 'Saproling', 'Satyr', 'Scarecrow', 'Scientist', 'Scion', 'Scorpion',
|
||||
'Scout', 'Sculpture', 'Serf', 'Serpent', 'Servo', 'Shade', 'Shaman', 'Shapeshifter', 'Shark', 'Sheep', 'Siren',
|
||||
'Skeleton', 'Skunk', 'Slith', 'Sliver', 'Sloth', 'Slug', 'Snail', 'Snake', 'Soldier', 'Soltari', 'Spawn',
|
||||
'Specter', 'Spellshaper', 'Sphinx', 'Spider', 'Spike', 'Spirit', 'Splinter', 'Sponge', 'Spy', 'Squid',
|
||||
'Squirrel', 'Starfish', 'Surrakar', 'Survivor', 'Synth', 'Teddy', 'Tentacle', 'Tetravite', 'Thalakos',
|
||||
'Thopter', 'Thrull', 'Tiefling', 'Time Lord', 'Toy', 'Treefolk', 'Trilobite', 'Triskelavite', 'Troll',
|
||||
'Turtle', 'Tyranid', 'Unicorn', 'Urzan', 'Vampire', 'Varmint', 'Vedalken', 'Volver', 'Wall', 'Walrus',
|
||||
'Warlock', 'Warrior', 'Wasp', 'Weasel', 'Weird', 'Werewolf', 'Whale', 'Wizard', 'Wolf', 'Wolverine', 'Wombat',
|
||||
'Worm', 'Wraith', 'Wurm', 'Yeti', 'Zombie', 'Zubera']
|
||||
|
||||
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']
|
||||
|
||||
non_creature_types = ['Legendary', 'Creature', 'Enchantment', 'Artifact',
|
||||
'Battle', 'Sorcery', 'Instant', 'Land', '-', '—',
|
||||
'Blood', 'Clue', 'Food', 'Gold', 'Incubator',
|
||||
'Junk', 'Map', 'Powerstone', 'Treasure',
|
||||
'Equipment', 'Fortification', 'vehicle',
|
||||
'Bobblehead', 'Attraction', 'Contraption',
|
||||
'Siege',
|
||||
'Aura', 'Background', 'Saga', 'Role', 'Shard',
|
||||
'Cartouche', 'Case', 'Class', 'Curse', 'Rune',
|
||||
'Shrine',
|
||||
'Plains', 'Island', 'Swamp', 'Forest', 'Mountain',
|
||||
'Cave', 'Desert', 'Gate', 'Lair', 'Locus', 'Mine',
|
||||
'Power-Plant', 'Sphere', 'Tower', 'Urza\'s']
|
||||
'Battle', 'Sorcery', 'Instant', 'Land', '-', '—',
|
||||
'Blood', 'Clue', 'Food', 'Gold', 'Incubator',
|
||||
'Junk', 'Map', 'Powerstone', 'Treasure',
|
||||
'Equipment', 'Fortification', 'vehicle',
|
||||
'Bobblehead', 'Attraction', 'Contraption',
|
||||
'Siege',
|
||||
'Aura', 'Background', 'Saga', 'Role', 'Shard',
|
||||
'Cartouche', 'Case', 'Class', 'Curse', 'Rune',
|
||||
'Shrine',
|
||||
'Plains', 'Island', 'Swamp', 'Forest', 'Mountain',
|
||||
'Cave', 'Desert', 'Gate', 'Lair', 'Locus', 'Mine',
|
||||
'Power-Plant', 'Sphere', 'Tower', 'Urza\'s']
|
||||
|
||||
num_to_search = ['a', 'an', 'one', '1', 'two', '2', 'three', '3', 'four','4', 'five', '5',
|
||||
'six', '6', 'seven', '7', 'eight', '8', 'nine', '9', 'ten', '10',
|
||||
'x','one or more']
|
||||
'six', '6', 'seven', '7', 'eight', '8', 'nine', '9', 'ten', '10',
|
||||
'x','one or more']
|
||||
|
||||
theme_tags = ['+1/+1 counter', 'one or more counters', 'token', 'gain life', 'one or more creature tokens',
|
||||
'creature token', 'treasure', 'create token', 'draw a card', 'flash', 'choose a creature type',
|
||||
'play land', 'artifact you control enters', 'enchantment you control enters', 'poison counter',
|
||||
'from graveyard', 'mana value', 'from exile', 'mana of any color', 'attacks', 'total power',
|
||||
'greater than starting life', 'lose life', 'whenever you sacrifice', 'creature dying',
|
||||
'creature enters', 'creature leaves', 'creature dies', 'put into graveyard', 'sacrifice',
|
||||
'sacricifice creature', 'sacrifice artifact', 'sacrifice another creature', '-1/-1 counter',
|
||||
'control get +1/+1', 'control dies', 'experience counter', 'triggered ability', 'token',
|
||||
'commit a crime']
|
||||
'creature token', 'treasure', 'create token', 'draw a card', 'flash', 'choose a creature type',
|
||||
'play land', 'artifact you control enters', 'enchantment you control enters', 'poison counter',
|
||||
'from graveyard', 'mana value', 'from exile', 'mana of any color', 'attacks', 'total power',
|
||||
'greater than starting life', 'lose life', 'whenever you sacrifice', 'creature dying',
|
||||
'creature enters', 'creature leaves', 'creature dies', 'put into graveyard', 'sacrifice',
|
||||
'sacrifice creature', 'sacrifice artifact', 'sacrifice another creature', '-1/-1 counter',
|
||||
'control get +1/+1', 'control dies', 'experience counter', 'triggered ability', 'token',
|
||||
'commit a crime']
|
||||
|
||||
targetted_removal_tags = ['exile target', 'destroy target', 'return target', 'shuffles target', 'you control',
|
||||
'deals damage to target', 'loses all abilities']
|
||||
'deals damage to target', 'loses all abilities']
|
||||
|
||||
triggers = ['when', 'whenever', 'at']
|
||||
|
|
2
setup.py
2
setup.py
|
@ -37,7 +37,7 @@ def filter_by_color(df, column_name, value, new_csv_name):
|
|||
filtered_df = filtered_df.loc[filtered_df['securityStamp'] != 'heart']
|
||||
filtered_df = filtered_df.loc[filtered_df['securityStamp'] != 'acorn']
|
||||
|
||||
card_types = ['Plane —', 'Conspiracy', 'Vanguard', 'Scheme', 'Phenomenon', 'Stickers', 'Attraction']
|
||||
card_types = ['Plane —', 'Conspiracy', 'Vanguard', 'Scheme', 'Phenomenon', 'Stickers', 'Attraction', 'Hero']
|
||||
for card_type in card_types:
|
||||
filtered_df = filtered_df[~filtered_df['type'].str.contains(card_type)]
|
||||
filtered_df['faceName'] = filtered_df['faceName'].fillna(filtered_df['name'])
|
||||
|
|
374
tagger.py
374
tagger.py
|
@ -59,7 +59,7 @@ def tag_by_color(df, color):
|
|||
# create_theme_tags(df, color)
|
||||
#else:
|
||||
# pass
|
||||
print('====================\n')
|
||||
"""print('====================\n')
|
||||
kindred_tagging(df, color)
|
||||
print('====================\n')
|
||||
create_theme_tags(df, color)
|
||||
|
@ -97,7 +97,8 @@ def tag_by_color(df, color):
|
|||
tag_for_ramp(df, color)
|
||||
print('====================\n')
|
||||
tag_for_themes(df, color)
|
||||
print('====================\n')
|
||||
print('====================\n')"""
|
||||
tag_for_board_wipes(df, color)
|
||||
|
||||
|
||||
# Lastly, sort all theme tags for easier reading
|
||||
|
@ -105,7 +106,7 @@ def tag_by_color(df, color):
|
|||
df.to_csv(f'{csv_directory}/{color}_cards.csv', index=False)
|
||||
print(df)
|
||||
print(f'Tags are done being set on {color}_cards.csv')
|
||||
#keyboard.wait('space')
|
||||
keyboard.wait('esc')
|
||||
|
||||
## Determine any non-creature cards that have creature types mentioned
|
||||
def kindred_tagging(df, color):
|
||||
|
@ -4046,7 +4047,370 @@ def tag_for_x_spells(df, color):
|
|||
|
||||
print(f'"X Spells" cards in {color}_cards.csv have been tagged.\n')
|
||||
|
||||
### Interaction
|
||||
## Overall tag for interaction group
|
||||
def tag_for_interaction(df, color):
|
||||
pass
|
||||
|
||||
## Counter spells
|
||||
def tag_for_counterspell(df, color):
|
||||
print(f'Tagging cards in {color}_cards.csv that are Counterspells or care about Counterspells.')
|
||||
for index, row in df.iterrows():
|
||||
theme_tags = row['themeTags']
|
||||
if pd.notna(row['text']):
|
||||
if ('control counters a' in row['text'].lower()
|
||||
or 'counter target' in row['text'].lower()
|
||||
or 'return target spell' in row['text'].lower()
|
||||
or 'then return it to its owner' in row['text'].lower()
|
||||
):
|
||||
tag_type = ['Counterspells', 'Spellslinger', 'Spells Matter']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
print(f'Counterspell cards in {color}_cards.csv have been tagged.\n')
|
||||
|
||||
## Board Wipes
|
||||
def tag_for_board_wipes(df, color):
|
||||
print(f'Tagging cards in {color}_cards.csv that are Board Wipes or otherwise deal board-wide damage.')
|
||||
for index, row in df.iterrows():
|
||||
theme_tags = row['themeTags']
|
||||
number_list = list(range(1, 101))
|
||||
number_list = list(map(str, number_list))
|
||||
number_list.append('x')
|
||||
|
||||
# Specifically-named cards
|
||||
if (
|
||||
# Colorless
|
||||
'Aetherspouts' == row['name']
|
||||
or 'Calamity of the Titans' == row['name']
|
||||
or 'Fraying Line' == row['name']
|
||||
or 'Living Death' == row['name']
|
||||
or 'Living End' == row['name']
|
||||
or 'Oblivion Stone' == row['name']
|
||||
or 'The Moment' == row['name']
|
||||
or 'The Tabernacle at Pendrell Vale' == row['name']
|
||||
or 'Ugin, the Spirit Dragon' == row['name']
|
||||
or 'Worldslayer' == row['name']
|
||||
|
||||
# White
|
||||
or 'Ajani, Strength of the Pride' == row['name']
|
||||
or 'Cleansing' == row['name']
|
||||
or 'Fall of the First Civilization' == row['name']
|
||||
or 'Gideon, the Oathsworn' == row['name']
|
||||
or 'Hallowed Burial' == row['name']
|
||||
or 'Out of Time' == row['name']
|
||||
or 'The Eternal Wanderer' == row['name']
|
||||
or 'The Night of the Doctor' == row['name']
|
||||
or 'Wave of Reckoning' == row['name']
|
||||
or 'What Must Be Done' == row['name']
|
||||
or 'Winds of Abandon' == row['name']
|
||||
|
||||
# Blue
|
||||
or 'Cyclonic Rift' == row['name']
|
||||
or 'Engulf the Shore' == row['name']
|
||||
or 'Hurkyl\'s Final Meditation' == row['name']
|
||||
or 'Jin-Gitaxias // The Greath Synthesis' == row['name']
|
||||
or 'Kederekt Leviathan' == row['name']
|
||||
or 'Profaner of the Dead' == row['name']
|
||||
|
||||
# Black
|
||||
or 'Blasphemous Edict' == row['name']
|
||||
or 'Blood on the Snow' == row['name']
|
||||
or 'Curse of the Cabal' == row['name']
|
||||
or 'Death Cloud' == row['name']
|
||||
or 'Gix\'s Command' == row['name']
|
||||
or 'Killing Wave' == row['name']
|
||||
or 'Liliana, Death\'s Majesty' == row['name']
|
||||
or 'Necroplasm' == row['name']
|
||||
or 'Necrotic Hex' == row['name']
|
||||
or 'Olivia\'s Wrath' == row['name']
|
||||
or 'Sphere of Annihilation' == row['name']
|
||||
or 'Swarmyard Massacre' == row['name']
|
||||
or 'The Elderspell' == row['name']
|
||||
or 'Urborg\'s Justice' == row['name']
|
||||
or 'Zombie Apocalypse' == row['name']
|
||||
|
||||
# Red
|
||||
or 'Breath Weapon' == row['name']
|
||||
or 'Caught in the Crossfire' == row['name']
|
||||
or 'Chandra, Awakened Inferno' == row['name']
|
||||
or 'Draconic Intervention' == row['name']
|
||||
or 'Dwarven Catapult' == row['name']
|
||||
or 'Electrickery' == row['name']
|
||||
or 'Evaporate' == row['name']
|
||||
or 'Exocrine' == row['name']
|
||||
or 'Fiery Cannonade' == row['name']
|
||||
or 'Flame Blitz' == row['name']
|
||||
or 'Forerunner of the Empire' == row['name']
|
||||
|
||||
):
|
||||
print(row['name'])
|
||||
tag_type = ['Board Wipes']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
|
||||
if pd.notna(row['text']):
|
||||
# General non-damage
|
||||
if ('destroy all' in row['text'].lower()
|
||||
or 'destroy each' in row['text'].lower()
|
||||
or 'destroy the rest' in row['text'].lower()
|
||||
or 'destroys the rest' in row['text'].lower()
|
||||
or 'for each attacking creature, put' in row['text'].lower()
|
||||
or 'exile all' in row['text'].lower()
|
||||
or 'exile any number' in row['text'].lower()
|
||||
or 'exile each' in row['text'].lower()
|
||||
or 'exile the rest' in row['text'].lower()
|
||||
or 'exiles any number' in row['text'].lower()
|
||||
or 'exiles the rest' in row['text'].lower()
|
||||
or 'put all attacking creatures' in row['text'].lower()
|
||||
or 'put all creatures' in row['text'].lower()
|
||||
or 'return all' in row['text'].lower()
|
||||
or 'return any number of' in row['text'].lower()
|
||||
or 'return each' in row['text'].lower()
|
||||
or 'return to their owners\' hands' in row['text'].lower()
|
||||
or 'sacrifice all' in row['text'].lower()
|
||||
or 'sacrifice each' in row['text'].lower()
|
||||
or 'sacrifice that many' in row['text'].lower()
|
||||
or 'sacrifice the rest' in row['text'].lower()
|
||||
or 'sacrifice this creature unless you pay' in row['text'].lower()
|
||||
or 'sacrifices all' in row['text'].lower()
|
||||
or 'sacrifices each' in row['text'].lower()
|
||||
or 'sacrifices that many' in row['text'].lower()
|
||||
or 'sacrifices the creatures' in row['text'].lower()
|
||||
or 'sacrifices the rest' in row['text'].lower()
|
||||
or 'shuffles all creatures' in row['text'].lower()
|
||||
):
|
||||
if ('blocking enchanted' in row['text'].lower()
|
||||
or 'blocking it' in row['text'].lower()
|
||||
or 'blocked by' in row['text'].lower()
|
||||
or f'card exiled with {row['name'].lower()}' in row['text'].lower()
|
||||
or f'cards exiled with {row['name'].lower()}' in row['text'].lower()
|
||||
or 'end the turn' in row['text'].lower()
|
||||
or 'exile all cards from your library' in row['text'].lower()
|
||||
or 'exile all cards from your hand' in row['text'].lower()
|
||||
or 'for each card exiled this way, search' in row['text'].lower()
|
||||
or 'from all graveyards to the battlefield' in row['text'].lower()
|
||||
or 'from all graveyards to their owner' in row['text'].lower()
|
||||
or 'from your graveyard with the same name' in row['text'].lower()
|
||||
or 'from their graveyard with the same name' in row['text'].lower()
|
||||
or 'from their hand with the same name' in row['text'].lower()
|
||||
or 'from their library with the same name' in row['text'].lower()
|
||||
or 'from their graveyard to the battlefield' in row['text'].lower()
|
||||
or 'from their graveyards to the battlefield' in row['text'].lower()
|
||||
or 'from your graveyard with the same name' in row['text'].lower()
|
||||
or 'from your graveyard to the battlefield' in row['text'].lower()
|
||||
or 'from your graveyard to your hand' in row['text'].lower()
|
||||
or 'from your hand with the same name' in row['text'].lower()
|
||||
or 'from your library with the same name' in row['text'].lower()
|
||||
or 'into your hand and exile the rest' in row['text'].lower()
|
||||
or 'into your hand, and exile the rest' in row['text'].lower()
|
||||
or 'it blocked' in row['text'].lower()
|
||||
or 'rest back in any order' in row['text'].lower()
|
||||
or 'reveals their hand' in row['text'].lower()
|
||||
or 'other cards revealed' in row['text'].lower()
|
||||
or 'return them to the battlefield' in row['text'].lower()
|
||||
or 'return each of them to the battlefield' in row['text'].lower()
|
||||
|
||||
# Excluding targetted
|
||||
or 'destroy target' in row['text'].lower()
|
||||
or 'exile target' in row['text'].lower()
|
||||
|
||||
# Exclude erroneously matching tags
|
||||
or 'Blink' in theme_tags
|
||||
|
||||
# Exclude specific matches
|
||||
# Colorless cards
|
||||
or 'Scavenger Grounds' == row['name']
|
||||
or 'Sentinel Totem' == row['name']
|
||||
or 'Sheltered Valley' == row['name']
|
||||
|
||||
# White cards
|
||||
or 'Brilliant Restoration' == row['name']
|
||||
or 'Calamity\'s Wake' == row['name']
|
||||
or 'Honor the Fallen' == row['name']
|
||||
or 'Hourglass of the Lost' == row['name']
|
||||
or 'Livio, Oathsworn Sentinel' == row['name']
|
||||
or 'Mandate of Peace' == row['name']
|
||||
or 'Morningtide' == row['name']
|
||||
or 'Pure Reflection' == row['name']
|
||||
or 'Rest in Peace' == row['name']
|
||||
or 'Sanctifier en-Vec' == row['name']
|
||||
|
||||
# Blue cards
|
||||
or 'Arcane Artisan' == row['name']
|
||||
or 'Bazaar of Wonders' == row['name']
|
||||
or 'Faerie Artisans' == row['name']
|
||||
or 'Jace, the Mind Sculptor' == row['name']
|
||||
or 'Mass Polymorph' == row['name']
|
||||
or 'Metallurgic Summonings' == row['name']
|
||||
or 'Paradoxical Outcome' == row['name']
|
||||
or 'Saprazzan Bailiff' == row['name']
|
||||
or 'The Tale of Tamiyo' == row['name']
|
||||
or 'Vodalian War Machine' == row['name']
|
||||
|
||||
# Black cards
|
||||
or 'Desperate Research' == row['name']
|
||||
or 'Doomsday' == row['name']
|
||||
or 'Drudge Spell' == row['name']
|
||||
or 'Elder Brain' == row['name']
|
||||
or 'Gorex, the Tombshell' == row['name']
|
||||
or 'Grave Consequences' == row['name']
|
||||
or 'Hellcarver Demon' == row['name']
|
||||
or 'Hypnox' == row['name']
|
||||
or 'Kaervek\'s Spite' == row['name']
|
||||
or 'Lich' == row['name']
|
||||
or 'Opposition Agent' == row['name']
|
||||
or 'Phyrexian Negator' == row['name']
|
||||
or 'Phyrexian Totem' == row['name']
|
||||
or 'Prowling Gheistcatcher' == row['name']
|
||||
or 'Sengir Autocrat' == row['name']
|
||||
or 'Shadow of the Enemy' == row['name']
|
||||
or 'Sink into Takenuma' == row['name']
|
||||
or 'Sutured Ghoul' == row['name']
|
||||
or 'Sword-Point Diplomacy' == row['name']
|
||||
or 'Szat\'s Will' == row['name']
|
||||
or 'Tomb of Urami' == row['name']
|
||||
or 'Tombstone Stairwell' == row['name']
|
||||
or 'Yukora, the Prisoner' == row['name']
|
||||
or 'Zombie Mob' == row['name']
|
||||
|
||||
# Red cards
|
||||
or 'Bomb Squad' in row['name']
|
||||
or 'Barrel Down Sokenzan' == row['name']
|
||||
or 'Explosive Singularity' == row['name']
|
||||
or 'Expose the Culprit' == row['name']
|
||||
|
||||
):
|
||||
continue
|
||||
else:
|
||||
print(row['name'])
|
||||
tag_type = ['Board Wipes']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
# Number-based
|
||||
if pd.notna(row['text']):
|
||||
for i in number_list:
|
||||
# Deals damage from 1-100 or X
|
||||
if (f'deals {i} damage' in row['text'].lower()):
|
||||
if ('blocking it' in row['text'].lower()
|
||||
or 'is blocked' in row['text'].lower()
|
||||
or 'other creature you control' in row['text'].lower()
|
||||
):
|
||||
continue
|
||||
if ('and each creature' in row['text'].lower()
|
||||
or 'each artifact creature' in row['text'].lower()
|
||||
or 'each creature' in row['text'].lower()
|
||||
or 'each black creature' in row['text'].lower()
|
||||
or 'each blue creature' in row['text'].lower()
|
||||
or 'each green creature' in row['text'].lower()
|
||||
or 'each nonartifact creature' in row['text'].lower()
|
||||
or 'each nonblack creature' in row['text'].lower()
|
||||
or 'each nonblue creature' in row['text'].lower()
|
||||
or 'each nongreen creature' in row['text'].lower()
|
||||
or 'each nonred creature' in row['text'].lower()
|
||||
or 'each nonwhite creature' in row['text'].lower()
|
||||
or 'each red creature' in row['text'].lower()
|
||||
or 'each tapped creature' in row['text'].lower()
|
||||
or 'each untapped creature' in row['text'].lower()
|
||||
or 'each white creature' in row['text'].lower()
|
||||
or 'to each attacking creature' in row['text'].lower()
|
||||
or 'to each creature' in row['text'].lower()
|
||||
or 'to each other creature' in row['text'].lower()
|
||||
):
|
||||
print(row['name'])
|
||||
tag_type = ['Board Wipes', 'Burn']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
# -X/-X effects
|
||||
if (f'creatures get -{i}/-{i}' in row['text'].lower()
|
||||
or f'creatures get +{i}/-{i}' in row['text'].lower()
|
||||
or f'creatures of that type -{i}/-{i}' in row['text'].lower()
|
||||
or f'each creature gets -{i}/-{i}' in row['text'].lower()
|
||||
or f'each other creature gets -{i}/-{i}' in row['text'].lower()
|
||||
or f'control get -{i}/-{i}' in row['text'].lower()
|
||||
or f'control gets -{i}/-{i}' in row['text'].lower()
|
||||
or f'controls get -{i}/-{i}' in row['text'].lower()
|
||||
or f'creatures get -0/-{i}' in row['text'].lower()
|
||||
or f'tokens get -{i}/-{i}' in row['text'].lower()
|
||||
or f'put a -{i}/-{i} counter on each' in row['text'].lower()
|
||||
or f'put {i} -1/-1 counters on each' in row['text'].lower()
|
||||
or f'tokens get -{i}/-{i}' in row['text'].lower()
|
||||
or f'type of your choice get -{i}/-{i}' in row['text'].lower()
|
||||
):
|
||||
if ('you control get -1/-1' in row['text'].lower()
|
||||
):
|
||||
continue
|
||||
print(row['name'])
|
||||
tag_type = ['Board Wipes']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
# Deals non-definite damage equal to
|
||||
if ('deals damage equal to' in row['text'].lower()
|
||||
or 'deals that much damage to' in row['text'].lower()
|
||||
or 'deals damage to' in row['text'].lower()
|
||||
):
|
||||
#if ():
|
||||
# continue
|
||||
if ('each artifact creature' in row['text'].lower()
|
||||
or 'each creature' in row['text'].lower()
|
||||
or 'each black creature' in row['text'].lower()
|
||||
or 'each blue creature' in row['text'].lower()
|
||||
or 'each green creature' in row['text'].lower()
|
||||
or 'each nonartifact creature' in row['text'].lower()
|
||||
or 'each nonblack creature' in row['text'].lower()
|
||||
or 'each nonblue creature' in row['text'].lower()
|
||||
or 'each nongreen creature' in row['text'].lower()
|
||||
or 'each nonred creature' in row['text'].lower()
|
||||
or 'each nonwhite creature' in row['text'].lower()
|
||||
or 'each red creature' in row['text'].lower()
|
||||
or 'each tapped creature' in row['text'].lower()
|
||||
or 'each untapped creature' in row['text'].lower()
|
||||
or 'each white creature' in row['text'].lower()
|
||||
or 'to each attacking creature' in row['text'].lower()
|
||||
or 'to each creature' in row['text'].lower()
|
||||
or 'to each other creature' in row['text'].lower()
|
||||
):
|
||||
print(row['name'])
|
||||
tag_type = ['Board Wipes', 'Burn']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
|
||||
|
||||
if pd.notna(row['keywords']):
|
||||
if ('' in row['keywords']
|
||||
or '' in row['keywords']
|
||||
):
|
||||
tag_type = ['']
|
||||
for tag in tag_type:
|
||||
if tag not in theme_tags:
|
||||
theme_tags.extend([tag])
|
||||
df.at[index, 'themeTags'] = theme_tags
|
||||
|
||||
print(f'"Board Wipe" cards in {color}_cards.csv have been tagged.\n')
|
||||
|
||||
## Protection/Safety spells
|
||||
|
||||
|
||||
## Spot removal
|
||||
|
||||
|
||||
#regenerate_csv_by_color('colorless')
|
||||
for color in colors:
|
||||
load_dataframe(color)
|
||||
#for color in colors:
|
||||
load_dataframe('red')
|
Loading…
Add table
Add a link
Reference in a new issue