mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #4922 from mwerezak/power
Fixed cell chargers being infinite energy sources.
This commit is contained in:
@@ -187,8 +187,8 @@
|
||||
var/heat_capacity = gas.heat_capacity()
|
||||
var/energy_used = min( abs( heat_capacity*(gas.temperature - target_temperature) ), MAX_ENERGY_CHANGE)
|
||||
|
||||
//Use power. Assuming that each power unit represents 1000 watts....
|
||||
use_power(energy_used/1000, ENVIRON)
|
||||
//Use power. Assuming that each power unit represents 1 watts....
|
||||
use_power(energy_used, ENVIRON)
|
||||
|
||||
//We need to cool ourselves.
|
||||
if(environment.temperature > target_temperature)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
power_channel = EQUIP
|
||||
var/obj/item/weapon/cell/charging = null
|
||||
var/chargelevel = -1
|
||||
var/efficiency = 0.875 //<1.0 means some power is lost in the charging process, >1.0 means free energy.
|
||||
proc
|
||||
updateicon()
|
||||
icon_state = "ccharger[charging ? 1 : 0]"
|
||||
@@ -91,8 +92,10 @@
|
||||
//world << "ccpt [charging] [stat]"
|
||||
if(!charging || (stat & (BROKEN|NOPOWER)) || !anchored)
|
||||
return
|
||||
|
||||
use_power(200) //this used to use CELLRATE, but CELLRATE is fucking awful. feel free to fix this properly!
|
||||
charging.give(175) //inefficiency.
|
||||
|
||||
|
||||
var/power_used = 100000 //for 200 units of charge. Yes, thats right, 100 kW. Is something wrong with CELLRATE?
|
||||
|
||||
power_used = charging.give(power_used*CELLRATE*efficiency)
|
||||
use_power(power_used)
|
||||
|
||||
updateicon()
|
||||
|
||||
Reference in New Issue
Block a user