It is currently 16 Apr 2024, 08:54
   
Text Size

Extension allowing formats to be constrained by card rarity

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Extension allowing formats to be constrained by card rarity

Postby lukegothic » 04 Dec 2017, 21:36

Some people were requesting to be able to filter Pauper legal cards while building their Pauper decks, so I extended the format reader and it is now able to understand a new parameter on the format definitions called Rarities. You can put there any combination of valid rarities separated by commas, for instance:
Code: Select all
Rarities: Common, Uncommon
So, to support Pauper format, you would put this in either res/blockdata/formats.txt or your customformats.txt:
Code: Select all
[Pauper]
Banned:Cloud of Faeries; Cloudpost; Cranial Plating; Empty the Warrens; Frantic Search; Grapeshot; Invigorate; Peregrine Drake; Temporal Fissure; Treasure Cruise; Goblin Grenade; High Tide; Hymn to Tourach; Sinkhole
Rarities:Common
Code-wise, the patch just throws some code into the class GameFormat so it can use this new information, and while filtering cards, if the Rarities parameter is present it adds a new predicate to the filtering function checking for card rarity.

Included patch:
Attachments
supportrarityconstraininformats.zip
(2.12 KiB) Downloaded 192 times
lukegothic
 
Posts: 1
Joined: 01 Dec 2017, 12:53
Has thanked: 0 time
Been thanked: 1 time

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 48 guests


Who is online

In total there are 48 users online :: 0 registered, 0 hidden and 48 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 48 guests

Login Form