The Cyclops Charge Cycle - PrimeSonic/PrimeSonicSubnauticaMods GitHub Wiki
In spite of it being a mobile base, the Cyclops recharges its internal power cells similar to other vehicles.
This means that new sources of power in the Cyclops all act to recharge, rather than be another "battery" to draw energy from.
MoreCyclopsUpgrades builds on top of this idea, making use of "Cyclops Chargers" to keep the Cyclops power cells topped up.
For an in-depth look, the relevant code is in the
RechargeCyclops
method of the ChargeManager
On every Update cycle:
- The ChargeManager sends a request to all Cyclops Chargers to
GenerateNewEnergy
.- This method passes in the current energy deficit of the Cyclops
- This method returns the amount of free energy the cyclops charger was able to produce that cycle
- Once all cyclops chargers have finished, the ChargeManager checks if additional energy is required
- If the Cyclops does not require energy due to being either at 100%, or using Creative or NoEnergy game modes,
the next step is skipped
- If the Cyclops does not require energy due to being either at 100%, or using Creative or NoEnergy game modes,
- If the Cyclops still requires additional energy, the ChargeManager sends a request to all Cyclops Chargers to
DrainReserveEnergy
- This method passes in the current energy deficit of the Cyclops
- This method returns the amount of energy each charger is able to provide this cycle
- All this energy goes to the Cyclops power cells