/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
code/modules/power/solar.dm
109 строк
5 KB
SECBATON GRIFFON
Grammar and formatting issue nuke (#38346)
10 сен 2025, 14:26
Не верифицирован
10 сен 2025, 14:26
c165582
Код
Авторство
О чём код?
#define SOLAR_MAX_DIST 40 #define SOLARGENRATE 1500 // upgrade factor can happen later, regular solars start with rglass panels var/list/solars_list = list() /obj/machinery/power/solar icon = 'icons/obj/power.dmi' density = 1 /obj/machinery/power/solar/New(loc) ..(loc) solars_list += src if(ticker) initialize() /obj/machinery/power/solar/Destroy() solars_list -= src ..() /obj/machinery/power/solar/initialize() ..() connect_to_network() // this is here because it is fucking here. If you found this, you're lucky ! /obj/item/weapon/paper/solar name = "paper - 'Going green with Greencorps! Instructions on setting up your own solar array.'" info = {"<h1>Welcome</h1> <p>We at Greencorps love the environment, and space. With this package you can help mother nature and produce energy without using fossil fuel or plasma! Solar energy is one of the safest kinds you can use, without any of the nasty accidents associated with ones such as the supermatter or singularity. This paper details instructions on how you setup your own solar array.</p> <p>To make a solar panel, you must:</p> <ul><li>Wrench the solar assembly onto a cable node.</li> <li>Add a glass panel, reinforced or regular glass will do.</li></ul> <p>It's that easy!.</p> <p>Now after setting up 19 more of these solar panels, you would want to create a solar tracker to keep track of mother nature's gift, the sun. These are the same steps as before except you insert the tracker equipment circuit into the assembly before performing the final step of adding the glass. You now have a tracker!</p> <p>Now the last step is to add a computer to calculate the sun's movements and to send commands to the solar panels to change direction with the sun. Setting up the solar computer is the same as setting up any computer, so you should have no trouble in doing that. You do need to put a wire node under the computer, and the wire needs to be connected to the tracker.</p> <p>Congratulations, you should have a working solar array. If you are having any trouble, here are some tips:</p> <ul><li>Make sure all solar equipment is on a cable node, even the computer.</li> <li>You can always deconstruct your creations if you make a mistake.</li></ul> <p>That's all there is to it. Be safe, be green!</p>"} //Solar Assembly - For construction of solar arrays /obj/machinery/power/solar_assembly name = "solar panel assembly" desc = "A solar panel assembly kit, allows constructions of a solar panel, or with a tracking circuit board, a solar tracker." icon = 'icons/obj/power.dmi' icon_state = "sp_base" anchored = 0 density = 0 var/tracker = 0 var/glass_type = null //Give back the glass type we were supplied with /obj/machinery/power/solar_assembly/proc/give_glass() //And the lord said unto him, 'Give that fucker glass' if(glass_type) var/obj/item/stack/sheet/S = new glass_type(get_turf(src)) S.amount = 2 glass_type = null //Memory vars ho ! /obj/machinery/power/solar_assembly/attackby(var/obj/item/weapon/W, var/mob/user) if(!anchored && isturf(loc)) if(W.is_wrench(user)) anchored = 1 user.visible_message("<span class='notice'>[user] wrenches [src] down.</span>", \ "<span class='notice'>You wrench [src] down.</span>") W.playtoolsound(src, 75) return 1 else if(W.is_wrench(user)) anchored = 0 user.visible_message("<span class='notice'>[user] unwrenches [src] from the ground.</span>", \ "<span class='notice'>You unwrench [src] from the ground.</span>") W.playtoolsound(src, 75) return 1 if(istype(W, /obj/item/stack/sheet/glass)) var/obj/item/stack/sheet/glass/S = W if(S.amount >= 2) glass_type = W.type S.use(2) playsound(src, 'sound/machines/click.ogg', 50, 1) user.visible_message("<span class='notice'>[user] carefully adds glass to [src].</span>", \ "<span class='notice'>You carefully add glass to [src].</span>") if(tracker) new /obj/machinery/power/solar/panel/tracker(get_turf(src), src) else new /obj/machinery/power/solar/panel(get_turf(src), src) else to_chat(user, "<span class='notice'>You lack enough [W.name] to finish the solar.</span>") return 1 if(!tracker) if(istype(W, /obj/item/weapon/tracker_electronics)) if(user.drop_item(W)) tracker = 1 qdel(W) user.visible_message("<span class='notice'>[user] inserts the electronics into [src].</span>", \ "<span class='notice'>You insert the electronics into [src].</span>") return 1 else if(iscrowbar(W)) new /obj/item/weapon/tracker_electronics(src.loc) tracker = 0 user.visible_message("<span class='notice'>[user] takes the electronics out of [src].</span>", \ "<span class='notice'>You take the electronics out of [src].</span>") return 1 ..() /obj/machinery/power/solar_assembly/give_tech_list() return "power=3"