Thread:Jens Ingels/@comment-24416108-20141128155015/@comment-24416108-20141202185225

No, just the gains from last level would get increased. Is what I got currently.

Anyway, I think I've got everything working quite decently right now. I included a few data tags in the main div, which are now fed into the calculation - they are no longer affected by their previous values.

at the select parts, I had to use ParseInt over their output, and I still don't really understand why. Regardless, it works now. The upgrades also function, though I am planning to introduce a way to prevent people selecting Upgrades that don't work on that specific unit - maybe another data- parameter that carries the information.

As to prevent people from selecting the same upgrades multiple times, I was wondering if it were possible to invert the switch statement. My C++ instinct says it can, but I'll show you the code first: //Switch for the healthCalc function switch(5) { case upgrade0: case upgrade1: case upgrade2: b = 10; break; default: b = 0; break; } Would this work?

If it does, it's a pretty easy fix. They'll be able to fill in multiple of the same upgrade, and it'll still count only once. Also, it makes the functions a bit neater IMO.

Also, some upgrades and Experience ranks add abilities to the unit. I've tried my luck with the following statements: MCU = unit0.getElementsByClassName("Abil0")[0];

MCU.innerHTML = "Enchanted Armor "; While it changes the text and renders the HTML list, it doesn't appear to give the tooltips this script would usually give. The span class "ability-tooltip" is used by another javascript function(and loaded on page load), but it doesn't seem to recognize it. Would you know anything I'm doing wrong?