Implement Bay's SSmachinery and power usage updates, further unclogging the toilet (#13910)

This commit is contained in:
Wildkins
2022-05-16 12:50:16 -04:00
committed by GitHub
parent a18d6598e3
commit a4461a17af
296 changed files with 1662 additions and 1778 deletions

View File

@@ -15,7 +15,7 @@
/obj/machinery/computer/ship/sensors/proc/find_sensors()
if(!linked)
return
for(var/obj/machinery/shipsensors/S in SSmachinery.all_machines)
for(var/obj/machinery/shipsensors/S in SSmachinery.machinery)
if(linked.check_ownership(S))
sensors = S
break
@@ -102,7 +102,7 @@
new/obj/item/paper/(get_turf(src), O.get_scan_data(usr), "paper (Sensor Scan - [O])")
return TOPIC_HANDLED
/obj/machinery/computer/ship/sensors/machinery_process()
/obj/machinery/computer/ship/sensors/process()
..()
if(!linked)
return
@@ -180,11 +180,11 @@
if(!use_power && (health == 0 || !in_vacuum()))
return // No turning on if broken or misplaced.
if(!use_power) //need some juice to kickstart
use_power(idle_power_usage*5)
use_power_oneoff(idle_power_usage*5)
update_use_power(!use_power)
queue_icon_update()
/obj/machinery/shipsensors/machinery_process()
/obj/machinery/shipsensors/process()
..()
if(use_power) //can't run in non-vacuum
if(!in_vacuum())
@@ -207,7 +207,7 @@
/obj/machinery/shipsensors/proc/set_range(nrange)
range = nrange
active_power_usage = (1500 * (range**2)) //Exponential increase, also affects speed of overheating
change_power_consumption(1500 * (range**2), POWER_USE_ACTIVE)
/obj/machinery/shipsensors/emp_act(severity)
if(!use_power)

View File

@@ -36,12 +36,12 @@
/datum/ship_engine/gas_thruster/toggle()
if(nozzle.use_power)
nozzle.update_use_power(0)
nozzle.update_use_power(POWER_USE_OFF)
else
if(nozzle.blockage)
if(nozzle.check_blockage())
return
nozzle.update_use_power(1)
nozzle.update_use_power(POWER_USE_IDLE)
if(nozzle.stat & NOPOWER)//try again
nozzle.power_change()
if(nozzle.is_on())//if everything is in working order, start booting!
@@ -61,7 +61,7 @@
density = 1
atmos_canpass = CANPASS_NEVER
use_power = 0
use_power = POWER_USE_OFF
power_channel = EQUIP
idle_power_usage = 21600 //6 Wh per tick for default 2 capacitor. Gives them a reason to turn it off, really to nerf backup battery
@@ -148,7 +148,7 @@
/obj/machinery/atmospherics/unary/engine/power_change()
. = ..()
if(stat & NOPOWER)
update_use_power(0)
update_use_power(POWER_USE_OFF)
/obj/machinery/atmospherics/unary/engine/update_use_power()
. = ..()
@@ -185,9 +185,9 @@
/obj/machinery/atmospherics/unary/engine/proc/burn()
if(!is_on())
return 0
if(!check_fuel() || (0 < use_power(charge_per_burn)) || check_blockage())
if(!check_fuel() || (0 < use_power_oneoff(charge_per_burn)) || check_blockage())
audible_message(src,"<span class='warning'>[src] coughs once and goes silent!</span>")
update_use_power(0)
update_use_power(POWER_USE_OFF)
return 0
var/datum/gas_mixture/removed = air_contents.remove_ratio(volume_per_burn * thrust_limit / air_contents.volume)

View File

@@ -46,10 +46,10 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
STOP_PROCESSING(SSprocessing, src)
SSshuttle.ships -= src
for(var/obj/machinery/computer/ship/S in SSmachinery.all_machines)
for(var/obj/machinery/computer/ship/S in SSmachinery.machinery)
if(S.linked == src)
S.linked = null
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.all_machines)
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.machinery)
if(C.linked == src)
C.linked = null
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
@@ -242,9 +242,9 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
/obj/effect/overmap/visitable/ship/populate_sector_objects()
..()
for(var/obj/machinery/computer/ship/S in SSmachinery.all_machines)
for(var/obj/machinery/computer/ship/S in SSmachinery.machinery)
S.attempt_hook_up(src)
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.all_machines)
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.machinery)
C.attempt_hook_up(src)
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
H.attempt_hook_up(src)