power standardization 1/??????? - power scales, SMES/cellrate/APC/powernet/god i'm dying inside (#4103)

* start

* about ready for conversions

* oh boy

* oh boy

* powernet procs

* draw power, surplus, avil, smes

* cellrate, smes

* cellrate, smes

* more

* wacky

* aa

* there we go

* Wild!

* ix

* more

* why

* between needs to die

* smart

* oh no

* fear

* f

* fixes

* i hate parentheses

* i hate parentheses

* fixes

* calc moment

* *pawstamp*

* acter

* i hate myself too thank you

* a

* wack

* cheat factors

* that

* fix

* recomp

* epic js moment

* fix
This commit is contained in:
silicons
2022-05-26 01:27:14 -07:00
committed by GitHub
parent 282094f2c9
commit 7152e7ff2a
164 changed files with 1011 additions and 1077 deletions
@@ -23,7 +23,7 @@
amount = round(amount)
if(damage_casing)
damage += amount
damage = between(0, damage, max_damage)
damage = clamp( damage, 0, max_damage)
if(component_probability)
for(var/obj/item/computer_hardware/H in get_all_components())
@@ -12,7 +12,7 @@
apc_powered = FALSE
if(!battery_module || !battery_module.check_functionality() || battery_module.battery.charge <= 0)
return FALSE
if(battery_module.battery.use(power_usage * CELLRATE) || ((power_usage == 0) && battery_module.battery.charge))
if(battery_module.battery.use(DYNAMIC_W_TO_CELL_UNITS(power_usage, 1)) || ((power_usage == 0) && battery_module.battery.charge))
return TRUE
return FALSE
@@ -30,7 +30,7 @@
// At this point, we know that APC can power us for this tick. Check if we also need to charge our battery, and then actually use the power.
if(battery_module && (battery_module.battery.charge < battery_module.battery.maxcharge) && (power_usage > 0))
power_usage += tesla_link.passive_charging_rate
battery_module.battery.give(tesla_link.passive_charging_rate * CELLRATE)
battery_module.battery.give(DYNAMIC_W_TO_CELL_UNITS(tesla_link.passive_charging_rate, 1))
A.use_power_oneoff(power_usage, EQUIP)
return TRUE