Closed erosson closed 6 years ago
Related: https://github.com/erosson/ch2plan/issues/25#issuecomment-407621087 , and https://docs.google.com/spreadsheets/d/1lkYz1oH1mh5unHEt4WFyq_s_mUsxFBkWC35FZ1d9JQA/edit?usp=sharing
Options:
more information on where this stuff lives in the source code:
mods/active/HelpfulAdventurerMain.as
defines nodetypes in onStartup(); levelGraphNodeTypes
. on each node, purchaseFunction()
associates each node with a stat. we already execute this to get edge/node/tooltip infobuild/extract/scripts/models/Character.as
constructor populates statValueFunctions
, which defines the numbers attached to each stat and how they grow.this.statValueFunctions[CH2.STAT_HASTE] = exponentialMultiplier(1.05);
build/extract/scripts/heroclickerlib/CH2.as
initStats() defines each stat and how it grows on items. This is json-like and easily parseable - if only I cared about item stats. Also defines stat constants.In a perfect world, I would be able to:
{"G": {name: "Gold", ...stat: CH2.STAT_GOLD}, ...}
{CH2.STAT_GOLD: ["exponentialMultiplier", 1.1], ...}
{CH2.STAT_GOLD: "STAT_GOLD"}
. (They're integer constants.)none of these are possible from as3, it can't see its own source code. in theory we could write js or something to parse the as3, but that would be fragile as hell. I'd rather parse tooltip text. (character.as is currently a pretty simple grep; HelpfulAdventurerMain.as is multiline/trickier; either could change in the future)
after thinking about this a while, here's a better option than the four above:
this approach avoids the whack-a-mole bug-hunting with every update that I've been afraid of, and also avoids fragile actionscript parsing. many complex skill calculations can't be extracted/updated automatically, anyway.
implemented the actionscript autoextracting, plus some stat total calculations. calculations for keystones (teal nodes) and skill costs/durations/cooldowns are not implemented yet.
closing, since this is a pretty solid start. spawned #27, #28, #29, #30 for more work.
like PoB/poeplanner. Obviously a popular request.
skill data is applied with an actionscript function; it's not trivial to add it up (or for them to implement respecs.) This would take lots of added work. For now, I'm holding out for them to change the format.