mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
* Adds a new power storage type: The Megacell. Drastically reduces power cell consumption/storage. [MDB Ignore] * Multi chargers * all this other shit * maps * more fixes * even more * mapping * map fixes * MCR * map2 * map3 * map4 * map5 --------- Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com> Co-authored-by: Fluffles <piecopresident@gmail.com>
27 lines
947 B
Plaintext
27 lines
947 B
Plaintext
/**
|
|
* # Cell Charge Component
|
|
*
|
|
* Allows for reading of the max/current charge of the cell in an integrated circuit.
|
|
*/
|
|
/obj/item/circuit_component/cell_charge
|
|
display_name = "Cell Charge"
|
|
desc = "A component that can read out the max and current charge of the cell."
|
|
category = "Sensor"
|
|
|
|
/// max and current charge for the cell
|
|
var/datum/port/output/max_charge
|
|
var/datum/port/output/current_charge
|
|
|
|
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
|
|
|
/obj/item/circuit_component/cell_charge/populate_ports()
|
|
max_charge = add_output_port("Max Charge", PORT_TYPE_NUMBER)
|
|
current_charge = add_output_port("Current Charge", PORT_TYPE_NUMBER)
|
|
|
|
/obj/item/circuit_component/cell_charge/input_received(datum/port/input/port)
|
|
var/obj/item/stock_parts/power_store/read_cell = parent.cell
|
|
if(!read_cell || !istype(read_cell))
|
|
return
|
|
max_charge.set_output(read_cell.maxcharge)
|
|
current_charge.set_output(read_cell.charge)
|