fenhl / mse-to-json

A script that converts Magic Set Editor files to MTG JSON
MIT License
2 stars 1 forks source link

Exception when artifact colour is set manually #3

Closed caelen-feller closed 5 years ago

caelen-feller commented 5 years ago

When you manually set an artifact's color identity (here white, artifact and the default horizontal are selected), it causes the following exception.

[!!!!] Exception in card 'Test'
Traceback (most recent call last):
  File "./mse_to_json.py", line 893, in <module>
    set_json = convert_mse_set(set_file, set_code=set_code, version=args.set_version)
  File "./mse_to_json.py", line 506, in convert_mse_set
    }[color_indicator]
KeyError: 'white, artifact'

Doing this manually adds the following line to the mse-set file.

card color: white, artifact, horizontal

The exception and source become the following if the artifact is set to be colorless.

[!!!!] Exception in card 'Test'
Traceback (most recent call last):
  File "./mse_to_json.py", line 893, in <module>
    set_json = convert_mse_set(set_file, set_code=set_code, version=args.set_version)
  File "./mse_to_json.py", line 674, in convert_mse_set
    result['colorIdentity'] = sorted(ci, key='WUBRG'.index)
ValueError: substring not found
card color: artifact
fenhl commented 5 years ago

Which template is this card using? (Check --decode for the card's stylesheet field, or the set's stylesheet field if the card doesn't have one.)

caelen-feller commented 5 years ago

m15

fenhl commented 5 years ago

I'll see if I can add support for that template, but no promises, as it's an older template which has been replaced by M15 Mainframe (m15-altered). In the meantime, you can use M15 Mainframe as a workaround.

caelen-feller commented 5 years ago

Ah, that's strange, I thought it was the most updated. I can update the templates without too much issue, probably. Thank you!

caelen-feller commented 5 years ago

Can confirm, works perfectly with m15-altered. Thanks again.