eternaldensity / Sandcastle-Builder

xkcd: 1190: Time: The Game
Other
84 stars 68 forks source link

Newpix Number used in ONGBase calculations is the wrong one: SBTF is borked, Log names are wrong, etc. #1539

Open Eregrith opened 2 months ago

Eregrith commented 2 months ago

Because of the refactoring done on the Molpy.ONG separating it into ONGBase and sub-ONGs functions, the order of newpixNumber incrementation and ONG operations has been wrong for 9 years.

Here is the code: https://github.com/eternaldensity/Sandcastle-Builder/blame/4ecf1f261420ef0836264910b90f4a37ebdb300b/castle.js#L3729

I noticed it when Swim Between The Flags did not work properly, giving me a boost to wave castle prod on ONGs reaching odd newpix despite what it should be. The logs names "Notification log for Newpix {...}" are also wrong because of that.

You can try it yourself:

Proposed fix: Put the call to Molpy.ONGBase(); below the lines 'todo' instead:

    var todo=Molpy.ONGs[type];
    if(todo==undefined){todo=Molpy.ONGs[0]}
    todo();
    Molpy.ONGBase();

Disclaimer: I'm not sure when should the second part of the ONGs functions be processed, like these:

    Molpy.Boosts['Controlled Hysteresis'].power=-1;
    Molpy.Boosts['Signpost'].power = 0;
    Molpy.Boosts['Signpost'].Refresh();
    Molpy.Boosts['PG'].Refresh();