raithos / xwing

Squad builder for the X-Wing Miniatures game by Fantasy Flight Games.
https://raithos.github.io/
MIT License
60 stars 81 forks source link

Feature Request: Add the Threat card loadouts and their associated costs. #297

Closed GordonBerg closed 5 years ago

GordonBerg commented 5 years ago

Subject pretty much says it all. Would be a third format option alongside Extended and Hyperspace. Instead of 200 points, you could enter the max value allowed. Our current league night right now is Threat cards only -- six points -- so it'd be nice to quickly see options at a glance.

Bonus: Will mention our undying love for Stephen Kim the next time we get together to record Stay On Target? SOOOOO much better than Mynocks! :P

Patschke commented 5 years ago

As this is not the first request for Quickbuilds I'll see if i can implement that in reasonable time.

Patschke commented 5 years ago

Code is written, now it's just a matter of getting all the data in. If you want to help me with that, you are welcome to do so. Everybody is able to learn copy+pasting from the quickbuild pdf to our format within a minute ;-)

Bonus: This has been implemented by @Patschke not by Stephen Kim. Hope that does not cause any issues...

Patschke commented 5 years ago

You may want to look at f6236a394987a69fac2098a0f6c16245a99557ec to see how data should be added.

GordonBerg commented 5 years ago

Sure, I'll volunteer for data entry, but I am thoroughly lost.

f6236a3 seems to be a Galactic Empire list that's Threat 5, yes? So am I looking at what's behind the scenes to generate that? Or is that some kind of copy/paste example?

Patschke commented 5 years ago

It is a example of the first three Quickbuild cards from the Empire Quickbuild list. We'll need to add all of them, I've already added a few more ships. I've granted you access to: https://github.com/Patschke/xwing/blob/master/coffeescripts/cards-common.coffee, there is an edit button on the upper right corner. The list of quickbuild cards starts somewhere around line 9000. All Quickbuild cards need to be added.

Patschke commented 5 years ago

Every Quickbuild card is going to be represented by that structure in the code of yasb. This is not a specific quickbuild squad, but a list of all available quickbuild cards. So we need to add all quickbuilds from the pdfs from ffg to that list:

        {
            id: [consecutive number]
            faction: [name of the faction]
            pilot: [name of the pilot]
            ship: [name of the ship]
            threat: [threat points]
            upgrades: [
                [upgrade 1 name]
                [upgrade 2 name]
                [...]
            ]
        }

Where all the stuff inside[_] needs to be filled with the data from the quickbuild pdfs. The id is just a consecutive number, count it up by 1 for each quickbuild card you add. The faction is one of the following: "Scum and Villainy","Galactic Empire","Rebel Alliance","First Order" or "Resistance". The name is just the pilot name as given in the quickbuild pdf. The ship is the name of the ship, unfortunately we are still using 1.0 names for most ships. If you are unsure how to name a ship, you may search for the ship in the first ~1500 lines of that file. The threat points is the number of threat points given in the quickbuild pdf, and the upgrades is a list of the upgrade names as written in the pdf, each upgrade having a line. For Example an Onyx Squadron ace looks like that:

        {
            id: 46
            faction: "Galactic Empire"
            pilot: "Onyx Squadron Ace"
            ship: "TIE Defender"
            threat: 4
            upgrades: [
                "Elusive"
                "Advanced Sensors"
                "Proton Rockets"
            ]
        }
GordonBerg commented 5 years ago

Okay, as a test, I just entered in Tomax Bren. Assuming I didn't screw that up, I'll add builds later when I have time. Thanks Patrick!

Patschke commented 5 years ago

Yep, almost like that. You want to select "Spaces" and "4" in the instead of "Tab" and "8" on the top bar, to make the whitespace in front match the existing one.

Thanks for contributing!

Patschke commented 5 years ago

grafik

GordonBerg commented 5 years ago

Okay, I tried another. Formatted okay? It said Spaces and 4.

Patschke commented 5 years ago

Yep, that looks correct. Unfortunately we are still using the shorter 1.0 names for most ships. For the empire that is mostly done by dropping the /.. after TIE, and for the rebels some prefixes. We should probably change those names to the 2.0 ones at some point, but we did not so far. If you are unsure how to name a ship, you may search for the ship in the first ~1500 lines of that file.

GordonBerg commented 5 years ago

Okay. Thanks!

raithos commented 5 years ago

@GordonBerg appreciate the <3

danrs commented 5 years ago

@Patschke @GordonBerg are you aware that https://github.com/guidokessels/xwing-data2/tree/master/data/quick-builds contains data for all the quick builds? You can import from there and that will save you a lot of time. Even if you just write a python script to parse the json and spit it out in yasb data format that should make things easier for you

Patschke commented 5 years ago

I don't think, that this would be less work. That python script would need to read the json from xwing-data2, read our database (which is partly created during runtime, which makes it hard to be read by a external script), and match the xws-names to our yasb-names. It would also need to take care of those 2-ship bundles properly. I think it is easier to add scum and resistance manually as well...

GordonBerg commented 5 years ago

The Jumpmasters aren't showing up when selected under Quickbuild.

GordonBerg commented 5 years ago

And it seems Quickbuild only remains as an option when using 8 points, otherwise it switches to Custom, so still a work in progress?

Patschke commented 5 years ago

The Jumpmasters aren't showing up when selected under Quickbuild.

Well, there's a typo. I called them Jumpaster 5000 but they are named JumpMaster 5000, so they are not found correctly. going to fix that.

And it seems Quickbuild only remains as an option when using 8 points, otherwise it switches to Custom, so still a work in progress?

The same issue exists for Hyperspace, so that is nothing I've done "wrong" with quickbuild. It is however still an issue to be fixed...

Patschke commented 5 years ago

The Jumpmasters aren't showing up when selected under Quickbuild.

fixed as part of #311

Patschke commented 5 years ago

And it seems Quickbuild only remains as an option when using 8 points, otherwise it switches to Custom, so still a work in progress?

@raithos I'd just remove the point selection and custom mode entirely. There is no bid shown on the print outs, so it doesn't matter at all which value is selected here. If somebody wants to play not default point costs, he may in my opinion calculate the points left himself? If you want to keep the custom stuff, we should keep the last selected mode active for custom (which requires some changes to the squad saving/loading, as that currently assumes that any custome mode squad is an extended squad with the given points).

raithos commented 5 years ago

Custom mode is still useful for people that want to do progressive tournaments. I'd be ok with removing custom mode but we would have enable points selection for all game modes (perhaps we can add a warning that the list is not tournament legal for hyperspace and extended.). Effectively we would just set a default value for each and not hard set the points.

raithos commented 5 years ago

Are there any quickbuilds that still need to be added? If not I will close this

danrs commented 5 years ago

I just did a manual spot check and it looks like you're missing all the quick builds that aren't in the PDFs. As far as I know, the only quick builds not in the PDFs are the wave 1 and 2 promos and the scum falcon / escape craft quick builds. I've copied these in below (from http://xhud.sirjorj.com/xwing.cgi/quickbuilds2, which is validated and up to date with xws)

Wave 1 promos

Thane Kyrrel (2): Stealth Device, outmaneuver
Iden Versio (2): Proton torpedoes, Lone wolf
Skull squadron pilot (3): marksmanship, advanced proton torpedoes, afterburners

Wave 2 promos

Foreman proach (2): fearless, crack shot
Blackout (3): Trick shot .
Greer sonnel (2): marksmanship, primed thrusters

Scum falcon / escape craft builds

(5) Han solo: elusive, chewbacca, title, agile gunner, tactical scrambler, rigged cargo. Outer rim pioneer: tobias beckett (4) Lando: han, qira, title. L337 shuttle (5) L337: Han, title, qira, hull upgrade, outmaneuver. Lando shuttle: elusive, shield upgrade (3) Freighter captain: title. Autopilot drone: afterburners

I don't have time to script up a full comparison between xws data and cards-common.coffee but that would be the best way to be sure everything is entered correctly

Patschke commented 5 years ago

I didn't even know there exist quickbuilds that are not listed in those pdfs...

nexusno2000 commented 5 years ago

Rebel: TIE fighter quick build.

I get Zeb, but none of the others. There is just a box under Zeb that says "Searching..."