Files
vgstation13/code/modules/cmc
jellyveggie2 0471421e9a Reworks electric power grid to have priority levels (#32613)
* Move machinery procs from power to machinery. Getting real tired of confusing them for power procs, why were they even there?

* use_power = [0-2] replaced with the proper MACHINE_POWER_USE(NONE|IDLE|ACTIVE) defines. KEEP IT CLEAN

* Creates MACHINE_POWER_USE_GRID, for machines marked as MACHINE_POWER_USE_NONE that were actually drawing power, and doing so straight from the grid

* More numbers to defines

* Power connection component: Get rid of unused parameters on New() that were being misused anyway, and more importantly make the radio broadcaster actually draw it's power through the component instead of APCs.
NEEEEXIIIIS!

* ...actually adds MACHINE_POWER_USE_GRID this time
JEEEELLLYYYYYY!

* Converts a bunch of snowflakes into using the power connection component

* RECAP: Alright, I've fixed some major peeves and made sure no one's adding load to the powernet without going through a machine/component first, now is the time to start modifying how power draw works

* Give grid loads priorities, and convert powernet.load to a list of loads. Does nothing yet

* Satisfaction

* Converts power sink and singularity beacon

* Converts wall shield generator

* Converts emitters. Emitters will turn off below 30% satisfaction, and beam power will be affected by power satisfaction; eg: at 50% satisfaction beams will only be 50% as powerful

* Converts the antique matter synth

* Converts APCs

* get_satisfaction() for cables

* Converts SMES

* Converts artifacts

* Fixes a bunch of stupid things with SMESs and APCs, turns some more use_power numbers into defines, and gets rid of MACHINE_POWER_USE_GRID cause there's really no need for it, not yet.

* Fixes for power sink and singularity beacon

* Antique synth fixes

* More SMES fixes. No more free energy shenanigans, and measured output/load should update properly now

* Converts radio broadcaster and syphoners. Also adds a way to connect to smooth cables, because syphoners.

* RECAP: I think that should be it for converting and testing priority/satisfaction stuff. Up next is reworking the power monitor to display all loads (not just APCs) grouped by area, and each load's priority, as well as controls to edit a load's priority.

* Power monitor is in a workable state. Issues so far:
- It looks like ass. The "area details" buttons are ugly, and the priority dropdowns are uglier AND  fuck up the vertical spacing between rows
- Power connection machines (eg: radio transmitter) don't show up
- Setting an SMES priority low enough it won't charge means it won't appear on the list, so can't change priority back. other machines likely affected too

Still, it's taking shape

* Couldn't get priority dropdowns to look nice, switches them for buttons. Touches up the show/hide details button to look nicer

* Ensure normal power/connection machinery does show up by default

* Give artifacts BYPASS priority so xenoarcheologists don't have to wonder whether it's working or not (assuming there's enough power on the grid)

* Make sure any SMES do show up even if not charging, so you can raise their priority if need be

* Allow players to set the SMES' (until now unused) nametag, to better identify them on the monitor

* Review 1

* Review 2
Adds TOTAL_PRIORITY_SLOTS for clarity instead of using POWER_PRIORITY_EXCESS
2022-06-04 00:03:58 -05:00
..