From 38b313a4544fade16877462e34467d42217c67a0 Mon Sep 17 00:00:00 2001 From: Markolie Date: Sat, 1 Aug 2015 22:25:32 +0200 Subject: [PATCH] Engineering outpost solar update --- _maps/map_files/cyberiad/z4.dmm | 4 ++-- code/modules/power/power.dm | 2 +- code/modules/power/solar.dm | 34 ++++++++++++++------------------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/_maps/map_files/cyberiad/z4.dmm b/_maps/map_files/cyberiad/z4.dmm index 051608af944..e4ba6112ae9 100644 --- a/_maps/map_files/cyberiad/z4.dmm +++ b/_maps/map_files/cyberiad/z4.dmm @@ -82,7 +82,7 @@ "bD" = (/turf/simulated/floor/plating/airless,/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0},/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"},/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"},/turf/simulated/floor/plating/airless/catwalk{tag = "icon-catwalk12"; icon_state = "catwalk12"},/area/engiestation/solars) "bE" = (/turf/simulated/floor/plating/airless,/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0},/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"},/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"},/turf/simulated/floor/plating/airless/catwalk{tag = "icon-catwalk8"; icon_state = "catwalk8"},/area/engiestation/solars) "bF" = (/obj/structure/table,/obj/machinery/kitchen_machine/microwave,/turf/simulated/floor/plating,/area/exploration/methlab) -"bG" = (/obj/machinery/light{dir = 1},/obj/machinery/power/solar_control{name = "Engineering Outpost Solar Control"},/obj/structure/cable{icon_state = "0-2"; pixel_y = 1; d2 = 2},/turf/simulated/floor{dir = 8; icon_state = "vault"; tag = "icon-vault (WEST)"},/area/engiestation) +"bG" = (/obj/machinery/light{dir = 1},/obj/structure/cable{icon_state = "0-2"; pixel_y = 1; d2 = 2},/obj/machinery/power/solar_control/autostart{name = "Engineering Outpost Solar Control"},/turf/simulated/floor{dir = 8; icon_state = "vault"; tag = "icon-vault (WEST)"},/area/engiestation) "bH" = (/obj/machinery/power/solar,/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor{icon_state = "solarpanel"},/area/engiestation/solars) "bI" = (/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"},/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0},/turf/simulated/floor/plating,/area/engiestation) "bJ" = (/obj/structure/table,/obj/item/weapon/storage/toolbox/mechanical{pixel_x = -2; pixel_y = -1},/obj/item/device/multitool,/turf/simulated/floor{icon_state = "dark"},/area/engiestation) @@ -134,7 +134,7 @@ "cD" = (/obj/machinery/mass_driver{dir = 4; id_tag = "constructiondriver2"; name = "construction driver #2"},/obj/machinery/door/window{dir = 8; name = "Construction Driver"; req_access_txt = "10"},/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/engiestation) "cE" = (/obj/machinery/door/poddoor{id_tag = "constructiondriver2"; name = "Construction Driver Door"; protected = 0},/turf/simulated/floor/plating,/area/engiestation) "cF" = (/obj/machinery/recharge_station,/turf/simulated/floor/plating/airless,/area/constructionsite/ai) -"cG" = (/obj/machinery/power/smes{input_attempt = 1; input_level = 40000; inputting = 1; output_level = 10000},/obj/structure/cable{d2 = 2; icon_state = "0-2"; pixel_y = 0},/turf/simulated/floor{icon_state = "dark"},/area/engiestation) +"cG" = (/obj/machinery/power/smes{input_attempt = 1; input_level = 50000; inputting = 1; output_level = 15000},/obj/structure/cable{d2 = 2; icon_state = "0-2"; pixel_y = 0},/turf/simulated/floor{icon_state = "dark"},/area/engiestation) "cH" = (/obj/structure/table,/obj/item/weapon/lighter/random,/obj/item/weapon/reagent_containers/food/snacks/icecreamsandwich,/obj/item/clothing/head/chefhat,/obj/item/weapon/storage/box/donkpockets,/obj/structure/sign/fire{pixel_y = 32},/turf/simulated/floor{dir = 9; icon_state = "blue"},/area/engiestation) "cI" = (/turf/simulated/floor/plating/airless,/turf/simulated/floor/plating/airless/catwalk{tag = "icon-catwalk1"; icon_state = "catwalk1"},/area/engiestation/solars) "cJ" = (/obj/structure/flora/kirbyplants,/obj/machinery/light{dir = 1},/obj/machinery/status_display{pixel_x = 0; pixel_y = 32},/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/engiestation) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index d4aad807b51..af09f71e271 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -222,7 +222,7 @@ // rebuild all power networks from scratch - only called at world creation or by the admin verb /proc/makepowernets() for(var/datum/powernet/PN in powernets) - del(PN) + qdel(PN) powernets.Cut() for(var/obj/structure/cable/PC in cable_list) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index e6305f8374f..6935bd7777d 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -290,11 +290,24 @@ var/track = 0 // 0= off 1=timed 2=auto (tracker) var/trackrate = 600 // 300-900 seconds var/nexttime = 0 // time for a panel to rotate of 1? in manual tracking + var/autostart = 0 // Automatically search for connected devices var/obj/machinery/power/tracker/connected_tracker = null var/list/connected_panels = list() + +// Used for mapping in solar array which automatically starts itself (telecomms, for example) +/obj/machinery/power/solar_control/autostart + track = 2 // Auto tracking mode + autostart = 1 // Automatically start /obj/machinery/power/solar_control/initialize() - connect_to_network() + ..() + if(!powernet) + return + if(autostart) + src.search_for_connected() + if(connected_tracker && track == 2) + connected_tracker.set_angle(sun.angle) + set_panels(cdir) /obj/machinery/power/solar_control/Destroy() for(var/obj/machinery/power/solar/M in connected_panels) @@ -344,13 +357,6 @@ set_panels(cdir) updateDialog() - -/obj/machinery/power/solar_control/initialize() - ..() - if(!powernet) - return - set_panels(cdir) - /obj/machinery/power/solar_control/update_icon() overlays.Cut() if(stat & NOPOWER) @@ -523,18 +529,6 @@ if (prob(75)) broken() src.density = 0 - -// Used for mapping in solar array which automatically starts itself (telecomms, for example) -/obj/machinery/power/solar_control/autostart - track = 2 // Auto tracking mode - -/obj/machinery/power/solar_control/autostart/initialize() - ..() - spawn(500) // Make sure the powernet has initialized - src.search_for_connected() - if(connected_tracker && track == 2) - connected_tracker.set_angle(sun.angle) - src.set_panels(cdir) // // MISC