randomCommanderFromFile.txt
The randomcommander from file feature allows players to load a commander deck from a predefined list stored in an external file. Here’s how it works:
File Loading: The game attempts to open a file named commander.txt located in the User/commander/ directory. This file contains a list of possible commander IDs or names.
Default Handling: If the file doesn't exist or is empty, the game creates the file and writes a default commander ID (670972) to it. The file is then re-opened for further processing.
Commander ID Extraction: The game reads each line in the file, ignoring comments (lines starting with #). It validates whether the line is a numeric commander ID. If not, the game tries to convert it from a card name to an ID using function getMTGId().
Filtering and Validation: The game then filters out invalid IDs (e.g., IDs that do not correspond to an existing card in the game's database). If no valid IDs remain, it defaults to using the same commander ID (670972).
Random Selection: Once a list of valid commander IDs is compiled, the game randomly selects one ID from this list to be used as the commander for the player.
Deck Construction: A temporary deck is constructed using the selected commander, along with a predefined number of lands and spells that match the commander's colors.
Summary
The random commander from file feature provides a way to customize and randomize the commander used in a game based on an external file. This adds variety and replayability, as each game can have a different commander selected from the list, allowing for different strategies and experiences.
Loads a player with a randomly selected commander from a specified file.
* This function reads a file ('User/commander/commander.txt') that contains a list of potential commander IDs or names.
* It selects one randomly to be used as the player's commander. If the file doesn't exist, or no valid commanders are found, a default commander ID (670972) is used.
* Can read the commander name and a multiverseID
* Lines that start with '#' are ignored
As long as your life total is less than or equal to half your starting life total, this has indestructible
Agrus Kos, Spirit of Justice
Alloy Animist
Bane, Lord of Darkness
Bhaal, Lord of Murder
Fighter Class
Flamerush Rider
Greasefang, Okiba Boss
Hydroid Krasis
=Ilharg, the Raze-Boar
Mangara, the Diplomat
Myrkul, Lord of Bones
Omo, Queen of Vesuva
Ragavan, Nimble Pilferer
Titania's Song
Vedalken Humiliator
Winota, Joiner of Forces
Zara, Renegade Recruiter
Zoraline, Cosmos Caller
Aethermage's Touch
Dragon Mask
Rakalite
Nahiri, the Harbinger
Had to use the treasure defined as primitive since the Fable of the Mirror-Breaker token won't create a treasure otherwise.
Changes:
Rat Colony
Shadow of the Second Sun
Sphinx of the Second Sun
Viashino is no longer a creature type. The postcombat main phase is now referred to as the second main phase.
Updated Rules.cpp to exclude the Viashino type from random kindred decks.
Bug Fixes:
Fable of the Mirror-Breaker
Rat Colony
Plumb the Forbidden
Oblivion Stone
Due to card type association, Dryad Arbor is placed at the end. Any other card that associates two super types in this manner should also be placed at the end of the primitive to avoid changeling thinking that “forest” is a creature type. This applies to reconfigure cards as well, to avoid making changelings equipment.
Changed ownerHand to just hand, inspecting the source code it is the same
Individual cards bug fixes:
Arbiter of the Ideal have to misspell manifest
Curate Must Draw After Surveil
Deface casting restrictions
Discombobulate
Dovin, Grand Arbiter
Downsize
Dragon Throne Of Tarkir
Dragonshift
Dregs of Sorrow
Elder Spawn
Elvish Mariner
Faerie Mastermind
Fecundity
Finale Of Revelation
Flame Channeler
Flameskull
Frostwalk Bastion frozen ability
Gate To The Afterlife
Invade the City is still on the stack while you count your instant and sorcery cards in your graveyard. It doesn't count itself.
Kabira Evangel doesn't seem to work with a may condition
Krosan Verge
Livewire Lash
Meteor Blast
Midnight Clock
Mindlink Mech
Mirror Match
Morality Shift removed
Overwhelming Encounter removed
Peace Talks removed
Quiet Disrepair removed
Ravenous Gigantotherium removed
Reign Of Chaos
Rout
Sanctuary Blade removed
Sculpted Sunburst
Seeds Of Innocence
Shackles Of Treachery
Shared Summons
Sokenzan Smelter
Valiant Endeavor removed
Vraska, Betrayal's Sting
I had to update the _cards.dat files for The Lord of the Rings: Tales of Middle-earth (LTR) and Tales of Middle-earth Commander (LTC) since they didn't have the correct official multiverse IDs. I'm sorry if this affects past decks, but I had to make these changes because it was difficult to debug cards within the set and obtain their respective tokens.
Hisoka, Minamo Sensei
Ragemonger text
Igneous Inspiration and other instants/serceries that target an opponents permanent
Mind Rake
Keeper of the Accord
Aria Of Flame
Arixmethes, Slumbering Isle, Annoying
Battlefield Scrounger
Bloodchief Ascension
Breathless Knight
Breeches, Brazen Plunderer
Doubling Season
Contaminant Grafter
Cursed Rack was working even after being destroyed
Leovold, Emissary of Trest
soldevi digger
raze-boar returned a card from the graveyard
Hatchery Spider is a cast
Estrid, the Masked had to create a flavorful workaround
Atemsis, All-Seeing not exaclty the effect
Nothic
Thunderwave crashing and not working any iteration
Kuldotha Flamefiend
The effect "Whenever one or more +1/+1 counters are put" should be coded as @totalcounteradded(1/1) to to avoid triggering from a single instance that puts multiple counters.
Updated the BLC file to include the alternative layout cards.
Rakdos the Defiler
Jin-Gitaxias, Progress Tyrant
Jousting Lance
Leaf Drum Controlled By The Ai
Spectacle as a macro causes bugs
Sword of the Paruns
Suit Up
Lurrus of the Dream-Den
Double square brackets was causing bugs.
Changed cards with the effect "Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. (It can attack and {T} this turn.)"
I had to modify how the _cards.dat files are created to incorporate variant layouts of adventures, aftermath, and split cards. They are now showing in the collection, but you will need to download the images again.
Rootless Yew
Repel Intruders
Resplendent Angel
Karn, Scion of Urza
when this creature dies, put its counters on target creature you control
Shiny Impetus
Witch of the Moors
Parish-Blade Trainee
Enduring Bondwarden
Marauding Maulhorn
I added a condition to energy activation to prevent the AI from hanging, trimmed excessive '9s' in 'infinite' conditions, fixed the Adapt, Mentor, and Amass Orcs macros, and implemented mercenary token macros.
Light of the Legion
Myriad Construct
Sheoldred
Neheb, the Eternal
Complete the Circuit
Return to Nature
Diffusion Sliver
Frost Titan
Death Match
Requiem Angel
Wildwood Scourge
Glasspool Mimic
Adaptive Gemguard
Admiral Brass, Unsinkable
Ajani Fells the Godsire
Archangel of Wrath
Argent Dais
Bitter Chill
Boggart Bog
Boggart Trawler
Brazen Blademaster
Case of the Crimson Pulse
Case of the Filched Falcon
Case of the Gorgon's Kiss
Case of the Locked Hothouse
Case of the Ransacked Lab
Case of the Shattered Pact
Case of the Shifting Visage
Case of the Stashed Skeleton
Case of the Trampled Garden
Case of the Uneaten Feast
Chancellor of Tales
Charnel Serenade
Confounding Riddle
Copycrook
Court of Ardenvale
Court of Embereth
Court of Garenbrig
Crown of the Ages
Deconstruction Hammer
Deep-Cavern Bat
Detective of the Month
Djinn of the Fountain
Dusk Rose Reliquary
Eladamri, Korvecdal
Explorer's Cache
Family Reunion
Final-Word Phantom
Fires of Victory
Flooded Woodlands
Frogmyr Enforcer
Frostfist Strider
Fungal Fortitude
Galvanic Discharge
Garna, Bloodfist of Keld
Ghostfire Slice
Glimpse the Core
Glorifier of Suffering
Goldfury Strider
Gravedig
Guardian of the Forgotten
Guardian of the Great Door
Howling Galefang
Illicit Masquerade
Impede Momentum
In Thrall to the Pit
Inti, Seneschal of the Sun
Itzquinth, Firstborn of Gishath
Jedit Ojanen, Mercenary
Join the Maestros
Keldon Strike Team
Lethal Throwdown
Malleable Impostor
Mistway Spy
Nelly Borca, Impulsive Accuser
Nettling Nuisance
Ocelot Pride
Ogre Chitterlord
Ohabi Caleria
Ojer Pakpatiq, Deepest Epoch
Ondu Knotmaster // Throw a Line
Orazca Puzzle-Door
Perimeter Enforcer
Pirate Hat
Projektor Inspector
Pyretic Rebirth
Queen's Bay Paladin
Ral and the Implicit Maze
Ray of Ruin
Reckless Pyrosurfer
Refurbished Familiar
Relive the Past
Sage of Days
Salt Road Ambushers
Scroll of Fate
Scurry of Gremlins
Shadow Prophecy
Shadow Puppeteers
Shadow of the Second Sun
Shifting Woodland
Shipwreck Sentry
Silverback Elder
Sleep with the Fishes
Song of Stupefaction
Sorin of House Markov
Sorin, Ravenous Neonate
Soulcoil Viper
Stall for Time
Stronghold Arena
Sunfire Torch
Sunshot Militia
Tamiyo, Inquisitive Student
Tamiyo, Seasoned Scholar
Tear Asunder
Temple of Cyclical Time
Tesak, Judith's Hellhound
The Ancient One
Unlucky Drop
Urborg Lhurgoyf
Vein Ripper
Vodalian Mindsinger
Vohar, Vodalian Desecrator
Voja, Jaws of the Conclave
Warhost's Frenzy
Warm Welcome
Waylaying Pirates
Welcome to Sweettooth
Wumpus Aberration
Bug fixes
abilities simplification
Disciples of the Inferno
Blade of the Bloodchief
Grenzo, Havoc Raiser
Belligerent Brontodon
Weight Advantage
Liliana, Death Mage
Garruk's Warsteed
Ashiok's Forerunner
Liliana, Death Mage
New ability "canplayenchantmentlibrarytop" allow to play enchantments from top
sets now include tokens
you no longer draw conspiracy cards in the random
rules file revisions
commander bugs
Eutropia the Twice-Favored
Calculating Lich
Seismic Wave
Rank and File
Professional Face-Breaker
Realmwalker
Phlage, Titan of Fire's Fury
Scent of Cinder
Radagast The Brown for the AI
Flood of Recollection
Samwise the Stouthearted
Blood Aspirant
Anax, Hardened in the Forge
Kairi, the Swirling Sky
Mind Rake
Hungering Hydra
Spearpoint Oread
Rampaging Geoderm
Keeper of the Accord
Electropotence
Orochi Merge-Keeper
IKO(GODZILLA SERIES MONSTERS)
New Cards:
Agency Coroner
Agrus Kos, Spirit of Justice
Anim Pakal, Thousandth Moon
Azlask, the Swelling Scourge
Badlands Revival
Barbed Servitor
Belligerent Yearling
Bloodbraid Challenger
Breathe Your Last
Broodmate Tyrant
Caught Red-Handed
Cayth, Famed Mechanist
Chittering Dispatcher
Clandestine Meddler
Connecting the Dots
Convenient Target
Conversion Apparatus
Copy Land
Culvert Ambusher
Dauntless Dismantler
Desert's Due
Disa the Restless
Dreadmaw's Ire
Dreamtide Whale
Drossclaw
Due Diligence
Echoing Deeps
Ego Drain
Eldrazi Confluence
Eldritch Immunity
Elemental Eruption
Envoy of the Ancestors
Essence Reliquary
Expanding Ooze
Expel the Unworthy
Felonious Rage
Final Act
Flare of Cultivation
Flare of Denial
Flare of Duplication
Flare of Fortitude
Flare of Malice
From the Rubble
Grim Servant
Hexgold Slith
Hideous Taskmaster
Hope-Ender Coatl
Horrid Shadowspinner
Hourglass of the Lost
Incriminating Impetus
Inspired Inventor
Inversion Behemoth
It Doesn't Add Up
Jyoti, Moag Ancient
Kozilek's Unsealing
Kudo, King Among Bears
Lion Umbra
Make Your Move
March of the Canonized
Mine Raider
Necromancy
No Witnesses
Obstinate Gargoyle
Omo, Queen of Vesuva
Person of Interest
Petrifying Meddler
Polygoyf
Prosperity Tycoon
Pugnacious Hammerskull
Pyrogoyf
Reasonable Doubt
Redemption Choir
Repeat Offender
Rubblebelt Braggart
Rune-Brand Juggler
Salvation Colossus
Scalestorm Summoner
Selective Obliteration
Serum Visionary
Shilgengar, Sire of Famine
Siege-Gang Lieutenant
Skoa, Embermage
Skullcap Snail
Spawnbed Protector
Spider Food
Stone Idol Generator
Strix Serenade
Talion's Messenger
Tarmogoyf Nest
Temperamental Oozewagg
Ulamog's Dreadsire
Vanguard of the Rose
Voidpouncer
White Orchid Phantom
Wing It