////////////////////////////////////// // SUIT STORAGE UNIT ///////////////// ////////////////////////////////////// /obj/machinery/suit_storage_unit name = "Suit Storage Unit" desc = "An industrial U-Stor-It Storage unit designed to accomodate all kinds of space suits. Its on-board equipment also allows the user to decontaminate the contents through a UV-ray purging cycle. There's a warning label dangling from the control pad, reading \"STRICTLY NO BIOLOGICALS IN THE CONFINES OF THE UNIT\"." icon = 'icons/obj/suitstorage.dmi' icon_state = "suitstorage000000100" //order is: [has helmet][has suit][has human][is open][is locked][is UV cycling][is powered][is dirty/broken] [is superUVcycling] anchored = 1 density = 1 var/mob/living/carbon/human/OCCUPANT = null var/obj/item/clothing/suit/space/SUIT = null var/SUIT_TYPE = null var/obj/item/clothing/head/helmet/space/HELMET = null var/HELMET_TYPE = null var/obj/item/clothing/mask/MASK = null //All the stuff that's gonna be stored insiiiiiiiiiiiiiiiiiiide, nyoro~n var/MASK_TYPE = null //Erro's idea on standarising SSUs whle keeping creation of other SSU types easy: Make a child SSU, name it something then set the TYPE vars to your desired suit output. New() should take it from there by itself. var/isopen = 0 var/islocked = 0 var/isUV = 0 var/ispowered = 1 //starts powered var/isbroken = 0 var/issuperUV = 0 var/panelopen = 0 var/safetieson = 1 var/cycletime_left = 0 //The units themselves///////////////// /obj/machinery/suit_storage_unit/standard_unit SUIT_TYPE = /obj/item/clothing/suit/space/eva HELMET_TYPE = /obj/item/clothing/head/helmet/space/eva MASK_TYPE = /obj/item/clothing/mask/breath /obj/machinery/suit_storage_unit/New() src.update_icon() if(SUIT_TYPE) SUIT = new SUIT_TYPE(src) if(HELMET_TYPE) HELMET = new HELMET_TYPE(src) if(MASK_TYPE) MASK = new MASK_TYPE(src) /obj/machinery/suit_storage_unit/update_icon() var/hashelmet = 0 var/hassuit = 0 var/hashuman = 0 if(HELMET) hashelmet = 1 if(SUIT) hassuit = 1 if(OCCUPANT) hashuman = 1 icon_state = text("suitstorage[][][][][][][][][]",hashelmet,hassuit,hashuman,src.isopen,src.islocked,src.isUV,src.ispowered,src.isbroken,src.issuperUV) /obj/machinery/suit_storage_unit/power_change() if( powered() ) src.ispowered = 1 stat &= ~NOPOWER src.update_icon() else spawn(rand(0, 15)) src.ispowered = 0 stat |= NOPOWER src.islocked = 0 src.isopen = 1 src.dump_everything() src.update_icon() /obj/machinery/suit_storage_unit/ex_act(severity) switch(severity) if(1.0) if(prob(50)) src.dump_everything() //So suits dont survive all the time qdel(src) return if(2.0) if(prob(50)) src.dump_everything() qdel(src) return else return return /obj/machinery/suit_storage_unit/attack_hand(mob/user as mob) var/dat if(..()) return if(stat & NOPOWER) return if(!user.IsAdvancedToolUser()) return 0 if(src.panelopen) //The maintenance panel is open. Time for some shady stuff dat+= "Suit storage unit: Maintenance panel" dat+= "Maintenance panel controls
" dat+= "The panel is ridden with controls, button and meters, labeled in strange signs and symbols that
you cannot understand. Probably the manufactoring world's language.
Among other things, a few controls catch your eye.

" dat+= text("A small dial with a \"ë\" symbol embroidded on it. It's pointing towards a gauge that reads [].
Turn towards []
",(src.issuperUV ? "15nm" : "185nm"),src,(src.issuperUV ? "185nm" : "15nm") ) dat+= text("A thick old-style button, with 2 grimy LED lights next to it. The [] LED is on.
Press button",(src.safetieson? "GREEN" : "RED"),src) dat+= text("

Close panel", user) //user << browse(dat, "window=ssu_m_panel;size=400x500") //onclose(user, "ssu_m_panel") else if(src.isUV) //The thing is running its cauterisation cycle. You have to wait. dat += "Suit storage unit" dat+= "Unit is cauterising contents with selected UV ray intensity. Please wait.
" //dat+= "Cycle end in: [src.cycletimeleft()] seconds. " //user << browse(dat, "window=ssu_cycling_panel;size=400x500") //onclose(user, "ssu_cycling_panel") else if(!src.isbroken) dat+= "Suit storage unit" dat+= "U-Stor-It Suit Storage Unit, model DS1900
" dat+= "Welcome to the Unit control panel.
" dat+= text("Helmet storage compartment: []
",(src.HELMET ? HELMET.name : "
No helmet detected.") ) if(HELMET && src.isopen) dat+=text("Dispense helmet
",src) dat+= text("Suit storage compartment: []
",(src.SUIT ? SUIT.name : "
No exosuit detected.") ) if(SUIT && src.isopen) dat+=text("Dispense suit
",src) dat+= text("Breathmask storage compartment: []
",(src.MASK ? MASK.name : "
No breathmask detected.") ) if(MASK && src.isopen) dat+=text("Dispense mask
",src) if(src.OCCUPANT) dat+= "
WARNING: Biological entity detected inside the Unit's storage. Please remove.
" dat+= "Eject extra load" dat+= text("
Unit is: [] - [] Unit ",(src.isopen ? "Open" : "Closed"),src,(src.isopen ? "Close" : "Open")) if(src.isopen) dat+="
" else dat+= text(" - *[] Unit*
",src,(src.islocked ? "Unlock" : "Lock") ) dat+= text("Unit status: []",(src.islocked? "**LOCKED**
" : "**UNLOCKED**
") ) dat+= text("Start Disinfection cycle
",src) dat += text("

Close control panel", user) //user << browse(dat, "window=Suit Storage Unit;size=400x500") //onclose(user, "Suit Storage Unit") else //Ohhhh shit it's dirty or broken! Let's inform the guy. dat+= "Suit storage unit" dat+= "Unit chamber is too contaminated to continue usage. Please call for a qualified individual to perform maintenance.

" dat+= text("
Close control panel", user) //user << browse(dat, "window=suit_storage_unit;size=400x500") //onclose(user, "suit_storage_unit") user << browse(dat, "window=suit_storage_unit;size=400x500") onclose(user, "suit_storage_unit") return /obj/machinery/suit_storage_unit/Topic(href, href_list) //I fucking HATE this proc if(..()) return 1 if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) usr.set_machine(src) if (href_list["toggleUV"]) src.toggleUV(usr) src.updateUsrDialog() src.update_icon() if (href_list["togglesafeties"]) src.togglesafeties(usr) src.updateUsrDialog() src.update_icon() if (href_list["dispense_helmet"]) src.dispense_helmet(usr) src.updateUsrDialog() src.update_icon() if (href_list["dispense_suit"]) src.dispense_suit(usr) src.updateUsrDialog() src.update_icon() if (href_list["dispense_mask"]) src.dispense_mask(usr) src.updateUsrDialog() src.update_icon() if (href_list["toggle_open"]) src.toggle_open(usr) src.updateUsrDialog() src.update_icon() if (href_list["toggle_lock"]) src.toggle_lock(usr) src.updateUsrDialog() src.update_icon() if (href_list["start_UV"]) src.start_UV(usr) src.updateUsrDialog() src.update_icon() if (href_list["eject_guy"]) src.eject_occupant(usr) src.updateUsrDialog() src.update_icon() /*if (href_list["refresh"]) src.updateUsrDialog()*/ src.add_fingerprint(usr) return /obj/machinery/suit_storage_unit/proc/toggleUV(mob/user as mob) // var/protected = 0 // var/mob/living/carbon/human/H = user if(!src.panelopen) return /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves if(istype(G,/obj/item/clothing/gloves/color/yellow)) protected = 1 if(!protected) playsound(src.loc, "sparks", 75, 1, -1) user << "You try to touch the controls but you get zapped. There must be a short circuit somewhere." return*/ else //welp, the guy is protected, we can continue if(src.issuperUV) user << "You slide the dial back towards \"185nm\"." src.issuperUV = 0 else user << "You crank the dial all the way up to \"15nm\"." src.issuperUV = 1 return /obj/machinery/suit_storage_unit/proc/togglesafeties(mob/user as mob) // var/protected = 0 // var/mob/living/carbon/human/H = user if(!src.panelopen) //Needed check due to bugs return /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves if(istype(G,/obj/item/clothing/gloves/color/yellow) ) protected = 1 if(!protected) playsound(src.loc, "sparks", 75, 1, -1) user << "You try to touch the controls but you get zapped. There must be a short circuit somewhere." return*/ else user << "You push the button. The coloured LED next to it changes." src.safetieson = !src.safetieson /obj/machinery/suit_storage_unit/proc/dispense_helmet(mob/user as mob) if(!src.HELMET) return //Do I even need this sanity check? Nyoro~n else src.HELMET.loc = src.loc src.HELMET = null return /obj/machinery/suit_storage_unit/proc/dispense_suit(mob/user as mob) if(!src.SUIT) return else src.SUIT.loc = src.loc src.SUIT = null return /obj/machinery/suit_storage_unit/proc/dispense_mask(mob/user as mob) if(!src.MASK) return else src.MASK.loc = src.loc src.MASK = null return /obj/machinery/suit_storage_unit/proc/dump_everything() src.islocked = 0 //locks go free if(src.SUIT) src.SUIT.loc = src.loc src.SUIT = null if(src.HELMET) src.HELMET.loc = src.loc src.HELMET = null if(src.MASK) src.MASK.loc = src.loc src.MASK = null if(src.OCCUPANT) src.eject_occupant(OCCUPANT) return /obj/machinery/suit_storage_unit/proc/toggle_open(mob/user as mob) if(src.islocked || src.isUV) user << "Unable to open unit." return if(src.OCCUPANT) src.eject_occupant(user) return // eject_occupant opens the door, so we need to return src.isopen = !src.isopen return /obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob) if(src.OCCUPANT && src.safetieson) user << "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments." return if(src.isopen) return src.islocked = !src.islocked return /obj/machinery/suit_storage_unit/proc/start_UV(mob/user as mob) if(src.isUV || src.isopen) //I'm bored of all these sanity checks return if(src.OCCUPANT && src.safetieson) user << "WARNING: Biological entity detected in the confines of the Unit's storage. Cannot initiate cycle." return if(!src.HELMET && !src.MASK && !src.SUIT && !src.OCCUPANT ) //shit's empty yo user << "Unit storage bays empty. Nothing to disinfect -- Aborting." return user << "You start the Unit's cauterisation cycle." src.cycletime_left = 20 src.isUV = 1 if(src.OCCUPANT && !src.islocked) src.islocked = 1 //Let's lock it for good measure src.update_icon() src.updateUsrDialog() var/i //our counter for(i=0,i<4,i++) sleep(50) if(src.OCCUPANT) if(src.issuperUV) var/burndamage = rand(35,45) OCCUPANT.take_organ_damage(0,burndamage) OCCUPANT.emote("scream") else var/burndamage = rand(10,15) OCCUPANT.take_organ_damage(0,burndamage) OCCUPANT.emote("scream") if(i==3) //End of the cycle if(!src.issuperUV) if(src.HELMET) HELMET.clean_blood() if(src.SUIT) SUIT.clean_blood() if(src.MASK) MASK.clean_blood() else //It was supercycling, destroy everything if(src.HELMET) src.HELMET = null if(src.SUIT) src.SUIT = null if(src.MASK) src.MASK = null visible_message("With a loud whining noise, the Suit Storage Unit's door grinds open. Puffs of ashen smoke come out of its chamber.", 3) src.isbroken = 1 src.isopen = 1 src.islocked = 0 src.eject_occupant(OCCUPANT) //Mixing up these two lines causes bug. DO NOT DO IT. src.isUV = 0 //Cycle ends src.update_icon() src.updateUsrDialog() return /* spawn(200) //Let's clean dat shit after 20 secs //Eh, this doesn't work if(src.HELMET) HELMET.clean_blood() if(src.SUIT) SUIT.clean_blood() if(src.MASK) MASK.clean_blood() src.isUV = 0 //Cycle ends src.update_icon() src.updateUsrDialog() var/i for(i=0,i<4,i++) //Gradually give the guy inside some damaged based on the intensity spawn(50) if(src.OCCUPANT) if(src.issuperUV) OCCUPANT.take_organ_damage(0,40) user << "Test. You gave him 40 damage" else OCCUPANT.take_organ_damage(0,8) user << "Test. You gave him 8 damage" return*/ /obj/machinery/suit_storage_unit/proc/cycletimeleft() if(src.cycletime_left >= 1) src.cycletime_left-- return src.cycletime_left /obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user as mob) if (src.islocked) return if (!src.OCCUPANT) return // for(var/obj/O in src) // O.loc = src.loc if (src.OCCUPANT.client) if(user != OCCUPANT) OCCUPANT << "The machine kicks you out!" if(user.loc != src.loc) OCCUPANT << "You leave the not-so-cozy confines of the SSU." src.OCCUPANT.client.eye = src.OCCUPANT.client.mob src.OCCUPANT.client.perspective = MOB_PERSPECTIVE src.OCCUPANT.loc = src.loc src.OCCUPANT = null if(!src.isopen) src.isopen = 1 src.update_icon() return /obj/machinery/suit_storage_unit/verb/get_out() set name = "Eject Suit Storage Unit" set category = "Object" set src in oview(1) if (usr.stat != 0) return src.eject_occupant(usr) add_fingerprint(usr) src.updateUsrDialog() src.update_icon() return /obj/machinery/suit_storage_unit/verb/move_inside() set name = "Hide in Suit Storage Unit" set category = "Object" set src in oview(1) if (usr.stat != 0) return if (!src.isopen) usr << "The unit's doors are shut." return if (!src.ispowered || src.isbroken) usr << "The unit is not operational." return if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) usr << "It's too cluttered inside for you to fit in!" return visible_message("[usr] starts squeezing into the suit storage unit!", 3) if(do_after(usr, 10)) usr.stop_pulling() usr.client.perspective = EYE_PERSPECTIVE usr.client.eye = src usr.loc = src // usr.metabslow = 1 src.OCCUPANT = usr src.isopen = 0 //Close the thing after the guy gets inside src.update_icon() // for(var/obj/O in src) // del(O) src.add_fingerprint(usr) src.updateUsrDialog() return else src.OCCUPANT = null //Testing this as a backup sanity test return /obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob, params) if(!src.ispowered) return if(istype(I, /obj/item/weapon/screwdriver)) src.panelopen = !src.panelopen playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) user << text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ) src.updateUsrDialog() return if ( istype(I, /obj/item/weapon/grab) ) var/obj/item/weapon/grab/G = I if( !(ismob(G.affecting)) ) return if (!src.isopen) usr << "The unit's doors are shut." return if (!src.ispowered || src.isbroken) usr << "The unit is not operational." return if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) //Unit needs to be absolutely empty user << "The unit's storage area is too cluttered." return visible_message("[user] starts putting [G.affecting.name] into the Suit Storage Unit.", 3) if(do_after(user, 20)) if(!G || !G.affecting) return //derpcheck var/mob/M = G.affecting if (M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src src.OCCUPANT = M src.isopen = 0 //close ittt //for(var/obj/O in src) // O.loc = src.loc src.add_fingerprint(user) qdel(G) src.updateUsrDialog() src.update_icon() return return if( istype(I,/obj/item/clothing/suit/space) ) if(!src.isopen) return var/obj/item/clothing/suit/space/S = I if(src.SUIT) user << "The unit already contains a suit." return user << "You load the [S.name] into the storage compartment." user.drop_item() S.loc = src src.SUIT = S src.update_icon() src.updateUsrDialog() return if( istype(I,/obj/item/clothing/head/helmet) ) if(!src.isopen) return var/obj/item/clothing/head/helmet/H = I if(src.HELMET) user << "The unit already contains a helmet." return user << "You load the [H.name] into the storage compartment." user.drop_item() H.loc = src src.HELMET = H src.update_icon() src.updateUsrDialog() return if( istype(I,/obj/item/clothing/mask) ) if(!src.isopen) return var/obj/item/clothing/mask/M = I if(src.MASK) user << "The unit already contains a mask." return user << "You load the [M.name] into the storage compartment." user.drop_item() M.loc = src src.MASK = M src.update_icon() src.updateUsrDialog() return src.update_icon() src.updateUsrDialog() return /obj/machinery/suit_storage_unit/attack_ai(mob/user as mob) return src.attack_hand(user) //////////////////////////////REMINDER: Make it lock once you place some fucker inside. //God this entire file is fucking awful //Suit painter for Bay's special snowflake aliums. /obj/machinery/suit_cycler name = "suit cycler" desc = "An industrial machine for repairing, painting and equipping hardsuits." anchored = 1 density = 1 icon = 'icons/obj/suitstorage.dmi' icon_state = "suitstorage000000100" req_access = list(access_captain,access_heads) var/active = 0 // PLEASE HOLD. var/safeties = 1 // The cycler won't start with a living thing inside it unless safeties are off. var/irradiating = 0 // If this is > 0, the cycler is decontaminating whatever is inside it. var/radiation_level = 2 // 1 is removing germs, 2 is removing blood, 3 is removing plasma. var/model_text = "" // Some flavour text for the topic box. var/locked = 1 // If locked, nothing can be taken from or added to the cycler. // Wiring bollocks. var/wires = 15 var/electrified = 0 var/const/WIRE_EXTEND = 1 // Safeties var/const/WIRE_SCANID = 2 // Locked status var/const/WIRE_SHOCK = 3 // What it says on the tin. //Departments that the cycler can paint suits to look like. var/list/departments = list("Engineering","Mining","Medical","Security","Atmos") //Species that the suits can be configured to fit. var/list/species = list("Human","Skrell","Unathi","Tajaran") var/target_department = "Engineering" var/target_species = "Human" var/mob/living/carbon/human/occupant = null var/obj/item/clothing/suit/space/rig/suit = null var/obj/item/clothing/head/helmet/space/helmet = null /obj/machinery/suit_cycler/engineering name = "Engineering suit cycler" model_text = "Engineering" req_access = list(access_construction) departments = list("Engineering","Atmos") species = list("Human","Unathi","Tajaran") /obj/machinery/suit_cycler/mining name = "Mining suit cycler" model_text = "Mining" req_access = list(access_mining) departments = list("Mining") species = list("Human","Unathi","Tajaran") /obj/machinery/suit_cycler/attack_ai(mob/user as mob) return src.attack_hand(user) /obj/machinery/suit_cycler/attackby(obj/item/I as obj, mob/user as mob, params) if(electrified != 0) if(src.shock(user, 100)) return //Hacking init. if(istype(I, /obj/item/device/multitool) || istype(I, /obj/item/weapon/wirecutters)) if(panel_open) attack_hand(user) return //Other interface stuff. if(istype(I, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = I if(!(ismob(G.affecting))) return if(locked) user << "\red The suit cycler is locked." return if(src.contents.len > 0) user << "\red There is no room inside the cycler for [G.affecting.name]." return visible_message("[user] starts putting [G.affecting.name] into the suit cycler.", 3) if(do_after(user, 20)) if(!G || !G.affecting) return var/mob/M = G.affecting if (M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src src.occupant = M src.add_fingerprint(user) qdel(G) src.updateUsrDialog() return else if(istype(I,/obj/item/weapon/screwdriver)) panel_open = !panel_open user << "You [panel_open ? "open" : "close"] the maintenance panel." src.updateUsrDialog() return else if(istype(I,/obj/item/clothing/head/helmet/space)) if(locked) user << "\red The suit cycler is locked." return if(helmet) user << "The cycler already contains a helmet." return user << "You fit \the [I] into the suit cycler." user.drop_item() I.loc = src helmet = I src.update_icon() src.updateUsrDialog() return else if(istype(I,/obj/item/clothing/suit/space/rig)) if(locked) user << "\red The suit cycler is locked." return if(suit) user << "The cycler already contains a hardsuit." return var/obj/item/clothing/suit/space/rig/S = I if(S.helmet) user << "\The [S] will not fit into the cycler with a helmet attached." return if(S.boots) user << "\The [S] will not fit into the cycler with boots attached." return user << "You fit \the [I] into the suit cycler." user.drop_item() I.loc = src suit = I src.update_icon() src.updateUsrDialog() return ..() /obj/machinery/suit_cycler/emag_act(user as mob) if(emagged) user << "\red The cycler has already been subverted." return //Clear the access reqs, disable the safeties, and open up all paintjobs. user << "\red You run the sequencer across the interface, corrupting the operating protocols." departments = list("Engineering","Mining","Medical","Security","Atmos","^%###^%$") emagged = 1 safeties = 0 req_access = list() return /obj/machinery/suit_cycler/attack_hand(mob/user as mob) add_fingerprint(user) if(..() || stat & (BROKEN|NOPOWER)) return if(!user.IsAdvancedToolUser()) return 0 if(electrified != 0) if(src.shock(user, 100)) return usr.set_machine(src) var/dat = "Suit Cycler Interface" if(src.active) dat+= "
The [model_text ? "[model_text] " : ""]suit cycler is currently in use. Please wait..." else if(locked) dat += "
The [model_text ? "[model_text] " : ""]suit cycler is currently locked. Please contact your system administrator." if(src.allowed(usr)) dat += "
\[unlock unit\]" else dat += "

Suit cycler

" dat += "Welcome to the [model_text ? "[model_text] " : ""]suit cycler control panel. \[lock unit\]
" dat += "

Maintenance

" dat += "Helmet: [helmet ? "\the [helmet]" : "no helmet stored" ]. \[eject\]
" dat += "Suit: [suit ? "\the [suit]" : "no suit stored" ]. \[eject\]" if(suit && istype(suit)) dat += "[(suit.damage ? " \[repair\]" : "")]" dat += "
UV decontamination systems: SYSTEM ERROR" : "green'>READY"]
" dat += "Output level: [radiation_level]
" dat += "\[select power level\] \[begin decontamination cycle\]

" dat += "

Customisation

" dat += "Target product: [target_department], [target_species]." dat += "
\[apply customisation routine\]


" /* if(panel_open) var/list/vendwires = list( "Violet" = 1, "Orange" = 2, "Goldenrod" = 3, ) dat += "

Access Panel

" for(var/wiredesc in vendwires) var/is_uncut = src.wires & APCWireColorToFlag[vendwires[wiredesc]] dat += "[wiredesc] wire: " if(!is_uncut) dat += "Mend" else dat += "Cut " dat += "Pulse " dat += "
" dat += "
" dat += "The orange light is [(electrified == 0) ? "off" : "on"].
" dat += "The red light is [safeties ? "blinking" : "off"].
" dat += "The yellow light is [locked ? "on" : "off"].
" */ user << browse(dat, "window=suit_cycler") onclose(user, "suit_cycler") return /obj/machinery/suit_cycler/Topic(href, href_list) if(href_list["eject_suit"]) if(!suit) return suit.loc = get_turf(src) suit = null else if(href_list["eject_helmet"]) if(!helmet) return helmet.loc = get_turf(src) helmet = null else if(href_list["select_department"]) var/choice = input("Please select the target department paintjob.","Suit cycler",null) as null|anything in departments if(choice) target_department = choice else if(href_list["select_species"]) var/choice = input("Please select the target species configuration.","Suit cycler",null) as null|anything in species if(choice) target_species = choice else if(href_list["select_rad_level"]) var/choices = list(1,2,3) if(emagged) choices = list(1,2,3,4,5) radiation_level = input("Please select the desired radiation level.","Suit cycler",null) as null|anything in choices else if(href_list["repair_suit"]) if(!suit) return active = 1 spawn(100) repair_suit() finished_job() else if(href_list["apply_paintjob"]) if(!suit && !helmet) return active = 1 spawn(100) apply_paintjob() finished_job() else if(href_list["toggle_safties"]) safeties = !safeties else if(href_list["toggle_lock"]) if(src.allowed(usr)) locked = !locked usr << "You [locked ? "" : "un"]lock \the [src]." else usr << "\red Access denied." else if(href_list["begin_decontamination"]) if(safeties && occupant) usr << "\red The cycler has detected an occupant. Please remove the occupant before commencing the decontamination cycle." return active = 1 irradiating = 10 src.updateUsrDialog() sleep(10) if(helmet) if(radiation_level > 1) helmet.clean_blood() if(suit) if(radiation_level > 1) suit.clean_blood() /* else if ((href_list["cutwire"]) && (src.panel_open)) var/twire = text2num(href_list["cutwire"]) if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(twire)) src.mend(twire) else src.cut(twire) else if ((href_list["pulsewire"]) && (src.panel_open)) var/twire = text2num(href_list["pulsewire"]) if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(twire)) usr << "You can't pulse a cut wire." return else src.pulse(twire)*/ src.updateUsrDialog() return /obj/machinery/suit_cycler/process() if(electrified > 0) electrified-- if(!active) return if(active && stat & (BROKEN|NOPOWER)) active = 0 irradiating = 0 electrified = 0 return if(irradiating == 1) finished_job() irradiating = 0 return irradiating-- if(occupant) if(prob(radiation_level*2)) occupant.emote("scream") if(radiation_level > 2) occupant.take_organ_damage(0,radiation_level*2 + rand(1,3)) if(radiation_level > 1) occupant.take_organ_damage(0,radiation_level + rand(1,3)) occupant.radiation += radiation_level*10 /obj/machinery/suit_cycler/proc/finished_job() var/turf/T = get_turf(src) T.visible_message("\The [src] pings loudly.") icon_state = initial(icon_state) active = 0 src.updateUsrDialog() /obj/machinery/suit_cycler/proc/repair_suit() if(!suit || !suit.damage || !suit.can_breach) return suit.breaches = list() suit.calc_breach_damage() return /obj/machinery/suit_cycler/verb/leave() set name = "Eject Cycler" set category = "Object" set src in oview(1) if (usr.stat != 0) return eject_occupant(usr) /obj/machinery/suit_cycler/proc/eject_occupant(mob/user as mob) if(locked || active) user << "\red The cycler is locked." return if (!occupant) return if (occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE occupant.loc = get_turf(occupant) occupant = null add_fingerprint(usr) src.updateUsrDialog() src.update_icon() return /* //HACKING PROCS, MOSTLY COPIED FROM VENDING MACHINES /obj/machinery/suit_cycler/proc/isWireColorCut(var/wireColor) var/wireFlag = APCWireColorToFlag[wireColor] return ((src.wires & wireFlag) == 0) /obj/machinery/suit_cycler/proc/isWireCut(var/wireIndex) var/wireFlag = APCIndexToFlag[wireIndex] return ((src.wires & wireFlag) == 0) /obj/machinery/suit_cycler/proc/cut(var/wireColor) var/wireFlag = APCWireColorToFlag[wireColor] var/wireIndex = APCWireColorToIndex[wireColor] src.wires &= ~wireFlag switch(wireIndex) if(WIRE_EXTEND) safeties = 0 if(WIRE_SHOCK) electrified = -1 if (WIRE_SCANID) locked = 0 /obj/machinery/suit_cycler/proc/mend(var/wireColor) var/wireFlag = APCWireColorToFlag[wireColor] var/wireIndex = APCWireColorToIndex[wireColor] //not used in this function src.wires |= wireFlag switch(wireIndex) if(WIRE_SHOCK) src.electrified = 0 /obj/machinery/suit_cycler/proc/pulse(var/wireColor) var/wireIndex = APCWireColorToIndex[wireColor] switch(wireIndex) if(WIRE_EXTEND) safeties = !locked if(WIRE_SHOCK) electrified = 30 if (WIRE_SCANID) locked = !locked */ /obj/machinery/suit_cycler/proc/shock(mob/user, prb) if(stat & (BROKEN|NOPOWER)) // unpowered, no shock return 0 if(!prob(prb)) return 0 var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() if (electrocute_mob(user, get_area(src), src, 0.7)) return 1 else return 0 //There HAS to be a less bloated way to do this. TODO: some kind of table/icon name coding? ~Z /obj/machinery/suit_cycler/proc/apply_paintjob() if(!target_species || !target_department) return if(target_species) if(helmet) helmet.refit_for_species(target_species) if(suit) suit.refit_for_species(target_species) switch(target_department) if("Engineering") if(helmet) helmet.name = "engineering hardsuit helmet" helmet.icon_state = "rig0-engineering" helmet.item_state = "eng_helm" helmet._color = "engineering" if(suit) suit.name = "engineering hardsuit" suit.icon_state = "rig-engineering" suit.item_state = "eng_hardsuit" if("Mining") if(helmet) helmet.name = "mining hardsuit helmet" helmet.icon_state = "rig0-mining" helmet.item_state = "mining_helm" helmet._color = "mining" if(suit) suit.name = "mining hardsuit" suit.icon_state = "rig-mining" suit.item_state = "mining_hardsuit" if("Medical") if(helmet) helmet.name = "medical hardsuit helmet" helmet.icon_state = "rig0-medical" helmet.item_state = "medical_helm" helmet._color = "medical" if(suit) suit.name = "medical hardsuit" suit.icon_state = "rig-medical" suit.item_state = "medical_hardsuit" if("Security") if(helmet) helmet.name = "security hardsuit helmet" helmet.icon_state = "rig0-sec" helmet.item_state = "sec_helm" helmet._color = "sec" if(suit) suit.name = "security hardsuit" suit.icon_state = "rig-sec" suit.item_state = "sec_hardsuit" if("Atmos") if(helmet) helmet.name = "atmospherics hardsuit helmet" helmet.icon_state = "rig0-atmos" helmet.item_state = "atmos_helm" helmet._color = "atmos" if(suit) suit.name = "atmospherics hardsuit" suit.icon_state = "rig-atmos" suit.item_state = "atmos_hardsuit" if("^%###^%$") if(helmet) helmet.name = "blood-red hardsuit helmet" helmet.icon_state = "rig0-syndie" helmet.item_state = "syndie_helm" helmet._color = "syndie" if(suit) suit.name = "blood-red hardsuit" suit.item_state = "syndie_hardsuit" suit.icon_state = "rig-syndie"