Palaxin Posted February 17, 2016 Report Share Posted February 17, 2016 (edited) Not sure if this is the right subforum (perhaps the mod subforum is suited better). AFAIK currently techs allow the modifications "add", "multiply" and "replace" and auras "add" and "multiply". The problem with "multiply" for techs is that it is calculated on base stats, not on current stats (as I explained here). I would like to differentiate between e.g. "multiply-base" and "multiply-current", but either I couldn't find the right place in the code or I'm a bigger noob than I thought. I looked in simulation/components/TechnologyManager.js and simulation/helpers/ValueModification.js as well as some C++ source files, but couldn't find similar code like this (taken from AuraManager.js): if (data.add) cache.get(classes).get(key).add += data.add; if (data.multiply) cache.get(classes).get(key).multiply *= data.multiply; My C++ and JS skills are quite limited but I would try to change the multiply operation for technologies if I knew where to look for it... Edited February 17, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
Palaxin Posted February 17, 2016 Author Report Share Posted February 17, 2016 I think I finally found it in globalscripts/Technologies.js if (modification.multiply) retValue += (modification.multiply - 1) * propertyValue; else if (modification.add) retValue += modification.add; else if (modification.replace !== undefined) // This will depend on ordering because there is no choice retValue = modification.replace; Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted February 18, 2016 Report Share Posted February 18, 2016 Auras work on tech-modified values, but they do change their own values similarly to techs. Auras always do (value * multiply + add), which is basically the same as the tech modifications, except that the tech modifications get calculated per tech, while the aura modifications are just reduced to one multiplier and one adder per changed value. It is important that you have a defined order in your code, so two different computers don't calculate a different value because they use a different order of techs. It doesn't really matter whether you first add and then multiply, or the other way around, but it matters that you have a defined order of operations. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.