Files
Bubberstation/code/__DEFINES/power.dm
Watermelon914 0db2a23faf Adds a new power storage type: The Megacell. Drastically reduces power cell consumption/storage. [MDB Ignore] (#84079)
## About The Pull Request
As the title says. A standard power cell now only stores 10 KJ and
drains power similar to how it did before the refactor to all power
appliances.

The new standard megacell stock part stores 1 MJ (what cells store right
now). APCs and SMESs have had their power cells replaced with these
megacell stock parts instead. Megacells can only be used in APCs and
SMESs. It shouldn't be possible to use megacells in any typical
appliance.

This shouldn't change anything about how much 'use' you can get out of a
power cell in regular practice. Most should operate the same and you
should still get the same amount of shots out of a laser gun, and we can
look at expanding what can be switched over to megacells, e.g. if we
want mechs to require significantly more power than a typical appliance.

Thanks to Meyhazah for the megacell icon sprites.

## Why It's Good For The Game
Power cell consumption is way too high ever since the power appliance
refactor that converted most things to be in joules. It's a bit
ridiculous for most of our machinery to drain the station's power supply
this early on.

The reason it's like this is because regular appliances (laser guns,
borgs, lights) all have a cell type that is identical to the APC/SMES
cell type. And it means that if we want to provide an easy way to charge
these appliances without making it easy to charge APCs/SMESs through a
power bug exploit, we need to introduce a new cell type to differentiate
between what supplies power and regular appliances that use power. This
is primarily what the megacell stock part does.

This moves us back to what it was originally like before the power
refactor, where recharging power cells wouldn't drain an exorbitant
amount of energy. However, it maintains the goal of the original
refactor which was to prevent people from cheesing power generation to
produce an infinite amount of power, as the power that APCs and SMESs
operate at is drastically different from the power that a regular
appliance uses.

## Changelog
🆑 Watermelon, Mayhazah
balance: Drastically reduces the power consumption and max charge of
power cells
balance: Added a new stock part called the battery, used primarily in
the construction of APCs and SMESs.
add: Suiciding with a cell/battery will shock you and potentially dust
you/shock the people around you if the charge is great enough.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com>
2024-06-25 00:32:19 +00:00

50 lines
2.0 KiB
Plaintext

#define CABLE_LAYER_ALL ALL
#define CABLE_LAYER_1 (1<<0)
#define CABLE_LAYER_1_NAME "Red Power Line"
#define CABLE_LAYER_2 (1<<1)
#define CABLE_LAYER_2_NAME "Yellow Power Line"
#define CABLE_LAYER_3 (1<<2)
#define CABLE_LAYER_3_NAME "Blue Power Line"
#define SOLAR_TRACK_OFF 0
#define SOLAR_TRACK_TIMED 1
#define SOLAR_TRACK_AUTO 2
///The watt is the standard unit of power for this codebase. Do not change this.
#define WATT 1
///The joule is the standard unit of energy for this codebase. Do not change this.
#define JOULE 1
///The watt is the standard unit of power for this codebase. You can use this with other defines to clarify that it will be multiplied by time.
#define WATTS * WATT
///The joule is the standard unit of energy for this codebase. You can use this with other defines to clarify that it will not be multiplied by time.
#define JOULES * JOULE
///The capacity of a standard power cell
#define STANDARD_CELL_VALUE (10 KILO)
///The amount of energy, in joules, a standard powercell has.
#define STANDARD_CELL_CHARGE (STANDARD_CELL_VALUE JOULES) // 10 KJ.
///The amount of power, in watts, a standard powercell can give.
#define STANDARD_CELL_RATE (STANDARD_CELL_VALUE WATTS) // 10 KW.
/// Capacity of a standard battery
#define STANDARD_BATTERY_VALUE (STANDARD_CELL_VALUE * 100)
/// The amount of energy, in joules, a standard battery has.
#define STANDARD_BATTERY_CHARGE (STANDARD_BATTERY_VALUE JOULES) // 1 MJ
/// The amount of energy, in watts, a standard battery can give.
#define STANDARD_BATTERY_RATE (STANDARD_BATTERY_VALUE WATTS) // 1 MW
// Converts cable layer to its human readable name
GLOBAL_LIST_INIT(cable_layer_to_name, list(
"[CABLE_LAYER_1]" = CABLE_LAYER_1_NAME,
"[CABLE_LAYER_2]" = CABLE_LAYER_2_NAME,
"[CABLE_LAYER_3]" = CABLE_LAYER_3_NAME
))
// Converts cable color name to its layer
GLOBAL_LIST_INIT(cable_name_to_layer, list(
CABLE_LAYER_1_NAME = CABLE_LAYER_1,
CABLE_LAYER_2_NAME = CABLE_LAYER_2,
CABLE_LAYER_3_NAME = CABLE_LAYER_3
))