rweyrauch / PrettyScribe

Pretty-printer for Battlescribe Warhammer 40k, Kill Team and Age of Sigmar rosters.
https://rweyrauch.github.io/PrettyScribe/
ISC License
59 stars 17 forks source link

40k rosterizer: cleanup model counting logic #155

Closed mardanbeigi closed 6 months ago

mardanbeigi commented 6 months ago

clean up model counting logic to just look at the unit stats

TheGameKnave commented 6 months ago

entry.stats.Models?.value Is a stat that describes how many models it expects to find. That may not be the count that exists (as some units like neurogaunts have separate stats to track their model count).

There's also a tally value of how many models are in a unit, but that tally tracks all models, including add-ons (with their own point costs) and models within attached commanders.

For add-on models, they get a tag of noTally, and a rule then tracks the true tally of countable models (minus noTally and attached commanders) for points. This rule is on each unit, and is called finalModelTally but it looks like we're trimming out the results of rules that don't cause changes. This is an oversight and should be fixed; I'll see about getting to it, as the result of that rule is what determines which points threshold to use for the final point value.

Edit: rule results are now being reported in .regiztry exports in Rz0.8.14. The value that's used for point calculations in a unit is: rules.finalModelTally.evals[1].result.integer

mardanbeigi commented 6 months ago

Thank you @TheGameKnave , is there a bug tracking the finalModelTally fix? I can pull your suggested changes into prettyscribe once fixed

TheGameKnave commented 6 months ago

@mardanbeigi rule results are now being reported in .regiztry exports in Rz0.8.14. The value that's used for point calculations in a unit is: rules.finalModelTally.evals[1].result.integer

I'm also deploying a change to the export, to publish the app and rulebook versions in the info object, to make debugging easier (i.e. "i see the problem; you need to update and re-export")