Light Replacer Snazzification: Finally done Jesus fuck
Created by: Exxion
It didn't actually take me four months of work. I just didn't work on it for four months because I was busy and/or lazy. Redo of #4800 Fixes #6807 (closed), fixes #4988 (closed), fixes #4972 (closed). The light replacer has been completely overhauled. I'm copying and slightly editing the change list from the old PR because it's basically the same.
- Light replacer now holds two boxes
- Only accepts /obj/item/weapon/storage/box/lights and its subtypes for these boxes
- One box is its light supply
- Lights inserted into fixtures are drawn from this supply
- Chooses the "best" light in its supply box that is compatible with the fixture it is used on
- At the moment, it just prioritizes HE lights over regular ones
- If it has a light that is "better" than the current one in the fixture, it will replace the one in the fixture, regardless of whether or not the one in the fixture works
- If it does work, it is placed into the supply box
- To prevent clogging of the box in the event one is attempting to upgrade all the lights, there are buttons in the menu to dump a number of lights of a given type from the supply box into the waste box
- Interface popup (accessed by clicking the light replacer in your active hand) says how many of each type of light the supply box has
- The other box is its waste container
- Broken or burnt-out lights inserted into the light replacer go in here
- Interface readout says how full this is, but not what types of lights it contains, as they should all be broken or obsolete
- The borg light replacer (but NOT the standard one) can recycle the lights in its waste container back into glass, though for significantly less glass than it takes to make them
- Interface popup allows either box to be ejected on the standard (but NOT borg) light replacer
- Boxes can, of course, be inserted
- If you attempt to insert a box, it first tries to use it as the supply, then tries to use it as the waste container if it already has a supply container. Obviously fails if it has both.
- Lights can be inserted the same way as before, too, though it's generally much slower than just replacing the supply/waste box
- Working ones inserted this way go into the supply box, broken/burnt-out ones go into the waste box
Webm demo (New, not old): https://a.uguu.se/vheiyj_2015-12-01_17-37-52.webm
EDIT: I forgot to mention Both the standard and the borg light replacers can produce lights from glass, but ones produced by the standard (NOT borg) light replacer burn out more quickly and are much more expensive than lights produced otherwise. The borg light replacer holds twice as much glass, uses half as much to produce lights, and produces perfect ones that don't burn out any more quickly than others. It's still more expensive than lights from an autolathe, but by much less. It is also filled by recharge stations at a rate of 500 glass per Charge().
This also tweaks the material costs of different types of lights. HE lights use three times as much glass and iron as their non-HE counterparts, but the glass cost of non-HE bulbs (not tubes) was halved. Overall, the most expensive light still takes only a small fraction of a sheet of glass when made with an autolathe.