Statistics, Translations, and Customization, Oh My!
eyo, back again, this time with some big projects that
GenevensiS and i have been picking at in the background. The major pieces here are an update of Genevensis's statistics page overhaul, which is now part of the main packs, and an upgrade to Magic's localization handling, with a couple other bits and pieces at the end.
GenevensiS Statistics Overhaul
About a year ago, GenevensiS developed a monster rewrite of the stats page, and i've finally gotten around to reviewing and approving for the official pack!
Set Tab
For starters, this overhaul adds a new Statistics section to the Set Tab:
Trim statistics
Disabled by default. Enabling this will remove Token, Special, and Masterpiece cards from the stats, as well as nonstandard card types such as Conspiracies and Planes.
Filter Statistics
This allows even more fine tuned filtering of what's allowed in the stats tab. This takes a comma separated list of field names, operators, and values, only letting in things that meet the filters:
• Use == for strict equality. For example, color=="G" will get cards that are monogreen, not multicolor green cards
• Use != for strict inequality. For example, color!="G" will filter out cards that are monogreen, and keep any cards that aren't green, or are multicolor and green.
• Use =: for contains. For example, rule_text=:"deathtouch" will get any cards that mention deathtouch.
• Use !: for does not contain. For example, sub_type!:"Goblin" will remove any cards that are Goblins.
• Use >= and <= for numeric comparisons. For example, mana_value<="4",power>="3" will get only cards with mana value 4 or less, and power 3 or greater.
• You can put [OR] at the beginning of the filter to change it to accept cards that meet any of the conditions, rather than all of them.
• You can use quotes within values, but they must be escaped with a backslash. notes=:"\"Why did I put this quote here?\"".
Count secondary faces
This checklist decides how multipart cards like DFCs and Adventures should be counted by the stats. Card color never considers secondary faces, while color identity always considers it.
Custom super types, Custom creature races, Custom creature classes
These three options let you define how custom types should be sorted in the super type, race type, and class type stats. Changing Custom creature types to the word detect will cause it to run a script that tries to detect all your custom creature types, then write them to the box. Additionally, you can run detect_custom_subtypes_statistic() in the console tab to get a readout of all your custom subtypes and the types they seem to be associated with.
Card notes clauses split
This is a regex that determines how card notes are split by the notes stat. It defaults to / *(\.|\n|;|,|(?=!)) */, which splits the notes at periods, line breaks, semicolons, and exclamation marks, plus any spaces around them.
Statistics Tab
In the console tab, you can enter statistics_info() for help in-app.
Color Category
There are several 'color' stats now, and this one most resembles the old Color tab, with Multicolor and Hybrid split, but otherwise combined into one column each.
Exact Color
Exact color breaks down multicolor and hybrid cards into their color pairs/tris/quads/quints, and lumps all colorless cards together.
Color Identity
This has the same layout as Exact Color, but uses color identity rules rather than just casting costs.
Permanent/Non
Now separates cards that live in the Command Zone.
Power, Toughness, Loyalty
These three have had a trade-off, all values of 11+ are lumped together, but variable values now have their own columns instead of being part of 0.
Rarity
Small thing, but mythic rarity's color has been fixed!
Filter
This provides a big, simple list of any cards that passed the Filter from the set tab.
Mana Production
This is a new stat that finds what cards produce what colors of mana, and further divides them into land and nonland sources.
Pip Count (Casting Costs, Ability Costs, All Costs)
These stats check the casting costs, ability costs, or both across your cards and count how many colored pips are in those costs. For example,
is a 0 and
is a 3.
Pip Colors (Casting Costs, Ability Costs, All Costs)
These stats check costs again, but for the specific sets of colored pips, so you get a
column, a
column, a
column, etc.
Pip Totals (Casting Costs, Ability Costs, All Costs)
Finally, these stats add up all those color pips and give you the total number that exist for each color across the whole set.
Card Notes Words, Card Notes Clauses
These new stats grab all the individual words from your card's notes, or the clauses/sentences broken by the regex from the Set tab
Average Opening Hand, Land Drop Hit
These stats assume that your set is a deck, and analyze the average contents of your opening hands and how likely you are to hit land drops on certain turns.
Color Count, Color Identity Count
These stats count up how many cards have 0, 1, 2, 3, 4, and 5 colors in their color/color identity.
Color (Secondary Face, All Faces, Promos)
These stats list out the exact colors of cards of their specific subcategory.
Omniverse Color
And finally, one last stat to be the Color Category for EKPLO cards.
Localization Overhaul
MSE's translation setup has always been more theoretical than practical, and Genevensis and I finally tackled that.
Expanded Language Support
Between the two of us, we only speak English, French, and a smidgen of Spanish, but we've done our best to add and update basic translation support for Spanish, French, German, Italian, Brazilian Portuguese, Russian, Japanese, Korean, and Chinese, the languages that have been officially translated by WotC at some point.
Word Lists and Spellchecking
Word Lists and spellcheck dictionaries are now readily available after changing the language in the set tab without needing to mess around with files, complete with up to date translated type lists!
Keywords and Statistics
We weren't able to completely do away with extra files, as Keywords and the Statistics pages now have localized versions available! To use these, go to your magic.mse-game folder, rename the keywords and statistics files to keywords_en and statistics_en respectively, then rename keywords_fr and statistics_fr, or whichever language you're after, to keywords and statistics. Those will be loaded up the next time you start MSE.
Scripting Support
The scripts spanish_number, french_number, german_number, italian_number, portuguese_number, russian_number, japanese_number, chinese_simplified_number, chinese_traditional_number, korean_number, korean_sino_number, and korean_counter_number have been added. Like english_number, they convert a number into its localized word form.
The type-checking functions, such as is_artifact(card.type), have been expanded and filled in for each of the languages. The full list can be seen in the language_map file. Templates which script off types or abilities should use these new functions so they are supported across languages, with Mainframe and Genevensis's frames already updated to do so. An example of the new format is lang_setting("is_vehicle")(card.sub_type), as opposed to the old is_vehicle(card.sub_type). lang_setting("is_vehicle") will return the is_vehicle function for the current language, then the relevant field to check is passed in a second set of parenthesis.
cajun pls i only speak english and stats are for nerds
while I don't have any new frames quite ready yet, we do have a couple things to add.
Custom Font Testing
M15 Mainframe, M15 Adventures, and Mainframe Tokens have been updated with Style options that allow you to redefine which font is used for their name, their typeline, their textbox, and their power/toughness. This includes setting a new font size, new font color, new italic font, and repositioning to help recenter very strange fonts.
These frames have a Yes/No style option named Apply Custom Fonts, which defaults to off. Below that is a text field for the fonts that can be rewritten. This takes up to 5 parameters in order, separated by semicolons:
Font name;Font size;Font color;Vertical offset;Italic name
Font name is the font's name as recognized by your computer. For instance, Comic Sans is likely called Comic Sans MS for this.
Font size is a simple number.
Font color can be an MSE recognized color such as red or blue, or 3 or 4 numbers from 0 to 255 separated by commas defining the Red, Green, Blue, and Alpha(transparency) values of the color.
Vertical offset is a simple number that moves the text down that many pixels, to adjust for fonts with a different baseline than whatever the default is. If you need to move up instead, use negative numbers.
Italic name is mostly only used for Body text, but is supported for the others as well. You don't need to put anything here to get the italic versions of most fonts, but some need it, and you can otherwise use it as a second font.
Any of these can be left blank to leave it as its default value.
This feature will likely be expanded to many more templates when I get to the big sweeping update for MOM-style card numbers, but for now it's just getting this trial run so we can find any issues we want to fix before that happens.
Alt rarity color
The code for this has been improved and added to several new frames, and is now very easy to add to new frames. Alt rarity color takes a string in the form of R1,G1,B1:R2,G1,B1:bR1,bG1,bB1:bR2,bG2,bB2:br:, such as 200,0,0:55,0,0:30,15,15:120,0,0:0.1: where R1G1B1 and R2G2B2 are the colors of the internal gradient, bR1bG1bB1 and bR2bG2bB2 are the colors of the border gradient, and br is the border radius. This alternate color pallet replaces the rarity symbol no matter the rarity.
Other stuff
• The Cockatrice Exporter has been updated to handle the new transform method.
• Added support for double digit loyalty mana symbols.
• Updated the namecheck exporter.
• Added Mainframe mana support for Archenemy, Planechase, Saga, Space, and Vanguard.
• Fixed some errors from the previous keyword update.
• Added the print fix function to several Mainframe templates that were getting updated anyway.