As promised, here is Version 2 of the
ENERGY BALANCER.
http://wadhost.fathax.com/files/nrgbal-v2.zipThis version is more consistent with the behavior of the actual Megaman games than the previous version.
HOW IT WORKS
With the Energy Balancer equipped weapon energy pickups are automatically given to the weapon with the lowest weapon energy when any buster is equipped (Mega, Bass, Proto). The Energy Balancer is active from when you pick it up until you die.
HOW TO USE
Load the .wad file in the launcher or put it in your .pk3.
Presently the only way to use this Energy Balancer with the existing maps is to use
]summon energybalancer
or
]give energybalancer
Future maps can be made with this item inserted by simply adding item number 19999 to your maps in Doom Builder.
Dr. Light's NoteThe Energy Balancer is a high performance and high output device. If you try to use a W-tank on your buster with an Energy Balancer equipped it has a chance of using the W-tank to fill the internal power supply of the Energy Balancer itself instead of your most depleted weapon. Beware! Often times using 2 W-tanks in succession will allow you to quickly fill your most depleted weapon to its maximum value while simultaneously quenching the Energy Balancer's thirst. There is a chance of having them fill your two most depleted weapons though if the Energy Balancer's hunger has been satisfied recently. Good luck, Megaman!Technical Notes
This version is released without source code. If you want the source for some reason let me know and we might be able to work something out.
This ended up being quite a difficult problem to solve despite its apparent simplicity.
This revision appropriately represents a version 2 because of the key innovation in scaling all the weapon energy. This means that if you have for example Magnet Missiles, Bubble Lead, Search Snakes, and Quick Boomerangs and you fire a single Quick Boomerang it will appropriately fill the Quick Boomerang ammo when you pick up a weapon energy with the Energy Balancer active despite the different ammo scales.
Thanks to SaviorSword for pointing out the importance of scaling all ammos despite different ammo scales and max amounts.
Thanks to Yellow Devil for suggesting I improve on the original design.
Thanks to Cutman Mike for the inspiration and motivation to push the limits of what's possible.