[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:
SkyratBot
2022-04-26 20:48:11 -07:00
committed by GitHub
co-authored by Ghilker
parent 52076f6749
commit 6832158d93
3 changed files with 5 additions and 0 deletions
+2
View File
@@ -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.
+2
View File
@@ -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)
+1
View File
@@ -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)