geordanr / xwing

Squad builder for the First Edition X-Wing Miniatures game by Fantasy Flight Games.
http://geordanr.github.io/xwing
MIT License
97 stars 154 forks source link

Importing a rebel squad with maul on first ship and ezrabridger on second #564

Open ghost opened 6 years ago

ghost commented 6 years ago

The following was exported from YASB but does not properly import, as the maul restriction is probably being applied before it checks the rest of the ships (I know... i had to fix my own project for this stupid card!)

{"description":"Maul with Ezra on different Ship","faction":"rebel","name":"Maul with Ezra Crew on Different Ship- Valid","pilots":[{"name":"lothalrebel","points":38,"ship":"vcx100","upgrades":{"crew":["maul"]}},{"name":"lothalrebel","points":38,"ship":"vcx100","upgrades":{"crew":["ezrabridger"]}}],"points":76,"vendor":{"yasb":{"builder":"(Yet Another) X-Wing Miniatures Squad Builder","builder_url":"https://geordanr.github.io/xwing/","link":"https://geordanr.github.io/xwing/?f=Rebel%20Alliance&d=v4!s!158:-1,-1,-1,-1,-1,250:-1:-1:;158:-1,-1,-1,-1,165,-1:-1:-1:&sn=Maul%20with%20Ezra%20Crew%20on%20Different%20Ship-%20Valid&obs="}},"version":"0.3.0"}

geordanr commented 6 years ago

Yeah, I'm stuck with this problem too with no easy way to fix it. The current workaround is to rearrange the incoming XWS to move Maul after Ezra.

ghost commented 6 years ago

One option would be to not prevent the user from making invalid squads, but update some status text when they have an invalid combination of upgrades. As in, you can add Maul but it will print a warning in red text that says the squad is not currently valid. The message goes away when you add Ezra. This would be a fairly drastic change, so there would probably be some other side effects, but it is an option.