mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
[MIRROR] Adds a power consumption multiplier to help downstreams change their consumption easily [MDB IGNORE] (#13155)
* Adds a power consumption multiplier to help downstreams change their consumption easily (#66476) * Adds a power consumption multiplier to help downstreams change their consumption easily Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
#define IDLE_POWER_USE 1
|
||||
#define ACTIVE_POWER_USE 2
|
||||
|
||||
///Base global power consumption for idling machines
|
||||
#define BASE_MACHINE_IDLE_CONSUMPTION 100
|
||||
///Base global power consumption for active machines
|
||||
#define BASE_MACHINE_ACTIVE_CONSUMPTION (BASE_MACHINE_IDLE_CONSUMPTION * 10)
|
||||
|
||||
/// Bitflags for a machine's preferences on when it should start processing. For use with machinery's `processing_flags` var.
|
||||
|
||||
@@ -143,6 +143,8 @@
|
||||
var/last_used_time = 0
|
||||
/// Mobtype of last user. Typecast to [/mob/living] for initial() usage
|
||||
var/mob/living/last_user_mobtype
|
||||
///Multiplier for power consumption.
|
||||
var/machine_power_rectifier = 1
|
||||
|
||||
/obj/machinery/Initialize(mapload)
|
||||
if(!armor)
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
|
||||
// increment the power usage stats for an area
|
||||
/obj/machinery/proc/use_power(amount, chan = power_channel)
|
||||
amount = max(amount * machine_power_rectifier, 0) // make sure we don't use negative power
|
||||
var/area/A = get_area(src) // make sure it's in an area
|
||||
A?.use_power(amount, chan)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user