Hello.
I decided to make a very simple mod that changes the supply cost defined in the MakeshiftEquipment skill.
The process seemed relatively simple as the modifiers are public static variables which can be changed from a simple plugin.
However the issue is that there seems to be an inconsistency with the values and I can not figure out for the life of me what is causing it.
What I did:
- Created a mod within which I made a new plugin .java named BetterSkillsPlugin
- I have overriden the onApplicationLoad method and changed the static variable MakeshiftEquipment.SUPPLY_USE_REDUCTION_MAX_PERCENT and SUPPLY_USE_REDUCTION_MAX_UNITS from within the method.
This should not be a problem unless the variables are not being rewritten by something else within the game (From what I have tested, this is NOT the case) - I launched the game and tested the changes. To my surprise the only thing that changed is part of the description (Which is why It is inconsistent). You can find it in the screenshot bellow:
As you can see, the values did change (75% and 200) however it did not affect the calculations.
The calculations make no sense to me because for some reason it is being reduced by 118 units or 33%, which is neither of the values I specified nor the default values specified in the skill. Doesn't matter how I change the values, the calculation still remains the same.
It seems like the logic, or calculation is done in a completely different place and it is not referencing any of the static variables defined in the skill itself. Only the first part of the description for whatever reason seems to be referencing it (Which tbh is kinda dumb from a design stadpoint.).
I also took the code and compiled it in a separate test application to test whether the values are really wrong and they are. Whatever is doing the actual calculation has nothing to do with the methods defined in this class as they are either not being called and therefore are just a dead code in the API, or being rewritten by something else before they get the chance to be displayed.
If you have some information you could give me, or tell me what Am I doing wrong, I would appreciate it.
Thanks.