mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-27 22:16:23 +01:00
APCs now use percent-based channel values.
- Equipment now once again shuts down when APC reaches 30% - Lighting shuts down at 15% This is now correctly based on APCs power cell, instead of being hardcoded. This means atmospherics and similar areas won't just suddenly go from all lit working room to darkness.
This commit is contained in:
@@ -1139,7 +1139,7 @@
|
||||
else if(longtermpower > -10)
|
||||
longtermpower -= 2
|
||||
|
||||
if(cell.charge >= 1250 || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
|
||||
if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
|
||||
if(autoflag != 3)
|
||||
equipment = autoset(equipment, 1)
|
||||
lighting = autoset(lighting, 1)
|
||||
@@ -1148,21 +1148,21 @@
|
||||
area.poweralert(1, src)
|
||||
if(cell.charge >= 4000)
|
||||
area.poweralert(1, src)
|
||||
else if(cell.charge < 1250 && cell.charge > 750 && longtermpower < 0) // <30%, turn off equipment
|
||||
else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment
|
||||
if(autoflag != 2)
|
||||
equipment = autoset(equipment, 2)
|
||||
lighting = autoset(lighting, 1)
|
||||
environ = autoset(environ, 1)
|
||||
area.poweralert(0, src)
|
||||
autoflag = 2
|
||||
else if(cell.charge < 750 && cell.charge > 10) // <15%, turn off lighting & equipment
|
||||
else if(cell.percent() <= 15) // <15%, turn off lighting & equipment
|
||||
if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0))
|
||||
equipment = autoset(equipment, 2)
|
||||
lighting = autoset(lighting, 2)
|
||||
environ = autoset(environ, 1)
|
||||
area.poweralert(0, src)
|
||||
autoflag = 1
|
||||
else if(cell.charge <= 0) // zero charge, turn all off
|
||||
else // zero charge, turn all off
|
||||
if(autoflag != 0)
|
||||
equipment = autoset(equipment, 0)
|
||||
lighting = autoset(lighting, 0)
|
||||
|
||||
Reference in New Issue
Block a user