Waste Disposal Unit
"
+
+ if(!ai) // AI can't pull flush handle
+ if(flush)
+ dat += "Disposal handle: Disengage Engaged"
+ else
+ dat += "Disposal handle: Disengaged Engage"
+
+ dat += "
Eject contents
"
+
+ if(mode <= 0)
+ dat += "Pump: Off On
"
+ else if(mode == 1)
+ dat += "Pump: Off On (pressurizing)
"
+ else
+ dat += "Pump: Off On (idle)
"
+
+ var/per = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
+
+ dat += "Pressure: [round(per, 1)]%
"
+
+
+ user.set_machine(src)
+ user << browse(dat, "window=disposal;size=360x170")
+ onclose(user, "disposal")
+
+// handle machine interaction
+
+/obj/machinery/disposal/Topic(href, href_list)
+ if(..())
+ return
+ if(usr.loc == src)
+ usr << "\red You cannot reach the controls from inside."
+ return
+
+ if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
+ usr << "\red \The [src]'s power is disabled."
+ return
+ ..()
+ usr.set_machine(src)
+
+ if(href_list["close"])
+ usr.unset_machine()
+ usr << browse(null, "window=disposal")
+ return
+
+ if(href_list["pump"])
+ if(text2num(href_list["pump"]))
+ mode = 1
+ else
+ mode = 0
+ update()
+
+ if(href_list["handle"])
+ flush = text2num(href_list["handle"])
+ update()
+
+ if(href_list["eject"])
+ eject()
+ return
+
+// eject the contents of the disposal unit
+/obj/machinery/disposal/proc/eject()
+ for(var/atom/movable/AM in src)
+ AM.loc = src.loc
+ AM.pipe_eject(0)
+ update()
+
+// update the icon & overlays to reflect mode & status
+/obj/machinery/disposal/proc/update()
+ overlays.Cut()
+ if(stat & BROKEN)
+ icon_state = "disposal-broken"
+ mode = 0
+ flush = 0
+ return
+
+ // flush handle
+ if(flush)
+ overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
+
+ // only handle is shown if no power
+ if(stat & NOPOWER || mode == -1)
+ return
+
+ // check for items in disposal - occupied light
+ if(contents.len > 0)
+ overlays += image('icons/obj/pipes/disposal.dmi', "dispover-full")
+
+ // charging and ready light
+ if(mode == 1)
+ overlays += image('icons/obj/pipes/disposal.dmi', "dispover-charge")
+ else if(mode == 2)
+ overlays += image('icons/obj/pipes/disposal.dmi', "dispover-ready")
+
+// timed process
+// charge the gas reservoir and perform flush if ready
+/obj/machinery/disposal/process()
+ if(stat & BROKEN) // nothing can happen if broken
+ return
+
+ flush_count++
+ if( flush_count >= flush_every_ticks )
+ if( contents.len )
+ if(mode == 2)
+ spawn(0)
+ feedback_inc("disposal_auto_flush",1)
+ flush()
+ flush_count = 0
+
+ src.updateDialog()
+
+ if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power
+ spawn(0)
+ flush()
+
+ if(stat & NOPOWER) // won't charge if no power
+ return
+
+ use_power(100) // base power usage
+
+ if(mode != 1) // if off or ready, no need to charge
+ return
+
+ // otherwise charge
+ use_power(500) // charging power usage
+
+ var/atom/L = loc // recharging from loc turf
+
+ var/datum/gas_mixture/env = L.return_air()
+ var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.return_pressure()
+
+ if(env.temperature > 0)
+ var/transfer_moles = 0.1 * pressure_delta*air_contents.volume/(env.temperature * R_IDEAL_GAS_EQUATION)
+
+ //Actually transfer the gas
+ var/datum/gas_mixture/removed = env.remove(transfer_moles)
+ air_contents.merge(removed)
+ air_update_turf()
+
+
+ // if full enough, switch to ready mode
+ if(air_contents.return_pressure() >= SEND_PRESSURE)
+ mode = 2
+ update()
+ return
+
+// perform a flush
+/obj/machinery/disposal/proc/flush()
+
+ flushing = 1
+ flick("[icon_state]-flush", src)
+
+ var/wrapcheck = 0
+ var/obj/structure/disposalholder/H = new() // virtual holder object which actually
+ // travels through the pipes.
+ for(var/obj/item/smallDelivery/O in src)
+ wrapcheck = 1
+
+ if(wrapcheck == 1)
+ H.tomail = 1
+
+ sleep(10)
+ if(last_sound < world.time + 1)
+ playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
+ last_sound = world.time
+ sleep(5) // wait for animation to finish
+
+ H.init(src) // copy the contents of disposer to holder
+ air_contents = new() // new empty gas resv.
+
+ H.start(src) // start the holder processing movement
+ flushing = 0
+ // now reset disposal state
+ flush = 0
+ if(mode == 2) // if was ready,
+ mode = 1 // switch to charging
+ update()
+ return
+
+
+// called when area power changes
+/obj/machinery/disposal/power_change()
+ ..() // do default setting/reset of stat NOPOWER bit
+ update() // update icon
+ return
+
+
+// called when holder is expelled from a disposal
+// should usually only occur if the pipe network is modified
+/obj/machinery/disposal/proc/expel(var/obj/structure/disposalholder/H)
+
+ var/turf/target
+ playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
+ if(H) // Somehow, someone managed to flush a window which broke mid-transit and caused the disposal to go in an infinite loop trying to expel null, hopefully this fixes it
+ for(var/atom/movable/AM in H)
+ target = get_offset_target_turf(src.loc, rand(5)-rand(5), rand(5)-rand(5))
+
+ AM.loc = src.loc
+ AM.pipe_eject(0)
+ spawn(1)
+ if(AM)
+ AM.throw_at(target, 5, 1)
+
+ H.vent_gas(loc)
+ qdel(H)
+
+/obj/machinery/disposal/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+ if (istype(mover,/obj/item) && mover.throwing)
+ var/obj/item/I = mover
+ if(istype(I, /obj/item/projectile))
+ return
+ if(prob(75))
+ I.loc = src
+ for(var/mob/M in viewers(src))
+ M.show_message("\the [I] lands in \the [src].", 3)
+ else
+ for(var/mob/M in viewers(src))
+ M.show_message("\the [I] bounces off of \the [src]'s rim!.", 3)
+ return 0
+ else
+ return ..(mover, target, height, air_group)
+
+// virtual disposal object
+// travels through pipes in lieu of actual items
+// contents will be items flushed by the disposal
+// this allows the gas flushed to be tracked
+
+/obj/structure/disposalholder
+ invisibility = 101
+ var/datum/gas_mixture/gas = null // gas used to flush, will appear at exit point
+ var/active = 0 // true if the holder is moving, otherwise inactive
+ dir = 0
+ var/count = 1000 //*** can travel 1000 steps before going inactive (in case of loops)
+ var/has_fat_guy = 0 // true if contains a fat person
+ var/destinationTag = 0 // changes if contains a delivery container
+ var/tomail = 0 //changes if contains wrapped package
+ var/hasmob = 0 //If it contains a mob
+
+
+ // initialize a holder from the contents of a disposal unit
+ proc/init(var/obj/machinery/disposal/D)
+ gas = D.air_contents// transfer gas resv. into holder object
+
+ //Check for any living mobs trigger hasmob.
+ //hasmob effects whether the package goes to cargo or its tagged destination.
+ for(var/mob/living/M in D)
+ if(M && M.stat != 2)
+ hasmob = 1
+
+ //Checks 1 contents level deep. This means that players can be sent through disposals...
+ //...but it should require a second person to open the package. (i.e. person inside a wrapped locker)
+ for(var/obj/O in D)
+ if(O.contents)
+ for(var/mob/living/M in O.contents)
+ if(M && M.stat != 2)
+ hasmob = 1
+
+ // now everything inside the disposal gets put into the holder
+ // note AM since can contain mobs or objs
+ for(var/atom/movable/AM in D)
+ AM.loc = src
+ if(istype(AM, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = AM
+ if(FAT in H.mutations) // is a human and fat?
+ has_fat_guy = 1 // set flag on holder
+ if(istype(AM, /obj/structure/bigDelivery) && !hasmob)
+ var/obj/structure/bigDelivery/T = AM
+ src.destinationTag = T.sortTag
+ if(istype(AM, /obj/item/smallDelivery) && !hasmob)
+ var/obj/item/smallDelivery/T = AM
+ src.destinationTag = T.sortTag
+
+
+ // start the movement process
+ // argument is the disposal unit the holder started in
+ proc/start(var/obj/machinery/disposal/D)
+ if(!D.trunk)
+ D.expel(src) // no trunk connected, so expel immediately
+ return
+
+ loc = D.trunk
+ active = 1
+ dir = DOWN
+ spawn(1)
+ move() // spawn off the movement process
+
+ return
+
+ // movement process, persists while holder is moving through pipes
+ proc/move()
+ var/obj/structure/disposalpipe/last
+ while(active)
+ if(has_fat_guy && prob(2)) // chance of becoming stuck per segment if contains a fat guy
+ active = 0
+ // find the fat guys
+ for(var/mob/living/carbon/human/H in src)
+
+ break
+ sleep(1) // was 1
+ var/obj/structure/disposalpipe/curr = loc
+ last = curr
+ curr = curr.transfer(src)
+ if(!curr)
+ last.expel(src, loc, dir)
+
+ //
+ if(!(count--))
+ active = 0
+ return
+
+
+
+ // find the turf which should contain the next pipe
+ proc/nextloc()
+ return get_step(loc,dir)
+
+ // find a matching pipe on a turf
+ proc/findpipe(var/turf/T)
+
+ if(!T)
+ return null
+
+ var/fdir = turn(dir, 180) // flip the movement direction
+ for(var/obj/structure/disposalpipe/P in T)
+ if(fdir & P.dpdir) // find pipe direction mask that matches flipped dir
+ return P
+ // if no matching pipe, return null
+ return null
+
+ // merge two holder objects
+ // used when a a holder meets a stuck holder
+ proc/merge(var/obj/structure/disposalholder/other)
+ for(var/atom/movable/AM in other)
+ AM.loc = src // move everything in other holder to this one
+ if(ismob(AM))
+ var/mob/M = AM
+ if(M.client) // if a client mob, update eye to follow this holder
+ M.client.eye = src
+
+ if(other.has_fat_guy)
+ has_fat_guy = 1
+ qdel(other)
+
+
+ // called when player tries to move while in a pipe
+ relaymove(mob/user as mob)
+ if (user.stat)
+ return
+ if (src.loc)
+ for (var/mob/M in hearers(src.loc.loc))
+ M << "CLONG, clong!"
+
+ playsound(src.loc, 'sound/effects/clang.ogg', 50, 0, 0)
+
+ // called to vent all gas in holder to a location
+ proc/vent_gas(var/atom/location)
+ location.assume_air(gas) // vent all gas to turf
+ return
+
+// Disposal pipes
+
+/obj/structure/disposalpipe
+ icon = 'icons/obj/pipes/disposal.dmi'
+ name = "disposal pipe"
+ desc = "An underfloor disposal pipe."
+ anchored = 1
+ density = 0
+
+ level = 1 // underfloor only
+ var/dpdir = 0 // bitmask of pipe directions
+ dir = 0 // dir will contain dominant direction for junction pipes
+ var/health = 10 // health points 0-10
+ layer = 2.3 // slightly lower than wires and other pipes
+ var/base_icon_state // initial icon state on map
+
+ // new pipe, set the icon_state as on map
+ New()
+ ..()
+ base_icon_state = icon_state
+ return
+
+
+ // pipe is deleted
+ // ensure if holder is present, it is expelled
+ Destroy()
+ var/obj/structure/disposalholder/H = locate() in src
+ if(H)
+ // holder was present
+ H.active = 0
+ var/turf/T = src.loc
+ if(T.density)
+ // deleting pipe is inside a dense turf (wall)
+ // this is unlikely, but just dump out everything into the turf in case
+
+ for(var/atom/movable/AM in H)
+ AM.loc = T
+ AM.pipe_eject(0)
+ qdel(H)
+ ..()
+ return
+
+ // otherwise, do normal expel from turf
+ if(H)
+ expel(H, T, 0)
+ ..()
+
+ // returns the direction of the next pipe object, given the entrance dir
+ // by default, returns the bitmask of remaining directions
+ proc/nextdir(var/fromdir)
+ return dpdir & (~turn(fromdir, 180))
+
+ // transfer the holder through this pipe segment
+ // overriden for special behaviour
+ //
+ proc/transfer(var/obj/structure/disposalholder/H)
+ var/nextdir = nextdir(H.dir)
+ H.dir = nextdir
+ var/turf/T = H.nextloc()
+ var/obj/structure/disposalpipe/P = H.findpipe(T)
+
+ if(P)
+ // find other holder in next loc, if inactive merge it with current
+ var/obj/structure/disposalholder/H2 = locate() in P
+ if(H2 && !H2.active)
+ H.merge(H2)
+
+ H.loc = P
+ else // if wasn't a pipe, then set loc to turf
+ H.loc = T
+ return null
+
+ return P
+
+
+ // update the icon_state to reflect hidden status
+ proc/update()
+ var/turf/T = src.loc
+ hide(T.intact && !istype(T,/turf/space)) // space never hides pipes
+
+ // hide called by levelupdate if turf intact status changes
+ // change visibility status and force update of icon
+ hide(var/intact)
+ invisibility = intact ? 101: 0 // hide if floor is intact
+ updateicon()
+
+ // update actual icon_state depending on visibility
+ // if invisible, append "f" to icon_state to show faded version
+ // this will be revealed if a T-scanner is used
+ // if visible, use regular icon_state
+ proc/updateicon()
+ if(invisibility)
+ icon_state = "[base_icon_state]f"
+ else
+ icon_state = base_icon_state
+ return
+
+
+ // expel the held objects into a turf
+ // called when there is a break in the pipe
+ //
+
+ proc/expel(var/obj/structure/disposalholder/H, var/turf/T, var/direction)
+
+ var/turf/target
+
+ if(istype(T, /turf/simulated/floor)) //intact floor, pop the tile
+ var/turf/simulated/floor/F = T
+ if(F.floor_tile)
+ F.floor_tile.loc = H //It took me a day to figure out this was the right way to do it. ¯\_(;_;)_/¯
+ F.floor_tile = null //So it doesn't get deleted in make_plating()
+ F.make_plating()
+
+ if(direction) // direction is specified
+ if(istype(T, /turf/space)) // if ended in space, then range is unlimited
+ target = get_edge_target_turf(T, direction)
+ else // otherwise limit to 10 tiles
+ target = get_ranged_target_turf(T, direction, 10)
+
+ playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
+ if(H)
+ for(var/atom/movable/AM in H)
+ AM.loc = T
+ AM.pipe_eject(direction)
+ spawn(1)
+ if(AM)
+ AM.throw_at(target, 100, 1)
+
+ else // no specified direction, so throw in random direction
+
+ playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
+ if(H)
+ for(var/atom/movable/AM in H)
+ target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5))
+
+ AM.loc = T
+ AM.pipe_eject(0)
+ spawn(1)
+ if(AM)
+ AM.throw_at(target, 5, 1)
+ H.vent_gas(T)
+ qdel(H)
+ return
+
+ // call to break the pipe
+ // will expel any holder inside at the time
+ // then delete the pipe
+ // remains : set to leave broken pipe pieces in place
+ proc/broken(var/remains = 0)
+ if(remains)
+ for(var/D in cardinal)
+ if(D & dpdir)
+ var/obj/structure/disposalpipe/broken/P = new(src.loc)
+ P.dir = D
+
+ src.invisibility = 101 // make invisible (since we won't delete the pipe immediately)
+ var/obj/structure/disposalholder/H = locate() in src
+ if(H)
+ // holder was present
+ H.active = 0
+ var/turf/T = src.loc
+ if(T.density)
+ // broken pipe is inside a dense turf (wall)
+ // this is unlikely, but just dump out everything into the turf in case
+
+ for(var/atom/movable/AM in H)
+ AM.loc = T
+ AM.pipe_eject(0)
+ qdel(H)
+ return
+
+ // otherwise, do normal expel from turf
+ if(H)
+ expel(H, T, 0)
+
+ spawn(2) // delete pipe after 2 ticks to ensure expel proc finished
+ qdel(src)
+
+
+ // pipe affected by explosion
+ ex_act(severity)
+
+ switch(severity)
+ if(1.0)
+ broken(0)
+ return
+ if(2.0)
+ health -= rand(5,15)
+ healthcheck()
+ return
+ if(3.0)
+ health -= rand(0,15)
+ healthcheck()
+ return
+
+
+ // test health for brokenness
+ proc/healthcheck()
+ if(health < -2)
+ broken(0)
+ else if(health<1)
+ broken(1)
+ return
+
+ //attack by item
+ //weldingtool: unfasten and convert to obj/disposalconstruct
+
+ attackby(var/obj/item/I, var/mob/user)
+
+ var/turf/T = src.loc
+ if(T.intact)
+ return // prevent interaction with T-scanner revealed pipes
+ src.add_fingerprint(user)
+ if(istype(I, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/W = I
+
+ if(W.remove_fuel(0,user))
+ playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
+ // check if anything changed over 2 seconds
+ var/turf/uloc = user.loc
+ var/atom/wloc = W.loc
+ user << "Slicing the disposal pipe."
+ sleep(30)
+ if(!W.isOn()) return
+ if(user.loc == uloc && wloc == W.loc)
+ welded()
+ else
+ user << "You must stay still while welding the pipe."
+ else
+ user << "You need more welding fuel to cut the pipe."
+ return
+
+ // called when pipe is cut with welder
+ proc/welded()
+
+ var/obj/structure/disposalconstruct/C = new (src.loc)
+ switch(base_icon_state)
+ if("pipe-s")
+ C.ptype = 0
+ if("pipe-c")
+ C.ptype = 1
+ if("pipe-j1")
+ C.ptype = 2
+ if("pipe-j2")
+ C.ptype = 3
+ if("pipe-y")
+ C.ptype = 4
+ if("pipe-t")
+ C.ptype = 5
+ if("pipe-j1s")
+ C.ptype = 9
+ if("pipe-j2s")
+ C.ptype = 10
+ src.transfer_fingerprints_to(C)
+ C.dir = dir
+ C.density = 0
+ C.anchored = 1
+ C.update()
+
+ qdel(src)
+
+// *** TEST verb
+//client/verb/dispstop()
+// for(var/obj/structure/disposalholder/H in world)
+// H.active = 0
+
+// a straight or bent segment
+/obj/structure/disposalpipe/segment
+ icon_state = "pipe-s"
+
+ New()
+ ..()
+ if(icon_state == "pipe-s")
+ dpdir = dir | turn(dir, 180)
+ else
+ dpdir = dir | turn(dir, -90)
+
+ update()
+ return
+
+
+
+
+//a three-way junction with dir being the dominant direction
+/obj/structure/disposalpipe/junction
+ icon_state = "pipe-j1"
+
+ New()
+ ..()
+ if(icon_state == "pipe-j1")
+ dpdir = dir | turn(dir, -90) | turn(dir,180)
+ else if(icon_state == "pipe-j2")
+ dpdir = dir | turn(dir, 90) | turn(dir,180)
+ else // pipe-y
+ dpdir = dir | turn(dir,90) | turn(dir, -90)
+ update()
+ return
+
+
+ // next direction to move
+ // if coming in from secondary dirs, then next is primary dir
+ // if coming in from primary dir, then next is equal chance of other dirs
+
+ nextdir(var/fromdir)
+ var/flipdir = turn(fromdir, 180)
+ if(flipdir != dir) // came from secondary dir
+ return dir // so exit through primary
+ else // came from primary
+ // so need to choose either secondary exit
+ var/mask = ..(fromdir)
+
+ // find a bit which is set
+ var/setbit = 0
+ if(mask & NORTH)
+ setbit = NORTH
+ else if(mask & SOUTH)
+ setbit = SOUTH
+ else if(mask & EAST)
+ setbit = EAST
+ else
+ setbit = WEST
+
+ if(prob(50)) // 50% chance to choose the found bit or the other one
+ return setbit
+ else
+ return mask & (~setbit)
+
+//a three-way junction that sorts objects
+/obj/structure/disposalpipe/sortjunction
+
+ icon_state = "pipe-j1s"
+ var/sortType = 0 //Look at the list called TAGGERLOCATIONS in setup.dm
+ var/posdir = 0
+ var/negdir = 0
+ var/sortdir = 0
+
+ proc/updatedesc()
+ desc = "An underfloor disposal pipe with a package sorting mechanism."
+ if(sortType>0)
+ var/tag = uppertext(TAGGERLOCATIONS[sortType])
+ desc += "\nIt's tagged with [tag]"
+
+ proc/updatedir()
+ posdir = dir
+ negdir = turn(posdir, 180)
+
+ if(icon_state == "pipe-j1s")
+ sortdir = turn(posdir, -90)
+ else
+ icon_state = "pipe-j2s"
+ sortdir = turn(posdir, 90)
+
+ dpdir = sortdir | posdir | negdir
+
+ New()
+ ..()
+ updatedir()
+ updatedesc()
+ update()
+ return
+
+ attackby(var/obj/item/I, var/mob/user)
+ if(..())
+ return
+
+ if(istype(I, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = I
+
+ if(O.currTag > 0)// Tag set
+ sortType = O.currTag
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
+ var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
+ user << "\blue Changed filter to [tag]"
+ updatedesc()
+
+
+ // next direction to move
+ // if coming in from negdir, then next is primary dir or sortdir
+ // if coming in from posdir, then flip around and go back to posdir
+ // if coming in from sortdir, go to posdir
+
+ nextdir(var/fromdir, var/sortTag)
+ //var/flipdir = turn(fromdir, 180)
+ if(fromdir != sortdir) // probably came from the negdir
+
+ if(src.sortType == sortTag) //if destination matches filtered type...
+ return sortdir // exit through sortdirection
+ else
+ return posdir
+ else // came from sortdir
+ // so go with the flow to positive direction
+ return posdir
+
+ transfer(var/obj/structure/disposalholder/H)
+ var/nextdir = nextdir(H.dir, H.destinationTag)
+ H.dir = nextdir
+ var/turf/T = H.nextloc()
+ var/obj/structure/disposalpipe/P = H.findpipe(T)
+
+ if(P)
+ // find other holder in next loc, if inactive merge it with current
+ var/obj/structure/disposalholder/H2 = locate() in P
+ if(H2 && !H2.active)
+ H.merge(H2)
+
+ H.loc = P
+ else // if wasn't a pipe, then set loc to turf
+ H.loc = T
+ return null
+
+ return P
+
+
+//a three-way junction that sorts objects destined for the mail office mail table (tomail = 1)
+/obj/structure/disposalpipe/wrapsortjunction
+
+ desc = "An underfloor disposal pipe which sorts wrapped and unwrapped objects."
+ icon_state = "pipe-j1s"
+ var/posdir = 0
+ var/negdir = 0
+ var/sortdir = 0
+
+ New()
+ ..()
+ posdir = dir
+ if(icon_state == "pipe-j1s")
+ sortdir = turn(posdir, -90)
+ negdir = turn(posdir, 180)
+ else
+ icon_state = "pipe-j2s"
+ sortdir = turn(posdir, 90)
+ negdir = turn(posdir, 180)
+ dpdir = sortdir | posdir | negdir
+
+ update()
+ return
+
+ // next direction to move
+ // if coming in from negdir, then next is primary dir or sortdir
+ // if coming in from posdir, then flip around and go back to posdir
+ // if coming in from sortdir, go to posdir
+
+ nextdir(var/fromdir, var/istomail)
+ //var/flipdir = turn(fromdir, 180)
+ if(fromdir != sortdir) // probably came from the negdir
+
+ if(istomail) //if destination matches filtered type...
+ return sortdir // exit through sortdirection
+ else
+ return posdir
+ else // came from sortdir
+ // so go with the flow to positive direction
+ return posdir
+
+ transfer(var/obj/structure/disposalholder/H)
+ var/nextdir = nextdir(H.dir, H.tomail)
+ H.dir = nextdir
+ var/turf/T = H.nextloc()
+ var/obj/structure/disposalpipe/P = H.findpipe(T)
+
+ if(P)
+ // find other holder in next loc, if inactive merge it with current
+ var/obj/structure/disposalholder/H2 = locate() in P
+ if(H2 && !H2.active)
+ H.merge(H2)
+
+ H.loc = P
+ else // if wasn't a pipe, then set loc to turf
+ H.loc = T
+ return null
+
+ return P
+
+
+
+
+
+//a trunk joining to a disposal bin or outlet on the same turf
+/obj/structure/disposalpipe/trunk
+ icon_state = "pipe-t"
+ var/obj/linked // the linked obj/machinery/disposal or obj/disposaloutlet
+
+/obj/structure/disposalpipe/trunk/New()
+ ..()
+ dpdir = dir
+ spawn(1)
+ getlinked()
+
+ update()
+ return
+
+/obj/structure/disposalpipe/trunk/proc/getlinked()
+ linked = null
+ var/obj/machinery/disposal/D = locate() in src.loc
+ if(D)
+ linked = D
+ if (!D.trunk)
+ D.trunk = src
+
+ var/obj/structure/disposaloutlet/O = locate() in src.loc
+ if(O)
+ linked = O
+
+ update()
+ return
+
+ // Override attackby so we disallow trunkremoval when somethings ontop
+/obj/structure/disposalpipe/trunk/attackby(var/obj/item/I, var/mob/user)
+
+ //Disposal bins or chutes
+ /*
+ These shouldn't be required
+ var/obj/machinery/disposal/D = locate() in src.loc
+ if(D && D.anchored)
+ return
+
+ //Disposal outlet
+ var/obj/structure/disposaloutlet/O = locate() in src.loc
+ if(O && O.anchored)
+ return
+ */
+
+ //Disposal constructors
+ var/obj/structure/disposalconstruct/C = locate() in src.loc
+ if(C && C.anchored)
+ return
+
+ var/turf/T = src.loc
+ if(T.intact)
+ return // prevent interaction with T-scanner revealed pipes
+ src.add_fingerprint(user)
+ if(istype(I, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/W = I
+
+ if(linked)
+ user << "You need to deconstruct disposal machinery above this pipe."
+ return
+
+ if(W.remove_fuel(0,user))
+ playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
+ // check if anything changed over 2 seconds
+ var/turf/uloc = user.loc
+ var/atom/wloc = W.loc
+ user << "Slicing the disposal pipe."
+ sleep(30)
+ if(!W.isOn()) return
+ if(user.loc == uloc && wloc == W.loc)
+ welded()
+ else
+ user << "You must stay still while welding the pipe."
+ else
+ user << "You need more welding fuel to cut the pipe."
+
+ return
+
+ // would transfer to next pipe segment, but we are in a trunk
+ // if not entering from disposal bin,
+ // transfer to linked object (outlet or bin)
+
+/obj/structure/disposalpipe/trunk/transfer(var/obj/structure/disposalholder/H)
+
+ if(H.dir == DOWN) // we just entered from a disposer
+ return ..() // so do base transfer proc
+ // otherwise, go to the linked object
+ if(linked)
+ var/obj/structure/disposaloutlet/O = linked
+ if(istype(O) && (H))
+ O.expel(H) // expel at outlet
+ else
+ var/obj/machinery/disposal/D = linked
+ if(H)
+ D.expel(H) // expel at disposal
+ else
+ if(H)
+ src.expel(H, src.loc, 0) // expel at turf
+ return null
+
+ // nextdir
+
+/obj/structure/disposalpipe/trunk/nextdir(var/fromdir)
+ if(fromdir == DOWN)
+ return dir
+ else
+ return 0
+
+// a broken pipe
+/obj/structure/disposalpipe/broken
+ icon_state = "pipe-b"
+ dpdir = 0 // broken pipes have dpdir=0 so they're not found as 'real' pipes
+ // i.e. will be treated as an empty turf
+ desc = "A broken piece of disposal pipe."
+
+ New()
+ ..()
+ update()
+ return
+
+ // called when welded
+ // for broken pipe, remove and turn into scrap
+
+ welded()
+// var/obj/item/scrap/S = new(src.loc)
+// S.set_components(200,0,0)
+ qdel(src)
+
+// the disposal outlet machine
+
+/obj/structure/disposaloutlet
+ name = "disposal outlet"
+ desc = "An outlet for the pneumatic disposal system."
+ icon = 'icons/obj/pipes/disposal.dmi'
+ icon_state = "outlet"
+ density = 1
+ anchored = 1
+ var/active = 0
+ var/turf/target // this will be where the output objects are 'thrown' to.
+ var/mode = 0
+ var/start_eject = 0
+ var/eject_range = 2
+
+ New()
+ ..()
+
+ spawn(1)
+ target = get_ranged_target_turf(src, dir, 10)
+
+
+ var/obj/structure/disposalpipe/trunk/trunk = locate() in src.loc
+ if(trunk)
+ trunk.linked = src // link the pipe trunk to self
+
+ // expel the contents of the holder object, then delete it
+ // called when the holder exits the outlet
+ proc/expel(var/obj/structure/disposalholder/H)
+
+ flick("outlet-open", src)
+ if((start_eject + 30) < world.time)
+ start_eject = world.time
+ playsound(src, 'sound/machines/warning-buzzer.ogg', 50, 0, 0)
+ sleep(20)
+ playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
+ else
+ sleep(20)
+ if(H)
+ for(var/atom/movable/AM in H)
+ AM.loc = src.loc
+ AM.pipe_eject(dir)
+ spawn(5)
+ if(AM)
+ AM.throw_at(target, eject_range, 1)
+ H.vent_gas(src.loc)
+ qdel(H)
+ return
+
+ attackby(var/obj/item/I, var/mob/user)
+ if(!I || !user)
+ return
+ src.add_fingerprint(user)
+ if(istype(I, /obj/item/weapon/screwdriver))
+ if(mode==0)
+ mode=1
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << "You remove the screws around the power connection."
+ return
+ else if(mode==1)
+ mode=0
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << "You attach the screws around the power connection."
+ return
+ else if(istype(I,/obj/item/weapon/weldingtool) && mode==1)
+ var/obj/item/weapon/weldingtool/W = I
+ if(W.remove_fuel(0,user))
+ playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
+ user << "You start slicing the floorweld off \the [src]."
+ if(do_after(user,20))
+ if(!src || !W.isOn()) return
+ user << "You slice the floorweld off \the [src]."
+ var/obj/structure/disposalconstruct/C = new (src.loc)
+ src.transfer_fingerprints_to(C)
+ C.ptype = 7 // 7 = outlet
+ C.update()
+ C.anchored = 1
+ C.density = 1
+ qdel(src)
+ return
+ else
+ user << "You need more welding fuel to complete this task."
+ return
+
+
+
+// called when movable is expelled from a disposal pipe or outlet
+// by default does nothing, override for special behaviour
+
+/atom/movable/proc/pipe_eject(var/direction)
+ return
+
+// check if mob has client, if so restore client view on eject
+/mob/pipe_eject(var/direction)
+ if (src.client)
+ src.client.perspective = MOB_PERSPECTIVE
+ src.client.eye = src
+
+ return
+
+/obj/effect/decal/cleanable/blood/gibs/pipe_eject(var/direction)
+ var/list/dirs
+ if(direction)
+ dirs = list( direction, turn(direction, -45), turn(direction, 45))
+ else
+ dirs = alldirs.Copy()
+
+ src.streak(dirs)
+
+/obj/effect/decal/cleanable/robot_debris/gib/pipe_eject(var/direction)
+ var/list/dirs
+ if(direction)
+ dirs = list( direction, turn(direction, -45), turn(direction, 45))
+ else
+ dirs = alldirs.Copy()
+
+ src.streak(dirs)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 1b4e584a9ec..043116087bf 100644
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -10,9 +10,9 @@
/obj/structure/bigDelivery/attack_hand(mob/user as mob)
- del(src)
+ qdel(src)
-/obj/structure/bigDelivery/Del()
+/obj/structure/bigDelivery/Destroy()
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = (get_turf(loc))
if(istype(wrapped, /obj/structure/closet))
@@ -66,7 +66,7 @@
else
wrapped.loc = get_turf(src)
- del(src)
+ qdel(src)
attackby(obj/item/W as obj, mob/user as mob)
@@ -156,7 +156,7 @@
user << "The object you are trying to wrap is unsuitable for the sorting machinery."
if(amount <= 0)
new /obj/item/weapon/c_tube( loc )
- del(src)
+ qdel(src)
return
return
@@ -315,7 +315,7 @@
C.update()
C.anchored = 1
C.density = 1
- del(src)
+ qdel(src)
return
else
user << "You need more welding fuel to complete this task."
diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm
index 0203d34a07e..d2f0e73a597 100644
--- a/code/modules/research/circuitprinter.dm
+++ b/code/modules/research/circuitprinter.dm
@@ -41,10 +41,10 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
/obj/machinery/r_n_d/circuit_imprinter/blob_act()
if (prob(50))
- del(src)
+ qdel(src)
/obj/machinery/r_n_d/circuit_imprinter/meteorhit()
- del(src)
+ qdel(src)
return
/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, var/M)
diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm
index be42adb48c7..3649c8ba438 100644
--- a/code/modules/research/destructive_analyzer.dm
+++ b/code/modules/research/destructive_analyzer.dm
@@ -29,7 +29,7 @@ Note: Must be placed within 3 tiles of the R&D Console
decon_mod = T
/obj/machinery/r_n_d/destructive_analyzer/meteorhit()
- del(src)
+ qdel(src)
return
/obj/machinery/r_n_d/destructive_analyzer/proc/ConvertReqString2List(var/list/source_list)
diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm
index cfc33660d10..884d4eb2f8b 100644
--- a/code/modules/research/message_server.dm
+++ b/code/modules/research/message_server.dm
@@ -66,7 +66,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
..()
return
-/obj/machinery/message_server/Del()
+/obj/machinery/message_server/Destroy()
message_servers -= src
..()
return
@@ -200,10 +200,10 @@ var/obj/machinery/blackbox_recorder/blackbox
/obj/machinery/blackbox_recorder/New()
if(blackbox)
if(istype(blackbox,/obj/machinery/blackbox_recorder))
- del(src)
+ qdel(src)
blackbox = src
-/obj/machinery/blackbox_recorder/Del()
+/obj/machinery/blackbox_recorder/Destroy()
var/turf/T = locate(1,1,2)
if(T)
blackbox = null
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 8fdfa403d14..085495d7b12 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -280,11 +280,11 @@ won't update every console in existence) but it's more of a hassle to do. Also,
S.amount--
linked_destroy.loaded_item = S
else
- del(S)
+ qdel(S)
linked_destroy.icon_state = "d_analyzer"
else
if(!(I in linked_destroy.component_parts))
- del(I)
+ qdel(I)
linked_destroy.icon_state = "d_analyzer"
use_power(250)
updateUsrDialog()
@@ -507,7 +507,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
sheet.amount = min(available_num_sheets, desired_num_sheets)
linked_lathe.vars[res_amount] = max(0, (linked_lathe.vars[res_amount]-sheet.amount * sheet.perunit))
else
- del sheet
+ qdel(sheet)
else if(href_list["imprinter_ejectsheet"] && linked_imprinter) //Causes the protolathe to eject a sheet of material
var/desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
var/res_amount, type
@@ -528,7 +528,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
sheet.amount = min(available_num_sheets, desired_num_sheets)
linked_imprinter.vars[res_amount] = max(0, (linked_imprinter.vars[res_amount]-sheet.amount * sheet.perunit))
else
- del sheet
+ qdel(sheet)
else if(href_list["find_device"]) //The R&D console looks for devices nearby to link up with.
screen = 0.0
diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm
index c5ecc05ef1e..ef765b17f9e 100644
--- a/code/modules/research/research.dm
+++ b/code/modules/research/research.dm
@@ -1,269 +1,269 @@
-/*
-General Explination:
-The research datum is the "folder" where all the research information is stored in a R&D console. It's also a holder for all the
-various procs used to manipulate it. It has four variables and seven procs:
-
-Variables:
-- possible_tech is a list of all the /datum/tech that can potentially be researched by the player. The RefreshResearch() proc
-(explained later) only goes through those when refreshing what you know. Generally, possible_tech contains ALL of the existing tech
-but it is possible to add tech to the game that DON'T start in it (example: Xeno tech). Generally speaking, you don't want to mess
-with these since they should be the default version of the datums. They're actually stored in a list rather then using typesof to
-refer to them since it makes it a bit easier to search through them for specific information.
-- know_tech is the companion list to possible_tech. It's the tech you can actually research and improve. Until it's added to this
-list, it can't be improved. All the tech in this list are visible to the player.
-- possible_designs is functionally identical to possbile_tech except it's for /datum/design.
-- known_designs is functionally identical to known_tech except it's for /datum/design
-
-Procs:
-- TechHasReqs: Used by other procs (specifically RefreshResearch) to see whether all of a tech's requirements are currently in
-known_tech and at a high enough level.
-- DesignHasReqs: Same as TechHasReqs but for /datum/design and known_design.
-- AddTech2Known: Adds a /datum/tech to known_tech. It checks to see whether it already has that tech (if so, it just replaces it). If
-it doesn't have it, it adds it. Note: It does NOT check possible_tech at all. So if you want to add something strange to it (like
-a player made tech?) you can.
-- AddDesign2Known: Same as AddTech2Known except for /datum/design and known_designs.
-- RefreshResearch: This is the workhorse of the R&D system. It updates the /datum/research holder and adds any unlocked tech paths
-and designs you have reached the requirements for. It only checks through possible_tech and possible_designs, however, so it won't
-accidentally add "secret" tech to it.
-- UpdateTech is used as part of the actual researching process. It takes an ID and finds techs with that same ID in known_tech. When
-it finds it, it checks to see whether it can improve it at all. If the known_tech's level is less then or equal to
-the inputted level, it increases the known tech's level to the inputted level -1 or know tech's level +1 (whichever is higher).
-
-The tech datums are the actual "tech trees" that you improve through researching. Each one has five variables:
-- Name: Pretty obvious. This is often viewable to the players.
-- Desc: Pretty obvious. Also player viewable.
-- ID: This is the unique ID of the tech that is used by the various procs to find and/or maniuplate it.
-- Level: This is the current level of the tech. All techs start at 1 and have a max of 20. Devices and some techs require a certain
-level in specific techs before you can produce them.
-- Req_tech: This is a list of the techs required to unlock this tech path. If left blank, it'll automatically be loaded into the
-research holder datum.
-
-*/
-/***************************************************************
-** Master Types **
-** Includes all the helper procs and basic tech processing. **
-***************************************************************/
-
-/datum/research //Holder for all the existing, archived, and known tech. Individual to console.
-
- //Datum/tech go here.
- var/list/possible_tech = list() //List of all tech in the game that players have access to (barring special events).
- var/list/known_tech = list() //List of locally known tech.
- var/list/possible_designs = list() //List of all designs (at base reliability).
- var/list/known_designs = list() //List of available designs (at base reliability).
-
-/datum/research/New() //Insert techs into possible_tech here. Known_tech automatically updated.
- for(var/T in typesof(/datum/tech) - /datum/tech)
- possible_tech += new T(src)
- for(var/D in typesof(/datum/design) - /datum/design)
- possible_designs += new D(src)
- RefreshResearch()
-
-
-
-//Checks to see if tech has all the required pre-reqs.
-//Input: datum/tech; Output: 0/1 (false/true)
-/datum/research/proc/TechHasReqs(var/datum/tech/T)
- if(T.req_tech.len == 0)
- return 1
- var/matches = 0
- for(var/req in T.req_tech)
- for(var/datum/tech/known in known_tech)
- if((req == known.id) && (known.level >= T.req_tech[req]))
- matches++
- break
- if(matches == T.req_tech.len)
- return 1
- else
- return 0
-
-//Checks to see if design has all the required pre-reqs.
-//Input: datum/design; Output: 0/1 (false/true)
-/datum/research/proc/DesignHasReqs(var/datum/design/D)//Heavily optimized -Sieve
- if(D.req_tech.len == 0)
- return 1
- for(var/datum/tech/T in known_tech)
- if((D.req_tech[T.id]) && (T.level < D.req_tech[T.id]))
- return 0
- return 1
-
-/*
-//Checks to see if design has all the required pre-reqs.
-//Input: datum/design; Output: 0/1 (false/true)
-/datum/research/proc/DesignHasReqs(var/datum/design/D)
- if(D.req_tech.len == 0)
- return 1
- var/matches = 0
- for(var/req in D.req_tech)
- for(var/datum/tech/known in known_tech)
- if((req == known.id) && (known.level >= D.req_tech[req]))
- matches++
- break
- if(matches == D.req_tech.len)
- return 1
- else
- return 0
-*/
-//Adds a tech to known_tech list. Checks to make sure there aren't duplicates and updates existing tech's levels if needed.
-//Input: datum/tech; Output: Null
-/datum/research/proc/AddTech2Known(var/datum/tech/T)
- for(var/datum/tech/known in known_tech)
- if(T.id == known.id)
- if(T.level > known.level)
- known.level = T.level
- return
- known_tech += T
- return
-
-/datum/research/proc/AddDesign2Known(var/datum/design/D)
- for(var/datum/design/known in known_designs)
- if(D.id == known.id)
- if(D.reliability > known.reliability)
- known.reliability = D.reliability
- return
- known_designs += D
- return
-
-//Refreshes known_tech and known_designs list. Then updates the reliability vars of the designs in the known_designs list.
-//Input/Output: n/a
-/datum/research/proc/RefreshResearch()
- for(var/datum/tech/PT in possible_tech)
- if(TechHasReqs(PT))
- AddTech2Known(PT)
- for(var/datum/design/PD in possible_designs)
- if(DesignHasReqs(PD))
- AddDesign2Known(PD)
- for(var/datum/tech/T in known_tech)
- T = Clamp(T.level, 1, 20)
- for(var/datum/design/D in known_designs)
- D.CalcReliability(known_tech)
- return
-
-//Refreshes the levels of a given tech.
-//Input: Tech's ID and Level; Output: null
-/datum/research/proc/UpdateTech(var/ID, var/level)
- for(var/datum/tech/KT in known_tech)
- if(KT.id == ID)
- if(KT.level <= level)
- KT.level = max((KT.level + 1), (level - 1))
- return
-
-/datum/research/proc/UpdateDesigns(var/obj/item/I, var/list/temp_tech)
- for(var/T in temp_tech)
- if(temp_tech[T] - 1 >= known_tech[T])
- for(var/datum/design/D in known_designs)
- if(D.req_tech[T])
- D.reliability = min(100, D.reliability + 1)
- if(D.build_path == I.type)
- D.reliability = min(100, D.reliability + rand(1,3))
- if(I.crit_fail)
- D.reliability = min(100, D.reliability + rand(3, 5))
-
-
-/***************************************************************
-** Technology Datums **
-** Includes all the various technoliges and what they make. **
-***************************************************************/
-
-datum/tech //Datum of individual technologies.
- var/name = "name" //Name of the technology.
- var/desc = "description" //General description of what it does and what it makes.
- var/id = "id" //An easily referenced ID. Must be alphanumeric, lower-case, and no symbols.
- var/level = 1 //A simple number scale of the research level. Level 0 = Secret tech.
- var/list/req_tech = list() //List of ids associated values of techs required to research this tech. "id" = #
-
-
-//Trunk Technologies (don't require any other techs and you start knowning them).
-
-datum/tech/materials
- name = "Materials Research"
- desc = "Development of new and improved materials."
- id = "materials"
-
-datum/tech/engineering
- name = "Engineering Research"
- desc = "Development of new and improved engineering parts and."
- id = "engineering"
-
-datum/tech/plasmatech
- name = "Plasma Research"
- desc = "Research into the mysterious substance colloqually known as 'plasma'."
- id = "plasmatech"
-
-datum/tech/powerstorage
- name = "Power Manipulation Technology"
- desc = "The various technologies behind the storage and generation of electicity."
- id = "powerstorage"
-
-datum/tech/bluespace
- name = "'Blue-space' Research"
- desc = "Research into the sub-reality known as 'blue-space'"
- id = "bluespace"
-
-datum/tech/biotech
- name = "Biological Technology"
- desc = "Research into the deeper mysteries of life and organic substances."
- id = "biotech"
-
-datum/tech/combat
- name = "Combat Systems Research"
- desc = "The development of offensive and defensive systems."
- id = "combat"
-
-datum/tech/magnets
- name = "Electromagnetic Spectrum Research"
- desc = "Research into the electromagnetic spectrum. No clue how they actually work, though."
- id = "magnets"
-
-datum/tech/programming
- name = "Data Theory Research"
- desc = "The development of new computer and artificial intelligence and data storage systems."
- id = "programming"
-
-datum/tech/syndicate
- name = "Illegal Technologies Research"
- desc = "The study of technologies that violate Nanotrassen regulations."
- id = "syndicate"
-
-/*
-datum/tech/arcane
- name = "Arcane Research"
- desc = "Research into the occult and arcane field for use in practical science"
- id = "arcane"
- level = 0 //It didn't become "secret" as advertised.
-
-//Branch Techs
-datum/tech/explosives
- name = "Explosives Research"
- desc = "The creation and application of explosive materials."
- id = "explosives"
- req_tech = list("materials" = 3)
-
-datum/tech/generators
- name = "Power Generation Technology"
- desc = "Research into more powerful and more reliable sources."
- id = "generators"
- req_tech = list("powerstorage" = 2)
-
-datum/tech/robotics
- name = "Robotics Technology"
- desc = "The development of advanced automated, autonomous machines."
- id = "robotics"
- req_tech = list("materials" = 3, "programming" = 3)
-*/
-
-
-/obj/item/weapon/disk/tech_disk
- name = "Technology Disk"
- desc = "A disk for storing technology data for further research."
- icon = 'icons/obj/cloning.dmi'
- icon_state = "datadisk2"
- item_state = "card-id"
- w_class = 1.0
- m_amt = 30
- g_amt = 10
- var/datum/tech/stored
-
-/obj/item/weapon/disk/tech_disk/New()
- src.pixel_x = rand(-5.0, 5)
+/*
+General Explination:
+The research datum is the "folder" where all the research information is stored in a R&D console. It's also a holder for all the
+various procs used to manipulate it. It has four variables and seven procs:
+
+Variables:
+- possible_tech is a list of all the /datum/tech that can potentially be researched by the player. The RefreshResearch() proc
+(explained later) only goes through those when refreshing what you know. Generally, possible_tech contains ALL of the existing tech
+but it is possible to add tech to the game that DON'T start in it (example: Xeno tech). Generally speaking, you don't want to mess
+with these since they should be the default version of the datums. They're actually stored in a list rather then using typesof to
+refer to them since it makes it a bit easier to search through them for specific information.
+- know_tech is the companion list to possible_tech. It's the tech you can actually research and improve. Until it's added to this
+list, it can't be improved. All the tech in this list are visible to the player.
+- possible_designs is functionally identical to possbile_tech except it's for /datum/design.
+- known_designs is functionally identical to known_tech except it's for /datum/design
+
+Procs:
+- TechHasReqs: Used by other procs (specifically RefreshResearch) to see whether all of a tech's requirements are currently in
+known_tech and at a high enough level.
+- DesignHasReqs: Same as TechHasReqs but for /datum/design and known_design.
+- AddTech2Known: Adds a /datum/tech to known_tech. It checks to see whether it already has that tech (if so, it just replaces it). If
+it doesn't have it, it adds it. Note: It does NOT check possible_tech at all. So if you want to add something strange to it (like
+a player made tech?) you can.
+- AddDesign2Known: Same as AddTech2Known except for /datum/design and known_designs.
+- RefreshResearch: This is the workhorse of the R&D system. It updates the /datum/research holder and adds any unlocked tech paths
+and designs you have reached the requirements for. It only checks through possible_tech and possible_designs, however, so it won't
+accidentally add "secret" tech to it.
+- UpdateTech is used as part of the actual researching process. It takes an ID and finds techs with that same ID in known_tech. When
+it finds it, it checks to see whether it can improve it at all. If the known_tech's level is less then or equal to
+the inputted level, it increases the known tech's level to the inputted level -1 or know tech's level +1 (whichever is higher).
+
+The tech datums are the actual "tech trees" that you improve through researching. Each one has five variables:
+- Name: Pretty obvious. This is often viewable to the players.
+- Desc: Pretty obvious. Also player viewable.
+- ID: This is the unique ID of the tech that is used by the various procs to find and/or maniuplate it.
+- Level: This is the current level of the tech. All techs start at 1 and have a max of 20. Devices and some techs require a certain
+level in specific techs before you can produce them.
+- Req_tech: This is a list of the techs required to unlock this tech path. If left blank, it'll automatically be loaded into the
+research holder datum.
+
+*/
+/***************************************************************
+** Master Types **
+** Includes all the helper procs and basic tech processing. **
+***************************************************************/
+
+/datum/research //Holder for all the existing, archived, and known tech. Individual to console.
+
+ //Datum/tech go here.
+ var/list/possible_tech = list() //List of all tech in the game that players have access to (barring special events).
+ var/list/known_tech = list() //List of locally known tech.
+ var/list/possible_designs = list() //List of all designs (at base reliability).
+ var/list/known_designs = list() //List of available designs (at base reliability).
+
+/datum/research/New() //Insert techs into possible_tech here. Known_tech automatically updated.
+ for(var/T in typesof(/datum/tech) - /datum/tech)
+ possible_tech += new T(src)
+ for(var/D in typesof(/datum/design) - /datum/design)
+ possible_designs += new D(src)
+ RefreshResearch()
+
+
+
+//Checks to see if tech has all the required pre-reqs.
+//Input: datum/tech; Output: 0/1 (false/true)
+/datum/research/proc/TechHasReqs(var/datum/tech/T)
+ if(T.req_tech.len == 0)
+ return 1
+ var/matches = 0
+ for(var/req in T.req_tech)
+ for(var/datum/tech/known in known_tech)
+ if((req == known.id) && (known.level >= T.req_tech[req]))
+ matches++
+ break
+ if(matches == T.req_tech.len)
+ return 1
+ else
+ return 0
+
+//Checks to see if design has all the required pre-reqs.
+//Input: datum/design; Output: 0/1 (false/true)
+/datum/research/proc/DesignHasReqs(var/datum/design/D)//Heavily optimized -Sieve
+ if(D.req_tech.len == 0)
+ return 1
+ for(var/datum/tech/T in known_tech)
+ if((D.req_tech[T.id]) && (T.level < D.req_tech[T.id]))
+ return 0
+ return 1
+
+/*
+//Checks to see if design has all the required pre-reqs.
+//Input: datum/design; Output: 0/1 (false/true)
+/datum/research/proc/DesignHasReqs(var/datum/design/D)
+ if(D.req_tech.len == 0)
+ return 1
+ var/matches = 0
+ for(var/req in D.req_tech)
+ for(var/datum/tech/known in known_tech)
+ if((req == known.id) && (known.level >= D.req_tech[req]))
+ matches++
+ break
+ if(matches == D.req_tech.len)
+ return 1
+ else
+ return 0
+*/
+//Adds a tech to known_tech list. Checks to make sure there aren't duplicates and updates existing tech's levels if needed.
+//Input: datum/tech; Output: Null
+/datum/research/proc/AddTech2Known(var/datum/tech/T)
+ for(var/datum/tech/known in known_tech)
+ if(T.id == known.id)
+ if(T.level > known.level)
+ known.level = T.level
+ return
+ known_tech += T
+ return
+
+/datum/research/proc/AddDesign2Known(var/datum/design/D)
+ for(var/datum/design/known in known_designs)
+ if(D.id == known.id)
+ if(D.reliability > known.reliability)
+ known.reliability = D.reliability
+ return
+ known_designs += D
+ return
+
+//Refreshes known_tech and known_designs list. Then updates the reliability vars of the designs in the known_designs list.
+//Input/Output: n/a
+/datum/research/proc/RefreshResearch()
+ for(var/datum/tech/PT in possible_tech)
+ if(TechHasReqs(PT))
+ AddTech2Known(PT)
+ for(var/datum/design/PD in possible_designs)
+ if(DesignHasReqs(PD))
+ AddDesign2Known(PD)
+ for(var/datum/tech/T in known_tech)
+ T = Clamp(T.level, 1, 20)
+ for(var/datum/design/D in known_designs)
+ D.CalcReliability(known_tech)
+ return
+
+//Refreshes the levels of a given tech.
+//Input: Tech's ID and Level; Output: null
+/datum/research/proc/UpdateTech(var/ID, var/level)
+ for(var/datum/tech/KT in known_tech)
+ if(KT.id == ID)
+ if(KT.level <= level)
+ KT.level = max((KT.level + 1), (level - 1))
+ return
+
+/datum/research/proc/UpdateDesigns(var/obj/item/I, var/list/temp_tech)
+ for(var/T in temp_tech)
+ if(temp_tech[T] - 1 >= known_tech[T])
+ for(var/datum/design/D in known_designs)
+ if(D.req_tech[T])
+ D.reliability = min(100, D.reliability + 1)
+ if(D.build_path == I.type)
+ D.reliability = min(100, D.reliability + rand(1,3))
+ if(I.crit_fail)
+ D.reliability = min(100, D.reliability + rand(3, 5))
+
+
+/***************************************************************
+** Technology Datums **
+** Includes all the various technoliges and what they make. **
+***************************************************************/
+
+datum/tech //Datum of individual technologies.
+ var/name = "name" //Name of the technology.
+ var/desc = "description" //General description of what it does and what it makes.
+ var/id = "id" //An easily referenced ID. Must be alphanumeric, lower-case, and no symbols.
+ var/level = 1 //A simple number scale of the research level. Level 0 = Secret tech.
+ var/list/req_tech = list() //List of ids associated values of techs required to research this tech. "id" = #
+
+
+//Trunk Technologies (don't require any other techs and you start knowning them).
+
+datum/tech/materials
+ name = "Materials Research"
+ desc = "Development of new and improved materials."
+ id = "materials"
+
+datum/tech/engineering
+ name = "Engineering Research"
+ desc = "Development of new and improved engineering parts and."
+ id = "engineering"
+
+datum/tech/plasmatech
+ name = "Plasma Research"
+ desc = "Research into the mysterious substance colloqually known as 'plasma'."
+ id = "plasmatech"
+
+datum/tech/powerstorage
+ name = "Power Manipulation Technology"
+ desc = "The various technologies behind the storage and generation of electicity."
+ id = "powerstorage"
+
+datum/tech/bluespace
+ name = "'Blue-space' Research"
+ desc = "Research into the sub-reality known as 'blue-space'"
+ id = "bluespace"
+
+datum/tech/biotech
+ name = "Biological Technology"
+ desc = "Research into the deeper mysteries of life and organic substances."
+ id = "biotech"
+
+datum/tech/combat
+ name = "Combat Systems Research"
+ desc = "The development of offensive and defensive systems."
+ id = "combat"
+
+datum/tech/magnets
+ name = "Electromagnetic Spectrum Research"
+ desc = "Research into the electromagnetic spectrum. No clue how they actually work, though."
+ id = "magnets"
+
+datum/tech/programming
+ name = "Data Theory Research"
+ desc = "The development of new computer and artificial intelligence and data storage systems."
+ id = "programming"
+
+datum/tech/syndicate
+ name = "Illegal Technologies Research"
+ desc = "The study of technologies that violate Nanotrassen regulations."
+ id = "syndicate"
+
+/*
+datum/tech/arcane
+ name = "Arcane Research"
+ desc = "Research into the occult and arcane field for use in practical science"
+ id = "arcane"
+ level = 0 //It didn't become "secret" as advertised.
+
+//Branch Techs
+datum/tech/explosives
+ name = "Explosives Research"
+ desc = "The creation and application of explosive materials."
+ id = "explosives"
+ req_tech = list("materials" = 3)
+
+datum/tech/generators
+ name = "Power Generation Technology"
+ desc = "Research into more powerful and more reliable sources."
+ id = "generators"
+ req_tech = list("powerstorage" = 2)
+
+datum/tech/robotics
+ name = "Robotics Technology"
+ desc = "The development of advanced automated, autonomous machines."
+ id = "robotics"
+ req_tech = list("materials" = 3, "programming" = 3)
+*/
+
+
+/obj/item/weapon/disk/tech_disk
+ name = "Technology Disk"
+ desc = "A disk for storing technology data for further research."
+ icon = 'icons/obj/cloning.dmi'
+ icon_state = "datadisk2"
+ item_state = "card-id"
+ w_class = 1.0
+ m_amt = 30
+ g_amt = 10
+ var/datum/tech/stored
+
+/obj/item/weapon/disk/tech_disk/New()
+ src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
\ No newline at end of file
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index dcd3d5c3cc2..bf53508cb38 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -24,7 +24,7 @@
RefreshParts()
src.initialize(); //Agouri
-/obj/machinery/r_n_d/server/Del()
+/obj/machinery/r_n_d/server/Destroy()
griefProtection()
..()
diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm
index 2676fefc3d5..8fadd57ba3f 100644
--- a/code/modules/shuttle/shuttle.dm
+++ b/code/modules/shuttle/shuttle.dm
@@ -1,121 +1,126 @@
-var/obj/list/shuttles = list(("escape" = new /datum/shuttle_manager(/area/shuttle/escape/centcom, 0)), ("pod1" = new /datum/shuttle_manager(/area/shuttle/escape_pod1/station, 0)), ("pod2" = new /datum/shuttle_manager(/area/shuttle/escape_pod2/station, 0)), ("pod3" = new /datum/shuttle_manager(/area/shuttle/escape_pod3/station, 0)), ("pod4" = new /datum/shuttle_manager(/area/shuttle/escape_pod4/station, 0)), ("mining" = new /datum/shuttle_manager(/area/shuttle/mining/station, 10)), ("laborcamp" = new /datum/shuttle_manager(/area/shuttle/laborcamp/station, 10)), ("ferry" = new /datum/shuttle_manager(/area/shuttle/transport1/centcom, 0)))
- //Pre-made shuttles should have non-number keys, so that buildable shuttles can use numbered keys without allowing 'I build a shuttle console with the escape number as its ID.'
-datum/shuttle_manager
- var/tickstomove = 10 //How long does it take to move the shuttle?
- var/moving = 0 //Is it moving?
- var/area/shuttle/location //The current location of the actual shuttle
-
-datum/shuttle_manager/New(var/area, var/delay) //Create a new shuttle manager for the shuttle starting area, "area" and with a movement delay of tickstomove
- location = area
- tickstomove = delay
-
-
-datum/shuttle_manager/proc/move_shuttle(var/override_delay)
- if(moving) return 0
- moving = 1
- spawn(override_delay == null ? tickstomove*10 : override_delay)
- var/area/shuttle/fromArea
- var/area/shuttle/toArea
- fromArea = locate(location) //the location of the shuttle
- toArea = locate(fromArea.destination)
-
- var/list/dstturfs = list()
- var/throwy = world.maxy
-
- for(var/turf/T in toArea)
- dstturfs += T
- if(T.y < throwy)
- throwy = T.y
-
- // hey you, get out of the way!
- for(var/turf/T in dstturfs)
- // find the turf to move things to
- var/turf/D = locate(T.x, throwy - 1, 1)
- //var/turf/E = get_step(D, SOUTH)
- for(var/atom/movable/AM as mob|obj in T)
- AM.Move(D)
- // NOTE: Commenting this out to avoid recreating mass driver glitch
- /*
- spawn(0)
- AM.throw_at(E, 1, 1)
- return
- */
-
- if(istype(T, /turf/simulated))
- del(T)
-
- for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
- bug.gib()
-
- fromArea.move_contents_to(toArea)
- location = toArea.type
-
- for(var/obj/machinery/door/D in toArea) //Close any doors on the shuttle
- spawn(0)
- D.close()
-
- for(var/mob/M in toArea)
- if(M.client)
- spawn(0)
- if(M.buckled)
- shake_camera(M, 2, 1) // turn it down a bit come on
- else
- shake_camera(M, 7, 1)
- if(istype(M, /mob/living/carbon))
- if(!M.buckled)
- M.Weaken(3)
-
- moving = 0
- return 1
-
-
-
-
-/obj/machinery/computer/shuttle
- name = "Shuttle Console"
- icon = 'icons/obj/computer.dmi'
- icon_state = "shuttle"
- req_access = list( )
- circuit = /obj/item/weapon/circuitboard/shuttle
- var/id
-
-/obj/machinery/computer/shuttle/attack_hand(user as mob)
- if(..(user))
- return
- src.add_fingerprint(usr)
- var/dat
- dat = text("Send Shuttle")
- //user << browse("[dat]", "window=miningshuttle;size=200x100")
- var/datum/browser/popup = new(user, "miningshuttle", name, 200, 140)
- popup.set_content(dat)
- popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
-
-/obj/machinery/computer/shuttle/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- if(!allowed(usr))
- usr << "\red Access denied."
- return
- if(href_list["move"])
- if(id in shuttles)
- var/datum/shuttle_manager/s = shuttles[id]
- if (s.move_shuttle())
- usr << "\blue Shuttle recieved message and will be sent shortly."
- else
- usr << "\blue Shuttle is already moving."
- else
- usr << "\red Invalid shuttle requested."
-
-
-/obj/machinery/computer/shuttle/attackby(I as obj, user as mob)
-
- if (istype(I, /obj/item/weapon/card/emag))
- src.req_access = list()
- emagged = 1
- usr << "You fried the consoles ID checking system. It's now available to everyone!"
- else
- ..()
+var/obj/list/shuttles = list(("escape" = new /datum/shuttle_manager(/area/shuttle/escape/centcom, 0)), ("pod1" = new /datum/shuttle_manager(/area/shuttle/escape_pod1/station, 0)), ("pod2" = new /datum/shuttle_manager(/area/shuttle/escape_pod2/station, 0)), ("pod3" = new /datum/shuttle_manager(/area/shuttle/escape_pod3/station, 0)), ("pod4" = new /datum/shuttle_manager(/area/shuttle/escape_pod4/station, 0)), ("mining" = new /datum/shuttle_manager(/area/shuttle/mining/station, 10)), ("laborcamp" = new /datum/shuttle_manager(/area/shuttle/laborcamp/station, 10)), ("ferry" = new /datum/shuttle_manager(/area/shuttle/transport1/centcom, 0)))
+ //Pre-made shuttles should have non-number keys, so that buildable shuttles can use numbered keys without allowing 'I build a shuttle console with the escape number as its ID.'
+datum/shuttle_manager
+ var/tickstomove = 10 //How long does it take to move the shuttle?
+ var/moving = 0 //Is it moving?
+ var/area/shuttle/location //The current location of the actual shuttle
+
+datum/shuttle_manager/New(var/area, var/delay) //Create a new shuttle manager for the shuttle starting area, "area" and with a movement delay of tickstomove
+ location = area
+ tickstomove = delay
+ var/area/A = locate(location)
+ A.has_gravity = 1
+
+
+datum/shuttle_manager/proc/move_shuttle(var/override_delay)
+ if(moving) return 0
+ moving = 1
+ spawn(override_delay == null ? tickstomove*10 : override_delay)
+ var/area/shuttle/fromArea
+ var/area/shuttle/toArea
+ fromArea = locate(location) //the location of the shuttle
+ toArea = locate(fromArea.destination)
+
+ var/list/dstturfs = list()
+ var/throwy = world.maxy
+
+ for(var/turf/T in toArea)
+ dstturfs += T
+ if(T.y < throwy)
+ throwy = T.y
+
+ // hey you, get out of the way!
+ for(var/turf/T in dstturfs)
+ // find the turf to move things to
+ var/turf/D = locate(T.x, throwy - 1, 1)
+ //var/turf/E = get_step(D, SOUTH)
+ for(var/atom/movable/AM as mob|obj in T)
+ AM.Move(D)
+ // NOTE: Commenting this out to avoid recreating mass driver glitch
+ /*
+ spawn(0)
+ AM.throw_at(E, 1, 1)
+ return
+ */
+
+ if(istype(T, /turf/simulated))
+ del(T)
+
+ for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
+ bug.gib()
+
+ fromArea.move_contents_to(toArea)
+ location = toArea.type
+
+ fromArea.has_gravity = 0
+ toArea.has_gravity = 1
+
+ for(var/obj/machinery/door/D in toArea) //Close any doors on the shuttle
+ spawn(0)
+ D.close()
+
+ for(var/mob/M in toArea)
+ if(M.client)
+ spawn(0)
+ if(M.buckled)
+ shake_camera(M, 2, 1) // turn it down a bit come on
+ else
+ shake_camera(M, 7, 1)
+ if(istype(M, /mob/living/carbon))
+ if(!M.buckled)
+ M.Weaken(3)
+
+ moving = 0
+ return 1
+
+
+
+
+/obj/machinery/computer/shuttle
+ name = "Shuttle Console"
+ icon = 'icons/obj/computer.dmi'
+ icon_state = "shuttle"
+ req_access = list( )
+ circuit = /obj/item/weapon/circuitboard/shuttle
+ var/id
+
+/obj/machinery/computer/shuttle/attack_hand(user as mob)
+ if(..(user))
+ return
+ src.add_fingerprint(usr)
+ var/dat
+ dat = text("Send Shuttle")
+ //user << browse("[dat]", "window=miningshuttle;size=200x100")
+ var/datum/browser/popup = new(user, "miningshuttle", name, 200, 140)
+ popup.set_content(dat)
+ popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+
+/obj/machinery/computer/shuttle/Topic(href, href_list)
+ if(..())
+ return
+ usr.set_machine(src)
+ src.add_fingerprint(usr)
+ if(!allowed(usr))
+ usr << "\red Access denied."
+ return
+ if(href_list["move"])
+ if(id in shuttles)
+ var/datum/shuttle_manager/s = shuttles[id]
+ if (s.move_shuttle())
+ usr << "\blue Shuttle recieved message and will be sent shortly."
+ else
+ usr << "\blue Shuttle is already moving."
+ else
+ usr << "\red Invalid shuttle requested."
+
+
+/obj/machinery/computer/shuttle/attackby(I as obj, user as mob)
+
+ if (istype(I, /obj/item/weapon/card/emag))
+ src.req_access = list()
+ emagged = 1
+ usr << "You fried the consoles ID checking system. It's now available to everyone!"
+ else
+ ..()
return
\ No newline at end of file
diff --git a/code/modules/surgery/generic_steps.dm b/code/modules/surgery/generic_steps.dm
index ea066277ed3..700d2b87e59 100644
--- a/code/modules/surgery/generic_steps.dm
+++ b/code/modules/surgery/generic_steps.dm
@@ -1,68 +1,68 @@
-
-//make incision
-/datum/surgery_step/incise
- implements = list(/obj/item/weapon/scalpel = 100, /obj/item/weapon/kitchenknife = 65, /obj/item/weapon/shard = 45)
- time = 24
-
-/datum/surgery_step/incise/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to make an incision in [target]'s [parse_zone(target_zone)].")
-
-
-
-//clamp bleeders
-/datum/surgery_step/clamp_bleeders
- implements = list(/obj/item/weapon/hemostat = 100, /obj/item/weapon/wirecutters = 60, /obj/item/stack/cable_coil = 15)
- time = 48
-
-/datum/surgery_step/clamp_bleeders/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to clamp bleeders in [target]'s [parse_zone(target_zone)].")
-
-
-//retract skin
-/datum/surgery_step/retract_skin
- implements = list(/obj/item/weapon/retractor = 100, /obj/item/weapon/screwdriver = 45, /obj/item/weapon/wirecutters = 35)
- time = 32
-
-/datum/surgery_step/retract_skin/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to retract the skin in [target]'s [parse_zone(target_zone)].")
-
-
-
-//close incision
-/datum/surgery_step/close
- implements = list(/obj/item/weapon/cautery = 100, /obj/item/weapon/weldingtool = 70, /obj/item/weapon/lighter = 45, /obj/item/weapon/match = 20)
- time = 32
-
-/datum/surgery_step/close/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to mend the incision in [target]'s [parse_zone(target_zone)].")
-
-
-/datum/surgery_step/close/tool_check(mob/user, obj/item/tool)
- if(istype(tool, /obj/item/weapon/cautery))
- return 1
-
- if(istype(tool, /obj/item/weapon/weldingtool))
- var/obj/item/weapon/weldingtool/WT = tool
- if(WT.isOn()) return 1
-
- else if(istype(tool, /obj/item/weapon/lighter))
- var/obj/item/weapon/lighter/L = tool
- if(L.lit) return 1
-
- else if(istype(tool, /obj/item/weapon/match))
- var/obj/item/weapon/match/M = tool
- if(M.lit) return 1
-
- return 0
-
-
-//saw bone
-/datum/surgery_step/saw
- implements = list(/obj/item/weapon/circular_saw = 100, /obj/item/weapon/melee/arm_blade = 75, /obj/item/weapon/hatchet = 35, /obj/item/weapon/butch = 25)
- time = 64
-
-/datum/surgery_step/saw/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to saw through the bone in [target]'s [parse_zone(target_zone)].")
-
-
-
+
+//make incision
+/datum/surgery_step/incise
+ implements = list(/obj/item/weapon/scalpel = 100, /obj/item/weapon/kitchenknife = 65, /obj/item/weapon/shard = 45)
+ time = 24
+
+/datum/surgery_step/incise/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to make an incision in [target]'s [parse_zone(target_zone)].")
+
+
+
+//clamp bleeders
+/datum/surgery_step/clamp_bleeders
+ implements = list(/obj/item/weapon/hemostat = 100, /obj/item/weapon/wirecutters = 60, /obj/item/stack/cable_coil = 15)
+ time = 48
+
+/datum/surgery_step/clamp_bleeders/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to clamp bleeders in [target]'s [parse_zone(target_zone)].")
+
+
+//retract skin
+/datum/surgery_step/retract_skin
+ implements = list(/obj/item/weapon/retractor = 100, /obj/item/weapon/screwdriver = 45, /obj/item/weapon/wirecutters = 35)
+ time = 32
+
+/datum/surgery_step/retract_skin/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to retract the skin in [target]'s [parse_zone(target_zone)].")
+
+
+
+//close incision
+/datum/surgery_step/close
+ implements = list(/obj/item/weapon/cautery = 100, /obj/item/weapon/weldingtool = 70, /obj/item/weapon/lighter = 45, /obj/item/weapon/match = 20)
+ time = 32
+
+/datum/surgery_step/close/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to mend the incision in [target]'s [parse_zone(target_zone)].")
+
+
+/datum/surgery_step/close/tool_check(mob/user, obj/item/tool)
+ if(istype(tool, /obj/item/weapon/cautery))
+ return 1
+
+ if(istype(tool, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/WT = tool
+ if(WT.isOn()) return 1
+
+ else if(istype(tool, /obj/item/weapon/lighter))
+ var/obj/item/weapon/lighter/L = tool
+ if(L.lit) return 1
+
+ else if(istype(tool, /obj/item/weapon/match))
+ var/obj/item/weapon/match/M = tool
+ if(M.lit) return 1
+
+ return 0
+
+
+//saw bone
+/datum/surgery_step/saw
+ implements = list(/obj/item/weapon/circular_saw = 100, /obj/item/weapon/melee/arm_blade = 75, /obj/item/weapon/hatchet = 35, /obj/item/weapon/butch = 25)
+ time = 64
+
+/datum/surgery_step/saw/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to saw through the bone in [target]'s [parse_zone(target_zone)].")
+
+
+
diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm
index 55bd4a572dd..054ad9a19d7 100644
--- a/code/modules/surgery/implant_removal.dm
+++ b/code/modules/surgery/implant_removal.dm
@@ -28,7 +28,7 @@
user.visible_message("[user] successfully removes [I] from [target]'s [target_zone]!")
if(istype(I, /obj/item/weapon/implant/loyalty))
target << "You feel a sense of liberation as Nanotrasen's grip on your mind fades away."
- del(I)
+ qdel(I)
else
user.visible_message("[user] can't find anything in [target]'s [target_zone].")
return 1
\ No newline at end of file
diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm
index 80a308dad21..2fc12830566 100644
--- a/code/modules/surgery/limb augmentation.dm
+++ b/code/modules/surgery/limb augmentation.dm
@@ -1,76 +1,76 @@
-
-/////AUGMENTATION SURGERIES//////
-
-
-//SURGERY STEPS
-
-/datum/surgery_step/replace
- implements = list(/obj/item/weapon/scalpel = 100, /obj/item/weapon/wirecutters = 55)
- time = 32
-
-
-/datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- user.visible_message("[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_sel.selecting)]!")
-
-
-/datum/surgery_step/add_limb
- implements = list(/obj/item/robot_parts = 100)
- time = 32
- var/obj/item/organ/limb/L = null // L because "limb"
- allowed_organs = list("r_arm","l_arm","r_leg","l_leg","chest","head")
-
-
-
-/datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- L = new_organ
- if(L)
- user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_sel.selecting)].")
- else
- user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_sel.selecting)].")
-
-
-
-//ACTUAL SURGERIES
-
-/datum/surgery/augmentation
- name = "augmentation"
- steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/saw, /datum/surgery_step/add_limb)
- species = list(/mob/living/carbon/human)
- location = "anywhere" //Check attempt_initate_surgery() (in code/modules/surgery/helpers) to see what this does if you can't tell
- has_multi_loc = 1 //Multi location stuff, See multiple_location_example.dm
-
-
-//SURGERY STEP SUCCESSES
-
-/datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- if(L)
- if(ishuman(target))
- var/mob/living/carbon/human/H = target
- user.visible_message("[user] successfully augments [target]'s [parse_zone(user.zone_sel.selecting)]!")
- L.loc = get_turf(target)
- H.organs -= L
- switch(user.zone_sel.selecting) //for the surgery to progress this MUST still be the original "location" so it's safe to do this.
- if("r_leg")
- H.organs += new /obj/item/organ/limb/robot/r_leg(src)
- if("l_leg")
- H.organs += new /obj/item/organ/limb/robot/l_leg(src)
- if("r_arm")
- H.organs += new /obj/item/organ/limb/robot/r_arm(src)
- if("l_arm")
- H.organs += new /obj/item/organ/limb/robot/l_arm(src)
- if("head")
- H.organs += new /obj/item/organ/limb/robot/head(src)
- if("chest")
- var/datum/surgery_step/xenomorph_removal/xeno_removal = new
- xeno_removal.remove_xeno(user, target) // remove an alien if there is one
- H.organs += new /obj/item/organ/limb/robot/chest(src)
- for(var/datum/disease/appendicitis/A in H.viruses) //If they already have Appendicitis, Remove it
- A.cure(1)
- user.drop_item()
- del(tool)
- H.update_damage_overlays(0)
- H.update_augments() //Gives them the Cyber limb overlay
- add_logs(user, target, "augmented", addition="by giving him new [parse_zone(user.zone_sel.selecting)] INTENT: [uppertext(user.a_intent)]")
- else
- user.visible_message("[user] [target] has no organic [parse_zone(user.zone_sel.selecting)] there!")
- return 1
+
+/////AUGMENTATION SURGERIES//////
+
+
+//SURGERY STEPS
+
+/datum/surgery_step/replace
+ implements = list(/obj/item/weapon/scalpel = 100, /obj/item/weapon/wirecutters = 55)
+ time = 32
+
+
+/datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_sel.selecting)]!")
+
+
+/datum/surgery_step/add_limb
+ implements = list(/obj/item/robot_parts = 100)
+ time = 32
+ var/obj/item/organ/limb/L = null // L because "limb"
+ allowed_organs = list("r_arm","l_arm","r_leg","l_leg","chest","head")
+
+
+
+/datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ L = new_organ
+ if(L)
+ user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_sel.selecting)].")
+ else
+ user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_sel.selecting)].")
+
+
+
+//ACTUAL SURGERIES
+
+/datum/surgery/augmentation
+ name = "augmentation"
+ steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/saw, /datum/surgery_step/add_limb)
+ species = list(/mob/living/carbon/human)
+ location = "anywhere" //Check attempt_initate_surgery() (in code/modules/surgery/helpers) to see what this does if you can't tell
+ has_multi_loc = 1 //Multi location stuff, See multiple_location_example.dm
+
+
+//SURGERY STEP SUCCESSES
+
+/datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ if(L)
+ if(ishuman(target))
+ var/mob/living/carbon/human/H = target
+ user.visible_message("[user] successfully augments [target]'s [parse_zone(user.zone_sel.selecting)]!")
+ L.loc = get_turf(target)
+ H.organs -= L
+ switch(user.zone_sel.selecting) //for the surgery to progress this MUST still be the original "location" so it's safe to do this.
+ if("r_leg")
+ H.organs += new /obj/item/organ/limb/robot/r_leg(src)
+ if("l_leg")
+ H.organs += new /obj/item/organ/limb/robot/l_leg(src)
+ if("r_arm")
+ H.organs += new /obj/item/organ/limb/robot/r_arm(src)
+ if("l_arm")
+ H.organs += new /obj/item/organ/limb/robot/l_arm(src)
+ if("head")
+ H.organs += new /obj/item/organ/limb/robot/head(src)
+ if("chest")
+ var/datum/surgery_step/xenomorph_removal/xeno_removal = new
+ xeno_removal.remove_xeno(user, target) // remove an alien if there is one
+ H.organs += new /obj/item/organ/limb/robot/chest(src)
+ for(var/datum/disease/appendicitis/A in H.viruses) //If they already have Appendicitis, Remove it
+ A.cure(1)
+ user.drop_item()
+ qdel(tool)
+ H.update_damage_overlays(0)
+ H.update_augments() //Gives them the Cyber limb overlay
+ add_logs(user, target, "augmented", addition="by giving him new [parse_zone(user.zone_sel.selecting)] INTENT: [uppertext(user.a_intent)]")
+ else
+ user.visible_message("[user] [target] has no organic [parse_zone(user.zone_sel.selecting)] there!")
+ return 1
diff --git a/code/modules/surgery/multiple_location_example.dm b/code/modules/surgery/multiple_location_example.dm
index 7a7dba5eaee..e5e331843e5 100644
--- a/code/modules/surgery/multiple_location_example.dm
+++ b/code/modules/surgery/multiple_location_example.dm
@@ -1,54 +1,54 @@
-/*
-//CONTENTS//
-Multiple location example surgery
-
-
-
-//THE SURGERY//
-it is very similar to a normal surgery.
-Location = "anywhere" is the unique difference.
-
-/datum/surgery/multiLocExample
- name = "Multiple Location Surgery Example"
- steps = list(/datum/surgery_step/multiLocExampleStep)
- species = list(/mob/living/carbon)
- location = "anywhere" //A Location "Anywhere" is handled in /code/modules/surgery/helpers attempt_initiate_surgery(), it is converted into a User.zone_sel.selecting.
- has_multi_loc = 1 //Needed to handle Multilocation
-
-//THE STEPS//
-The block of "If's" is necessary, add or remove so you have just the areas you want, and set them to convert L(or your subsitute) to what you want it to be
-EG: a zone on a mob (where user is targetting) to the limb thats actually there.
-
-
-/datum/surgery_step/multiLocExampleStep
- implements = list()
- time = 9001
- allowed_organs = list("r_arm","l_arm","r_leg","l_leg","chest","head", "etc")
- // allowed_organs is a list of organs this operation works with, it is defined in the earliest instance of the surgery_step (Eg, datum/surgery_step/multiLocExampleStep)
- // allowed_organs is handled in Handle_Multi_Loc() in surgery_step.dm
-
-
-/datum/surgery_step/multiLocExampleStep/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- L = new_organ //new_organ is a variable in /datum/surgery_step, it is null by default, and is given a value in Handle_Multi_Loc()
- //Although Handle_Multi_Loc() is /datum/surgery_step/SURGERYNAME/Handle_Multi_Loc() you do not need to rewrite it in the surgery
- if(L)
- user.visible_message("Generic Statement.")
- else
- user.visible_message("Generic Statement 2.")
-
-
-/datum/surgery_step/multiLocExampleStep/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
-You can use whatever you substituted "L" for here for useful things, swapping limbs for other limbs, etc.
-if the surgery is intended to be MultiLoc but should only be performable once per limb, add this
-"surgery.invalid_locations += user.zone_sel.selecting"
-Just after you have swapped limbs around, see limb augmentation for an example of this
-
-*/
-
-//This file is commented out as to avoid:
-// a snowflakey removal of it 100% of the time
-// it's an example, it doesn't work perfectly due to just being the multiple locations section.
-// It is also not set to compile, due to being Empty (according to the compiler)
-
-//Enjoy making Multi-location operations! (if you understood my Rambling)
+/*
+//CONTENTS//
+Multiple location example surgery
+
+
+
+//THE SURGERY//
+it is very similar to a normal surgery.
+Location = "anywhere" is the unique difference.
+
+/datum/surgery/multiLocExample
+ name = "Multiple Location Surgery Example"
+ steps = list(/datum/surgery_step/multiLocExampleStep)
+ species = list(/mob/living/carbon)
+ location = "anywhere" //A Location "Anywhere" is handled in /code/modules/surgery/helpers attempt_initiate_surgery(), it is converted into a User.zone_sel.selecting.
+ has_multi_loc = 1 //Needed to handle Multilocation
+
+//THE STEPS//
+The block of "If's" is necessary, add or remove so you have just the areas you want, and set them to convert L(or your subsitute) to what you want it to be
+EG: a zone on a mob (where user is targetting) to the limb thats actually there.
+
+
+/datum/surgery_step/multiLocExampleStep
+ implements = list()
+ time = 9001
+ allowed_organs = list("r_arm","l_arm","r_leg","l_leg","chest","head", "etc")
+ // allowed_organs is a list of organs this operation works with, it is defined in the earliest instance of the surgery_step (Eg, datum/surgery_step/multiLocExampleStep)
+ // allowed_organs is handled in Handle_Multi_Loc() in surgery_step.dm
+
+
+/datum/surgery_step/multiLocExampleStep/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ L = new_organ //new_organ is a variable in /datum/surgery_step, it is null by default, and is given a value in Handle_Multi_Loc()
+ //Although Handle_Multi_Loc() is /datum/surgery_step/SURGERYNAME/Handle_Multi_Loc() you do not need to rewrite it in the surgery
+ if(L)
+ user.visible_message("Generic Statement.")
+ else
+ user.visible_message("Generic Statement 2.")
+
+
+/datum/surgery_step/multiLocExampleStep/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+You can use whatever you substituted "L" for here for useful things, swapping limbs for other limbs, etc.
+if the surgery is intended to be MultiLoc but should only be performable once per limb, add this
+"surgery.invalid_locations += user.zone_sel.selecting"
+Just after you have swapped limbs around, see limb augmentation for an example of this
+
+*/
+
+//This file is commented out as to avoid:
+// a snowflakey removal of it 100% of the time
+// it's an example, it doesn't work perfectly due to just being the multiple locations section.
+// It is also not set to compile, due to being Empty (according to the compiler)
+
+//Enjoy making Multi-location operations! (if you understood my Rambling)
//If you didn't understand this, Ask for RobRichards in Coderbus
\ No newline at end of file
diff --git a/code/modules/surgery/organs/augments.dm b/code/modules/surgery/organs/augments.dm
index d3acb5135d9..263315aba1b 100644
--- a/code/modules/surgery/organs/augments.dm
+++ b/code/modules/surgery/organs/augments.dm
@@ -1,51 +1,51 @@
-/////AUGMENTATION\\\\\
-//See code/modules/surgery/organs/organ.dm for the parent "limb"
-
-
-/obj/item/organ/limb/robot
- name = "cyberlimb"
- desc = "You should never be seeing this!"
- status = ORGAN_ROBOTIC
-
-/obj/item/organ/limb/robot/chest
- name = "chest"
- desc = "A Robotic chest"
- icon_state = "chest"
- max_damage = 200
- body_part = CHEST
-
-/obj/item/organ/limb/robot/head
- name = "head"
- desc = "A Robotic head"
- icon_state = "head"
- max_damage = 200
- body_part = HEAD
-
-/obj/item/organ/limb/robot/l_arm
- name = "l_arm"
- desc = "A Robotic arm"
- icon_state = "l_arm"
- max_damage = 75
- body_part = ARM_LEFT
-
-/obj/item/organ/limb/robot/l_leg
- name = "l_leg"
- desc = "A Robotic leg"
- icon_state = "l_leg"
- max_damage = 75
- body_part = LEG_LEFT
-
-/obj/item/organ/limb/robot/r_arm
- name = "r_arm"
- desc = "A Robotic arm"
- icon_state = "r_arm"
- max_damage = 75
- body_part = ARM_RIGHT
-
-/obj/item/organ/limb/robot/r_leg
- name = "r_leg"
- desc = "A Robotic leg"
- icon_state = "r_leg"
- max_damage = 75
- body_part = LEG_RIGHT
-
+/////AUGMENTATION\\\\\
+//See code/modules/surgery/organs/organ.dm for the parent "limb"
+
+
+/obj/item/organ/limb/robot
+ name = "cyberlimb"
+ desc = "You should never be seeing this!"
+ status = ORGAN_ROBOTIC
+
+/obj/item/organ/limb/robot/chest
+ name = "chest"
+ desc = "A Robotic chest"
+ icon_state = "chest"
+ max_damage = 200
+ body_part = CHEST
+
+/obj/item/organ/limb/robot/head
+ name = "head"
+ desc = "A Robotic head"
+ icon_state = "head"
+ max_damage = 200
+ body_part = HEAD
+
+/obj/item/organ/limb/robot/l_arm
+ name = "l_arm"
+ desc = "A Robotic arm"
+ icon_state = "l_arm"
+ max_damage = 75
+ body_part = ARM_LEFT
+
+/obj/item/organ/limb/robot/l_leg
+ name = "l_leg"
+ desc = "A Robotic leg"
+ icon_state = "l_leg"
+ max_damage = 75
+ body_part = LEG_LEFT
+
+/obj/item/organ/limb/robot/r_arm
+ name = "r_arm"
+ desc = "A Robotic arm"
+ icon_state = "r_arm"
+ max_damage = 75
+ body_part = ARM_RIGHT
+
+/obj/item/organ/limb/robot/r_leg
+ name = "r_leg"
+ desc = "A Robotic leg"
+ icon_state = "r_leg"
+ max_damage = 75
+ body_part = LEG_RIGHT
+
diff --git a/code/modules/telesci/bscrystal.dm b/code/modules/telesci/bscrystal.dm
index d9e968f4daf..4cbb4573dc5 100644
--- a/code/modules/telesci/bscrystal.dm
+++ b/code/modules/telesci/bscrystal.dm
@@ -1,38 +1,38 @@
-// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
-
-/obj/item/bluespace_crystal
- name = "bluespace crystal"
- desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "bluespace_crystal"
- w_class = 1
- origin_tech = "bluespace=4;materials=3"
- var/blink_range = 8 // The teleport range when crushed/thrown at someone.
-
-/obj/item/bluespace_crystal/New()
- ..()
- pixel_x = rand(-5, 5)
- pixel_y = rand(-5, 5)
-
-/obj/item/bluespace_crystal/attack_self(var/mob/user)
- blink_mob(user)
- user.drop_item()
- user.visible_message("[user] crushes the [src]!")
- del(src)
-
-/obj/item/bluespace_crystal/proc/blink_mob(var/mob/living/L)
- do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
-
-/obj/item/bluespace_crystal/throw_impact(atom/hit_atom)
- ..()
- if(isliving(hit_atom))
- blink_mob(hit_atom)
- del(src)
-
-// Artifical bluespace crystal, doesn't give you much research.
-
-/obj/item/bluespace_crystal/artificial
- name = "artificial bluespace crystal"
- desc = "An artificially made bluespace crystal, it looks delicate."
- origin_tech = "bluespace=2"
+// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
+
+/obj/item/bluespace_crystal
+ name = "bluespace crystal"
+ desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "bluespace_crystal"
+ w_class = 1
+ origin_tech = "bluespace=4;materials=3"
+ var/blink_range = 8 // The teleport range when crushed/thrown at someone.
+
+/obj/item/bluespace_crystal/New()
+ ..()
+ pixel_x = rand(-5, 5)
+ pixel_y = rand(-5, 5)
+
+/obj/item/bluespace_crystal/attack_self(var/mob/user)
+ blink_mob(user)
+ user.drop_item()
+ user.visible_message("[user] crushes the [src]!")
+ qdel(src)
+
+/obj/item/bluespace_crystal/proc/blink_mob(var/mob/living/L)
+ do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
+
+/obj/item/bluespace_crystal/throw_impact(atom/hit_atom)
+ ..()
+ if(isliving(hit_atom))
+ blink_mob(hit_atom)
+ qdel(src)
+
+// Artifical bluespace crystal, doesn't give you much research.
+
+/obj/item/bluespace_crystal/artificial
+ name = "artificial bluespace crystal"
+ desc = "An artificially made bluespace crystal, it looks delicate."
+ origin_tech = "bluespace=2"
blink_range = 4 // Not as good as the organic stuff!
\ No newline at end of file
diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm
index 6c3fd66c025..883a6fc01cd 100644
--- a/code/modules/telesci/gps.dm
+++ b/code/modules/telesci/gps.dm
@@ -1,81 +1,81 @@
-var/list/GPS_list = list()
-/obj/item/device/gps
- name = "global positioning system"
- desc = "Helping lost spacemen find their way through the planets since 2016."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "gps-c"
- w_class = 2.0
- slot_flags = SLOT_BELT
- origin_tech = "programming=2;engineering=2"
- var/gpstag = "COM0"
- var/emped = 0
- var/turf/locked_location
-
-/obj/item/device/gps/New()
- ..()
- GPS_list.Add(src)
- name = "global positioning system ([gpstag])"
- overlays += "working"
-
-/obj/item/device/gps/Del()
- GPS_list.Remove(src)
- ..()
-
-/obj/item/device/gps/emp_act(severity)
- emped = 1
- overlays -= "working"
- overlays += "emp"
- spawn(300)
- emped = 0
- overlays -= "emp"
- overlays += "working"
-
-/obj/item/device/gps/attack_self(mob/user as mob)
-
- var/obj/item/device/gps/t = ""
- var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
- if(emped)
- t += "ERROR"
- else
- t += "
Set Tag "
- t += "
Tag: [gpstag]"
- if(locked_location && locked_location.loc)
- t += "
Bluespace coordinates saved: [locked_location.loc]"
- gps_window_height += 20
-
- for(var/obj/item/device/gps/G in GPS_list)
- var/turf/pos = get_turf(G)
- var/area/gps_area = get_area(G)
- var/tracked_gpstag = G.gpstag
- if(G.emped == 1)
- t += "
[tracked_gpstag]: ERROR"
- else
- t += "
[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
-
- var/datum/browser/popup = new(user, "GPS", name, 360, min(gps_window_height, 800))
- popup.set_content(t)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
-
-/obj/item/device/gps/Topic(href, href_list)
- ..()
- if(href_list["tag"] )
- var/a = input("Please enter desired tag.", name, gpstag) as text
- a = uppertext(copytext(sanitize(a), 1, 5))
- if(src.loc == usr)
- gpstag = a
- name = "global positioning system ([gpstag])"
- attack_self(usr)
-
-/obj/item/device/gps/science
- icon_state = "gps-s"
- gpstag = "SCI0"
-
-/obj/item/device/gps/engineering
- icon_state = "gps-e"
- gpstag = "ENG0"
-
-/obj/item/device/gps/mining
- icon_state = "gps-m"
- gpstag = "MINE0"
- desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
+var/list/GPS_list = list()
+/obj/item/device/gps
+ name = "global positioning system"
+ desc = "Helping lost spacemen find their way through the planets since 2016."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "gps-c"
+ w_class = 2.0
+ slot_flags = SLOT_BELT
+ origin_tech = "programming=2;engineering=2"
+ var/gpstag = "COM0"
+ var/emped = 0
+ var/turf/locked_location
+
+/obj/item/device/gps/New()
+ ..()
+ GPS_list.Add(src)
+ name = "global positioning system ([gpstag])"
+ overlays += "working"
+
+/obj/item/device/gps/Destroy()
+ GPS_list.Remove(src)
+ ..()
+
+/obj/item/device/gps/emp_act(severity)
+ emped = 1
+ overlays -= "working"
+ overlays += "emp"
+ spawn(300)
+ emped = 0
+ overlays -= "emp"
+ overlays += "working"
+
+/obj/item/device/gps/attack_self(mob/user as mob)
+
+ var/obj/item/device/gps/t = ""
+ var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
+ if(emped)
+ t += "ERROR"
+ else
+ t += "
Set Tag "
+ t += "
Tag: [gpstag]"
+ if(locked_location && locked_location.loc)
+ t += "
Bluespace coordinates saved: [locked_location.loc]"
+ gps_window_height += 20
+
+ for(var/obj/item/device/gps/G in GPS_list)
+ var/turf/pos = get_turf(G)
+ var/area/gps_area = get_area(G)
+ var/tracked_gpstag = G.gpstag
+ if(G.emped == 1)
+ t += "
[tracked_gpstag]: ERROR"
+ else
+ t += "
[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
+
+ var/datum/browser/popup = new(user, "GPS", name, 360, min(gps_window_height, 800))
+ popup.set_content(t)
+ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+
+/obj/item/device/gps/Topic(href, href_list)
+ ..()
+ if(href_list["tag"] )
+ var/a = input("Please enter desired tag.", name, gpstag) as text
+ a = uppertext(copytext(sanitize(a), 1, 5))
+ if(src.loc == usr)
+ gpstag = a
+ name = "global positioning system ([gpstag])"
+ attack_self(usr)
+
+/obj/item/device/gps/science
+ icon_state = "gps-s"
+ gpstag = "SCI0"
+
+/obj/item/device/gps/engineering
+ icon_state = "gps-e"
+ gpstag = "ENG0"
+
+/obj/item/device/gps/mining
+ icon_state = "gps-m"
+ gpstag = "MINE0"
+ desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm
index ba7037a7572..e9873c7c732 100644
--- a/code/modules/telesci/telepad.dm
+++ b/code/modules/telesci/telepad.dm
@@ -1,157 +1,157 @@
-///SCI TELEPAD///
-/obj/machinery/telepad
- name = "telepad"
- desc = "A bluespace telepad used for teleporting objects to and from a location."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "pad-idle"
- anchored = 1
- use_power = 1
- idle_power_usage = 200
- active_power_usage = 5000
- var/efficiency
-
-/obj/machinery/telepad/New()
- ..()
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/telesci_pad(null)
- component_parts += new /obj/item/bluespace_crystal/artificial(null)
- component_parts += new /obj/item/bluespace_crystal/artificial(null)
- component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
- component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
- component_parts += new /obj/item/stack/cable_coil(null, 1)
- RefreshParts()
-
-/obj/machinery/telepad/RefreshParts()
- var/E
- for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
- E += C.rating
- efficiency = E
-
-/obj/machinery/telepad/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I))
- return
-
- if(panel_open)
- if(istype(I, /obj/item/device/multitool))
- var/obj/item/device/multitool/M = I
- M.buffer = src
- user << "You save the data in the [I.name]'s buffer."
-
- if(exchange_parts(user, I))
- return
-
- default_deconstruction_crowbar(I)
-
-
-//CARGO TELEPAD//
-/obj/machinery/telepad_cargo
- name = "cargo telepad"
- desc = "A telepad used by the Rapid Crate Sender."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "pad-idle"
- anchored = 1
- use_power = 1
- idle_power_usage = 20
- active_power_usage = 500
- var/stage = 0
-/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
- anchored = 0
- playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
- if(anchored)
- anchored = 0
- user << " The [src] can now be moved."
- else if(!anchored)
- anchored = 1
- user << " The [src] is now secured."
- if(istype(W, /obj/item/weapon/screwdriver))
- if(stage == 0)
- playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
- user << " You unscrew the telepad's tracking beacon."
- stage = 1
- else if(stage == 1)
- playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
- user << " You screw in the telepad's tracking beacon."
- stage = 0
- if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
- playsound(src, 'sound/items/Welder.ogg', 50, 1)
- user << " You disassemble the telepad."
- new /obj/item/stack/sheet/metal(get_turf(src))
- new /obj/item/stack/sheet/glass(get_turf(src))
- del(src)
-
-///TELEPAD CALLER///
-/obj/item/device/telepad_beacon
- name = "telepad beacon"
- desc = "Use to warp in a cargo telepad."
- icon = 'icons/obj/radio.dmi'
- icon_state = "beacon"
- item_state = "signaler"
- origin_tech = "bluespace=3"
-
-/obj/item/device/telepad_beacon/attack_self(mob/user as mob)
- if(user)
- user << " Locked In"
- new /obj/machinery/telepad_cargo(user.loc)
- playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
- del(src)
- return
-
-///HANDHELD TELEPAD USER///
-/obj/item/weapon/rcs
- name = "rapid-crate-sender (RCS)"
- desc = "Use this to send crates and closets to cargo telepads."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "rcs"
- flags = CONDUCT
- force = 10.0
- throwforce = 10.0
- throw_speed = 2
- throw_range = 5
- var/rcharges = 10
- var/obj/machinery/pad = null
- var/last_charge = 30
- var/mode = 0
- var/rand_x = 0
- var/rand_y = 0
- var/emagged = 0
- var/teleporting = 0
-
-/obj/item/weapon/rcs/New()
- ..()
- processing_objects.Add(src)
-/obj/item/weapon/rcs/examine()
- desc = "Use this to send crates and closets to cargo telepads. There are [rcharges] charges left."
- ..()
-
-/obj/item/weapon/rcs/Del()
- processing_objects.Remove(src)
- ..()
-/obj/item/weapon/rcs/process()
- if(rcharges > 10)
- rcharges = 10
- if(last_charge == 0)
- rcharges++
- last_charge = 30
- else
- last_charge--
-
-/obj/item/weapon/rcs/attack_self(mob/user)
- if(emagged)
- if(mode == 0)
- mode = 1
- playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
- user << " The telepad locator has become uncalibrated."
- else
- mode = 0
- playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
- user << " You calibrate the telepad locator."
-
-/obj/item/weapon/rcs/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
- emagged = 1
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(5, 1, src)
- s.start()
- user << " You emag the RCS. Click on it to toggle between modes."
+///SCI TELEPAD///
+/obj/machinery/telepad
+ name = "telepad"
+ desc = "A bluespace telepad used for teleporting objects to and from a location."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "pad-idle"
+ anchored = 1
+ use_power = 1
+ idle_power_usage = 200
+ active_power_usage = 5000
+ var/efficiency
+
+/obj/machinery/telepad/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/telesci_pad(null)
+ component_parts += new /obj/item/bluespace_crystal/artificial(null)
+ component_parts += new /obj/item/bluespace_crystal/artificial(null)
+ component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
+ component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
+ component_parts += new /obj/item/stack/cable_coil(null, 1)
+ RefreshParts()
+
+/obj/machinery/telepad/RefreshParts()
+ var/E
+ for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
+ E += C.rating
+ efficiency = E
+
+/obj/machinery/telepad/attackby(obj/item/I, mob/user)
+ if(default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I))
+ return
+
+ if(panel_open)
+ if(istype(I, /obj/item/device/multitool))
+ var/obj/item/device/multitool/M = I
+ M.buffer = src
+ user << "You save the data in the [I.name]'s buffer."
+
+ if(exchange_parts(user, I))
+ return
+
+ default_deconstruction_crowbar(I)
+
+
+//CARGO TELEPAD//
+/obj/machinery/telepad_cargo
+ name = "cargo telepad"
+ desc = "A telepad used by the Rapid Crate Sender."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "pad-idle"
+ anchored = 1
+ use_power = 1
+ idle_power_usage = 20
+ active_power_usage = 500
+ var/stage = 0
+/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob)
+ if(istype(W, /obj/item/weapon/wrench))
+ anchored = 0
+ playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
+ if(anchored)
+ anchored = 0
+ user << " The [src] can now be moved."
+ else if(!anchored)
+ anchored = 1
+ user << " The [src] is now secured."
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(stage == 0)
+ playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << " You unscrew the telepad's tracking beacon."
+ stage = 1
+ else if(stage == 1)
+ playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << " You screw in the telepad's tracking beacon."
+ stage = 0
+ if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
+ playsound(src, 'sound/items/Welder.ogg', 50, 1)
+ user << " You disassemble the telepad."
+ new /obj/item/stack/sheet/metal(get_turf(src))
+ new /obj/item/stack/sheet/glass(get_turf(src))
+ qdel(src)
+
+///TELEPAD CALLER///
+/obj/item/device/telepad_beacon
+ name = "telepad beacon"
+ desc = "Use to warp in a cargo telepad."
+ icon = 'icons/obj/radio.dmi'
+ icon_state = "beacon"
+ item_state = "signaler"
+ origin_tech = "bluespace=3"
+
+/obj/item/device/telepad_beacon/attack_self(mob/user as mob)
+ if(user)
+ user << " Locked In"
+ new /obj/machinery/telepad_cargo(user.loc)
+ playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
+ qdel(src)
+ return
+
+///HANDHELD TELEPAD USER///
+/obj/item/weapon/rcs
+ name = "rapid-crate-sender (RCS)"
+ desc = "Use this to send crates and closets to cargo telepads."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "rcs"
+ flags = CONDUCT
+ force = 10.0
+ throwforce = 10.0
+ throw_speed = 2
+ throw_range = 5
+ var/rcharges = 10
+ var/obj/machinery/pad = null
+ var/last_charge = 30
+ var/mode = 0
+ var/rand_x = 0
+ var/rand_y = 0
+ var/emagged = 0
+ var/teleporting = 0
+
+/obj/item/weapon/rcs/New()
+ ..()
+ processing_objects.Add(src)
+/obj/item/weapon/rcs/examine()
+ desc = "Use this to send crates and closets to cargo telepads. There are [rcharges] charges left."
+ ..()
+
+/obj/item/weapon/rcs/Destroy()
+ processing_objects.Remove(src)
+ ..()
+/obj/item/weapon/rcs/process()
+ if(rcharges > 10)
+ rcharges = 10
+ if(last_charge == 0)
+ rcharges++
+ last_charge = 30
+ else
+ last_charge--
+
+/obj/item/weapon/rcs/attack_self(mob/user)
+ if(emagged)
+ if(mode == 0)
+ mode = 1
+ playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
+ user << " The telepad locator has become uncalibrated."
+ else
+ mode = 0
+ playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
+ user << " You calibrate the telepad locator."
+
+/obj/item/weapon/rcs/attackby(obj/item/W, mob/user)
+ if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
+ emagged = 1
+ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ s.set_up(5, 1, src)
+ s.start()
+ user << " You emag the RCS. Click on it to toggle between modes."
return
\ No newline at end of file
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index e23f1117dd9..edb9916eb06 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -1,381 +1,381 @@
-/obj/machinery/computer/telescience
- name = "\improper Telepad Control Console"
- desc = "Used to teleport objects to and from the telescience telepad."
- icon_state = "teleport"
- circuit = /obj/item/weapon/circuitboard/telesci_console
- var/sending = 1
- var/obj/machinery/telepad/telepad = null
- var/temp_msg = "Telescience control console initialized.
Welcome."
-
- // VARIABLES //
- var/teles_left // How many teleports left until it becomes uncalibrated
- var/datum/projectile_data/last_tele_data = null
- var/z_co = 1
- var/power_off
- var/rotation_off
- //var/angle_off
- var/last_target
-
- var/rotation = 0
- var/angle = 45
- var/power = 5
-
- // Based on the power used
- var/teleport_cooldown = 0 // every index requires a bluespace crystal
- var/list/power_options = list(5, 10, 20, 25, 30, 40, 50, 80, 100)
- var/teleporting = 0
- var/starting_crystals = 3
- var/max_crystals = 4
- var/list/crystals = list()
- var/obj/item/device/gps/inserted_gps
-
-/obj/machinery/computer/telescience/New()
- ..()
- recalibrate()
-
-/obj/machinery/computer/telescience/Del()
- eject()
- if(inserted_gps)
- inserted_gps.loc = loc
- inserted_gps = null
- ..()
-
-/obj/machinery/computer/telescience/examine()
- ..()
- usr << "There are [crystals.len ? crystals.len : "no"] bluespace crystals in the crystal slots."
-
-/obj/machinery/computer/telescience/initialize()
- ..()
- for(var/i = 1; i <= starting_crystals; i++)
- crystals += new /obj/item/bluespace_crystal/artificial(null) // starting crystals
-
-/obj/machinery/computer/telescience/update_icon()
- if(stat & BROKEN)
- icon_state = "telescib"
- else
- if(stat & NOPOWER)
- src.icon_state = "teleport0"
- stat |= NOPOWER
- else
- icon_state = initial(icon_state)
- stat &= ~NOPOWER
-
-/obj/machinery/computer/telescience/attack_paw(mob/user)
- user << "You are too primitive to use this computer."
- return
-
-/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/bluespace_crystal))
- if(crystals.len >= max_crystals)
- user << "There are not enough crystal slots."
- return
- user.drop_item()
- crystals += W
- W.loc = null
- user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.")
- updateDialog()
- else if(istype(W, /obj/item/device/gps))
- if(!inserted_gps)
- inserted_gps = W
- user.unEquip(W)
- W.loc = src
- user.visible_message("[user] inserts [W] into \the [src]'s GPS device slot.")
- else if(istype(W, /obj/item/device/multitool))
- var/obj/item/device/multitool/M = W
- if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
- telepad = M.buffer
- M.buffer = null
- user << "You upload the data from the [W.name]'s buffer."
- else
- ..()
-
-/obj/machinery/computer/telescience/attack_ai(mob/user)
- src.attack_hand(user)
-
-/obj/machinery/computer/telescience/attack_hand(mob/user)
- if(..())
- return
- interact(user)
-
-/obj/machinery/computer/telescience/interact(mob/user)
- var/t
- if(!telepad)
- in_use = 0 //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console
- t += "No telepad located.
Please add telepad data.
"
- else
- if(inserted_gps)
- t += "Eject GPS"
- t += "Set GPS memory"
- else
- t += "Eject GPS"
- t += "Set GPS memory"
- t += "[temp_msg]
"
- t += "Set Bearing"
- t += "[rotation]°
"
- t += "Set Elevation"
- t += "[angle]°
"
- t += "Set Power"
- t += ""
-
- for(var/i = 1; i <= power_options.len; i++)
- if(crystals.len + telepad.efficiency < i)
- t += "
[power_options[i]]"
- continue
- if(power == power_options[i])
- t += "
[power_options[i]]"
- continue
- t += "
[power_options[i]]"
- t += "
"
-
- t += "Set Sector"
- t += "[z_co ? z_co : "NULL"]
"
-
- t += "
Send"
- t += " Receive"
- t += "
Recalibrate Crystals Eject Crystals"
-
- // Information about the last teleport
- t += "
"
- if(!last_tele_data)
- t += "No teleport data found."
- else
- t += "Source Location: ([last_tele_data.src_x], [last_tele_data.src_y])
"
- //t += "Distance: [round(last_tele_data.distance, 0.1)]m
"
- t += "Time: [round(last_tele_data.time, 0.1)] secs
"
- t += "
"
-
- var/datum/browser/popup = new(user, "telesci", name, 300, 500)
- popup.set_content(t)
- popup.open()
- return
-
-/obj/machinery/computer/telescience/proc/sparks()
- if(telepad)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(5, 1, get_turf(telepad))
- s.start()
- else
- return
-
-/obj/machinery/computer/telescience/proc/telefail()
- sparks()
- visible_message("The telepad weakly fizzles.")
- return
-
-/obj/machinery/computer/telescience/proc/doteleport(mob/user)
-
- if(teleport_cooldown > world.time)
- temp_msg = "Telepad is recharging power.
Please wait [round((teleport_cooldown - world.time) / 10)] seconds."
- return
-
- if(teleporting)
- temp_msg = "Telepad is in use.
Please wait."
- return
-
- if(telepad)
-
- var/truePower = Clamp(power + power_off, 1, 1000)
- var/trueRotation = rotation + rotation_off
- var/trueAngle = Clamp(angle, 1, 90)
-
- var/datum/projectile_data/proj_data = projectile_trajectory(telepad.x, telepad.y, trueRotation, trueAngle, truePower)
- last_tele_data = proj_data
-
- var/trueX = Clamp(round(proj_data.dest_x, 1), 1, world.maxx)
- var/trueY = Clamp(round(proj_data.dest_y, 1), 1, world.maxy)
- var/spawn_time = round(proj_data.time) * 10
-
- var/turf/target = locate(trueX, trueY, z_co)
- last_target = target
- var/area/A = get_area(target)
- flick("pad-beam", telepad)
-
- if(spawn_time > 15) // 1.5 seconds
- playsound(telepad.loc, 'sound/weapons/flash.ogg', 25, 1)
- // Wait depending on the time the projectile took to get there
- teleporting = 1
- temp_msg = "Powering up bluespace crystals.
Please wait."
-
-
- spawn(round(proj_data.time) * 10) // in seconds
- if(!telepad)
- return
- if(telepad.stat & NOPOWER)
- return
- teleporting = 0
- teleport_cooldown = world.time + (power * 2)
- teles_left -= 1
-
- // use a lot of power
- use_power(power * 10)
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(5, 1, get_turf(telepad))
- s.start()
-
- temp_msg = "Teleport successful.
"
- if(teles_left < 10)
- temp_msg += "
Calibration required soon."
- else
- temp_msg += "Data printed below."
-
- var/sparks = get_turf(target)
- var/datum/effect/effect/system/spark_spread/y = new /datum/effect/effect/system/spark_spread
- y.set_up(5, 1, sparks)
- y.start()
-
- var/turf/source = target
- var/turf/dest = get_turf(telepad)
- var/log_msg = ""
- log_msg += ": [key_name(user)] has teleported "
-
- if(sending)
- source = dest
- dest = target
-
- flick("pad-beam", telepad)
- playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
- for(var/atom/movable/ROI in source)
- // if is anchored, don't let through
- if(ROI.anchored)
- if(isliving(ROI))
- var/mob/living/L = ROI
- if(L.buckled)
- // TP people on office chairs
- if(L.buckled.anchored)
- continue
-
- log_msg += "[key_name(L)] (on a chair), "
- else
- continue
- else if(!isobserver(ROI))
- continue
- if(ismob(ROI))
- var/mob/T = ROI
- log_msg += "[key_name(T)], "
- else
- log_msg += "[ROI.name]"
- if (istype(ROI, /obj/structure/closet))
- var/obj/structure/closet/C = ROI
- log_msg += " ("
- for(var/atom/movable/Q as mob|obj in C)
- if(ismob(Q))
- log_msg += "[key_name(Q)], "
- else
- log_msg += "[Q.name], "
- if (dd_hassuffix(log_msg, "("))
- log_msg += "empty)"
- else
- log_msg = dd_limittext(log_msg, length(log_msg) - 2)
- log_msg += ")"
- log_msg += ", "
- do_teleport(ROI, dest)
-
- if (dd_hassuffix(log_msg, ", "))
- log_msg = dd_limittext(log_msg, length(log_msg) - 2)
- else
- log_msg += "nothing"
- log_msg += " [sending ? "to" : "from"] [trueX], [trueY], [z_co] ([A ? A.name : "null area"])"
- investigate_log(log_msg, "telesci")
- updateDialog()
-
-/obj/machinery/computer/telescience/proc/teleport(mob/user)
- if(rotation == null || angle == null || z_co == null)
- temp_msg = "ERROR!
Set a angle, rotation and sector."
- return
- if(power <= 0)
- telefail()
- temp_msg = "ERROR!
No power selected!"
- return
- if(angle < 1 || angle > 90)
- telefail()
- temp_msg = "ERROR!
Elevation is less than 1 or greater than 90."
- return
- if(z_co == 2 || z_co < 1 || z_co > 6)
- telefail()
- temp_msg = "ERROR! Sector is less than 1,
greater than 6, or equal to 2."
- return
- if(teles_left > 0)
- doteleport(user)
- else
- telefail()
- temp_msg = "ERROR!
Calibration required."
- return
- return
-
-/obj/machinery/computer/telescience/proc/eject()
- for(var/obj/item/I in crystals)
- I.loc = src.loc
- crystals -= I
- power = 0
-
-/obj/machinery/computer/telescience/Topic(href, href_list)
- if(..())
- return
- if(!telepad)
- updateDialog()
- return
- if(telepad.panel_open)
- temp_msg = "Telepad undergoing physical maintenance operations."
-
- if(href_list["setrotation"])
- var/new_rot = input("Please input desired bearing in degrees.", name, rotation) as num
- if(..()) // Check after we input a value, as they could've moved after they entered something
- return
- rotation = Clamp(new_rot, -900, 900)
- rotation = round(rotation, 0.01)
-
- if(href_list["setangle"])
- var/new_angle = input("Please input desired elevation in degrees.", name, angle) as num
- if(..())
- return
- angle = Clamp(round(new_angle, 0.1), 1, 9999)
-
- if(href_list["setpower"])
- var/index = href_list["setpower"]
- index = text2num(index)
- if(index != null && power_options[index])
- if(crystals.len + telepad.efficiency >= index)
- power = power_options[index]
-
- if(href_list["setz"])
- var/new_z = input("Please input desired sector.", name, z_co) as num
- if(..())
- return
- z_co = Clamp(round(new_z), 1, 10)
-
- if(href_list["ejectGPS"])
- inserted_gps.loc = loc
- inserted_gps = null
-
- if(href_list["setMemory"])
- if(last_target)
- inserted_gps.locked_location = last_target
- temp_msg = "Location saved."
- else
- temp_msg = "ERROR!
No data stored."
-
- if(href_list["send"])
- sending = 1
- teleport(usr)
-
- if(href_list["receive"])
- sending = 0
- teleport(usr)
-
- if(href_list["recal"])
- recalibrate()
- sparks()
- temp_msg = "NOTICE:
Calibration successful."
-
- if(href_list["eject"])
- eject()
- temp_msg = "NOTICE:
Bluespace crystals ejected."
-
- updateDialog()
-
-/obj/machinery/computer/telescience/proc/recalibrate()
- teles_left = rand(30, 40)
- //angle_off = rand(-25, 25)
- power_off = rand(-4, 0)
+/obj/machinery/computer/telescience
+ name = "\improper Telepad Control Console"
+ desc = "Used to teleport objects to and from the telescience telepad."
+ icon_state = "teleport"
+ circuit = /obj/item/weapon/circuitboard/telesci_console
+ var/sending = 1
+ var/obj/machinery/telepad/telepad = null
+ var/temp_msg = "Telescience control console initialized.
Welcome."
+
+ // VARIABLES //
+ var/teles_left // How many teleports left until it becomes uncalibrated
+ var/datum/projectile_data/last_tele_data = null
+ var/z_co = 1
+ var/power_off
+ var/rotation_off
+ //var/angle_off
+ var/last_target
+
+ var/rotation = 0
+ var/angle = 45
+ var/power = 5
+
+ // Based on the power used
+ var/teleport_cooldown = 0 // every index requires a bluespace crystal
+ var/list/power_options = list(5, 10, 20, 25, 30, 40, 50, 80, 100)
+ var/teleporting = 0
+ var/starting_crystals = 3
+ var/max_crystals = 4
+ var/list/crystals = list()
+ var/obj/item/device/gps/inserted_gps
+
+/obj/machinery/computer/telescience/New()
+ ..()
+ recalibrate()
+
+/obj/machinery/computer/telescience/Destroy()
+ eject()
+ if(inserted_gps)
+ inserted_gps.loc = loc
+ inserted_gps = null
+ ..()
+
+/obj/machinery/computer/telescience/examine()
+ ..()
+ usr << "There are [crystals.len ? crystals.len : "no"] bluespace crystals in the crystal slots."
+
+/obj/machinery/computer/telescience/initialize()
+ ..()
+ for(var/i = 1; i <= starting_crystals; i++)
+ crystals += new /obj/item/bluespace_crystal/artificial(null) // starting crystals
+
+/obj/machinery/computer/telescience/update_icon()
+ if(stat & BROKEN)
+ icon_state = "telescib"
+ else
+ if(stat & NOPOWER)
+ src.icon_state = "teleport0"
+ stat |= NOPOWER
+ else
+ icon_state = initial(icon_state)
+ stat &= ~NOPOWER
+
+/obj/machinery/computer/telescience/attack_paw(mob/user)
+ user << "You are too primitive to use this computer."
+ return
+
+/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user)
+ if(istype(W, /obj/item/bluespace_crystal))
+ if(crystals.len >= max_crystals)
+ user << "There are not enough crystal slots."
+ return
+ user.drop_item()
+ crystals += W
+ W.loc = null
+ user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.")
+ updateDialog()
+ else if(istype(W, /obj/item/device/gps))
+ if(!inserted_gps)
+ inserted_gps = W
+ user.unEquip(W)
+ W.loc = src
+ user.visible_message("[user] inserts [W] into \the [src]'s GPS device slot.")
+ else if(istype(W, /obj/item/device/multitool))
+ var/obj/item/device/multitool/M = W
+ if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
+ telepad = M.buffer
+ M.buffer = null
+ user << "You upload the data from the [W.name]'s buffer."
+ else
+ ..()
+
+/obj/machinery/computer/telescience/attack_ai(mob/user)
+ src.attack_hand(user)
+
+/obj/machinery/computer/telescience/attack_hand(mob/user)
+ if(..())
+ return
+ interact(user)
+
+/obj/machinery/computer/telescience/interact(mob/user)
+ var/t
+ if(!telepad)
+ in_use = 0 //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console
+ t += "No telepad located.
Please add telepad data.
"
+ else
+ if(inserted_gps)
+ t += "Eject GPS"
+ t += "Set GPS memory"
+ else
+ t += "Eject GPS"
+ t += "Set GPS memory"
+ t += "[temp_msg]
"
+ t += "Set Bearing"
+ t += "[rotation]°
"
+ t += "Set Elevation"
+ t += "[angle]°
"
+ t += "Set Power"
+ t += ""
+
+ for(var/i = 1; i <= power_options.len; i++)
+ if(crystals.len + telepad.efficiency < i)
+ t += "
[power_options[i]]"
+ continue
+ if(power == power_options[i])
+ t += "
[power_options[i]]"
+ continue
+ t += "
[power_options[i]]"
+ t += "
"
+
+ t += "Set Sector"
+ t += "[z_co ? z_co : "NULL"]
"
+
+ t += "
Send"
+ t += " Receive"
+ t += "
Recalibrate Crystals Eject Crystals"
+
+ // Information about the last teleport
+ t += "
"
+ if(!last_tele_data)
+ t += "No teleport data found."
+ else
+ t += "Source Location: ([last_tele_data.src_x], [last_tele_data.src_y])
"
+ //t += "Distance: [round(last_tele_data.distance, 0.1)]m
"
+ t += "Time: [round(last_tele_data.time, 0.1)] secs
"
+ t += "
"
+
+ var/datum/browser/popup = new(user, "telesci", name, 300, 500)
+ popup.set_content(t)
+ popup.open()
+ return
+
+/obj/machinery/computer/telescience/proc/sparks()
+ if(telepad)
+ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ s.set_up(5, 1, get_turf(telepad))
+ s.start()
+ else
+ return
+
+/obj/machinery/computer/telescience/proc/telefail()
+ sparks()
+ visible_message("The telepad weakly fizzles.")
+ return
+
+/obj/machinery/computer/telescience/proc/doteleport(mob/user)
+
+ if(teleport_cooldown > world.time)
+ temp_msg = "Telepad is recharging power.
Please wait [round((teleport_cooldown - world.time) / 10)] seconds."
+ return
+
+ if(teleporting)
+ temp_msg = "Telepad is in use.
Please wait."
+ return
+
+ if(telepad)
+
+ var/truePower = Clamp(power + power_off, 1, 1000)
+ var/trueRotation = rotation + rotation_off
+ var/trueAngle = Clamp(angle, 1, 90)
+
+ var/datum/projectile_data/proj_data = projectile_trajectory(telepad.x, telepad.y, trueRotation, trueAngle, truePower)
+ last_tele_data = proj_data
+
+ var/trueX = Clamp(round(proj_data.dest_x, 1), 1, world.maxx)
+ var/trueY = Clamp(round(proj_data.dest_y, 1), 1, world.maxy)
+ var/spawn_time = round(proj_data.time) * 10
+
+ var/turf/target = locate(trueX, trueY, z_co)
+ last_target = target
+ var/area/A = get_area(target)
+ flick("pad-beam", telepad)
+
+ if(spawn_time > 15) // 1.5 seconds
+ playsound(telepad.loc, 'sound/weapons/flash.ogg', 25, 1)
+ // Wait depending on the time the projectile took to get there
+ teleporting = 1
+ temp_msg = "Powering up bluespace crystals.
Please wait."
+
+
+ spawn(round(proj_data.time) * 10) // in seconds
+ if(!telepad)
+ return
+ if(telepad.stat & NOPOWER)
+ return
+ teleporting = 0
+ teleport_cooldown = world.time + (power * 2)
+ teles_left -= 1
+
+ // use a lot of power
+ use_power(power * 10)
+
+ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ s.set_up(5, 1, get_turf(telepad))
+ s.start()
+
+ temp_msg = "Teleport successful.
"
+ if(teles_left < 10)
+ temp_msg += "
Calibration required soon."
+ else
+ temp_msg += "Data printed below."
+
+ var/sparks = get_turf(target)
+ var/datum/effect/effect/system/spark_spread/y = new /datum/effect/effect/system/spark_spread
+ y.set_up(5, 1, sparks)
+ y.start()
+
+ var/turf/source = target
+ var/turf/dest = get_turf(telepad)
+ var/log_msg = ""
+ log_msg += ": [key_name(user)] has teleported "
+
+ if(sending)
+ source = dest
+ dest = target
+
+ flick("pad-beam", telepad)
+ playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
+ for(var/atom/movable/ROI in source)
+ // if is anchored, don't let through
+ if(ROI.anchored)
+ if(isliving(ROI))
+ var/mob/living/L = ROI
+ if(L.buckled)
+ // TP people on office chairs
+ if(L.buckled.anchored)
+ continue
+
+ log_msg += "[key_name(L)] (on a chair), "
+ else
+ continue
+ else if(!isobserver(ROI))
+ continue
+ if(ismob(ROI))
+ var/mob/T = ROI
+ log_msg += "[key_name(T)], "
+ else
+ log_msg += "[ROI.name]"
+ if (istype(ROI, /obj/structure/closet))
+ var/obj/structure/closet/C = ROI
+ log_msg += " ("
+ for(var/atom/movable/Q as mob|obj in C)
+ if(ismob(Q))
+ log_msg += "[key_name(Q)], "
+ else
+ log_msg += "[Q.name], "
+ if (dd_hassuffix(log_msg, "("))
+ log_msg += "empty)"
+ else
+ log_msg = dd_limittext(log_msg, length(log_msg) - 2)
+ log_msg += ")"
+ log_msg += ", "
+ do_teleport(ROI, dest)
+
+ if (dd_hassuffix(log_msg, ", "))
+ log_msg = dd_limittext(log_msg, length(log_msg) - 2)
+ else
+ log_msg += "nothing"
+ log_msg += " [sending ? "to" : "from"] [trueX], [trueY], [z_co] ([A ? A.name : "null area"])"
+ investigate_log(log_msg, "telesci")
+ updateDialog()
+
+/obj/machinery/computer/telescience/proc/teleport(mob/user)
+ if(rotation == null || angle == null || z_co == null)
+ temp_msg = "ERROR!
Set a angle, rotation and sector."
+ return
+ if(power <= 0)
+ telefail()
+ temp_msg = "ERROR!
No power selected!"
+ return
+ if(angle < 1 || angle > 90)
+ telefail()
+ temp_msg = "ERROR!
Elevation is less than 1 or greater than 90."
+ return
+ if(z_co == 2 || z_co < 1 || z_co > 6)
+ telefail()
+ temp_msg = "ERROR! Sector is less than 1,
greater than 6, or equal to 2."
+ return
+ if(teles_left > 0)
+ doteleport(user)
+ else
+ telefail()
+ temp_msg = "ERROR!
Calibration required."
+ return
+ return
+
+/obj/machinery/computer/telescience/proc/eject()
+ for(var/obj/item/I in crystals)
+ I.loc = src.loc
+ crystals -= I
+ power = 0
+
+/obj/machinery/computer/telescience/Topic(href, href_list)
+ if(..())
+ return
+ if(!telepad)
+ updateDialog()
+ return
+ if(telepad.panel_open)
+ temp_msg = "Telepad undergoing physical maintenance operations."
+
+ if(href_list["setrotation"])
+ var/new_rot = input("Please input desired bearing in degrees.", name, rotation) as num
+ if(..()) // Check after we input a value, as they could've moved after they entered something
+ return
+ rotation = Clamp(new_rot, -900, 900)
+ rotation = round(rotation, 0.01)
+
+ if(href_list["setangle"])
+ var/new_angle = input("Please input desired elevation in degrees.", name, angle) as num
+ if(..())
+ return
+ angle = Clamp(round(new_angle, 0.1), 1, 9999)
+
+ if(href_list["setpower"])
+ var/index = href_list["setpower"]
+ index = text2num(index)
+ if(index != null && power_options[index])
+ if(crystals.len + telepad.efficiency >= index)
+ power = power_options[index]
+
+ if(href_list["setz"])
+ var/new_z = input("Please input desired sector.", name, z_co) as num
+ if(..())
+ return
+ z_co = Clamp(round(new_z), 1, 10)
+
+ if(href_list["ejectGPS"])
+ inserted_gps.loc = loc
+ inserted_gps = null
+
+ if(href_list["setMemory"])
+ if(last_target)
+ inserted_gps.locked_location = last_target
+ temp_msg = "Location saved."
+ else
+ temp_msg = "ERROR!
No data stored."
+
+ if(href_list["send"])
+ sending = 1
+ teleport(usr)
+
+ if(href_list["receive"])
+ sending = 0
+ teleport(usr)
+
+ if(href_list["recal"])
+ recalibrate()
+ sparks()
+ temp_msg = "NOTICE:
Calibration successful."
+
+ if(href_list["eject"])
+ eject()
+ temp_msg = "NOTICE:
Bluespace crystals ejected."
+
+ updateDialog()
+
+/obj/machinery/computer/telescience/proc/recalibrate()
+ teles_left = rand(30, 40)
+ //angle_off = rand(-25, 25)
+ power_off = rand(-4, 0)
rotation_off = rand(-10, 10)
\ No newline at end of file
diff --git a/code/unused/Agouri_stuff.dm b/code/unused/Agouri_stuff.dm
index 4fbfc7adc1a..e8820b410fe 100644
--- a/code/unused/Agouri_stuff.dm
+++ b/code/unused/Agouri_stuff.dm
@@ -1,1949 +1,1949 @@
-/*
-/obj/vehicle/airtight
- //inner atmos
- var/use_internal_tank = 0
- var/internal_tank_valve = ONE_ATMOSPHERE
- var/obj/machinery/portable_atmospherics/canister/internal_tank
- var/datum/gas_mixture/cabin_air
- var/obj/machinery/atmospherics/portables_connector/connected_port = null
-
- var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
- var/datum/global_iterator/pr_give_air //moves air from tank to cabin
-
-
-/obj/vehicle/airtight/New()
- ..()
- src.add_airtank()
- src.add_cabin()
- src.add_airtight_iterators()
-
-
-
-
-//######################################### Helpers for airtight vehicles #########################################
-
-/obj/vehicle/airtight/proc/add_cabin()
- cabin_air = new
- cabin_air.temperature = T20C
- cabin_air.volume = 200
- cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- return cabin_air
-
-/obj/vehicle/airtight/proc/add_airtank()
- internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
- return internal_tank
-
-/obj/vehicle/airtight/proc/add_airtight_iterators()
- pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src))
- pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src))
-
-
-//######################################### Specific datums for airtight vehicles #################################
-
-
-/datum/global_iterator/vehicle_preserve_temp //normalizing cabin air temperature to 20 degrees celsium
- delay = 20
-
- process(var/obj/vehicle/airtight/V)
- if(V.cabin_air && V.cabin_air.return_volume() > 0)
- var/delta = V.cabin_air.temperature - T20C
- V.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
- return
-
-
-/datum/global_iterator/vehicle_tank_give_air
- delay = 15
-
- process(var/obj/vehicle/airtight/V)
- if(V.internal_tank)
- var/datum/gas_mixture/tank_air = V.internal_tank.return_air()
- var/datum/gas_mixture/cabin_air = V.cabin_air
-
- var/release_pressure = V.internal_tank_valve
- var/cabin_pressure = cabin_air.return_pressure()
- var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
- var/transfer_moles = 0
- if(pressure_delta > 0) //cabin pressure lower than release pressure
- if(tank_air.return_temperature() > 0)
- transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
- cabin_air.merge(removed)
- else if(pressure_delta < 0) //cabin pressure higher than release pressure
- var/datum/gas_mixture/t_air = V.get_turf_air()
- pressure_delta = cabin_pressure - release_pressure
- if(t_air)
- pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
- if(pressure_delta > 0) //if location pressure is lower than cabin pressure
- transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
- if(t_air)
- t_air.merge(removed)
- else //just delete the cabin gas, we're in space or some shit
- del(removed)
- else
- return stop()
- return
-
-
-//######################################### Atmospherics for vehicles #############################################
-
-
-/obj/vehicle/proc/get_turf_air()
- var/turf/T = get_turf(src)
- if(T)
- . = T.return_air()
- return
-
-/obj/vehicle/airtight/remove_air(amount)
- if(use_internal_tank)
- return cabin_air.remove(amount)
- else
- var/turf/T = get_turf(src)
- if(T)
- return T.remove_air(amount)
- return
-
-/obj/vehicle/airtight/return_air()
- if(use_internal_tank)
- return cabin_air
- return get_turf_air()
-
-/obj/vehicle/airtight/proc/return_pressure()
- . = 0
- if(use_internal_tank)
- . = cabin_air.return_pressure()
- else
- var/datum/gas_mixture/t_air = get_turf_air()
- if(t_air)
- . = t_air.return_pressure()
- return
-
-
-/obj/vehicle/airtight/proc/return_temperature()
- . = 0
- if(use_internal_tank)
- . = cabin_air.return_temperature()
- else
- var/datum/gas_mixture/t_air = get_turf_air()
- if(t_air)
- . = t_air.return_temperature()
- return
-
-/obj/vehicle/airtight/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
- //Make sure not already connected to something else
- if(connected_port || !new_port || new_port.connected_device)
- return 0
-
- //Make sure are close enough for a valid connection
- if(new_port.loc != src.loc)
- return 0
-
- //Perform the connection
- connected_port = new_port
- connected_port.connected_device = src
-
- //Actually enforce the air sharing
- var/datum/pipe_network/network = connected_port.return_network(src)
- if(network && !(internal_tank.return_air() in network.gases))
- network.gases += internal_tank.return_air()
- network.update = 1
- log_message("Vehicle airtank connected to external port.")
- return 1
-
-/obj/vehicle/airtight/proc/disconnect()
- if(!connected_port)
- return 0
-
- var/datum/pipe_network/network = connected_port.return_network(src)
- if(network)
- network.gases -= internal_tank.return_air()
-
- connected_port.connected_device = null
- connected_port = null
- src.log_message("Vehicle airtank disconnected from external port.")
- return 1
-
-
-
-
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-
-
-
-/obj/vehicle
- name = "Vehicle"
- icon = 'icons/vehicles/vehicles.dmi'
- density = 1
- anchored = 1
- unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
- layer = MOB_LAYER
- //var/can_move = 1
- var/mob/living/carbon/occupant = null
- //var/step_in = 10 //make a step in step_in/10 sec.
- //var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
- //var/step_energy_drain = 10
- var/health = 300 //health is health
- //var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
- //the values in this list show how much damage will pass through, not how much will be absorbed.
- var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
- var/obj/item/weapon/stock_parts/cell/cell //Our power source
- var/state = 0
- var/list/log = new
- var/last_message = 0
- var/add_req_access = 1
- var/maint_access = 1
- //var/dna //dna-locking the mech
- var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
- var/datum/effect/effect/system/spark_spread/spark_system = new
- var/lights = 0
- var/lights_power = 6
-
- //inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
- //var/use_internal_tank = 0
- //var/internal_tank_valve = ONE_ATMOSPHERE
- //var/obj/machinery/portable_atmospherics/canister/internal_tank
- //var/datum/gas_mixture/cabin_air
- //var/obj/machinery/atmospherics/portables_connector/connected_port = null
-
- var/obj/item/device/radio/radio = null
-
- var/max_temperature = 2500
- //var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
- var/internal_damage = 0 //contains bitflags
-
- var/list/operation_req_access = list()//required access level for mecha operation
- var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
-
- //var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
- var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
-
- //var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
-
- var/datum/global_iterator/pr_internal_damage //processes internal damage
-
-
- var/wreckage
-
- var/list/equipment = new
- var/obj/selected
- //var/max_equip = 3
-
- var/datum/events/events
-
-
-
-/obj/vehicle/New()
- ..()
- events = new
- icon_state += "-unmanned"
- add_radio()
- //add_cabin() //No cabin for non-airtights
-
- spark_system.set_up(2, 0, src)
- spark_system.attach(src)
- add_cell()
- add_iterators()
- removeVerb(/obj/mecha/verb/disconnect_from_port)
- removeVerb(/atom/movable/verb/pull)
- log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
- loc.Entered(src)
- return
-
-
-//################ Helpers ###########################################################
-
-
-/obj/vehicle/proc/removeVerb(verb_path)
- verbs -= verb_path
-
-/obj/vehicle/proc/addVerb(verb_path)
- verbs += verb_path
-
-/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
- internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
- return internal_tank*/
-
-/obj/vehicle/proc/add_cell(var/obj/item/weapon/stock_parts/cell/C=null)
- if(C)
- C.forceMove(src)
- cell = C
- return
- cell = new(src)
- cell.charge = 15000
- cell.maxcharge = 15000
-
-/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
- cabin_air = new
- cabin_air.temperature = T20C
- cabin_air.volume = 200
- cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- return cabin_air*/
-
-/obj/vehicle/proc/add_radio()
- radio = new(src)
- radio.name = "[src] radio"
- radio.icon = icon
- radio.icon_state = icon_state
- radio.subspace_transmission = 1
-
-/obj/vehicle/proc/add_iterators()
- pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
- //pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
- //pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
- //pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
-
-/obj/vehicle/proc/check_for_support()
- if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
- return 1
- else
- return 0
-
-//################ Logs and messages ############################################
-
-
-/obj/vehicle/proc/log_message(message as text,red=null)
- log.len++
- log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]")
- return log.len
-
-
-
-//################ Global Iterator Datums ######################################
-
-
-/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
- delay = 7
-
- process(var/obj/vehicle/V as obj, direction)
- if(direction)
- if(!step(V, direction)||V.check_for_support())
- src.stop()
- else
- src.stop()
- return
-
-
-/datum/global_iterator/mecha_internal_damage // processing internal damage
-
- process(var/obj/mecha/mecha)
- if(!mecha.hasInternalDamage())
- return stop()
- if(mecha.hasInternalDamage(MECHA_INT_FIRE))
- if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
- mecha.clearInternalDamage(MECHA_INT_FIRE)
- if(mecha.internal_tank)
- if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
- mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
- int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
- if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
- mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
- if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
- mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
- if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
- mecha.pr_int_temp_processor.stop()
- if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
- if(mecha.internal_tank)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
- if(mecha.loc && hascall(mecha.loc,"assume_air"))
- mecha.loc.assume_air(leaked_gas)
- else
- del(leaked_gas)
- if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
- if(mecha.get_charge())
- mecha.spark_system.start()
- mecha.cell.charge -= min(20,mecha.cell.charge)
- mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
- return
-
-
-*/
-
-
-
-
-
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-
-
-
-
-/*/turf/DblClick()
- if(istype(usr, /mob/living/silicon/ai))
- return move_camera_by_click()
- if(usr.stat || usr.restrained() || usr.lying)
- return ..()
-
- if(usr.hand && istype(usr.l_hand, /obj/item/weapon/flamethrower))
- var/turflist = getline(usr,src)
- var/obj/item/weapon/flamethrower/F = usr.l_hand
- F.flame_turf(turflist)
- else if(!usr.hand && istype(usr.r_hand, /obj/item/weapon/flamethrower))
- var/turflist = getline(usr,src)
- var/obj/item/weapon/flamethrower/F = usr.r_hand
- F.flame_turf(turflist)
-
- return ..()
-
-/turf/New()
- ..()
- for(var/atom/movable/AM as mob|obj in src)
- spawn( 0 )
- src.Entered(AM)
- return
- return
-
-/turf/ex_act(severity)
- return 0
-
-
-/turf/bullet_act(var/obj/item/projectile/Proj)
- if(istype(Proj ,/obj/item/projectile/beam/pulse))
- src.ex_act(2)
- ..()
- return 0
-
-/turf/bullet_act(var/obj/item/projectile/Proj)
- if(istype(Proj ,/obj/item/projectile/bullet/gyro))
- explosion(src, -1, 0, 2)
- ..()
- return 0
-
-/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
- if (!mover || !isturf(mover.loc))
- return 1
-
-
- //First, check objects to block exit that are not on the border
- for(var/obj/obstacle in mover.loc)
- if((obstacle.flags & ~ON_BORDER) && (mover != obstacle) && (forget != obstacle))
- if(!obstacle.CheckExit(mover, src))
- mover.Bump(obstacle, 1)
- return 0
-
- //Now, check objects to block exit that are on the border
- for(var/obj/border_obstacle in mover.loc)
- if((border_obstacle.flags & ON_BORDER) && (mover != border_obstacle) && (forget != border_obstacle))
- if(!border_obstacle.CheckExit(mover, src))
- mover.Bump(border_obstacle, 1)
- return 0
-
- //Next, check objects to block entry that are on the border
- for(var/obj/border_obstacle in src)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle))
- mover.Bump(border_obstacle, 1)
- return 0
-
- //Then, check the turf itself
- if (!src.CanPass(mover, src))
- mover.Bump(src, 1)
- return 0
-
- //Finally, check objects/mobs to block entry that are not on the border
- for(var/atom/movable/obstacle in src)
- if(obstacle.flags & ~ON_BORDER)
- if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle))
- mover.Bump(obstacle, 1)
- return 0
- return 1 //Nothing found to block so return success!
-
-
-/turf/Entered(atom/movable/M as mob|obj)
- var/loopsanity = 100
- if(ismob(M))
- if(!M:lastarea)
- M:lastarea = get_area(M.loc)
- if(M:lastarea.has_gravity == 0)
- inertial_drift(M)
-
- /*
- if(M.flags & NOGRAV)
- inertial_drift(M)
- */
-
-
-
- else if(!istype(src, /turf/space))
- M:inertia_dir = 0
- ..()
- var/objects = 0
- for(var/atom/A as mob|obj|turf|area in src)
- if(objects > loopsanity) break
- objects++
- spawn( 0 )
- if ((A && M))
- A.HasEntered(M, 1)
- return
- objects = 0
- for(var/atom/A as mob|obj|turf|area in range(1))
- if(objects > loopsanity) break
- objects++
- spawn( 0 )
- if ((A && M))
- A.HasProximity(M, 1)
- return
- return
-
-/turf/proc/inertial_drift(atom/movable/A as mob|obj)
- if(!(A.last_move)) return
- if((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1)))
- var/mob/M = A
- if(M.Process_Spacemove(1))
- M.inertia_dir = 0
- return
- spawn(5)
- if((M && !(M.anchored) && (M.loc == src)))
- if(M.inertia_dir)
- step(M, M.inertia_dir)
- return
- M.inertia_dir = M.last_move
- step(M, M.inertia_dir)
- return
-
-/turf/proc/levelupdate()
- for(var/obj/O in src)
- if(O.level == 1)
- O.hide(src.intact)
-
-// override for space turfs, since they should never hide anything
-/turf/space/levelupdate()
- for(var/obj/O in src)
- if(O.level == 1)
- O.hide(0)
-
-// Removes all signs of lattice on the pos of the turf -Donkieyo
-/turf/proc/RemoveLattice()
- var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
- if(L)
- del L
-
-/turf/proc/ReplaceWithFloor(explode=0)
- var/prior_icon = icon_old
- var/old_dir = dir
-
- var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) )
-
- W.RemoveLattice()
- W.dir = old_dir
- if(prior_icon) W.icon_state = prior_icon
- else W.icon_state = "floor"
-
- if (!explode)
- W.opacity = 1
- W.sd_SetOpacity(0)
- //This is probably gonna make lighting go a bit wonky in bombed areas, but sd_SetOpacity was the primary reason bombs have been so laggy. --NEO
- W.levelupdate()
- return W
-
-/turf/proc/ReplaceWithPlating()
- var/prior_icon = icon_old
- var/old_dir = dir
-
- var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) )
-
- W.RemoveLattice()
- W.dir = old_dir
- if(prior_icon) W.icon_state = prior_icon
- else W.icon_state = "plating"
- W.opacity = 1
- W.sd_SetOpacity(0)
- W.levelupdate()
- return W
-
-/turf/proc/ReplaceWithEngineFloor()
- var/old_dir = dir
-
- var/turf/simulated/floor/engine/E = new /turf/simulated/floor/engine( locate(src.x, src.y, src.z) )
-
- E.dir = old_dir
- E.icon_state = "engine"
-
-/turf/simulated/Entered(atom/A, atom/OL)
- if (istype(A,/mob/living/carbon))
- var/mob/living/carbon/M = A
- if(M.lying) return
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
- if(istype(H.shoes, /obj/item/clothing/shoes/clown_shoes))
- if(H.m_intent == "run")
- if(H.footstep >= 2)
- H.footstep = 0
- else
- H.footstep++
- if(H.footstep == 0)
- playsound(src, "clownstep", 50, 1) // this will get annoying very fast.
- else
- playsound(src, "clownstep", 20, 1)
-
- switch (src.wet)
- if(1)
- if(istype(M, /mob/living/carbon/human)) // Added check since monkeys don't have shoes
- if ((M.m_intent == "run") && !(istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP))
- M.stop_pulling()
- step(M, M.dir)
- M << "\blue You slipped on the wet floor!"
- playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- M.Stun(8)
- M.Weaken(5)
- else
- M.inertia_dir = 0
- return
- else if(!istype(M, /mob/living/carbon/slime))
- if (M.m_intent == "run")
- M.stop_pulling()
- step(M, M.dir)
- M << "\blue You slipped on the wet floor!"
- playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- M.Stun(8)
- M.Weaken(5)
- else
- M.inertia_dir = 0
- return
-
- if(2) //lube
- if(!istype(M, /mob/living/carbon/slime))
- M.stop_pulling()
- step(M, M.dir)
- spawn(1) step(M, M.dir)
- spawn(2) step(M, M.dir)
- spawn(3) step(M, M.dir)
- spawn(4) step(M, M.dir)
- M.take_organ_damage(2)
- M << "\blue You slipped on the floor!"
- playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- M.Weaken(10)
-
- ..()
-
-/turf/proc/ReplaceWithSpace()
- var/old_dir = dir
- var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
- S.dir = old_dir
- return S
-
-/turf/proc/ReplaceWithLattice()
- var/old_dir = dir
- var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
- S.dir = old_dir
- new /obj/structure/lattice( locate(src.x, src.y, src.z) )
- return S
-
-/turf/proc/ReplaceWithWall()
- var/old_icon = icon_state
- var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) )
- S.icon_old = old_icon
- S.opacity = 0
- S.sd_NewOpacity(1)
- return S
-
-/turf/proc/ReplaceWithRWall()
- var/old_icon = icon_state
- var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) )
- S.icon_old = old_icon
- S.opacity = 0
- S.sd_NewOpacity(1)
- return S
-
-/turf/simulated/wall/New()
- ..()
-
-/turf/simulated/wall/proc/dismantle_wall(devastated=0, explode=0)
- if(istype(src,/turf/simulated/wall/r_wall))
- if(!devastated)
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- new /obj/structure/girder/reinforced(src)
- new /obj/item/stack/sheet/plasteel( src )
- else
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/plasteel( src )
- else if(istype(src,/turf/simulated/wall/cult))
- if(!devastated)
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- new /obj/effect/decal/remains/human(src)
- else
- new /obj/effect/decal/remains/human(src)
-
- else
- if(!devastated)
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- new /obj/structure/girder(src)
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- else
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
-
- ReplaceWithPlating(explode)
-
-/turf/simulated/wall/examine()
- set src in oview(1)
-
- usr << "It looks like a regular wall."
- return
-
-/turf/simulated/wall/ex_act(severity)
- switch(severity)
- if(1.0)
- //SN src = null
- src.ReplaceWithSpace()
- del(src)
- return
- if(2.0)
- if (prob(50))
- dismantle_wall(0,1)
- else
- dismantle_wall(1,1)
- if(3.0)
- var/proba
- if (istype(src, /turf/simulated/wall/r_wall))
- proba = 15
- else
- proba = 40
- if (prob(proba))
- dismantle_wall(0,1)
- else
- return
-
-/turf/simulated/wall/blob_act()
- if(prob(50))
- dismantle_wall()
-
-/turf/simulated/wall/attack_paw(mob/user as mob)
- if ((user.mutations & HULK))
- if (prob(40))
- usr << text("\blue You smash through the wall.")
- dismantle_wall(1)
- return
- else
- usr << text("\blue You punch the wall.")
- return
-
- return src.attack_hand(user)
-
-
-/turf/simulated/wall/attack_animal(mob/living/simple_animal/M as mob)
- if(M.wall_smash)
- if (istype(src, /turf/simulated/wall/r_wall))
- M << text("\blue This wall is far too strong for you to destroy.")
- return
- else
- if (prob(40))
- M << text("\blue You smash through the wall.")
- dismantle_wall(1)
- return
- else
- M << text("\blue You smash against the wall.")
- return
-
- M << "\blue You push the wall but nothing happens!"
- return
-
-/turf/simulated/wall/attack_hand(mob/user as mob)
- if ((user.mutations & HULK))
- if (prob(40))
- usr << text("\blue You smash through the wall.")
- dismantle_wall(1)
- return
- else
- usr << text("\blue You punch the wall.")
- return
-
- user << "\blue You push the wall but nothing happens!"
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 25, 1)
- src.add_fingerprint(user)
- return
-
-/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
-
- if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- usr << "\red You don't have the dexterity to do this!"
- return
-
- if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
- var/turf/T = get_turf(user)
- if (!( istype(T, /turf) ))
- return
-
- if (thermite)
- var/obj/effect/overlay/O = new/obj/effect/overlay( src )
- O.name = "Thermite"
- O.desc = "Looks hot."
- O.icon = 'icons/effects/fire.dmi'
- O.icon_state = "2"
- O.anchored = 1
- O.density = 1
- O.layer = 5
- var/turf/simulated/floor/F = ReplaceWithPlating()
- F.burn_tile()
- F.icon_state = "wall_thermite"
- user << "\red The thermite melts the wall."
- spawn(100) del(O)
- F.sd_LumReset()
- return
-
- if (W:remove_fuel(0,user))
- W:welding = 2
- user << "\blue Now disassembling the outer wall plating."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(100)
- if (W && istype(src, /turf/simulated/wall))
- if ((get_turf(user) == T && user.equipped() == W))
- user << "\blue You disassembled the outer wall plating."
- dismantle_wall()
- W:welding = 1
- else
- user << "\blue You need more welding fuel to complete this task."
- return
-
- else if (istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- var/turf/T = user.loc
- if (!( istype(T, /turf) ))
- return
-
- if (thermite)
- var/obj/effect/overlay/O = new/obj/effect/overlay( src )
- O.name = "Thermite"
- O.desc = "Looks hot."
- O.icon = 'icons/effects/fire.dmi'
- O.icon_state = "2"
- O.anchored = 1
- O.density = 1
- O.layer = 5
- var/turf/simulated/floor/F = ReplaceWithPlating()
- F.burn_tile()
- F.icon_state = "wall_thermite"
- user << "\red The thermite melts the wall."
- spawn(100) del(O)
- F.sd_LumReset()
- return
-
- else
- user << "\blue Now disassembling the outer wall plating."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(60)
- if (W && istype(src, /turf/simulated/wall))
- if ((get_turf(user) == T && user.equipped() == W))
- user << "\blue You disassembled the outer wall plating."
- dismantle_wall()
- for(var/mob/O in viewers(user, 5))
- O.show_message(text("\blue The wall was sliced apart by []!", user), 1, text("\red You hear metal being sliced apart."), 2)
- return
-
- else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- var/turf/T = user.loc
- user << "\blue Now drilling through wall."
- sleep(60)
- if (W && istype(src, /turf/simulated/wall))
- if ((user.loc == T && user.equipped() == W))
- dismantle_wall(1)
- for(var/mob/O in viewers(user, 5))
- O.show_message(text("\blue The wall was drilled apart by []!", user), 1, text("\red You hear metal being drilled appart."), 2)
- return
-
- else if(istype(W, /obj/item/weapon/melee/energy/blade))
- var/turf/T = user.loc
- user << "\blue Now slicing through wall."
- W:spark_system.start()
- playsound(src.loc, "sparks", 50, 1)
- sleep(70)
- if (W && istype(src, /turf/simulated/wall))
- if ((user.loc == T && user.equipped() == W))
- W:spark_system.start()
- playsound(src.loc, "sparks", 50, 1)
- playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
- dismantle_wall(1)
- for(var/mob/O in viewers(user, 5))
- O.show_message(text("\blue The wall was sliced apart by []!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2)
- return
-
- else if(istype(W,/obj/item/apc_frame))
- var/obj/item/apc_frame/AH = W
- AH.try_build(src)
- else if(istype(W,/obj/item/weapon/contraband/poster))
- var/obj/item/weapon/contraband/poster/P = W
- if(P.resulting_poster)
- var/check = 0
- var/stuff_on_wall = 0
- for( var/obj/O in src.contents) //Let's see if it already has a poster on it or too much stuff
- if(istype(O,/obj/effect/decal/poster))
- check = 1
- break
- stuff_on_wall++
- if(stuff_on_wall==3)
- check = 1
- break
-
- if(check)
- user << "The wall is far too cluttered to place a poster!"
- return
-
- user << "You start placing the poster on the wall..." //Looks like it's uncluttered enough. Place the poster.
-
- P.resulting_poster.loc = src
- var/temp = P.resulting_poster.icon_state
- var/temp_loc = user.loc
- P.resulting_poster.icon_state = "poster_being_set"
- playsound(P.resulting_poster.loc, 'sound/items/poster_being_created.ogg', 100, 1)
- sleep(24)
-
- if(user.loc == temp_loc)//Let's check if he still is there
- user << "You place the poster!"
- P.resulting_poster.icon_state = temp
- src.contents += P.resulting_poster
- del(P)
- else
- user << "You stop placing the poster."
- P.resulting_poster.loc = P
- P.resulting_poster.icon_state = temp
- else
- return attack_hand(user)
- return
-
-
-/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob)
-
- if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- usr << "\red You don't have the dexterity to do this!"
- return
-
- if(!istype(src, /turf/simulated/wall/r_wall))
- return // this may seem stupid and redundant but apparently floors can call this attackby() proc, it was spamming shit up. -- Doohl
-
-
- if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
- W:eyecheck(user)
- var/turf/T = user.loc
- if (!( istype(T, /turf) ))
- return
-
- if (thermite)
- var/obj/effect/overlay/O = new/obj/effect/overlay( src )
- O.name = "Thermite"
- O.desc = "Looks hot."
- O.icon = 'icons/effects/fire.dmi'
- O.icon_state = "2"
- O.anchored = 1
- O.density = 1
- O.layer = 5
- var/turf/simulated/floor/F = ReplaceWithPlating()
- F.burn_tile()
- F.icon_state = "wall_thermite"
- user << "\red The thermite melts the wall."
- spawn(100) del(O)
- F.sd_LumReset()
- return
-
- if (src.d_state == 2)
- W:welding = 2
- user << "\blue Slicing metal cover."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(60)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 3
- user << "\blue You removed the metal cover."
- W:welding = 1
-
- else if (src.d_state == 5)
- W:welding = 2
- user << "\blue Removing support rods."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(100)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 6
- new /obj/item/stack/rods( src )
- user << "\blue You removed the support rods."
- W:welding = 1
-
- else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- var/turf/T = user.loc
- if (!( istype(T, /turf) ))
- return
-
- if (thermite)
- var/obj/effect/overlay/O = new/obj/effect/overlay( src )
- O.name = "Thermite"
- O.desc = "Looks hot."
- O.icon = 'icons/effects/fire.dmi'
- O.icon_state = "2"
- O.anchored = 1
- O.density = 1
- O.layer = 5
- var/turf/simulated/floor/F = ReplaceWithPlating()
- F.burn_tile()
- F.icon_state = "wall_thermite"
- user << "\red The thermite melts the wall."
- spawn(100) del(O)
- F.sd_LumReset()
- return
-
- if (src.d_state == 2)
- user << "\blue Slicing metal cover."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(40)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 3
- user << "\blue You removed the metal cover."
-
- else if (src.d_state == 5)
- user << "\blue Removing support rods."
- playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- sleep(70)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 6
- new /obj/item/stack/rods( src )
- user << "\blue You removed the support rods."
-
- else if(istype(W, /obj/item/weapon/melee/energy/blade))
- user << "\blue This wall is too thick to slice through. You will need to find a different path."
- return
-
- else if (istype(W, /obj/item/weapon/wrench))
- if (src.d_state == 4)
- var/turf/T = user.loc
- user << "\blue Detaching support rods."
- playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
- sleep(40)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 5
- user << "\blue You detach the support rods."
-
- else if (istype(W, /obj/item/weapon/wirecutters))
- if (src.d_state == 0)
- playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
- src.d_state = 1
- new /obj/item/stack/rods( src )
-
- else if (istype(W, /obj/item/weapon/screwdriver))
- if (src.d_state == 1)
- var/turf/T = user.loc
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
- user << "\blue Removing support lines."
- sleep(40)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 2
- user << "\blue You removed the support lines."
-
- else if (istype(W, /obj/item/weapon/crowbar))
-
- if (src.d_state == 3)
- var/turf/T = user.loc
- user << "\blue Prying cover off."
- playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
- sleep(100)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 4
- user << "\blue You removed the cover."
-
- else if (src.d_state == 6)
- var/turf/T = user.loc
- user << "\blue Prying outer sheath off."
- playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
- sleep(100)
- if(src)
- if ((user.loc == T && user.equipped() == W))
- user << "\blue You removed the outer sheath."
- dismantle_wall()
- return
-
- else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- var/turf/T = user.loc
- user << "\blue You begin to drill though, this will take some time."
- sleep(200)
- if(src)
- if ((user.loc == T && user.equipped() == W))
- user << "\blue Your drill tears though the reinforced plating."
- dismantle_wall()
- return
-
- else if ((istype(W, /obj/item/stack/sheet/metal)) && (src.d_state))
- var/turf/T = user.loc
- user << "\blue Repairing wall."
- sleep(100)
- if ((user.loc == T && user.equipped() == W))
- src.d_state = 0
- src.icon_state = initial(src.icon_state)
- user << "\blue You repaired the wall."
- if (W:amount > 1)
- W:amount--
- else
- del(W)
-
- else if(istype(W,/obj/item/weapon/contraband/poster))
- var/obj/item/weapon/contraband/poster/P = W
- if(P.resulting_poster)
- var/check = 0
- var/stuff_on_wall = 0
- for( var/obj/O in src.contents) //Let's see if it already has a poster on it or too much stuff
- if(istype(O,/obj/effect/decal/poster))
- check = 1
- break
- stuff_on_wall++
- if(stuff_on_wall==3)
- check = 1
- break
-
- if(check)
- user << "The wall is far too cluttered to place a poster!"
- return
-
- user << "You start placing the poster on the wall..." //Looks like it's uncluttered enough. Place the poster.
-
- P.resulting_poster.loc = src
- var/temp = P.resulting_poster.icon_state
- var/temp_loc = user.loc
- P.resulting_poster.icon_state = "poster_being_set"
- playsound(P.resulting_poster.loc, 'sound/items/poster_being_created.ogg', 100, 1)
- sleep(24)
-
- if(user.loc == temp_loc)//Let's check if he still is there
- user << "You place the poster!"
- P.resulting_poster.icon_state = temp
- src.contents += P.resulting_poster
- del(P)
- else
- user << "You stop placing the poster."
- P.resulting_poster.loc = P
- P.resulting_poster.icon_state = temp
- return
-
- if(istype(W,/obj/item/apc_frame))
- var/obj/item/apc_frame/AH = W
- AH.try_build(src)
- return
-
- if(src.d_state > 0)
- src.icon_state = "r_wall-[d_state]"
-
- else
- return attack_hand(user)
- return
-
-/turf/simulated/wall/meteorhit(obj/M as obj)
- if (prob(15))
- dismantle_wall()
- else if(prob(70))
- ReplaceWithPlating()
- else
- ReplaceWithLattice()
- return 0
-
-
-//This is so damaged or burnt tiles or platings don't get remembered as the default tile
-var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
- "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
- "platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
- "light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
- "light_on_broken","light_off","wall_thermite","grass1","grass2","grass3","grass4",
- "asteroid","asteroid_dug",
- "asteroid0","asteroid1","asteroid2","asteroid3","asteroid4",
- "asteroid5","asteroid6","asteroid7","asteroid8",
- "burning","oldburning","light-on-r","light-on-y","light-on-g","light-on-b")
-
-var/list/plating_icons = list("plating","platingdmg1","platingdmg2","platingdmg3","asteroid","asteroid_dug")
-
-/turf/simulated/floor
-
- //Note to coders, the 'intact' var can no longer be used to determine if the floor is a plating or not.
- //Use the is_plating(), is_plasteel_floor() and is_light_floor() procs instead. --Errorage
- name = "floor"
- icon = 'icons/turf/floors.dmi'
- icon_state = "floor"
- var/icon_regular_floor = "floor" //used to remember what icon the tile should have by default
- var/icon_plating = "plating"
- thermal_conductivity = 0.040
- heat_capacity = 10000
- var/broken = 0
- var/burnt = 0
- var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/plasteel
-
- airless
- icon_state = "floor"
- name = "airless floor"
- oxygen = 0.01
- nitrogen = 0.01
- temperature = TCMB
-
- New()
- ..()
- name = "floor"
-
- light
- name = "Light floor"
- luminosity = 5
- icon_state = "light_on"
- floor_tile = new/obj/item/stack/tile/light
-
- New()
- floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
- var/n = name //just in case commands rename it in the ..() call
- ..()
- spawn(4)
- update_icon()
- name = n
-
- grass
- name = "Grass patch"
- icon_state = "grass1"
- floor_tile = new/obj/item/stack/tile/grass
-
- New()
- floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
- icon_state = "grass[pick("1","2","3","4")]"
- ..()
- spawn(4)
- update_icon()
- for(var/direction in cardinal)
- if(istype(get_step(src,direction),/turf/simulated/floor))
- var/turf/simulated/floor/FF = get_step(src,direction)
- FF.update_icon() //so siding get updated properly
-
-/turf/simulated/floor/vault
- icon_state = "rockvault"
-
- New(location,type)
- ..()
- icon_state = "[type]vault"
-
-/turf/simulated/wall/vault
- icon_state = "rockvault"
-
- New(location,type)
- ..()
- icon_state = "[type]vault"
-
-/turf/simulated/floor/engine
- name = "reinforced floor"
- icon_state = "engine"
- thermal_conductivity = 0.025
- heat_capacity = 325000
-
-/turf/simulated/floor/engine/cult
- name = "engraved floor"
- icon_state = "cult"
-
-
-/turf/simulated/floor/engine/n20
- New()
- ..()
- var/datum/gas_mixture/adding = new
- var/datum/gas/sleeping_agent/trace_gas = new
-
- trace_gas.moles = 2000
- adding.trace_gases += trace_gas
- adding.temperature = T20C
-
- assume_air(adding)
-
-/turf/simulated/floor/engine/vacuum
- name = "vacuum floor"
- icon_state = "engine"
- oxygen = 0
- nitrogen = 0.001
- temperature = TCMB
-
-/turf/simulated/floor/plating
- name = "plating"
- icon_state = "plating"
- floor_tile = null
- intact = 0
-
-/turf/simulated/floor/plating/airless
- icon_state = "plating"
- name = "airless plating"
- oxygen = 0.01
- nitrogen = 0.01
- temperature = TCMB
-
- New()
- ..()
- name = "plating"
-
-/turf/simulated/floor/grid
- icon = 'icons/turf/floors.dmi'
- icon_state = "circuit"
-
-/turf/simulated/floor/New()
- ..()
- if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
- icon_regular_floor = "floor"
- else
- icon_regular_floor = icon_state
-
-//turf/simulated/floor/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
-// if ((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
-// if (!( locate(/obj/machinery/mass_driver, src) ))
-// return 0
-// return ..()
-
-/turf/simulated/floor/ex_act(severity)
- //set src in oview(1)
- switch(severity)
- if(1.0)
- src.ReplaceWithSpace()
- if(2.0)
- switch(pick(1,2;75,3))
- if (1)
- src.ReplaceWithLattice()
- if(prob(33)) new /obj/item/stack/sheet/metal(src)
- if(2)
- src.ReplaceWithSpace()
- if(3)
- if(prob(80))
- src.break_tile_to_plating()
- else
- src.break_tile()
- src.hotspot_expose(1000,CELL_VOLUME)
- if(prob(33)) new /obj/item/stack/sheet/metal(src)
- if(3.0)
- if (prob(50))
- src.break_tile()
- src.hotspot_expose(1000,CELL_VOLUME)
- return
-
-/turf/simulated/floor/blob_act()
- return
-
-turf/simulated/floor/proc/update_icon()
- if(is_plasteel_floor())
- if(!broken && !burnt)
- icon_state = icon_regular_floor
- if(is_plating())
- if(!broken && !burnt)
- icon_state = icon_plating //Because asteroids are 'platings' too.
- if(is_light_floor())
- var/obj/item/stack/tile/light/T = floor_tile
- if(T.on)
- switch(T.state)
- if(0)
- icon_state = "light_on"
- sd_SetLuminosity(5)
- if(1)
- var/num = pick("1","2","3","4")
- icon_state = "light_on_flicker[num]"
- sd_SetLuminosity(5)
- if(2)
- icon_state = "light_on_broken"
- sd_SetLuminosity(5)
- if(3)
- icon_state = "light_off"
- sd_SetLuminosity(0)
- else
- sd_SetLuminosity(0)
- icon_state = "light_off"
- if(is_grass_floor())
- if(!broken && !burnt)
- if(!(icon_state in list("grass1","grass2","grass3","grass4")))
- icon_state = "grass[pick("1","2","3","4")]"
- spawn(1)
- if(istype(src,/turf/simulated/floor)) //Was throwing runtime errors due to a chance of it changing to space halfway through.
- if(air)
- update_visuals(air)
-
-turf/simulated/floor/return_siding_icon_state()
- ..()
- if(is_grass_floor())
- var/dir_sum = 0
- for(var/direction in cardinal)
- var/turf/T = get_step(src,direction)
- if(!(T.is_grass_floor()))
- dir_sum += direction
- if(dir_sum)
- return "wood_siding[dir_sum]"
- else
- return 0
-
-
-/turf/simulated/floor/attack_paw(mob/user as mob)
- return src.attack_hand(user)
-
-/turf/simulated/floor/attack_hand(mob/user as mob)
- if (is_light_floor())
- var/obj/item/stack/tile/light/T = floor_tile
- T.on = !T.on
- update_icon()
- if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
- return
- if (user.pulling.anchored)
- return
- if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
- return
- if (ismob(user.pulling))
- var/mob/M = user.pulling
- var/mob/t = M.pulling
- M.stop_pulling()
- step(user.pulling, get_dir(user.pulling.loc, src))
- M.start_pulling(t)
- else
- step(user.pulling, get_dir(user.pulling.loc, src))
- return
-
-/turf/simulated/floor/engine/attackby(obj/item/weapon/C as obj, mob/user as mob)
- if(!C)
- return
- if(!user)
- return
- if(istype(C, /obj/item/weapon/wrench))
- user << "\blue Removing rods..."
- playsound(src.loc, 'sound/items/Ratchet.ogg', 80, 1)
- if(do_after(user, 30))
- new /obj/item/stack/rods(src, 2)
- ReplaceWithFloor()
- var/turf/simulated/floor/F = src
- F.make_plating()
- return
-
-/turf/simulated/floor/proc/gets_drilled()
- return
-
-/turf/simulated/floor/proc/break_tile_to_plating()
- if(!is_plating())
- make_plating()
- break_tile()
-
-/turf/simulated/floor/is_plasteel_floor()
- if(istype(floor_tile,/obj/item/stack/tile/plasteel))
- return 1
- else
- return 0
-
-/turf/simulated/floor/is_light_floor()
- if(istype(floor_tile,/obj/item/stack/tile/light))
- return 1
- else
- return 0
-
-/turf/simulated/floor/is_grass_floor()
- if(istype(floor_tile,/obj/item/stack/tile/grass))
- return 1
- else
- return 0
-
-/turf/simulated/floor/is_plating()
- if(!floor_tile)
- return 1
- return 0
-
-/turf/simulated/floor/proc/break_tile()
- if(istype(src,/turf/simulated/floor/engine)) return
- if(istype(src,/turf/simulated/floor/mech_bay_recharge_floor))
- src.ReplaceWithPlating()
- if(broken) return
- if(is_plasteel_floor())
- src.icon_state = "damaged[pick(1,2,3,4,5)]"
- broken = 1
- else if(is_plasteel_floor())
- src.icon_state = "light_broken"
- broken = 1
- else if(is_plating())
- src.icon_state = "platingdmg[pick(1,2,3)]"
- broken = 1
- else if(is_grass_floor())
- src.icon_state = "sand[pick("1","2","3")]"
- broken = 1
-
-/turf/simulated/floor/proc/burn_tile()
- if(istype(src,/turf/simulated/floor/engine)) return
- if(broken || burnt) return
- if(is_plasteel_floor())
- src.icon_state = "damaged[pick(1,2,3,4,5)]"
- burnt = 1
- else if(is_plasteel_floor())
- src.icon_state = "floorscorched[pick(1,2)]"
- burnt = 1
- else if(is_plating())
- src.icon_state = "panelscorched"
- burnt = 1
- else if(is_grass_floor())
- src.icon_state = "sand[pick("1","2","3")]"
- burnt = 1
-
-//This proc will delete the floor_tile and the update_iocn() proc will then change the icon_state of the turf
-//This proc auto corrects the grass tiles' siding.
-/turf/simulated/floor/proc/make_plating()
- if(istype(src,/turf/simulated/floor/engine)) return
-
- if(is_grass_floor())
- for(var/direction in cardinal)
- if(istype(get_step(src,direction),/turf/simulated/floor))
- var/turf/simulated/floor/FF = get_step(src,direction)
- FF.update_icon() //so siding get updated properly
-
- if(!floor_tile) return
- del(floor_tile)
- icon_plating = "plating"
- sd_SetLuminosity(0)
- floor_tile = null
- intact = 0
- broken = 0
- burnt = 0
-
- update_icon()
- levelupdate()
-
-//This proc will make the turf a plasteel floor tile. The expected argument is the tile to make the turf with
-//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
-//this proc.
-/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/plasteel/T = null)
- broken = 0
- burnt = 0
- intact = 1
- sd_SetLuminosity(0)
- if(T)
- if(istype(T,/obj/item/stack/tile/plasteel))
- floor_tile = T
- if (icon_regular_floor)
- icon_state = icon_regular_floor
- else
- icon_state = "floor"
- icon_regular_floor = icon_state
- update_icon()
- levelupdate()
- return
- //if you gave a valid parameter, it won't get thisf ar.
- floor_tile = new/obj/item/stack/tile/plasteel
- icon_state = "floor"
- icon_regular_floor = icon_state
-
- update_icon()
- levelupdate()
-
-//This proc will make the turf a light floor tile. The expected argument is the tile to make the turf with
-//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
-//this proc.
-/turf/simulated/floor/proc/make_light_floor(var/obj/item/stack/tile/light/T = null)
- broken = 0
- burnt = 0
- intact = 1
- if(T)
- if(istype(T,/obj/item/stack/tile/light))
- floor_tile = T
- update_icon()
- levelupdate()
- return
- //if you gave a valid parameter, it won't get thisf ar.
- floor_tile = new/obj/item/stack/tile/light
-
- update_icon()
- levelupdate()
-
-//This proc will make a turf into a grass patch. Fun eh? Insert the grass tile to be used as the argument
-//If no argument is given a new one will be made.
-/turf/simulated/floor/proc/make_grass_floor(var/obj/item/stack/tile/grass/T = null)
- broken = 0
- burnt = 0
- intact = 1
- if(T)
- if(istype(T,/obj/item/stack/tile/grass))
- floor_tile = T
- update_icon()
- levelupdate()
- return
- //if you gave a valid parameter, it won't get thisf ar.
- floor_tile = new/obj/item/stack/tile/grass
-
- update_icon()
- levelupdate()
-
-/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob)
-
- if(!C || !user)
- return 0
-
- if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles
- if(is_light_floor())
- var/obj/item/stack/tile/light/T = floor_tile
- if(T.state)
- user.unEquip(C)
- del(C)
- T.state = C //fixing it by bashing it with a light bulb, fun eh?
- update_icon()
- user << "\blue You replace the light bulb."
- else
- user << "\blue The lightbulb seems fine, no need to replace it."
-
- if(istype(C, /obj/item/weapon/crowbar) && (!(is_plating())))
- if(broken || burnt)
- user << "\red You remove the broken plating."
- else
- user << "\red You remove the [floor_tile.name]."
- new floor_tile.type(src)
-
- make_plating()
- playsound(src.loc, 'sound/items/Crowbar.ogg', 80, 1)
-
- return
-
- if(istype(C, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = C
- if (is_plating())
- if (R.amount >= 2)
- user << "\blue Reinforcing the floor..."
- if(do_after(user, 30) && R && R.amount >= 2 && is_plating())
- ReplaceWithEngineFloor()
- playsound(src.loc, 'sound/items/Deconstruct.ogg', 80, 1)
- R.use(2)
- return
- else
- user << "\red You need more rods."
- else
- user << "\red You must remove the plating first."
- return
-
- if(istype(C, /obj/item/stack/tile))
- if(is_plating())
- if(!broken && !burnt)
- var/obj/item/stack/tile/T = C
- floor_tile = new T.type
- intact = 1
- if(istype(T,/obj/item/stack/tile/light))
- var/obj/item/stack/tile/light/L = T
- var/obj/item/stack/tile/light/F = floor_tile
- F.state = L.state
- F.on = L.on
- if(istype(T,/obj/item/stack/tile/grass))
- for(var/direction in cardinal)
- if(istype(get_step(src,direction),/turf/simulated/floor))
- var/turf/simulated/floor/FF = get_step(src,direction)
- FF.update_icon() //so siding gets updated properly
- T.use(1)
- update_icon()
- levelupdate()
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
- else
- user << "\blue This section is too damaged to support a tile. Use a welder to fix the damage."
-
-
- if(istype(C, /obj/item/stack/cable_coil))
- if(is_plating())
- var/obj/item/stack/cable_coil/coil = C
- coil.turf_place(src, user)
- else
- user << "\red You must remove the plating first."
-
- if(istype(C, /obj/item/weapon/shovel))
- if(is_grass_floor())
- new /obj/item/weapon/ore/glass(src)
- new /obj/item/weapon/ore/glass(src) //Make some sand if you shovel grass
- user << "\blue You shovel the grass."
- make_plating()
- else
- user << "\red You cannot shovel this."
-
- if(istype(C, /obj/item/weapon/weldingtool))
- var/obj/item/weapon/weldingtool/welder = C
- if(welder.welding && (is_plating()))
- if(broken || burnt)
- if(welder.remove_fuel(0,user))
- user << "\red You fix some dents on the broken plating."
- playsound(src.loc, 'sound/items/Welder.ogg', 80, 1)
- icon_state = "plating"
- burnt = 0
- broken = 0
- else
- user << "\blue You need more welding fuel to complete this task."
-
-/turf/unsimulated/floor/attack_paw(user as mob)
- return src.attack_hand(user)
-
-/turf/unsimulated/floor/attack_hand(var/mob/user as mob)
- if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
- return
- if (user.pulling.anchored)
- return
- if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
- return
- if (ismob(user.pulling))
- var/mob/M = user.pulling
- var/mob/t = M.pulling
- M.stop_pulling()
- step(user.pulling, get_dir(user.pulling.loc, src))
- M.start_pulling(t)
- else
- step(user.pulling, get_dir(user.pulling.loc, src))
- return
-
-// imported from space.dm
-
-/turf/space/attack_paw(mob/user as mob)
- return src.attack_hand(user)
-
-/turf/space/attack_hand(mob/user as mob)
- if ((user.restrained() || !( user.pulling )))
- return
- if (user.pulling.anchored)
- return
- if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
- return
- if (ismob(user.pulling))
- var/mob/M = user.pulling
- var/atom/movable/t = M.pulling
- M.stop_pulling()
- step(user.pulling, get_dir(user.pulling.loc, src))
- M.start_pulling(t)
- else
- step(user.pulling, get_dir(user.pulling.loc, src))
- return
-
-/turf/space/attackby(obj/item/C as obj, mob/user as mob)
-
- if (istype(C, /obj/item/stack/rods))
- var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
- if(L)
- return
- var/obj/item/stack/rods/R = C
- user << "\blue Constructing support lattice ..."
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
- ReplaceWithLattice()
- R.use(1)
- return
-
- if (istype(C, /obj/item/stack/tile/plasteel))
- var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
- if(L)
- var/obj/item/stack/tile/plasteel/S = C
- del(L)
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
- S.build(src)
- S.use(1)
- return
- else
- user << "\red The plating is going to need some support."
- return
-
-
-// Ported from unstable r355
-
-/turf/space/Entered(atom/movable/A as mob|obj)
- ..()
- if ((!(A) || src != A.loc || istype(null, /obj/effect/beam))) return
-
- inertial_drift(A)
-
- if(ticker && ticker.mode)
-
- // Okay, so let's make it so that people can travel z levels but not nuke disks!
- // if(ticker.mode.name == "nuclear emergency") return
-
- if(ticker.mode.name == "extended"||ticker.mode.name == "sandbox")
- Sandbox_Spacemove(A)
-
- else
- if (src.x <= 2 || A.x >= (world.maxx - 1) || src.y <= 2 || A.y >= (world.maxy - 1))
- if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
- return
-
- if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
- return
-
- if(!isemptylist(A.search_contents_for(/obj/item/weapon/disk/nuclear)))
- if(istype(A, /mob/living))
- var/mob/living/MM = A
- if(MM.client)
- MM << "\red Something you are carrying is preventing you from leaving. Don't play stupid; you know exactly what it is."
- return
-
-
-
- var/move_to_z_str = pickweight(accessable_z_levels)
-
- var/move_to_z = text2num(move_to_z_str)
-
- if(!move_to_z)
- return
-
-
-
- A.z = move_to_z
-
-
- if(src.x <= 2)
- A.x = world.maxx - 2
-
- else if (A.x >= (world.maxx - 1))
- A.x = 3
-
- else if (src.y <= 2)
- A.y = world.maxy - 2
-
- else if (A.y >= (world.maxy - 1))
- A.y = 3
-
- spawn (0)
- if ((A && A.loc))
- A.loc.Entered(A)
-
-// if(istype(A, /obj/structure/closet/coffin))
-// coffinhandler.Add(A)
-
-/turf/space/proc/Sandbox_Spacemove(atom/movable/A as mob|obj)
- var/cur_x
- var/cur_y
- var/next_x
- var/next_y
- var/target_z
- var/list/y_arr
-
- if(src.x <= 1)
- if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
- return
-
- var/list/cur_pos = src.get_global_map_pos()
- if(!cur_pos) return
- cur_x = cur_pos["x"]
- cur_y = cur_pos["y"]
- next_x = (--cur_x||global_map.len)
- y_arr = global_map[next_x]
- target_z = y_arr[cur_y]
-/*
- //debug
- world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
- world << "Target Z = [target_z]"
- world << "Next X = [next_x]"
- //debug
-*/
- if(target_z)
- A.z = target_z
- A.x = world.maxx - 2
- spawn (0)
- if ((A && A.loc))
- A.loc.Entered(A)
- else if (src.x >= world.maxx)
- if(istype(A, /obj/effect/meteor))
- del(A)
- return
-
- var/list/cur_pos = src.get_global_map_pos()
- if(!cur_pos) return
- cur_x = cur_pos["x"]
- cur_y = cur_pos["y"]
- next_x = (++cur_x > global_map.len ? 1 : cur_x)
- y_arr = global_map[next_x]
- target_z = y_arr[cur_y]
-/*
- //debug
- world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
- world << "Target Z = [target_z]"
- world << "Next X = [next_x]"
- //debug
-*/
- if(target_z)
- A.z = target_z
- A.x = 3
- spawn (0)
- if ((A && A.loc))
- A.loc.Entered(A)
- else if (src.y <= 1)
- if(istype(A, /obj/effect/meteor))
- del(A)
- return
- var/list/cur_pos = src.get_global_map_pos()
- if(!cur_pos) return
- cur_x = cur_pos["x"]
- cur_y = cur_pos["y"]
- y_arr = global_map[cur_x]
- next_y = (--cur_y||y_arr.len)
- target_z = y_arr[next_y]
-/*
- //debug
- world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
- world << "Next Y = [next_y]"
- world << "Target Z = [target_z]"
- //debug
-*/
- if(target_z)
- A.z = target_z
- A.y = world.maxy - 2
- spawn (0)
- if ((A && A.loc))
- A.loc.Entered(A)
-
- else if (src.y >= world.maxy)
- if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
- return
- var/list/cur_pos = src.get_global_map_pos()
- if(!cur_pos) return
- cur_x = cur_pos["x"]
- cur_y = cur_pos["y"]
- y_arr = global_map[cur_x]
- next_y = (++cur_y > y_arr.len ? 1 : cur_y)
- target_z = y_arr[next_y]
-/*
- //debug
- world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
- world << "Next Y = [next_y]"
- world << "Target Z = [target_z]"
- //debug
-*/
- if(target_z)
- A.z = target_z
- A.y = 3
- spawn (0)
- if ((A && A.loc))
- A.loc.Entered(A)
- return
-
-/obj/effect/vaultspawner
- var/maxX = 6
- var/maxY = 6
- var/minX = 2
- var/minY = 2
-
-/obj/effect/vaultspawner/New(turf/location as turf,lX = minX,uX = maxX,lY = minY,uY = maxY,var/type = null)
- if(!type)
- type = pick("sandstone","rock","alien")
-
- var/lowBoundX = location.x
- var/lowBoundY = location.y
-
- var/hiBoundX = location.x + rand(lX,uX)
- var/hiBoundY = location.y + rand(lY,uY)
-
- var/z = location.z
-
- for(var/i = lowBoundX,i<=hiBoundX,i++)
- for(var/j = lowBoundY,j<=hiBoundY,j++)
- if(i == lowBoundX || i == hiBoundX || j == lowBoundY || j == hiBoundY)
- new /turf/simulated/wall/vault(locate(i,j,z),type)
- else
- new /turf/simulated/floor/vault(locate(i,j,z),type)
-
- del(src)
-
-/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
-//Useful to batch-add creatures to the list.
- for(var/mob/living/M in src)
- if(M==U) continue//Will not harm U. Since null != M, can be excluded to kill everyone.
- spawn(0)
- M.gib()
- for(var/obj/mecha/M in src)//Mecha are not gibbed but are damaged.
- spawn(0)
- M.take_damage(100, "brute")
- for(var/obj/effect/critter/M in src)
- spawn(0)
- M.Die()
-
-/turf/proc/Bless()
- if(flags & NOJAUNT)
- return
- flags |= NOJAUNT
+/*
+/obj/vehicle/airtight
+ //inner atmos
+ var/use_internal_tank = 0
+ var/internal_tank_valve = ONE_ATMOSPHERE
+ var/obj/machinery/portable_atmospherics/canister/internal_tank
+ var/datum/gas_mixture/cabin_air
+ var/obj/machinery/atmospherics/portables_connector/connected_port = null
+
+ var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
+ var/datum/global_iterator/pr_give_air //moves air from tank to cabin
+
+
+/obj/vehicle/airtight/New()
+ ..()
+ src.add_airtank()
+ src.add_cabin()
+ src.add_airtight_iterators()
+
+
+
+
+//######################################### Helpers for airtight vehicles #########################################
+
+/obj/vehicle/airtight/proc/add_cabin()
+ cabin_air = new
+ cabin_air.temperature = T20C
+ cabin_air.volume = 200
+ cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ return cabin_air
+
+/obj/vehicle/airtight/proc/add_airtank()
+ internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
+ return internal_tank
+
+/obj/vehicle/airtight/proc/add_airtight_iterators()
+ pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src))
+ pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src))
+
+
+//######################################### Specific datums for airtight vehicles #################################
+
+
+/datum/global_iterator/vehicle_preserve_temp //normalizing cabin air temperature to 20 degrees celsium
+ delay = 20
+
+ process(var/obj/vehicle/airtight/V)
+ if(V.cabin_air && V.cabin_air.return_volume() > 0)
+ var/delta = V.cabin_air.temperature - T20C
+ V.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
+ return
+
+
+/datum/global_iterator/vehicle_tank_give_air
+ delay = 15
+
+ process(var/obj/vehicle/airtight/V)
+ if(V.internal_tank)
+ var/datum/gas_mixture/tank_air = V.internal_tank.return_air()
+ var/datum/gas_mixture/cabin_air = V.cabin_air
+
+ var/release_pressure = V.internal_tank_valve
+ var/cabin_pressure = cabin_air.return_pressure()
+ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
+ var/transfer_moles = 0
+ if(pressure_delta > 0) //cabin pressure lower than release pressure
+ if(tank_air.return_temperature() > 0)
+ transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
+ var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
+ cabin_air.merge(removed)
+ else if(pressure_delta < 0) //cabin pressure higher than release pressure
+ var/datum/gas_mixture/t_air = V.get_turf_air()
+ pressure_delta = cabin_pressure - release_pressure
+ if(t_air)
+ pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
+ if(pressure_delta > 0) //if location pressure is lower than cabin pressure
+ transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
+ var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
+ if(t_air)
+ t_air.merge(removed)
+ else //just delete the cabin gas, we're in space or some shit
+ del(removed)
+ else
+ return stop()
+ return
+
+
+//######################################### Atmospherics for vehicles #############################################
+
+
+/obj/vehicle/proc/get_turf_air()
+ var/turf/T = get_turf(src)
+ if(T)
+ . = T.return_air()
+ return
+
+/obj/vehicle/airtight/remove_air(amount)
+ if(use_internal_tank)
+ return cabin_air.remove(amount)
+ else
+ var/turf/T = get_turf(src)
+ if(T)
+ return T.remove_air(amount)
+ return
+
+/obj/vehicle/airtight/return_air()
+ if(use_internal_tank)
+ return cabin_air
+ return get_turf_air()
+
+/obj/vehicle/airtight/proc/return_pressure()
+ . = 0
+ if(use_internal_tank)
+ . = cabin_air.return_pressure()
+ else
+ var/datum/gas_mixture/t_air = get_turf_air()
+ if(t_air)
+ . = t_air.return_pressure()
+ return
+
+
+/obj/vehicle/airtight/proc/return_temperature()
+ . = 0
+ if(use_internal_tank)
+ . = cabin_air.return_temperature()
+ else
+ var/datum/gas_mixture/t_air = get_turf_air()
+ if(t_air)
+ . = t_air.return_temperature()
+ return
+
+/obj/vehicle/airtight/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
+ //Make sure not already connected to something else
+ if(connected_port || !new_port || new_port.connected_device)
+ return 0
+
+ //Make sure are close enough for a valid connection
+ if(new_port.loc != src.loc)
+ return 0
+
+ //Perform the connection
+ connected_port = new_port
+ connected_port.connected_device = src
+
+ //Actually enforce the air sharing
+ var/datum/pipe_network/network = connected_port.return_network(src)
+ if(network && !(internal_tank.return_air() in network.gases))
+ network.gases += internal_tank.return_air()
+ network.update = 1
+ log_message("Vehicle airtank connected to external port.")
+ return 1
+
+/obj/vehicle/airtight/proc/disconnect()
+ if(!connected_port)
+ return 0
+
+ var/datum/pipe_network/network = connected_port.return_network(src)
+ if(network)
+ network.gases -= internal_tank.return_air()
+
+ connected_port.connected_device = null
+ connected_port = null
+ src.log_message("Vehicle airtank disconnected from external port.")
+ return 1
+
+
+
+
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+
+
+
+/obj/vehicle
+ name = "Vehicle"
+ icon = 'icons/vehicles/vehicles.dmi'
+ density = 1
+ anchored = 1
+ unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
+ layer = MOB_LAYER
+ //var/can_move = 1
+ var/mob/living/carbon/occupant = null
+ //var/step_in = 10 //make a step in step_in/10 sec.
+ //var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
+ //var/step_energy_drain = 10
+ var/health = 300 //health is health
+ //var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
+ //the values in this list show how much damage will pass through, not how much will be absorbed.
+ var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
+ var/obj/item/weapon/stock_parts/cell/cell //Our power source
+ var/state = 0
+ var/list/log = new
+ var/last_message = 0
+ var/add_req_access = 1
+ var/maint_access = 1
+ //var/dna //dna-locking the mech
+ var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
+ var/datum/effect/effect/system/spark_spread/spark_system = new
+ var/lights = 0
+ var/lights_power = 6
+
+ //inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
+ //var/use_internal_tank = 0
+ //var/internal_tank_valve = ONE_ATMOSPHERE
+ //var/obj/machinery/portable_atmospherics/canister/internal_tank
+ //var/datum/gas_mixture/cabin_air
+ //var/obj/machinery/atmospherics/portables_connector/connected_port = null
+
+ var/obj/item/device/radio/radio = null
+
+ var/max_temperature = 2500
+ //var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
+ var/internal_damage = 0 //contains bitflags
+
+ var/list/operation_req_access = list()//required access level for mecha operation
+ var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
+
+ //var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
+ var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
+
+ //var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
+
+ var/datum/global_iterator/pr_internal_damage //processes internal damage
+
+
+ var/wreckage
+
+ var/list/equipment = new
+ var/obj/selected
+ //var/max_equip = 3
+
+ var/datum/events/events
+
+
+
+/obj/vehicle/New()
+ ..()
+ events = new
+ icon_state += "-unmanned"
+ add_radio()
+ //add_cabin() //No cabin for non-airtights
+
+ spark_system.set_up(2, 0, src)
+ spark_system.attach(src)
+ add_cell()
+ add_iterators()
+ removeVerb(/obj/mecha/verb/disconnect_from_port)
+ removeVerb(/atom/movable/verb/pull)
+ log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
+ loc.Entered(src)
+ return
+
+
+//################ Helpers ###########################################################
+
+
+/obj/vehicle/proc/removeVerb(verb_path)
+ verbs -= verb_path
+
+/obj/vehicle/proc/addVerb(verb_path)
+ verbs += verb_path
+
+/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
+ internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
+ return internal_tank*/
+
+/obj/vehicle/proc/add_cell(var/obj/item/weapon/stock_parts/cell/C=null)
+ if(C)
+ C.forceMove(src)
+ cell = C
+ return
+ cell = new(src)
+ cell.charge = 15000
+ cell.maxcharge = 15000
+
+/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
+ cabin_air = new
+ cabin_air.temperature = T20C
+ cabin_air.volume = 200
+ cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ return cabin_air*/
+
+/obj/vehicle/proc/add_radio()
+ radio = new(src)
+ radio.name = "[src] radio"
+ radio.icon = icon
+ radio.icon_state = icon_state
+ radio.subspace_transmission = 1
+
+/obj/vehicle/proc/add_iterators()
+ pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
+ //pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
+ //pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
+ //pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
+
+/obj/vehicle/proc/check_for_support()
+ if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
+ return 1
+ else
+ return 0
+
+//################ Logs and messages ############################################
+
+
+/obj/vehicle/proc/log_message(message as text,red=null)
+ log.len++
+ log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]")
+ return log.len
+
+
+
+//################ Global Iterator Datums ######################################
+
+
+/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
+ delay = 7
+
+ process(var/obj/vehicle/V as obj, direction)
+ if(direction)
+ if(!step(V, direction)||V.check_for_support())
+ src.stop()
+ else
+ src.stop()
+ return
+
+
+/datum/global_iterator/mecha_internal_damage // processing internal damage
+
+ process(var/obj/mecha/mecha)
+ if(!mecha.hasInternalDamage())
+ return stop()
+ if(mecha.hasInternalDamage(MECHA_INT_FIRE))
+ if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
+ mecha.clearInternalDamage(MECHA_INT_FIRE)
+ if(mecha.internal_tank)
+ if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
+ mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
+ int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
+ if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
+ mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
+ if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
+ mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
+ if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
+ mecha.pr_int_temp_processor.stop()
+ if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
+ if(mecha.internal_tank)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
+ if(mecha.loc && hascall(mecha.loc,"assume_air"))
+ mecha.loc.assume_air(leaked_gas)
+ else
+ del(leaked_gas)
+ if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
+ if(mecha.get_charge())
+ mecha.spark_system.start()
+ mecha.cell.charge -= min(20,mecha.cell.charge)
+ mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
+ return
+
+
+*/
+
+
+
+
+
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+
+
+
+
+/*/turf/DblClick()
+ if(istype(usr, /mob/living/silicon/ai))
+ return move_camera_by_click()
+ if(usr.stat || usr.restrained() || usr.lying)
+ return ..()
+
+ if(usr.hand && istype(usr.l_hand, /obj/item/weapon/flamethrower))
+ var/turflist = getline(usr,src)
+ var/obj/item/weapon/flamethrower/F = usr.l_hand
+ F.flame_turf(turflist)
+ else if(!usr.hand && istype(usr.r_hand, /obj/item/weapon/flamethrower))
+ var/turflist = getline(usr,src)
+ var/obj/item/weapon/flamethrower/F = usr.r_hand
+ F.flame_turf(turflist)
+
+ return ..()
+
+/turf/New()
+ ..()
+ for(var/atom/movable/AM as mob|obj in src)
+ spawn( 0 )
+ src.Entered(AM)
+ return
+ return
+
+/turf/ex_act(severity)
+ return 0
+
+
+/turf/bullet_act(var/obj/item/projectile/Proj)
+ if(istype(Proj ,/obj/item/projectile/beam/pulse))
+ src.ex_act(2)
+ ..()
+ return 0
+
+/turf/bullet_act(var/obj/item/projectile/Proj)
+ if(istype(Proj ,/obj/item/projectile/bullet/gyro))
+ explosion(src, -1, 0, 2)
+ ..()
+ return 0
+
+/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
+ if (!mover || !isturf(mover.loc))
+ return 1
+
+
+ //First, check objects to block exit that are not on the border
+ for(var/obj/obstacle in mover.loc)
+ if((obstacle.flags & ~ON_BORDER) && (mover != obstacle) && (forget != obstacle))
+ if(!obstacle.CheckExit(mover, src))
+ mover.Bump(obstacle, 1)
+ return 0
+
+ //Now, check objects to block exit that are on the border
+ for(var/obj/border_obstacle in mover.loc)
+ if((border_obstacle.flags & ON_BORDER) && (mover != border_obstacle) && (forget != border_obstacle))
+ if(!border_obstacle.CheckExit(mover, src))
+ mover.Bump(border_obstacle, 1)
+ return 0
+
+ //Next, check objects to block entry that are on the border
+ for(var/obj/border_obstacle in src)
+ if(border_obstacle.flags & ON_BORDER)
+ if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle))
+ mover.Bump(border_obstacle, 1)
+ return 0
+
+ //Then, check the turf itself
+ if (!src.CanPass(mover, src))
+ mover.Bump(src, 1)
+ return 0
+
+ //Finally, check objects/mobs to block entry that are not on the border
+ for(var/atom/movable/obstacle in src)
+ if(obstacle.flags & ~ON_BORDER)
+ if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle))
+ mover.Bump(obstacle, 1)
+ return 0
+ return 1 //Nothing found to block so return success!
+
+
+/turf/Entered(atom/movable/M as mob|obj)
+ var/loopsanity = 100
+ if(ismob(M))
+ if(!M:lastarea)
+ M:lastarea = get_area(M.loc)
+ if(M:lastarea.has_gravity == 0)
+ inertial_drift(M)
+
+ /*
+ if(M.flags & NOGRAV)
+ inertial_drift(M)
+ */
+
+
+
+ else if(!istype(src, /turf/space))
+ M:inertia_dir = 0
+ ..()
+ var/objects = 0
+ for(var/atom/A as mob|obj|turf|area in src)
+ if(objects > loopsanity) break
+ objects++
+ spawn( 0 )
+ if ((A && M))
+ A.HasEntered(M, 1)
+ return
+ objects = 0
+ for(var/atom/A as mob|obj|turf|area in range(1))
+ if(objects > loopsanity) break
+ objects++
+ spawn( 0 )
+ if ((A && M))
+ A.HasProximity(M, 1)
+ return
+ return
+
+/turf/proc/inertial_drift(atom/movable/A as mob|obj)
+ if(!(A.last_move)) return
+ if((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1)))
+ var/mob/M = A
+ if(M.Process_Spacemove(1))
+ M.inertia_dir = 0
+ return
+ spawn(5)
+ if((M && !(M.anchored) && (M.loc == src)))
+ if(M.inertia_dir)
+ step(M, M.inertia_dir)
+ return
+ M.inertia_dir = M.last_move
+ step(M, M.inertia_dir)
+ return
+
+/turf/proc/levelupdate()
+ for(var/obj/O in src)
+ if(O.level == 1)
+ O.hide(src.intact)
+
+// override for space turfs, since they should never hide anything
+/turf/space/levelupdate()
+ for(var/obj/O in src)
+ if(O.level == 1)
+ O.hide(0)
+
+// Removes all signs of lattice on the pos of the turf -Donkieyo
+/turf/proc/RemoveLattice()
+ var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
+ if(L)
+ del L
+
+/turf/proc/ReplaceWithFloor(explode=0)
+ var/prior_icon = icon_old
+ var/old_dir = dir
+
+ var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) )
+
+ W.RemoveLattice()
+ W.dir = old_dir
+ if(prior_icon) W.icon_state = prior_icon
+ else W.icon_state = "floor"
+
+ if (!explode)
+ W.opacity = 1
+ W.sd_SetOpacity(0)
+ //This is probably gonna make lighting go a bit wonky in bombed areas, but sd_SetOpacity was the primary reason bombs have been so laggy. --NEO
+ W.levelupdate()
+ return W
+
+/turf/proc/ReplaceWithPlating()
+ var/prior_icon = icon_old
+ var/old_dir = dir
+
+ var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) )
+
+ W.RemoveLattice()
+ W.dir = old_dir
+ if(prior_icon) W.icon_state = prior_icon
+ else W.icon_state = "plating"
+ W.opacity = 1
+ W.sd_SetOpacity(0)
+ W.levelupdate()
+ return W
+
+/turf/proc/ReplaceWithEngineFloor()
+ var/old_dir = dir
+
+ var/turf/simulated/floor/engine/E = new /turf/simulated/floor/engine( locate(src.x, src.y, src.z) )
+
+ E.dir = old_dir
+ E.icon_state = "engine"
+
+/turf/simulated/Entered(atom/A, atom/OL)
+ if (istype(A,/mob/living/carbon))
+ var/mob/living/carbon/M = A
+ if(M.lying) return
+ if(istype(M, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = M
+ if(istype(H.shoes, /obj/item/clothing/shoes/clown_shoes))
+ if(H.m_intent == "run")
+ if(H.footstep >= 2)
+ H.footstep = 0
+ else
+ H.footstep++
+ if(H.footstep == 0)
+ playsound(src, "clownstep", 50, 1) // this will get annoying very fast.
+ else
+ playsound(src, "clownstep", 20, 1)
+
+ switch (src.wet)
+ if(1)
+ if(istype(M, /mob/living/carbon/human)) // Added check since monkeys don't have shoes
+ if ((M.m_intent == "run") && !(istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP))
+ M.stop_pulling()
+ step(M, M.dir)
+ M << "\blue You slipped on the wet floor!"
+ playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
+ M.Stun(8)
+ M.Weaken(5)
+ else
+ M.inertia_dir = 0
+ return
+ else if(!istype(M, /mob/living/carbon/slime))
+ if (M.m_intent == "run")
+ M.stop_pulling()
+ step(M, M.dir)
+ M << "\blue You slipped on the wet floor!"
+ playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
+ M.Stun(8)
+ M.Weaken(5)
+ else
+ M.inertia_dir = 0
+ return
+
+ if(2) //lube
+ if(!istype(M, /mob/living/carbon/slime))
+ M.stop_pulling()
+ step(M, M.dir)
+ spawn(1) step(M, M.dir)
+ spawn(2) step(M, M.dir)
+ spawn(3) step(M, M.dir)
+ spawn(4) step(M, M.dir)
+ M.take_organ_damage(2)
+ M << "\blue You slipped on the floor!"
+ playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
+ M.Weaken(10)
+
+ ..()
+
+/turf/proc/ReplaceWithSpace()
+ var/old_dir = dir
+ var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
+ S.dir = old_dir
+ return S
+
+/turf/proc/ReplaceWithLattice()
+ var/old_dir = dir
+ var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
+ S.dir = old_dir
+ new /obj/structure/lattice( locate(src.x, src.y, src.z) )
+ return S
+
+/turf/proc/ReplaceWithWall()
+ var/old_icon = icon_state
+ var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) )
+ S.icon_old = old_icon
+ S.opacity = 0
+ S.sd_NewOpacity(1)
+ return S
+
+/turf/proc/ReplaceWithRWall()
+ var/old_icon = icon_state
+ var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) )
+ S.icon_old = old_icon
+ S.opacity = 0
+ S.sd_NewOpacity(1)
+ return S
+
+/turf/simulated/wall/New()
+ ..()
+
+/turf/simulated/wall/proc/dismantle_wall(devastated=0, explode=0)
+ if(istype(src,/turf/simulated/wall/r_wall))
+ if(!devastated)
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ new /obj/structure/girder/reinforced(src)
+ new /obj/item/stack/sheet/plasteel( src )
+ else
+ new /obj/item/stack/sheet/metal( src )
+ new /obj/item/stack/sheet/metal( src )
+ new /obj/item/stack/sheet/plasteel( src )
+ else if(istype(src,/turf/simulated/wall/cult))
+ if(!devastated)
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ new /obj/effect/decal/remains/human(src)
+ else
+ new /obj/effect/decal/remains/human(src)
+
+ else
+ if(!devastated)
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ new /obj/structure/girder(src)
+ new /obj/item/stack/sheet/metal( src )
+ new /obj/item/stack/sheet/metal( src )
+ else
+ new /obj/item/stack/sheet/metal( src )
+ new /obj/item/stack/sheet/metal( src )
+ new /obj/item/stack/sheet/metal( src )
+
+ ReplaceWithPlating(explode)
+
+/turf/simulated/wall/examine()
+ set src in oview(1)
+
+ usr << "It looks like a regular wall."
+ return
+
+/turf/simulated/wall/ex_act(severity)
+ switch(severity)
+ if(1.0)
+ //SN src = null
+ src.ReplaceWithSpace()
+ del(src)
+ return
+ if(2.0)
+ if (prob(50))
+ dismantle_wall(0,1)
+ else
+ dismantle_wall(1,1)
+ if(3.0)
+ var/proba
+ if (istype(src, /turf/simulated/wall/r_wall))
+ proba = 15
+ else
+ proba = 40
+ if (prob(proba))
+ dismantle_wall(0,1)
+ else
+ return
+
+/turf/simulated/wall/blob_act()
+ if(prob(50))
+ dismantle_wall()
+
+/turf/simulated/wall/attack_paw(mob/user as mob)
+ if ((user.mutations & HULK))
+ if (prob(40))
+ usr << text("\blue You smash through the wall.")
+ dismantle_wall(1)
+ return
+ else
+ usr << text("\blue You punch the wall.")
+ return
+
+ return src.attack_hand(user)
+
+
+/turf/simulated/wall/attack_animal(mob/living/simple_animal/M as mob)
+ if(M.wall_smash)
+ if (istype(src, /turf/simulated/wall/r_wall))
+ M << text("\blue This wall is far too strong for you to destroy.")
+ return
+ else
+ if (prob(40))
+ M << text("\blue You smash through the wall.")
+ dismantle_wall(1)
+ return
+ else
+ M << text("\blue You smash against the wall.")
+ return
+
+ M << "\blue You push the wall but nothing happens!"
+ return
+
+/turf/simulated/wall/attack_hand(mob/user as mob)
+ if ((user.mutations & HULK))
+ if (prob(40))
+ usr << text("\blue You smash through the wall.")
+ dismantle_wall(1)
+ return
+ else
+ usr << text("\blue You punch the wall.")
+ return
+
+ user << "\blue You push the wall but nothing happens!"
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 25, 1)
+ src.add_fingerprint(user)
+ return
+
+/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
+
+ if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
+ usr << "\red You don't have the dexterity to do this!"
+ return
+
+ if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
+ var/turf/T = get_turf(user)
+ if (!( istype(T, /turf) ))
+ return
+
+ if (thermite)
+ var/obj/effect/overlay/O = new/obj/effect/overlay( src )
+ O.name = "Thermite"
+ O.desc = "Looks hot."
+ O.icon = 'icons/effects/fire.dmi'
+ O.icon_state = "2"
+ O.anchored = 1
+ O.density = 1
+ O.layer = 5
+ var/turf/simulated/floor/F = ReplaceWithPlating()
+ F.burn_tile()
+ F.icon_state = "wall_thermite"
+ user << "\red The thermite melts the wall."
+ spawn(100) del(O)
+ F.sd_LumReset()
+ return
+
+ if (W:remove_fuel(0,user))
+ W:welding = 2
+ user << "\blue Now disassembling the outer wall plating."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(100)
+ if (W && istype(src, /turf/simulated/wall))
+ if ((get_turf(user) == T && user.equipped() == W))
+ user << "\blue You disassembled the outer wall plating."
+ dismantle_wall()
+ W:welding = 1
+ else
+ user << "\blue You need more welding fuel to complete this task."
+ return
+
+ else if (istype(W, /obj/item/weapon/pickaxe/plasmacutter))
+ var/turf/T = user.loc
+ if (!( istype(T, /turf) ))
+ return
+
+ if (thermite)
+ var/obj/effect/overlay/O = new/obj/effect/overlay( src )
+ O.name = "Thermite"
+ O.desc = "Looks hot."
+ O.icon = 'icons/effects/fire.dmi'
+ O.icon_state = "2"
+ O.anchored = 1
+ O.density = 1
+ O.layer = 5
+ var/turf/simulated/floor/F = ReplaceWithPlating()
+ F.burn_tile()
+ F.icon_state = "wall_thermite"
+ user << "\red The thermite melts the wall."
+ spawn(100) del(O)
+ F.sd_LumReset()
+ return
+
+ else
+ user << "\blue Now disassembling the outer wall plating."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(60)
+ if (W && istype(src, /turf/simulated/wall))
+ if ((get_turf(user) == T && user.equipped() == W))
+ user << "\blue You disassembled the outer wall plating."
+ dismantle_wall()
+ for(var/mob/O in viewers(user, 5))
+ O.show_message(text("\blue The wall was sliced apart by []!", user), 1, text("\red You hear metal being sliced apart."), 2)
+ return
+
+ else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
+ var/turf/T = user.loc
+ user << "\blue Now drilling through wall."
+ sleep(60)
+ if (W && istype(src, /turf/simulated/wall))
+ if ((user.loc == T && user.equipped() == W))
+ dismantle_wall(1)
+ for(var/mob/O in viewers(user, 5))
+ O.show_message(text("\blue The wall was drilled apart by []!", user), 1, text("\red You hear metal being drilled appart."), 2)
+ return
+
+ else if(istype(W, /obj/item/weapon/melee/energy/blade))
+ var/turf/T = user.loc
+ user << "\blue Now slicing through wall."
+ W:spark_system.start()
+ playsound(src.loc, "sparks", 50, 1)
+ sleep(70)
+ if (W && istype(src, /turf/simulated/wall))
+ if ((user.loc == T && user.equipped() == W))
+ W:spark_system.start()
+ playsound(src.loc, "sparks", 50, 1)
+ playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
+ dismantle_wall(1)
+ for(var/mob/O in viewers(user, 5))
+ O.show_message(text("\blue The wall was sliced apart by []!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2)
+ return
+
+ else if(istype(W,/obj/item/apc_frame))
+ var/obj/item/apc_frame/AH = W
+ AH.try_build(src)
+ else if(istype(W,/obj/item/weapon/contraband/poster))
+ var/obj/item/weapon/contraband/poster/P = W
+ if(P.resulting_poster)
+ var/check = 0
+ var/stuff_on_wall = 0
+ for( var/obj/O in src.contents) //Let's see if it already has a poster on it or too much stuff
+ if(istype(O,/obj/effect/decal/poster))
+ check = 1
+ break
+ stuff_on_wall++
+ if(stuff_on_wall==3)
+ check = 1
+ break
+
+ if(check)
+ user << "The wall is far too cluttered to place a poster!"
+ return
+
+ user << "You start placing the poster on the wall..." //Looks like it's uncluttered enough. Place the poster.
+
+ P.resulting_poster.loc = src
+ var/temp = P.resulting_poster.icon_state
+ var/temp_loc = user.loc
+ P.resulting_poster.icon_state = "poster_being_set"
+ playsound(P.resulting_poster.loc, 'sound/items/poster_being_created.ogg', 100, 1)
+ sleep(24)
+
+ if(user.loc == temp_loc)//Let's check if he still is there
+ user << "You place the poster!"
+ P.resulting_poster.icon_state = temp
+ src.contents += P.resulting_poster
+ del(P)
+ else
+ user << "You stop placing the poster."
+ P.resulting_poster.loc = P
+ P.resulting_poster.icon_state = temp
+ else
+ return attack_hand(user)
+ return
+
+
+/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob)
+
+ if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
+ usr << "\red You don't have the dexterity to do this!"
+ return
+
+ if(!istype(src, /turf/simulated/wall/r_wall))
+ return // this may seem stupid and redundant but apparently floors can call this attackby() proc, it was spamming shit up. -- Doohl
+
+
+ if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
+ W:eyecheck(user)
+ var/turf/T = user.loc
+ if (!( istype(T, /turf) ))
+ return
+
+ if (thermite)
+ var/obj/effect/overlay/O = new/obj/effect/overlay( src )
+ O.name = "Thermite"
+ O.desc = "Looks hot."
+ O.icon = 'icons/effects/fire.dmi'
+ O.icon_state = "2"
+ O.anchored = 1
+ O.density = 1
+ O.layer = 5
+ var/turf/simulated/floor/F = ReplaceWithPlating()
+ F.burn_tile()
+ F.icon_state = "wall_thermite"
+ user << "\red The thermite melts the wall."
+ spawn(100) del(O)
+ F.sd_LumReset()
+ return
+
+ if (src.d_state == 2)
+ W:welding = 2
+ user << "\blue Slicing metal cover."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(60)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 3
+ user << "\blue You removed the metal cover."
+ W:welding = 1
+
+ else if (src.d_state == 5)
+ W:welding = 2
+ user << "\blue Removing support rods."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(100)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 6
+ new /obj/item/stack/rods( src )
+ user << "\blue You removed the support rods."
+ W:welding = 1
+
+ else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
+ var/turf/T = user.loc
+ if (!( istype(T, /turf) ))
+ return
+
+ if (thermite)
+ var/obj/effect/overlay/O = new/obj/effect/overlay( src )
+ O.name = "Thermite"
+ O.desc = "Looks hot."
+ O.icon = 'icons/effects/fire.dmi'
+ O.icon_state = "2"
+ O.anchored = 1
+ O.density = 1
+ O.layer = 5
+ var/turf/simulated/floor/F = ReplaceWithPlating()
+ F.burn_tile()
+ F.icon_state = "wall_thermite"
+ user << "\red The thermite melts the wall."
+ spawn(100) del(O)
+ F.sd_LumReset()
+ return
+
+ if (src.d_state == 2)
+ user << "\blue Slicing metal cover."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(40)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 3
+ user << "\blue You removed the metal cover."
+
+ else if (src.d_state == 5)
+ user << "\blue Removing support rods."
+ playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
+ sleep(70)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 6
+ new /obj/item/stack/rods( src )
+ user << "\blue You removed the support rods."
+
+ else if(istype(W, /obj/item/weapon/melee/energy/blade))
+ user << "\blue This wall is too thick to slice through. You will need to find a different path."
+ return
+
+ else if (istype(W, /obj/item/weapon/wrench))
+ if (src.d_state == 4)
+ var/turf/T = user.loc
+ user << "\blue Detaching support rods."
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
+ sleep(40)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 5
+ user << "\blue You detach the support rods."
+
+ else if (istype(W, /obj/item/weapon/wirecutters))
+ if (src.d_state == 0)
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
+ src.d_state = 1
+ new /obj/item/stack/rods( src )
+
+ else if (istype(W, /obj/item/weapon/screwdriver))
+ if (src.d_state == 1)
+ var/turf/T = user.loc
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
+ user << "\blue Removing support lines."
+ sleep(40)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 2
+ user << "\blue You removed the support lines."
+
+ else if (istype(W, /obj/item/weapon/crowbar))
+
+ if (src.d_state == 3)
+ var/turf/T = user.loc
+ user << "\blue Prying cover off."
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
+ sleep(100)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 4
+ user << "\blue You removed the cover."
+
+ else if (src.d_state == 6)
+ var/turf/T = user.loc
+ user << "\blue Prying outer sheath off."
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
+ sleep(100)
+ if(src)
+ if ((user.loc == T && user.equipped() == W))
+ user << "\blue You removed the outer sheath."
+ dismantle_wall()
+ return
+
+ else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
+ var/turf/T = user.loc
+ user << "\blue You begin to drill though, this will take some time."
+ sleep(200)
+ if(src)
+ if ((user.loc == T && user.equipped() == W))
+ user << "\blue Your drill tears though the reinforced plating."
+ dismantle_wall()
+ return
+
+ else if ((istype(W, /obj/item/stack/sheet/metal)) && (src.d_state))
+ var/turf/T = user.loc
+ user << "\blue Repairing wall."
+ sleep(100)
+ if ((user.loc == T && user.equipped() == W))
+ src.d_state = 0
+ src.icon_state = initial(src.icon_state)
+ user << "\blue You repaired the wall."
+ if (W:amount > 1)
+ W:amount--
+ else
+ del(W)
+
+ else if(istype(W,/obj/item/weapon/contraband/poster))
+ var/obj/item/weapon/contraband/poster/P = W
+ if(P.resulting_poster)
+ var/check = 0
+ var/stuff_on_wall = 0
+ for( var/obj/O in src.contents) //Let's see if it already has a poster on it or too much stuff
+ if(istype(O,/obj/effect/decal/poster))
+ check = 1
+ break
+ stuff_on_wall++
+ if(stuff_on_wall==3)
+ check = 1
+ break
+
+ if(check)
+ user << "The wall is far too cluttered to place a poster!"
+ return
+
+ user << "You start placing the poster on the wall..." //Looks like it's uncluttered enough. Place the poster.
+
+ P.resulting_poster.loc = src
+ var/temp = P.resulting_poster.icon_state
+ var/temp_loc = user.loc
+ P.resulting_poster.icon_state = "poster_being_set"
+ playsound(P.resulting_poster.loc, 'sound/items/poster_being_created.ogg', 100, 1)
+ sleep(24)
+
+ if(user.loc == temp_loc)//Let's check if he still is there
+ user << "You place the poster!"
+ P.resulting_poster.icon_state = temp
+ src.contents += P.resulting_poster
+ del(P)
+ else
+ user << "You stop placing the poster."
+ P.resulting_poster.loc = P
+ P.resulting_poster.icon_state = temp
+ return
+
+ if(istype(W,/obj/item/apc_frame))
+ var/obj/item/apc_frame/AH = W
+ AH.try_build(src)
+ return
+
+ if(src.d_state > 0)
+ src.icon_state = "r_wall-[d_state]"
+
+ else
+ return attack_hand(user)
+ return
+
+/turf/simulated/wall/meteorhit(obj/M as obj)
+ if (prob(15))
+ dismantle_wall()
+ else if(prob(70))
+ ReplaceWithPlating()
+ else
+ ReplaceWithLattice()
+ return 0
+
+
+//This is so damaged or burnt tiles or platings don't get remembered as the default tile
+var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
+ "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
+ "platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
+ "light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
+ "light_on_broken","light_off","wall_thermite","grass1","grass2","grass3","grass4",
+ "asteroid","asteroid_dug",
+ "asteroid0","asteroid1","asteroid2","asteroid3","asteroid4",
+ "asteroid5","asteroid6","asteroid7","asteroid8",
+ "burning","oldburning","light-on-r","light-on-y","light-on-g","light-on-b")
+
+var/list/plating_icons = list("plating","platingdmg1","platingdmg2","platingdmg3","asteroid","asteroid_dug")
+
+/turf/simulated/floor
+
+ //Note to coders, the 'intact' var can no longer be used to determine if the floor is a plating or not.
+ //Use the is_plating(), is_plasteel_floor() and is_light_floor() procs instead. --Errorage
+ name = "floor"
+ icon = 'icons/turf/floors.dmi'
+ icon_state = "floor"
+ var/icon_regular_floor = "floor" //used to remember what icon the tile should have by default
+ var/icon_plating = "plating"
+ thermal_conductivity = 0.040
+ heat_capacity = 10000
+ var/broken = 0
+ var/burnt = 0
+ var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/plasteel
+
+ airless
+ icon_state = "floor"
+ name = "airless floor"
+ oxygen = 0.01
+ nitrogen = 0.01
+ temperature = TCMB
+
+ New()
+ ..()
+ name = "floor"
+
+ light
+ name = "Light floor"
+ luminosity = 5
+ icon_state = "light_on"
+ floor_tile = new/obj/item/stack/tile/light
+
+ New()
+ floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
+ var/n = name //just in case commands rename it in the ..() call
+ ..()
+ spawn(4)
+ update_icon()
+ name = n
+
+ grass
+ name = "Grass patch"
+ icon_state = "grass1"
+ floor_tile = new/obj/item/stack/tile/grass
+
+ New()
+ floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
+ icon_state = "grass[pick("1","2","3","4")]"
+ ..()
+ spawn(4)
+ update_icon()
+ for(var/direction in cardinal)
+ if(istype(get_step(src,direction),/turf/simulated/floor))
+ var/turf/simulated/floor/FF = get_step(src,direction)
+ FF.update_icon() //so siding get updated properly
+
+/turf/simulated/floor/vault
+ icon_state = "rockvault"
+
+ New(location,type)
+ ..()
+ icon_state = "[type]vault"
+
+/turf/simulated/wall/vault
+ icon_state = "rockvault"
+
+ New(location,type)
+ ..()
+ icon_state = "[type]vault"
+
+/turf/simulated/floor/engine
+ name = "reinforced floor"
+ icon_state = "engine"
+ thermal_conductivity = 0.025
+ heat_capacity = 325000
+
+/turf/simulated/floor/engine/cult
+ name = "engraved floor"
+ icon_state = "cult"
+
+
+/turf/simulated/floor/engine/n20
+ New()
+ ..()
+ var/datum/gas_mixture/adding = new
+ var/datum/gas/sleeping_agent/trace_gas = new
+
+ trace_gas.moles = 2000
+ adding.trace_gases += trace_gas
+ adding.temperature = T20C
+
+ assume_air(adding)
+
+/turf/simulated/floor/engine/vacuum
+ name = "vacuum floor"
+ icon_state = "engine"
+ oxygen = 0
+ nitrogen = 0.001
+ temperature = TCMB
+
+/turf/simulated/floor/plating
+ name = "plating"
+ icon_state = "plating"
+ floor_tile = null
+ intact = 0
+
+/turf/simulated/floor/plating/airless
+ icon_state = "plating"
+ name = "airless plating"
+ oxygen = 0.01
+ nitrogen = 0.01
+ temperature = TCMB
+
+ New()
+ ..()
+ name = "plating"
+
+/turf/simulated/floor/grid
+ icon = 'icons/turf/floors.dmi'
+ icon_state = "circuit"
+
+/turf/simulated/floor/New()
+ ..()
+ if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
+ icon_regular_floor = "floor"
+ else
+ icon_regular_floor = icon_state
+
+//turf/simulated/floor/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+// if ((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
+// if (!( locate(/obj/machinery/mass_driver, src) ))
+// return 0
+// return ..()
+
+/turf/simulated/floor/ex_act(severity)
+ //set src in oview(1)
+ switch(severity)
+ if(1.0)
+ src.ReplaceWithSpace()
+ if(2.0)
+ switch(pick(1,2;75,3))
+ if (1)
+ src.ReplaceWithLattice()
+ if(prob(33)) new /obj/item/stack/sheet/metal(src)
+ if(2)
+ src.ReplaceWithSpace()
+ if(3)
+ if(prob(80))
+ src.break_tile_to_plating()
+ else
+ src.break_tile()
+ src.hotspot_expose(1000,CELL_VOLUME)
+ if(prob(33)) new /obj/item/stack/sheet/metal(src)
+ if(3.0)
+ if (prob(50))
+ src.break_tile()
+ src.hotspot_expose(1000,CELL_VOLUME)
+ return
+
+/turf/simulated/floor/blob_act()
+ return
+
+turf/simulated/floor/proc/update_icon()
+ if(is_plasteel_floor())
+ if(!broken && !burnt)
+ icon_state = icon_regular_floor
+ if(is_plating())
+ if(!broken && !burnt)
+ icon_state = icon_plating //Because asteroids are 'platings' too.
+ if(is_light_floor())
+ var/obj/item/stack/tile/light/T = floor_tile
+ if(T.on)
+ switch(T.state)
+ if(0)
+ icon_state = "light_on"
+ sd_SetLuminosity(5)
+ if(1)
+ var/num = pick("1","2","3","4")
+ icon_state = "light_on_flicker[num]"
+ sd_SetLuminosity(5)
+ if(2)
+ icon_state = "light_on_broken"
+ sd_SetLuminosity(5)
+ if(3)
+ icon_state = "light_off"
+ sd_SetLuminosity(0)
+ else
+ sd_SetLuminosity(0)
+ icon_state = "light_off"
+ if(is_grass_floor())
+ if(!broken && !burnt)
+ if(!(icon_state in list("grass1","grass2","grass3","grass4")))
+ icon_state = "grass[pick("1","2","3","4")]"
+ spawn(1)
+ if(istype(src,/turf/simulated/floor)) //Was throwing runtime errors due to a chance of it changing to space halfway through.
+ if(air)
+ update_visuals(air)
+
+turf/simulated/floor/return_siding_icon_state()
+ ..()
+ if(is_grass_floor())
+ var/dir_sum = 0
+ for(var/direction in cardinal)
+ var/turf/T = get_step(src,direction)
+ if(!(T.is_grass_floor()))
+ dir_sum += direction
+ if(dir_sum)
+ return "wood_siding[dir_sum]"
+ else
+ return 0
+
+
+/turf/simulated/floor/attack_paw(mob/user as mob)
+ return src.attack_hand(user)
+
+/turf/simulated/floor/attack_hand(mob/user as mob)
+ if (is_light_floor())
+ var/obj/item/stack/tile/light/T = floor_tile
+ T.on = !T.on
+ update_icon()
+ if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
+ return
+ if (user.pulling.anchored)
+ return
+ if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
+ return
+ if (ismob(user.pulling))
+ var/mob/M = user.pulling
+ var/mob/t = M.pulling
+ M.stop_pulling()
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ M.start_pulling(t)
+ else
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ return
+
+/turf/simulated/floor/engine/attackby(obj/item/weapon/C as obj, mob/user as mob)
+ if(!C)
+ return
+ if(!user)
+ return
+ if(istype(C, /obj/item/weapon/wrench))
+ user << "\blue Removing rods..."
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 80, 1)
+ if(do_after(user, 30))
+ new /obj/item/stack/rods(src, 2)
+ ReplaceWithFloor()
+ var/turf/simulated/floor/F = src
+ F.make_plating()
+ return
+
+/turf/simulated/floor/proc/gets_drilled()
+ return
+
+/turf/simulated/floor/proc/break_tile_to_plating()
+ if(!is_plating())
+ make_plating()
+ break_tile()
+
+/turf/simulated/floor/is_plasteel_floor()
+ if(istype(floor_tile,/obj/item/stack/tile/plasteel))
+ return 1
+ else
+ return 0
+
+/turf/simulated/floor/is_light_floor()
+ if(istype(floor_tile,/obj/item/stack/tile/light))
+ return 1
+ else
+ return 0
+
+/turf/simulated/floor/is_grass_floor()
+ if(istype(floor_tile,/obj/item/stack/tile/grass))
+ return 1
+ else
+ return 0
+
+/turf/simulated/floor/is_plating()
+ if(!floor_tile)
+ return 1
+ return 0
+
+/turf/simulated/floor/proc/break_tile()
+ if(istype(src,/turf/simulated/floor/engine)) return
+ if(istype(src,/turf/simulated/floor/mech_bay_recharge_floor))
+ src.ReplaceWithPlating()
+ if(broken) return
+ if(is_plasteel_floor())
+ src.icon_state = "damaged[pick(1,2,3,4,5)]"
+ broken = 1
+ else if(is_plasteel_floor())
+ src.icon_state = "light_broken"
+ broken = 1
+ else if(is_plating())
+ src.icon_state = "platingdmg[pick(1,2,3)]"
+ broken = 1
+ else if(is_grass_floor())
+ src.icon_state = "sand[pick("1","2","3")]"
+ broken = 1
+
+/turf/simulated/floor/proc/burn_tile()
+ if(istype(src,/turf/simulated/floor/engine)) return
+ if(broken || burnt) return
+ if(is_plasteel_floor())
+ src.icon_state = "damaged[pick(1,2,3,4,5)]"
+ burnt = 1
+ else if(is_plasteel_floor())
+ src.icon_state = "floorscorched[pick(1,2)]"
+ burnt = 1
+ else if(is_plating())
+ src.icon_state = "panelscorched"
+ burnt = 1
+ else if(is_grass_floor())
+ src.icon_state = "sand[pick("1","2","3")]"
+ burnt = 1
+
+//This proc will delete the floor_tile and the update_iocn() proc will then change the icon_state of the turf
+//This proc auto corrects the grass tiles' siding.
+/turf/simulated/floor/proc/make_plating()
+ if(istype(src,/turf/simulated/floor/engine)) return
+
+ if(is_grass_floor())
+ for(var/direction in cardinal)
+ if(istype(get_step(src,direction),/turf/simulated/floor))
+ var/turf/simulated/floor/FF = get_step(src,direction)
+ FF.update_icon() //so siding get updated properly
+
+ if(!floor_tile) return
+ del(floor_tile)
+ icon_plating = "plating"
+ sd_SetLuminosity(0)
+ floor_tile = null
+ intact = 0
+ broken = 0
+ burnt = 0
+
+ update_icon()
+ levelupdate()
+
+//This proc will make the turf a plasteel floor tile. The expected argument is the tile to make the turf with
+//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
+//this proc.
+/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/plasteel/T = null)
+ broken = 0
+ burnt = 0
+ intact = 1
+ sd_SetLuminosity(0)
+ if(T)
+ if(istype(T,/obj/item/stack/tile/plasteel))
+ floor_tile = T
+ if (icon_regular_floor)
+ icon_state = icon_regular_floor
+ else
+ icon_state = "floor"
+ icon_regular_floor = icon_state
+ update_icon()
+ levelupdate()
+ return
+ //if you gave a valid parameter, it won't get thisf ar.
+ floor_tile = new/obj/item/stack/tile/plasteel
+ icon_state = "floor"
+ icon_regular_floor = icon_state
+
+ update_icon()
+ levelupdate()
+
+//This proc will make the turf a light floor tile. The expected argument is the tile to make the turf with
+//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
+//this proc.
+/turf/simulated/floor/proc/make_light_floor(var/obj/item/stack/tile/light/T = null)
+ broken = 0
+ burnt = 0
+ intact = 1
+ if(T)
+ if(istype(T,/obj/item/stack/tile/light))
+ floor_tile = T
+ update_icon()
+ levelupdate()
+ return
+ //if you gave a valid parameter, it won't get thisf ar.
+ floor_tile = new/obj/item/stack/tile/light
+
+ update_icon()
+ levelupdate()
+
+//This proc will make a turf into a grass patch. Fun eh? Insert the grass tile to be used as the argument
+//If no argument is given a new one will be made.
+/turf/simulated/floor/proc/make_grass_floor(var/obj/item/stack/tile/grass/T = null)
+ broken = 0
+ burnt = 0
+ intact = 1
+ if(T)
+ if(istype(T,/obj/item/stack/tile/grass))
+ floor_tile = T
+ update_icon()
+ levelupdate()
+ return
+ //if you gave a valid parameter, it won't get thisf ar.
+ floor_tile = new/obj/item/stack/tile/grass
+
+ update_icon()
+ levelupdate()
+
+/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob)
+
+ if(!C || !user)
+ return 0
+
+ if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles
+ if(is_light_floor())
+ var/obj/item/stack/tile/light/T = floor_tile
+ if(T.state)
+ user.unEquip(C)
+ del(C)
+ T.state = C //fixing it by bashing it with a light bulb, fun eh?
+ update_icon()
+ user << "\blue You replace the light bulb."
+ else
+ user << "\blue The lightbulb seems fine, no need to replace it."
+
+ if(istype(C, /obj/item/weapon/crowbar) && (!(is_plating())))
+ if(broken || burnt)
+ user << "\red You remove the broken plating."
+ else
+ user << "\red You remove the [floor_tile.name]."
+ new floor_tile.type(src)
+
+ make_plating()
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 80, 1)
+
+ return
+
+ if(istype(C, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = C
+ if (is_plating())
+ if (R.amount >= 2)
+ user << "\blue Reinforcing the floor..."
+ if(do_after(user, 30) && R && R.amount >= 2 && is_plating())
+ ReplaceWithEngineFloor()
+ playsound(src.loc, 'sound/items/Deconstruct.ogg', 80, 1)
+ R.use(2)
+ return
+ else
+ user << "\red You need more rods."
+ else
+ user << "\red You must remove the plating first."
+ return
+
+ if(istype(C, /obj/item/stack/tile))
+ if(is_plating())
+ if(!broken && !burnt)
+ var/obj/item/stack/tile/T = C
+ floor_tile = new T.type
+ intact = 1
+ if(istype(T,/obj/item/stack/tile/light))
+ var/obj/item/stack/tile/light/L = T
+ var/obj/item/stack/tile/light/F = floor_tile
+ F.state = L.state
+ F.on = L.on
+ if(istype(T,/obj/item/stack/tile/grass))
+ for(var/direction in cardinal)
+ if(istype(get_step(src,direction),/turf/simulated/floor))
+ var/turf/simulated/floor/FF = get_step(src,direction)
+ FF.update_icon() //so siding gets updated properly
+ T.use(1)
+ update_icon()
+ levelupdate()
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
+ else
+ user << "\blue This section is too damaged to support a tile. Use a welder to fix the damage."
+
+
+ if(istype(C, /obj/item/stack/cable_coil))
+ if(is_plating())
+ var/obj/item/stack/cable_coil/coil = C
+ coil.turf_place(src, user)
+ else
+ user << "\red You must remove the plating first."
+
+ if(istype(C, /obj/item/weapon/shovel))
+ if(is_grass_floor())
+ new /obj/item/weapon/ore/glass(src)
+ new /obj/item/weapon/ore/glass(src) //Make some sand if you shovel grass
+ user << "\blue You shovel the grass."
+ make_plating()
+ else
+ user << "\red You cannot shovel this."
+
+ if(istype(C, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/welder = C
+ if(welder.welding && (is_plating()))
+ if(broken || burnt)
+ if(welder.remove_fuel(0,user))
+ user << "\red You fix some dents on the broken plating."
+ playsound(src.loc, 'sound/items/Welder.ogg', 80, 1)
+ icon_state = "plating"
+ burnt = 0
+ broken = 0
+ else
+ user << "\blue You need more welding fuel to complete this task."
+
+/turf/unsimulated/floor/attack_paw(user as mob)
+ return src.attack_hand(user)
+
+/turf/unsimulated/floor/attack_hand(var/mob/user as mob)
+ if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
+ return
+ if (user.pulling.anchored)
+ return
+ if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
+ return
+ if (ismob(user.pulling))
+ var/mob/M = user.pulling
+ var/mob/t = M.pulling
+ M.stop_pulling()
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ M.start_pulling(t)
+ else
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ return
+
+// imported from space.dm
+
+/turf/space/attack_paw(mob/user as mob)
+ return src.attack_hand(user)
+
+/turf/space/attack_hand(mob/user as mob)
+ if ((user.restrained() || !( user.pulling )))
+ return
+ if (user.pulling.anchored)
+ return
+ if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
+ return
+ if (ismob(user.pulling))
+ var/mob/M = user.pulling
+ var/atom/movable/t = M.pulling
+ M.stop_pulling()
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ M.start_pulling(t)
+ else
+ step(user.pulling, get_dir(user.pulling.loc, src))
+ return
+
+/turf/space/attackby(obj/item/C as obj, mob/user as mob)
+
+ if (istype(C, /obj/item/stack/rods))
+ var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
+ if(L)
+ return
+ var/obj/item/stack/rods/R = C
+ user << "\blue Constructing support lattice ..."
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
+ ReplaceWithLattice()
+ R.use(1)
+ return
+
+ if (istype(C, /obj/item/stack/tile/plasteel))
+ var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
+ if(L)
+ var/obj/item/stack/tile/plasteel/S = C
+ del(L)
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
+ S.build(src)
+ S.use(1)
+ return
+ else
+ user << "\red The plating is going to need some support."
+ return
+
+
+// Ported from unstable r355
+
+/turf/space/Entered(atom/movable/A as mob|obj)
+ ..()
+ if ((!(A) || src != A.loc || istype(null, /obj/effect/beam))) return
+
+ inertial_drift(A)
+
+ if(ticker && ticker.mode)
+
+ // Okay, so let's make it so that people can travel z levels but not nuke disks!
+ // if(ticker.mode.name == "nuclear emergency") return
+
+ if(ticker.mode.name == "extended"||ticker.mode.name == "sandbox")
+ Sandbox_Spacemove(A)
+
+ else
+ if (src.x <= 2 || A.x >= (world.maxx - 1) || src.y <= 2 || A.y >= (world.maxy - 1))
+ if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
+ del(A)
+ return
+
+ if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
+ return
+
+ if(!isemptylist(A.search_contents_for(/obj/item/weapon/disk/nuclear)))
+ if(istype(A, /mob/living))
+ var/mob/living/MM = A
+ if(MM.client)
+ MM << "\red Something you are carrying is preventing you from leaving. Don't play stupid; you know exactly what it is."
+ return
+
+
+
+ var/move_to_z_str = pickweight(accessable_z_levels)
+
+ var/move_to_z = text2num(move_to_z_str)
+
+ if(!move_to_z)
+ return
+
+
+
+ A.z = move_to_z
+
+
+ if(src.x <= 2)
+ A.x = world.maxx - 2
+
+ else if (A.x >= (world.maxx - 1))
+ A.x = 3
+
+ else if (src.y <= 2)
+ A.y = world.maxy - 2
+
+ else if (A.y >= (world.maxy - 1))
+ A.y = 3
+
+ spawn (0)
+ if ((A && A.loc))
+ A.loc.Entered(A)
+
+// if(istype(A, /obj/structure/closet/coffin))
+// coffinhandler.Add(A)
+
+/turf/space/proc/Sandbox_Spacemove(atom/movable/A as mob|obj)
+ var/cur_x
+ var/cur_y
+ var/next_x
+ var/next_y
+ var/target_z
+ var/list/y_arr
+
+ if(src.x <= 1)
+ if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
+ del(A)
+ return
+
+ var/list/cur_pos = src.get_global_map_pos()
+ if(!cur_pos) return
+ cur_x = cur_pos["x"]
+ cur_y = cur_pos["y"]
+ next_x = (--cur_x||global_map.len)
+ y_arr = global_map[next_x]
+ target_z = y_arr[cur_y]
+/*
+ //debug
+ world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
+ world << "Target Z = [target_z]"
+ world << "Next X = [next_x]"
+ //debug
+*/
+ if(target_z)
+ A.z = target_z
+ A.x = world.maxx - 2
+ spawn (0)
+ if ((A && A.loc))
+ A.loc.Entered(A)
+ else if (src.x >= world.maxx)
+ if(istype(A, /obj/effect/meteor))
+ del(A)
+ return
+
+ var/list/cur_pos = src.get_global_map_pos()
+ if(!cur_pos) return
+ cur_x = cur_pos["x"]
+ cur_y = cur_pos["y"]
+ next_x = (++cur_x > global_map.len ? 1 : cur_x)
+ y_arr = global_map[next_x]
+ target_z = y_arr[cur_y]
+/*
+ //debug
+ world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
+ world << "Target Z = [target_z]"
+ world << "Next X = [next_x]"
+ //debug
+*/
+ if(target_z)
+ A.z = target_z
+ A.x = 3
+ spawn (0)
+ if ((A && A.loc))
+ A.loc.Entered(A)
+ else if (src.y <= 1)
+ if(istype(A, /obj/effect/meteor))
+ del(A)
+ return
+ var/list/cur_pos = src.get_global_map_pos()
+ if(!cur_pos) return
+ cur_x = cur_pos["x"]
+ cur_y = cur_pos["y"]
+ y_arr = global_map[cur_x]
+ next_y = (--cur_y||y_arr.len)
+ target_z = y_arr[next_y]
+/*
+ //debug
+ world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
+ world << "Next Y = [next_y]"
+ world << "Target Z = [target_z]"
+ //debug
+*/
+ if(target_z)
+ A.z = target_z
+ A.y = world.maxy - 2
+ spawn (0)
+ if ((A && A.loc))
+ A.loc.Entered(A)
+
+ else if (src.y >= world.maxy)
+ if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
+ del(A)
+ return
+ var/list/cur_pos = src.get_global_map_pos()
+ if(!cur_pos) return
+ cur_x = cur_pos["x"]
+ cur_y = cur_pos["y"]
+ y_arr = global_map[cur_x]
+ next_y = (++cur_y > y_arr.len ? 1 : cur_y)
+ target_z = y_arr[next_y]
+/*
+ //debug
+ world << "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]"
+ world << "Next Y = [next_y]"
+ world << "Target Z = [target_z]"
+ //debug
+*/
+ if(target_z)
+ A.z = target_z
+ A.y = 3
+ spawn (0)
+ if ((A && A.loc))
+ A.loc.Entered(A)
+ return
+
+/obj/effect/vaultspawner
+ var/maxX = 6
+ var/maxY = 6
+ var/minX = 2
+ var/minY = 2
+
+/obj/effect/vaultspawner/New(turf/location as turf,lX = minX,uX = maxX,lY = minY,uY = maxY,var/type = null)
+ if(!type)
+ type = pick("sandstone","rock","alien")
+
+ var/lowBoundX = location.x
+ var/lowBoundY = location.y
+
+ var/hiBoundX = location.x + rand(lX,uX)
+ var/hiBoundY = location.y + rand(lY,uY)
+
+ var/z = location.z
+
+ for(var/i = lowBoundX,i<=hiBoundX,i++)
+ for(var/j = lowBoundY,j<=hiBoundY,j++)
+ if(i == lowBoundX || i == hiBoundX || j == lowBoundY || j == hiBoundY)
+ new /turf/simulated/wall/vault(locate(i,j,z),type)
+ else
+ new /turf/simulated/floor/vault(locate(i,j,z),type)
+
+ del(src)
+
+/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
+//Useful to batch-add creatures to the list.
+ for(var/mob/living/M in src)
+ if(M==U) continue//Will not harm U. Since null != M, can be excluded to kill everyone.
+ spawn(0)
+ M.gib()
+ for(var/obj/mecha/M in src)//Mecha are not gibbed but are damaged.
+ spawn(0)
+ M.take_damage(100, "brute")
+ for(var/obj/effect/critter/M in src)
+ spawn(0)
+ M.Die()
+
+/turf/proc/Bless()
+ if(flags & NOJAUNT)
+ return
+ flags |= NOJAUNT
overlays += image('icons/effects/water.dmi',src,"holywater")*/
\ No newline at end of file
diff --git a/code/unused/Ultralight.dm b/code/unused/Ultralight.dm
index d7597ee6fcc..63c679b68be 100644
--- a/code/unused/Ultralight.dm
+++ b/code/unused/Ultralight.dm
@@ -223,7 +223,7 @@ atom
ul_Illuminate()
return
- Del()
+ Delete()
if(ul_IsLuminous())
ul_Extinguish()
diff --git a/code/unused/assemblies.dm b/code/unused/assemblies.dm
index 8450da294cc..52e48f700c4 100644
--- a/code/unused/assemblies.dm
+++ b/code/unused/assemblies.dm
@@ -121,7 +121,7 @@
part2.master = src
//part2.status = 0
-/obj/item/assembly/time_ignite/Del()
+/obj/item/assembly/time_ignite/Delete()
del(part1)
del(part2)
..()
@@ -301,7 +301,7 @@
user.show_message("\blue The armor is now unsecured!", 1)
src.add_fingerprint(user)
-/obj/item/assembly/a_i_a/Del()
+/obj/item/assembly/a_i_a/Delete()
//src.part1 = null
del(src.part1)
//src.part2 = null
@@ -311,7 +311,7 @@
return
//*****
-/obj/item/assembly/rad_time/Del()
+/obj/item/assembly/rad_time/Delete()
//src.part1 = null
del(src.part1)
//src.part2 = null
@@ -361,7 +361,7 @@
src.icon_state = "prox-radio[n]"
return
-/obj/item/assembly/rad_prox/Del()
+/obj/item/assembly/rad_prox/Delete()
//src.part1 = null
del(src.part1)
//src.part2 = null
@@ -431,7 +431,7 @@
src.icon_state = text("infrared-radio[]", n)
return
-/obj/item/assembly/rad_infra/Del()
+/obj/item/assembly/rad_infra/Delete()
del(src.part1)
del(src.part2)
..()
@@ -516,7 +516,7 @@
return
return
-/obj/item/assembly/prox_ignite/Del()
+/obj/item/assembly/prox_ignite/Delete()
del(src.part1)
del(src.part2)
..()
@@ -565,7 +565,7 @@
src.part2.Activate()
return
-/obj/item/assembly/rad_ignite/Del()
+/obj/item/assembly/rad_ignite/Delete()
del(src.part1)
del(src.part2)
..()
@@ -664,7 +664,7 @@
..()
part3.examine()
-/obj/item/assembly/m_i_ptank/Del()
+/obj/item/assembly/m_i_ptank/Delete()
//src.part1 = null
del(src.part1)
@@ -752,7 +752,7 @@
..()
src.part3.examine()
-/obj/item/assembly/t_i_ptank/Del()
+/obj/item/assembly/t_i_ptank/Delete()
//src.part1 = null
del(src.part1)
@@ -831,7 +831,7 @@
..()
src.part3.examine()
-/obj/item/assembly/r_i_ptank/Del()
+/obj/item/assembly/r_i_ptank/Delete()
//src.part1 = null
del(src.part1)
diff --git a/code/unused/biomass_rift.dm b/code/unused/biomass_rift.dm
index 247f485b570..e021d333971 100644
--- a/code/unused/biomass_rift.dm
+++ b/code/unused/biomass_rift.dm
@@ -36,7 +36,7 @@
spawn(1) //DEBUG
starting.icon_state = "[newicon]"
-/obj/effect/rift/Del()
+/obj/effect/rift/Delete()
for(var/obj/effect/biomass/biomass in linkedBiomass)
del(biomass)
..()
diff --git a/code/unused/cable_heavyduty.dm b/code/unused/cable_heavyduty.dm
index 36bd4f93eb7..911fe50b43c 100644
--- a/code/unused/cable_heavyduty.dm
+++ b/code/unused/cable_heavyduty.dm
@@ -1,28 +1,28 @@
-/obj/item/stack/cable_coil/heavyduty
- name = "heavy cable coil"
- icon = 'icons/obj/power.dmi'
- icon_state = "wire"
-
-/obj/structure/cable/heavyduty
- icon = 'icons/obj/power_cond_heavy.dmi'
- name = "large power cable"
- desc = "This cable is tough. It cannot be cut with simple hand tools."
- layer = 2.39 //Just below pipes, which are at 2.4
-
-/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user)
-
- var/turf/T = src.loc
- if(T.intact)
- return
-
- if(istype(W, /obj/item/weapon/wirecutters))
- usr << "\blue These cables are too tough to be cut with those [W.name]."
- return
- else if(istype(W, /obj/item/stack/cable_coil))
- usr << "\blue You will need heavier cables to connect to these."
- return
- else
- ..()
-
-/obj/structure/cable/heavyduty/cableColor(var/colorC)
+/obj/item/stack/cable_coil/heavyduty
+ name = "heavy cable coil"
+ icon = 'icons/obj/power.dmi'
+ icon_state = "wire"
+
+/obj/structure/cable/heavyduty
+ icon = 'icons/obj/power_cond_heavy.dmi'
+ name = "large power cable"
+ desc = "This cable is tough. It cannot be cut with simple hand tools."
+ layer = 2.39 //Just below pipes, which are at 2.4
+
+/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user)
+
+ var/turf/T = src.loc
+ if(T.intact)
+ return
+
+ if(istype(W, /obj/item/weapon/wirecutters))
+ usr << "\blue These cables are too tough to be cut with those [W.name]."
+ return
+ else if(istype(W, /obj/item/stack/cable_coil))
+ usr << "\blue You will need heavier cables to connect to these."
+ return
+ else
+ ..()
+
+/obj/structure/cable/heavyduty/cableColor(var/colorC)
return
\ No newline at end of file
diff --git a/code/unused/carpetsplosion.dm b/code/unused/carpetsplosion.dm
index 01e0e757573..fda6b41f254 100644
--- a/code/unused/carpetsplosion.dm
+++ b/code/unused/carpetsplosion.dm
@@ -21,7 +21,7 @@
/obj/effect/spreader
var/list/obj/effect/spreader/spreadList = list()
-/obj/effect/spreader/Del()
+/obj/effect/spreader/Delete()
for(var/obj/effect/spreader/spread in spreadList)
if(spread != src)
del(spread)
diff --git a/code/unused/computer2/buildandrepair.dm b/code/unused/computer2/buildandrepair.dm
index 2fde1740b77..69e7b5fb822 100644
--- a/code/unused/computer2/buildandrepair.dm
+++ b/code/unused/computer2/buildandrepair.dm
@@ -1,150 +1,150 @@
-//Motherboard is just used in assembly/disassembly, doesn't exist in the actual computer object.
-/obj/item/weapon/motherboard
- name = "Computer mainboard"
- desc = "A computer motherboard."
- icon = 'icons/obj/module.dmi'
- icon_state = "mainboard"
- item_state = "electronic"
- w_class = 3
- var/created_name = null //If defined, result computer will have this name.
-
-/obj/computer2frame
- density = 1
- anchored = 0
- name = "Computer-frame"
- icon = 'icons/obj/stock_parts.dmi'
- icon_state = "0"
- var/state = 0
- var/obj/item/weapon/motherboard/mainboard = null
- var/obj/item/weapon/disk/data/fixed_disk/hd = null
- var/list/peripherals = list()
- var/created_icon_state = "aiupload"
-
-/obj/computer2frame/attackby(obj/item/P as obj, mob/user as mob)
- switch(state)
- if(0)
- if(istype(P, /obj/item/weapon/wrench))
- playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
- if(do_after(user, 20))
- user << "\blue You wrench the frame into place."
- src.anchored = 1
- src.state = 1
- if(istype(P, /obj/item/weapon/weldingtool))
- playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
- if(do_after(user, 20))
- user << "\blue You deconstruct the frame."
- new /obj/item/stack/sheet/metal( src.loc, 5 )
- del(src)
- if(1)
- if(istype(P, /obj/item/weapon/wrench))
- playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
- if(do_after(user, 20))
- user << "\blue You unfasten the frame."
- src.anchored = 0
- src.state = 0
- if(istype(P, /obj/item/weapon/motherboard) && !mainboard)
- playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "\blue You place the mainboard inside the frame."
- src.icon_state = "1"
- src.mainboard = P
- user.drop_item()
- P.loc = src
- if(istype(P, /obj/item/weapon/screwdriver) && mainboard)
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- user << "\blue You screw the mainboard into place."
- src.state = 2
- src.icon_state = "2"
- if(istype(P, /obj/item/weapon/crowbar) && mainboard)
- playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
- user << "\blue You remove the mainboard."
- src.state = 1
- src.icon_state = "0"
- mainboard.loc = src.loc
- src.mainboard = null
- if(2)
- if(istype(P, /obj/item/weapon/screwdriver) && mainboard && (!peripherals.len))
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- user << "\blue You unfasten the mainboard."
- src.state = 1
- src.icon_state = "1"
-
- if(istype(P, /obj/item/weapon/peripheral))
- if(src.peripherals.len < 3)
- user.drop_item()
- src.peripherals.Add(P)
- P.loc = src
- user << "\blue You add [P] to the frame."
- else
- user << "\red There is no more room for peripheral cards."
-
- if(istype(P, /obj/item/weapon/crowbar) && src.peripherals.len)
- playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
- user << "\blue You remove the peripheral boards."
- for(var/obj/item/weapon/peripheral/W in src.peripherals)
- W.loc = src.loc
- src.peripherals.Remove(W)
-
- if(istype(P, /obj/item/stack/cable_coil))
- if(P:amount >= 5)
- playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- if(do_after(user, 20))
- P:amount -= 5
- if(!P:amount) del(P)
- user << "\blue You add cables to the frame."
- src.state = 3
- src.icon_state = "3"
- if(3)
- if(istype(P, /obj/item/weapon/wirecutters))
- playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
- user << "\blue You remove the cables."
- src.state = 2
- src.icon_state = "2"
- var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
- A.amount = 5
- if(src.hd)
- src.hd.loc = src.loc
- src.hd = null
-
- if(istype(P, /obj/item/weapon/disk/data/fixed_disk) && !src.hd)
- user.drop_item()
- src.hd = P
- P.loc = src
- user << "\blue You connect the drive to the cabling."
-
- if(istype(P, /obj/item/weapon/crowbar) && src.hd)
- playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
- user << "\blue You remove the hard drive."
- src.hd.loc = src.loc
- src.hd = null
-
- if(istype(P, /obj/item/stack/sheet/glass))
- if(P:amount >= 2)
- playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- if(do_after(user, 20))
- P:use(2)
- user << "\blue You put in the glass panel."
- src.state = 4
- src.icon_state = "4"
- if(4)
- if(istype(P, /obj/item/weapon/crowbar))
- playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
- user << "\blue You remove the glass panel."
- src.state = 3
- src.icon_state = "3"
- new /obj/item/stack/sheet/glass( src.loc, 2 )
- if(istype(P, /obj/item/weapon/screwdriver))
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- user << "\blue You connect the monitor."
- var/obj/machinery/computer2/C= new /obj/machinery/computer2( src.loc )
- C.setup_drive_size = 0
- C.icon_state = src.created_icon_state
- if(mainboard.created_name) C.name = mainboard.created_name
- del(mainboard)
- if(hd)
- C.hd = hd
- hd.loc = C
- for(var/obj/item/weapon/peripheral/W in src.peripherals)
- W.loc = C
- W.host = C
- C.peripherals.Add(W)
+//Motherboard is just used in assembly/disassembly, doesn't exist in the actual computer object.
+/obj/item/weapon/motherboard
+ name = "Computer mainboard"
+ desc = "A computer motherboard."
+ icon = 'icons/obj/module.dmi'
+ icon_state = "mainboard"
+ item_state = "electronic"
+ w_class = 3
+ var/created_name = null //If defined, result computer will have this name.
+
+/obj/computer2frame
+ density = 1
+ anchored = 0
+ name = "Computer-frame"
+ icon = 'icons/obj/stock_parts.dmi'
+ icon_state = "0"
+ var/state = 0
+ var/obj/item/weapon/motherboard/mainboard = null
+ var/obj/item/weapon/disk/data/fixed_disk/hd = null
+ var/list/peripherals = list()
+ var/created_icon_state = "aiupload"
+
+/obj/computer2frame/attackby(obj/item/P as obj, mob/user as mob)
+ switch(state)
+ if(0)
+ if(istype(P, /obj/item/weapon/wrench))
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
+ if(do_after(user, 20))
+ user << "\blue You wrench the frame into place."
+ src.anchored = 1
+ src.state = 1
+ if(istype(P, /obj/item/weapon/weldingtool))
+ playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
+ if(do_after(user, 20))
+ user << "\blue You deconstruct the frame."
+ new /obj/item/stack/sheet/metal( src.loc, 5 )
+ del(src)
+ if(1)
+ if(istype(P, /obj/item/weapon/wrench))
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
+ if(do_after(user, 20))
+ user << "\blue You unfasten the frame."
+ src.anchored = 0
+ src.state = 0
+ if(istype(P, /obj/item/weapon/motherboard) && !mainboard)
+ playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
+ user << "\blue You place the mainboard inside the frame."
+ src.icon_state = "1"
+ src.mainboard = P
+ user.drop_item()
+ P.loc = src
+ if(istype(P, /obj/item/weapon/screwdriver) && mainboard)
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << "\blue You screw the mainboard into place."
+ src.state = 2
+ src.icon_state = "2"
+ if(istype(P, /obj/item/weapon/crowbar) && mainboard)
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ user << "\blue You remove the mainboard."
+ src.state = 1
+ src.icon_state = "0"
+ mainboard.loc = src.loc
+ src.mainboard = null
+ if(2)
+ if(istype(P, /obj/item/weapon/screwdriver) && mainboard && (!peripherals.len))
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << "\blue You unfasten the mainboard."
+ src.state = 1
+ src.icon_state = "1"
+
+ if(istype(P, /obj/item/weapon/peripheral))
+ if(src.peripherals.len < 3)
+ user.drop_item()
+ src.peripherals.Add(P)
+ P.loc = src
+ user << "\blue You add [P] to the frame."
+ else
+ user << "\red There is no more room for peripheral cards."
+
+ if(istype(P, /obj/item/weapon/crowbar) && src.peripherals.len)
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ user << "\blue You remove the peripheral boards."
+ for(var/obj/item/weapon/peripheral/W in src.peripherals)
+ W.loc = src.loc
+ src.peripherals.Remove(W)
+
+ if(istype(P, /obj/item/stack/cable_coil))
+ if(P:amount >= 5)
+ playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
+ if(do_after(user, 20))
+ P:amount -= 5
+ if(!P:amount) del(P)
+ user << "\blue You add cables to the frame."
+ src.state = 3
+ src.icon_state = "3"
+ if(3)
+ if(istype(P, /obj/item/weapon/wirecutters))
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
+ user << "\blue You remove the cables."
+ src.state = 2
+ src.icon_state = "2"
+ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
+ A.amount = 5
+ if(src.hd)
+ src.hd.loc = src.loc
+ src.hd = null
+
+ if(istype(P, /obj/item/weapon/disk/data/fixed_disk) && !src.hd)
+ user.drop_item()
+ src.hd = P
+ P.loc = src
+ user << "\blue You connect the drive to the cabling."
+
+ if(istype(P, /obj/item/weapon/crowbar) && src.hd)
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ user << "\blue You remove the hard drive."
+ src.hd.loc = src.loc
+ src.hd = null
+
+ if(istype(P, /obj/item/stack/sheet/glass))
+ if(P:amount >= 2)
+ playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
+ if(do_after(user, 20))
+ P:use(2)
+ user << "\blue You put in the glass panel."
+ src.state = 4
+ src.icon_state = "4"
+ if(4)
+ if(istype(P, /obj/item/weapon/crowbar))
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ user << "\blue You remove the glass panel."
+ src.state = 3
+ src.icon_state = "3"
+ new /obj/item/stack/sheet/glass( src.loc, 2 )
+ if(istype(P, /obj/item/weapon/screwdriver))
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ user << "\blue You connect the monitor."
+ var/obj/machinery/computer2/C= new /obj/machinery/computer2( src.loc )
+ C.setup_drive_size = 0
+ C.icon_state = src.created_icon_state
+ if(mainboard.created_name) C.name = mainboard.created_name
+ del(mainboard)
+ if(hd)
+ C.hd = hd
+ hd.loc = C
+ for(var/obj/item/weapon/peripheral/W in src.peripherals)
+ W.loc = C
+ W.host = C
+ C.peripherals.Add(W)
del(src)
\ No newline at end of file
diff --git a/code/unused/computer2/peripherals.dm b/code/unused/computer2/peripherals.dm
index b581e0c448b..cc3b50190fb 100644
--- a/code/unused/computer2/peripherals.dm
+++ b/code/unused/computer2/peripherals.dm
@@ -17,7 +17,7 @@
// var/setup_id = "\ref[src]"
// src.id = copytext(setup_id,4,(length(setup_id)-1) )
- Del()
+ Delete()
if(host)
host.peripherals.Remove(src)
..()
diff --git a/code/unused/conveyor.dm b/code/unused/conveyor.dm
index 0756be124f6..ad4337b696c 100644
--- a/code/unused/conveyor.dm
+++ b/code/unused/conveyor.dm
@@ -1,384 +1,384 @@
-// converyor belt
-
-// moves items/mobs/movables in set direction every ptick
-
-
-/obj/machinery/conveyor
- icon = 'icons/obj/recycling.dmi'
- icon_state = "conveyor0"
- name = "conveyor belt"
- desc = "A conveyor belt."
- anchored = 1
- var/operating = 0 // 1 if running forward, -1 if backwards, 0 if off
- var/operable = 1 // true if can operate (no broken segments in this belt run)
- var/basedir // this is the default (forward) direction, set by the map dir
- // note dir var can vary when the direction changes
-
- var/list/affecting // the list of all items that will be moved this ptick
- var/id = "" // the control ID - must match controller ID
- // following two only used if a diverter is present
- var/divert = 0 // if non-zero, direction to divert items
- var/divdir = 0 // if diverting, will be conveyer dir needed to divert (otherwise dense)
-
-
-
- // create a conveyor
-
-/obj/machinery/conveyor/New()
- ..()
- basedir = dir
- setdir()
-
- // set the dir and target turf depending on the operating direction
-
-/obj/machinery/conveyor/proc/setdir()
- if(operating == -1)
- dir = turn(basedir,180)
- else
- dir = basedir
- update()
-
-
- // update the icon depending on the operating condition
-
-/obj/machinery/conveyor/proc/update()
- if(stat & BROKEN)
- icon_state = "conveyor-b"
- operating = 0
- return
- if(!operable)
- operating = 0
- icon_state = "conveyor[(operating != 0) && !(stat & NOPOWER)]"
-
-
- // machine process
- // move items to the target location
-/obj/machinery/conveyor/process()
- if(stat & (BROKEN | NOPOWER))
- return
- if(!operating)
- return
- use_power(100)
-
- var/movedir = dir // base movement dir
- if(divert && dir==divdir) // update if diverter present
- movedir = divert
-
-
- affecting = loc.contents - src // moved items will be all in loc
- spawn(1) // slight delay to prevent infinite propagation due to map order
- var/items_moved = 0
- for(var/atom/movable/A in affecting)
- if(!A.anchored)
- if(isturf(A.loc)) // this is to prevent an ugly bug that forces a player to drop what they're holding if they recently pick it up from the conveyer belt
- if(ismob(A))
- var/mob/M = A
- if(M.buckled == src)
- var/obj/machinery/conveyor/C = locate() in get_step(src, dir)
- M.buckled = null
- step(M,dir)
- if(C)
- M.buckled = C
- else
- new/obj/item/stack/cable_coil/cut(M.loc)
- else
- step(M,movedir)
- else
- step(A,movedir)
- items_moved++
- if(items_moved >= 10)
- break
-
-// attack with item, place item on conveyor
-
-/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/grab)) // special handling if grabbing a mob
- var/obj/item/weapon/grab/G = I
- G.affecting.Move(src.loc)
- del(G)
- return
- else if(istype(I, /obj/item/stack/cable_coil)) // if cable, see if a mob is present
- var/mob/M = locate() in src.loc
- if(M)
- if (M == user)
- src.visible_message("\blue [M] ties \himself to the conveyor.")
- // note don't check for lying if self-tying
- else
- if(M.lying)
- user.visible_message("\blue [M] has been tied to the conveyor by [user].", "\blue You tie [M] to the converyor!")
- else
- user << "\blue [M] must be lying down to be tied to the converyor!"
- return
- M.buckled = src
- src.add_fingerprint(user)
- I:use(1)
- M.lying = 1
- return
-
- // else if no mob in loc, then allow coil to be placed
-
- else if(istype(I, /obj/item/weapon/wirecutters))
- var/mob/M = locate() in src.loc
- if(M && M.buckled == src)
- M.buckled = null
- src.add_fingerprint(user)
- if (M == user)
- src.visible_message("\blue [M] cuts \himself free from the conveyor.")
- else
- src.visible_message("\blue [M] had been cut free from the conveyor by [user].")
- return
-
- if(isrobot(user))
- return
-
- // otherwise drop and place on conveyor
- user.drop_item()
- if(I && I.loc) I.loc = src.loc
- return
-
-// attack with hand, move pulled object onto conveyor
-
-/obj/machinery/conveyor/attack_hand(mob/user as mob)
- user.Move_Pulled(src)
-
-
-// make the conveyor broken
-// also propagate inoperability to any connected conveyor with the same ID
-/obj/machinery/conveyor/proc/broken()
- stat |= BROKEN
- update()
-
- var/obj/machinery/conveyor/C = locate() in get_step(src, basedir)
- if(C)
- C.set_operable(basedir, id, 0)
-
- C = locate() in get_step(src, turn(basedir,180))
- if(C)
- C.set_operable(turn(basedir,180), id, 0)
-
-
-//set the operable var if ID matches, propagating in the given direction
-
-/obj/machinery/conveyor/proc/set_operable(stepdir, match_id, op)
-
- if(id != match_id)
- return
- operable = op
-
- update()
- var/obj/machinery/conveyor/C = locate() in get_step(src, stepdir)
- if(C)
- C.set_operable(stepdir, id, op)
-
-/*
-/obj/machinery/conveyor/verb/destroy()
- set src in view()
- src.broken()
-*/
-
-/obj/machinery/conveyor/power_change()
- ..()
- update()
-
-
-// converyor diverter
-// extendable arm that can be switched so items on the conveyer are diverted sideways
-// situate in same turf as conveyor
-// only works if belts is running proper direction
-//
-//
-/obj/machinery/diverter
- icon = 'icons/obj/recycling.dmi'
- icon_state = "diverter0"
- name = "diverter"
- desc = "A diverter arm for a conveyor belt."
- anchored = 1
- layer = FLY_LAYER
- var/obj/machinery/conveyor/conv // the conveyor this diverter works on
- var/deployed = 0 // true if diverter arm is extended
- var/operating = 0 // true if arm is extending/contracting
- var/divert_to // the dir that diverted items will be moved
- var/divert_from // the dir items must be moving to divert
-
-
-// create a diverter
-// set up divert_to and divert_from directions depending on dir state
-/obj/machinery/diverter/New()
-
- ..()
-
- switch(dir)
- if(NORTH)
- divert_to = WEST // stuff will be moved to the west
- divert_from = NORTH // if entering from the north
- if(SOUTH)
- divert_to = EAST
- divert_from = NORTH
- if(EAST)
- divert_to = EAST
- divert_from = SOUTH
- if(WEST)
- divert_to = WEST
- divert_from = SOUTH
- if(NORTHEAST)
- divert_to = NORTH
- divert_from = EAST
- if(NORTHWEST)
- divert_to = NORTH
- divert_from = WEST
- if(SOUTHEAST)
- divert_to = SOUTH
- divert_from = EAST
- if(SOUTHWEST)
- divert_to = SOUTH
- divert_from = WEST
- spawn(2)
- // wait for map load then find the conveyor in this turf
- conv = locate() in src.loc
- if(conv) // divert_from dir must match possible conveyor movement
- if(conv.basedir != divert_from && conv.basedir != turn(divert_from,180) )
- del(src) // if no dir match, then delete self
- set_divert()
- update()
-
-// update the icon state depending on whether the diverter is extended
-/obj/machinery/diverter/proc/update()
- icon_state = "diverter[deployed]"
-
-// call to set the diversion vars of underlying conveyor
-/obj/machinery/diverter/proc/set_divert()
- if(conv)
- if(deployed)
- conv.divert = divert_to
- conv.divdir = divert_from
- else
- conv.divert= 0
-
-
-// *** TESTING click to toggle
-/obj/machinery/diverter/Click()
- toggle()
-
-
-// toggle between arm deployed and not deployed, showing animation
-//
-/obj/machinery/diverter/proc/toggle()
- if( stat & (NOPOWER|BROKEN))
- return
-
- if(operating)
- return
-
- use_power(50)
- operating = 1
- if(deployed)
- flick("diverter10",src)
- icon_state = "diverter0"
- sleep(10)
- deployed = 0
- else
- flick("diverter01",src)
- icon_state = "diverter1"
- sleep(10)
- deployed = 1
- operating = 0
- update()
- set_divert()
-
-// don't allow movement into the 'backwards' direction if deployed
-/obj/machinery/diverter/CanPass(atom/movable/O, var/turf/target)
- var/direct = get_dir(O, target)
- if(direct == divert_to) // prevent movement through body of diverter
- return 0
- if(!deployed)
- return 1
- return(direct != turn(divert_from,180))
-
-// don't allow movement through the arm if deployed
-/obj/machinery/diverter/CheckExit(atom/movable/O, var/turf/target)
- var/direct = get_dir(O, target)
- if(direct == turn(divert_to,180)) // prevent movement through body of diverter
- return 0
- if(!deployed)
- return 1
- return(direct != divert_from)
-
-
-
-
-
-// the conveyor control switch
-//
-//
-
-/obj/machinery/conveyor_switch
-
- name = "conveyor switch"
- desc = "A conveyor control switch."
- icon = 'icons/obj/recycling.dmi'
- icon_state = "switch-off"
- var/position = 0 // 0 off, -1 reverse, 1 forward
- var/last_pos = -1 // last direction setting
- var/operated = 1 // true if just operated
-
- var/id = "" // must match conveyor IDs to control them
-
- var/list/conveyors // the list of converyors that are controlled by this switch
- anchored = 1
-
-
-
-/obj/machinery/conveyor_switch/New()
- ..()
- update()
-
- spawn(5) // allow map load
- conveyors = list()
- for(var/obj/machinery/conveyor/C in world)
- if(C.id == id)
- conveyors += C
-
-// update the icon depending on the position
-
-/obj/machinery/conveyor_switch/proc/update()
- if(position<0)
- icon_state = "switch-rev"
- else if(position>0)
- icon_state = "switch-fwd"
- else
- icon_state = "switch-off"
-
-
-// timed process
-// if the switch changed, update the linked conveyors
-
-/obj/machinery/conveyor_switch/process()
- if(!operated)
- return
- operated = 0
-
- for(var/obj/machinery/conveyor/C in conveyors)
- C.operating = position
- C.setdir()
-
-// attack with hand, switch position
-/obj/machinery/conveyor_switch/attack_hand(mob/user)
- if(position == 0)
- if(last_pos < 0)
- position = 1
- last_pos = 0
- else
- position = -1
- last_pos = 0
- else
- last_pos = position
- position = 0
-
- operated = 1
- update()
-
- // find any switches with same id as this one, and set their positions to match us
- for(var/obj/machinery/conveyor_switch/S in world)
- if(S.id == src.id)
- S.position = position
- S.update()
+// converyor belt
+
+// moves items/mobs/movables in set direction every ptick
+
+
+/obj/machinery/conveyor
+ icon = 'icons/obj/recycling.dmi'
+ icon_state = "conveyor0"
+ name = "conveyor belt"
+ desc = "A conveyor belt."
+ anchored = 1
+ var/operating = 0 // 1 if running forward, -1 if backwards, 0 if off
+ var/operable = 1 // true if can operate (no broken segments in this belt run)
+ var/basedir // this is the default (forward) direction, set by the map dir
+ // note dir var can vary when the direction changes
+
+ var/list/affecting // the list of all items that will be moved this ptick
+ var/id = "" // the control ID - must match controller ID
+ // following two only used if a diverter is present
+ var/divert = 0 // if non-zero, direction to divert items
+ var/divdir = 0 // if diverting, will be conveyer dir needed to divert (otherwise dense)
+
+
+
+ // create a conveyor
+
+/obj/machinery/conveyor/New()
+ ..()
+ basedir = dir
+ setdir()
+
+ // set the dir and target turf depending on the operating direction
+
+/obj/machinery/conveyor/proc/setdir()
+ if(operating == -1)
+ dir = turn(basedir,180)
+ else
+ dir = basedir
+ update()
+
+
+ // update the icon depending on the operating condition
+
+/obj/machinery/conveyor/proc/update()
+ if(stat & BROKEN)
+ icon_state = "conveyor-b"
+ operating = 0
+ return
+ if(!operable)
+ operating = 0
+ icon_state = "conveyor[(operating != 0) && !(stat & NOPOWER)]"
+
+
+ // machine process
+ // move items to the target location
+/obj/machinery/conveyor/process()
+ if(stat & (BROKEN | NOPOWER))
+ return
+ if(!operating)
+ return
+ use_power(100)
+
+ var/movedir = dir // base movement dir
+ if(divert && dir==divdir) // update if diverter present
+ movedir = divert
+
+
+ affecting = loc.contents - src // moved items will be all in loc
+ spawn(1) // slight delay to prevent infinite propagation due to map order
+ var/items_moved = 0
+ for(var/atom/movable/A in affecting)
+ if(!A.anchored)
+ if(isturf(A.loc)) // this is to prevent an ugly bug that forces a player to drop what they're holding if they recently pick it up from the conveyer belt
+ if(ismob(A))
+ var/mob/M = A
+ if(M.buckled == src)
+ var/obj/machinery/conveyor/C = locate() in get_step(src, dir)
+ M.buckled = null
+ step(M,dir)
+ if(C)
+ M.buckled = C
+ else
+ new/obj/item/stack/cable_coil/cut(M.loc)
+ else
+ step(M,movedir)
+ else
+ step(A,movedir)
+ items_moved++
+ if(items_moved >= 10)
+ break
+
+// attack with item, place item on conveyor
+
+/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
+ if(istype(I, /obj/item/weapon/grab)) // special handling if grabbing a mob
+ var/obj/item/weapon/grab/G = I
+ G.affecting.Move(src.loc)
+ del(G)
+ return
+ else if(istype(I, /obj/item/stack/cable_coil)) // if cable, see if a mob is present
+ var/mob/M = locate() in src.loc
+ if(M)
+ if (M == user)
+ src.visible_message("\blue [M] ties \himself to the conveyor.")
+ // note don't check for lying if self-tying
+ else
+ if(M.lying)
+ user.visible_message("\blue [M] has been tied to the conveyor by [user].", "\blue You tie [M] to the converyor!")
+ else
+ user << "\blue [M] must be lying down to be tied to the converyor!"
+ return
+ M.buckled = src
+ src.add_fingerprint(user)
+ I:use(1)
+ M.lying = 1
+ return
+
+ // else if no mob in loc, then allow coil to be placed
+
+ else if(istype(I, /obj/item/weapon/wirecutters))
+ var/mob/M = locate() in src.loc
+ if(M && M.buckled == src)
+ M.buckled = null
+ src.add_fingerprint(user)
+ if (M == user)
+ src.visible_message("\blue [M] cuts \himself free from the conveyor.")
+ else
+ src.visible_message("\blue [M] had been cut free from the conveyor by [user].")
+ return
+
+ if(isrobot(user))
+ return
+
+ // otherwise drop and place on conveyor
+ user.drop_item()
+ if(I && I.loc) I.loc = src.loc
+ return
+
+// attack with hand, move pulled object onto conveyor
+
+/obj/machinery/conveyor/attack_hand(mob/user as mob)
+ user.Move_Pulled(src)
+
+
+// make the conveyor broken
+// also propagate inoperability to any connected conveyor with the same ID
+/obj/machinery/conveyor/proc/broken()
+ stat |= BROKEN
+ update()
+
+ var/obj/machinery/conveyor/C = locate() in get_step(src, basedir)
+ if(C)
+ C.set_operable(basedir, id, 0)
+
+ C = locate() in get_step(src, turn(basedir,180))
+ if(C)
+ C.set_operable(turn(basedir,180), id, 0)
+
+
+//set the operable var if ID matches, propagating in the given direction
+
+/obj/machinery/conveyor/proc/set_operable(stepdir, match_id, op)
+
+ if(id != match_id)
+ return
+ operable = op
+
+ update()
+ var/obj/machinery/conveyor/C = locate() in get_step(src, stepdir)
+ if(C)
+ C.set_operable(stepdir, id, op)
+
+/*
+/obj/machinery/conveyor/verb/destroy()
+ set src in view()
+ src.broken()
+*/
+
+/obj/machinery/conveyor/power_change()
+ ..()
+ update()
+
+
+// converyor diverter
+// extendable arm that can be switched so items on the conveyer are diverted sideways
+// situate in same turf as conveyor
+// only works if belts is running proper direction
+//
+//
+/obj/machinery/diverter
+ icon = 'icons/obj/recycling.dmi'
+ icon_state = "diverter0"
+ name = "diverter"
+ desc = "A diverter arm for a conveyor belt."
+ anchored = 1
+ layer = FLY_LAYER
+ var/obj/machinery/conveyor/conv // the conveyor this diverter works on
+ var/deployed = 0 // true if diverter arm is extended
+ var/operating = 0 // true if arm is extending/contracting
+ var/divert_to // the dir that diverted items will be moved
+ var/divert_from // the dir items must be moving to divert
+
+
+// create a diverter
+// set up divert_to and divert_from directions depending on dir state
+/obj/machinery/diverter/New()
+
+ ..()
+
+ switch(dir)
+ if(NORTH)
+ divert_to = WEST // stuff will be moved to the west
+ divert_from = NORTH // if entering from the north
+ if(SOUTH)
+ divert_to = EAST
+ divert_from = NORTH
+ if(EAST)
+ divert_to = EAST
+ divert_from = SOUTH
+ if(WEST)
+ divert_to = WEST
+ divert_from = SOUTH
+ if(NORTHEAST)
+ divert_to = NORTH
+ divert_from = EAST
+ if(NORTHWEST)
+ divert_to = NORTH
+ divert_from = WEST
+ if(SOUTHEAST)
+ divert_to = SOUTH
+ divert_from = EAST
+ if(SOUTHWEST)
+ divert_to = SOUTH
+ divert_from = WEST
+ spawn(2)
+ // wait for map load then find the conveyor in this turf
+ conv = locate() in src.loc
+ if(conv) // divert_from dir must match possible conveyor movement
+ if(conv.basedir != divert_from && conv.basedir != turn(divert_from,180) )
+ del(src) // if no dir match, then delete self
+ set_divert()
+ update()
+
+// update the icon state depending on whether the diverter is extended
+/obj/machinery/diverter/proc/update()
+ icon_state = "diverter[deployed]"
+
+// call to set the diversion vars of underlying conveyor
+/obj/machinery/diverter/proc/set_divert()
+ if(conv)
+ if(deployed)
+ conv.divert = divert_to
+ conv.divdir = divert_from
+ else
+ conv.divert= 0
+
+
+// *** TESTING click to toggle
+/obj/machinery/diverter/Click()
+ toggle()
+
+
+// toggle between arm deployed and not deployed, showing animation
+//
+/obj/machinery/diverter/proc/toggle()
+ if( stat & (NOPOWER|BROKEN))
+ return
+
+ if(operating)
+ return
+
+ use_power(50)
+ operating = 1
+ if(deployed)
+ flick("diverter10",src)
+ icon_state = "diverter0"
+ sleep(10)
+ deployed = 0
+ else
+ flick("diverter01",src)
+ icon_state = "diverter1"
+ sleep(10)
+ deployed = 1
+ operating = 0
+ update()
+ set_divert()
+
+// don't allow movement into the 'backwards' direction if deployed
+/obj/machinery/diverter/CanPass(atom/movable/O, var/turf/target)
+ var/direct = get_dir(O, target)
+ if(direct == divert_to) // prevent movement through body of diverter
+ return 0
+ if(!deployed)
+ return 1
+ return(direct != turn(divert_from,180))
+
+// don't allow movement through the arm if deployed
+/obj/machinery/diverter/CheckExit(atom/movable/O, var/turf/target)
+ var/direct = get_dir(O, target)
+ if(direct == turn(divert_to,180)) // prevent movement through body of diverter
+ return 0
+ if(!deployed)
+ return 1
+ return(direct != divert_from)
+
+
+
+
+
+// the conveyor control switch
+//
+//
+
+/obj/machinery/conveyor_switch
+
+ name = "conveyor switch"
+ desc = "A conveyor control switch."
+ icon = 'icons/obj/recycling.dmi'
+ icon_state = "switch-off"
+ var/position = 0 // 0 off, -1 reverse, 1 forward
+ var/last_pos = -1 // last direction setting
+ var/operated = 1 // true if just operated
+
+ var/id = "" // must match conveyor IDs to control them
+
+ var/list/conveyors // the list of converyors that are controlled by this switch
+ anchored = 1
+
+
+
+/obj/machinery/conveyor_switch/New()
+ ..()
+ update()
+
+ spawn(5) // allow map load
+ conveyors = list()
+ for(var/obj/machinery/conveyor/C in world)
+ if(C.id == id)
+ conveyors += C
+
+// update the icon depending on the position
+
+/obj/machinery/conveyor_switch/proc/update()
+ if(position<0)
+ icon_state = "switch-rev"
+ else if(position>0)
+ icon_state = "switch-fwd"
+ else
+ icon_state = "switch-off"
+
+
+// timed process
+// if the switch changed, update the linked conveyors
+
+/obj/machinery/conveyor_switch/process()
+ if(!operated)
+ return
+ operated = 0
+
+ for(var/obj/machinery/conveyor/C in conveyors)
+ C.operating = position
+ C.setdir()
+
+// attack with hand, switch position
+/obj/machinery/conveyor_switch/attack_hand(mob/user)
+ if(position == 0)
+ if(last_pos < 0)
+ position = 1
+ last_pos = 0
+ else
+ position = -1
+ last_pos = 0
+ else
+ last_pos = position
+ position = 0
+
+ operated = 1
+ update()
+
+ // find any switches with same id as this one, and set their positions to match us
+ for(var/obj/machinery/conveyor_switch/S in world)
+ if(S.id == src.id)
+ S.position = position
+ S.update()
diff --git a/code/unused/hivebot/hive_modules.dm b/code/unused/hivebot/hive_modules.dm
index abac6236910..c0ae3196ca9 100644
--- a/code/unused/hivebot/hive_modules.dm
+++ b/code/unused/hivebot/hive_modules.dm
@@ -1,57 +1,57 @@
-/obj/item/weapon/hive_module
- name = "hive robot module"
- icon = 'icons/obj/module.dmi'
- icon_state = "std_module"
- w_class = 2.0
- item_state = "electronic"
- flags = FPRINT|TABLEPASS | CONDUCT
- var/list/modules = list()
-
-/obj/item/weapon/hive_module/standard
- name = "give standard robot module"
-
-/obj/item/weapon/hive_module/engineering
- name = "HiveBot engineering robot module"
-
-/obj/item/weapon/hive_module/New()//Shit all the mods have
- src.modules += new /obj/item/device/flash(src)
-
-
-/obj/item/weapon/hive_module/standard/New()
- ..()
- src.modules += new /obj/item/weapon/melee/baton(src)
- src.modules += new /obj/item/weapon/extinguisher(src)
- //var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
- //M.weapon_lock = 0
- //src.modules += M
-
-
-/obj/item/weapon/hive_module/engineering/New()
-
- src.modules += new /obj/item/weapon/extinguisher(src)
- src.modules += new /obj/item/weapon/screwdriver(src)
- src.modules += new /obj/item/weapon/weldingtool(src)
- src.modules += new /obj/item/weapon/wrench(src)
- src.modules += new /obj/item/device/analyzer(src)
- src.modules += new /obj/item/device/flashlight(src)
-
- var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
- R.matter = 30
- src.modules += R
-
- src.modules += new /obj/item/device/t_scanner(src)
- src.modules += new /obj/item/weapon/crowbar(src)
- src.modules += new /obj/item/weapon/wirecutters(src)
- src.modules += new /obj/item/device/multitool(src)
-
- var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
- M.amount = 50
- src.modules += M
-
- var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
- G.amount = 50
- src.modules += G
-
- var/obj/item/stack/cable_coil/W = new /obj/item/stack/cable_coil(src)
- W.amount = 50
- src.modules += W
+/obj/item/weapon/hive_module
+ name = "hive robot module"
+ icon = 'icons/obj/module.dmi'
+ icon_state = "std_module"
+ w_class = 2.0
+ item_state = "electronic"
+ flags = FPRINT|TABLEPASS | CONDUCT
+ var/list/modules = list()
+
+/obj/item/weapon/hive_module/standard
+ name = "give standard robot module"
+
+/obj/item/weapon/hive_module/engineering
+ name = "HiveBot engineering robot module"
+
+/obj/item/weapon/hive_module/New()//Shit all the mods have
+ src.modules += new /obj/item/device/flash(src)
+
+
+/obj/item/weapon/hive_module/standard/New()
+ ..()
+ src.modules += new /obj/item/weapon/melee/baton(src)
+ src.modules += new /obj/item/weapon/extinguisher(src)
+ //var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
+ //M.weapon_lock = 0
+ //src.modules += M
+
+
+/obj/item/weapon/hive_module/engineering/New()
+
+ src.modules += new /obj/item/weapon/extinguisher(src)
+ src.modules += new /obj/item/weapon/screwdriver(src)
+ src.modules += new /obj/item/weapon/weldingtool(src)
+ src.modules += new /obj/item/weapon/wrench(src)
+ src.modules += new /obj/item/device/analyzer(src)
+ src.modules += new /obj/item/device/flashlight(src)
+
+ var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
+ R.matter = 30
+ src.modules += R
+
+ src.modules += new /obj/item/device/t_scanner(src)
+ src.modules += new /obj/item/weapon/crowbar(src)
+ src.modules += new /obj/item/weapon/wirecutters(src)
+ src.modules += new /obj/item/device/multitool(src)
+
+ var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
+ M.amount = 50
+ src.modules += M
+
+ var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
+ G.amount = 50
+ src.modules += G
+
+ var/obj/item/stack/cable_coil/W = new /obj/item/stack/cable_coil(src)
+ W.amount = 50
+ src.modules += W
diff --git a/code/unused/hologram.dm b/code/unused/hologram.dm
index 8622a923644..7254b0b6380 100644
--- a/code/unused/hologram.dm
+++ b/code/unused/hologram.dm
@@ -1,112 +1,112 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
-
-/obj/machinery/computer/hologram_comp
- name = "Hologram Console"
- desc = "Rumoured to control holograms."
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "holo_console0"
- var/obj/machinery/hologram/projector/projector = null
- var/temp = null
- var/lumens = 0.0
- var/h_r = 245.0
- var/h_g = 245.0
- var/h_b = 245.0
-
-
-/obj/machinery/computer/hologram_comp/New()
- ..()
- spawn( 10 )
- src.projector = locate(/obj/machinery/hologram/projector, get_step(src.loc, NORTH))
- return
- return
-
-/obj/machinery/computer/hologram_comp/DblClick()
- if (!in_range(src, usr))
- return 0
- src.show_console(usr)
- return
-
-/obj/machinery/computer/hologram_comp/proc/render()
- var/icon/I = new /icon('icons/mob/human.dmi', "[skin_tones[1]]_m_s")
-
- if (src.lumens >= 0)
- I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD)
- else
- I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT)
-
- I.Blend(new /icon('icons/mob/underwear.dmi', "Mens White"), ICON_OVERLAY)
-
- var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s")
- U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD)
-
- I.Blend(U, ICON_OVERLAY)
-
- src.projector.hologram.icon = I
-
-/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
- var/dat
- user.set_machine(src)
- if (src.temp)
- dat = text("[]
Clear", src.temp, src)
- else
- dat = text("Hologram Status:
\nPower: []
\nHologram Control:
\nColor Luminosity: []/220 \[Reset\]
\nLighten: 1 10
\nDarken: 1 10
\n
\nHair Color: ([],[],[]) \[Reset\]
\nRed (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nGreen (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nBlue (0-255): \[0\] -10 -1 [] 1 10 \[255\]
", src, (src.projector.hologram ? "On" : "Off"), -src.lumens + 35, src, src, src, src, src, src.h_r, src.h_g, src.h_b, src, src, src, src, src.h_r, src, src, src, src, src, src, src.h_g, src, src, src, src, src, src, src.h_b, src, src, src)
- //user << browse(dat, "window=hologram_console")
- //onclose(user, "hologram_console")
- var/datum/browser/popup = new(user, "hologram_console", name)
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-/obj/machinery/computer/hologram_comp/Topic(href, href_list)
- if(..())
- return
- if (in_range(src, usr))
- flick("holo_console1", src)
- if (href_list["power"])
- if (src.projector.hologram)
- src.projector.icon_state = "hologram0"
- //src.projector.hologram = null
- del(src.projector.hologram)
- else
- src.projector.hologram = new(src.projector.loc)
- src.projector.hologram.icon = 'icons/mob/human.dmi'
- src.projector.hologram.icon_state = "body_m_s"
- src.projector.icon_state = "hologram1"
- src.render()
- else
- if (href_list["h_r"])
- if (src.projector.hologram)
- src.h_r += text2num(href_list["h_r"])
- src.h_r = min(max(src.h_r, 0), 255)
- render()
- else
- if (href_list["h_g"])
- if (src.projector.hologram)
- src.h_g += text2num(href_list["h_g"])
- src.h_g = min(max(src.h_g, 0), 255)
- render()
- else
- if (href_list["h_b"])
- if (src.projector.hologram)
- src.h_b += text2num(href_list["h_b"])
- src.h_b = min(max(src.h_b, 0), 255)
- render()
- else
- if (href_list["light"])
- if (src.projector.hologram)
- src.lumens += text2num(href_list["light"])
- src.lumens = min(max(src.lumens, -185.0), 35)
- render()
- else
- if (href_list["reset"])
- if (src.projector.hologram)
- src.lumens = 0
- render()
- else
- if (href_list["temp"])
- src.temp = null
- for(var/mob/M in viewers(1, src))
- if ((M.client && M.machine == src))
- src.show_console(M)
- return
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
+
+/obj/machinery/computer/hologram_comp
+ name = "Hologram Console"
+ desc = "Rumoured to control holograms."
+ icon = 'icons/obj/stationobjs.dmi'
+ icon_state = "holo_console0"
+ var/obj/machinery/hologram/projector/projector = null
+ var/temp = null
+ var/lumens = 0.0
+ var/h_r = 245.0
+ var/h_g = 245.0
+ var/h_b = 245.0
+
+
+/obj/machinery/computer/hologram_comp/New()
+ ..()
+ spawn( 10 )
+ src.projector = locate(/obj/machinery/hologram/projector, get_step(src.loc, NORTH))
+ return
+ return
+
+/obj/machinery/computer/hologram_comp/DblClick()
+ if (!in_range(src, usr))
+ return 0
+ src.show_console(usr)
+ return
+
+/obj/machinery/computer/hologram_comp/proc/render()
+ var/icon/I = new /icon('icons/mob/human.dmi', "[skin_tones[1]]_m_s")
+
+ if (src.lumens >= 0)
+ I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD)
+ else
+ I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT)
+
+ I.Blend(new /icon('icons/mob/underwear.dmi', "Mens White"), ICON_OVERLAY)
+
+ var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s")
+ U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD)
+
+ I.Blend(U, ICON_OVERLAY)
+
+ src.projector.hologram.icon = I
+
+/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
+ var/dat
+ user.set_machine(src)
+ if (src.temp)
+ dat = text("[]
Clear", src.temp, src)
+ else
+ dat = text("Hologram Status:
\nPower: []
\nHologram Control:
\nColor Luminosity: []/220 \[Reset\]
\nLighten: 1 10
\nDarken: 1 10
\n
\nHair Color: ([],[],[]) \[Reset\]
\nRed (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nGreen (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nBlue (0-255): \[0\] -10 -1 [] 1 10 \[255\]
", src, (src.projector.hologram ? "On" : "Off"), -src.lumens + 35, src, src, src, src, src, src.h_r, src.h_g, src.h_b, src, src, src, src, src.h_r, src, src, src, src, src, src, src.h_g, src, src, src, src, src, src, src.h_b, src, src, src)
+ //user << browse(dat, "window=hologram_console")
+ //onclose(user, "hologram_console")
+ var/datum/browser/popup = new(user, "hologram_console", name)
+ popup.set_content(dat)
+ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+ return
+
+/obj/machinery/computer/hologram_comp/Topic(href, href_list)
+ if(..())
+ return
+ if (in_range(src, usr))
+ flick("holo_console1", src)
+ if (href_list["power"])
+ if (src.projector.hologram)
+ src.projector.icon_state = "hologram0"
+ //src.projector.hologram = null
+ del(src.projector.hologram)
+ else
+ src.projector.hologram = new(src.projector.loc)
+ src.projector.hologram.icon = 'icons/mob/human.dmi'
+ src.projector.hologram.icon_state = "body_m_s"
+ src.projector.icon_state = "hologram1"
+ src.render()
+ else
+ if (href_list["h_r"])
+ if (src.projector.hologram)
+ src.h_r += text2num(href_list["h_r"])
+ src.h_r = min(max(src.h_r, 0), 255)
+ render()
+ else
+ if (href_list["h_g"])
+ if (src.projector.hologram)
+ src.h_g += text2num(href_list["h_g"])
+ src.h_g = min(max(src.h_g, 0), 255)
+ render()
+ else
+ if (href_list["h_b"])
+ if (src.projector.hologram)
+ src.h_b += text2num(href_list["h_b"])
+ src.h_b = min(max(src.h_b, 0), 255)
+ render()
+ else
+ if (href_list["light"])
+ if (src.projector.hologram)
+ src.lumens += text2num(href_list["light"])
+ src.lumens = min(max(src.lumens, -185.0), 35)
+ render()
+ else
+ if (href_list["reset"])
+ if (src.projector.hologram)
+ src.lumens = 0
+ render()
+ else
+ if (href_list["temp"])
+ src.temp = null
+ for(var/mob/M in viewers(1, src))
+ if ((M.client && M.machine == src))
+ src.show_console(M)
+ return
diff --git a/code/unused/limbs.dm b/code/unused/limbs.dm
index b9a95ba889e..ef73eec5ece 100644
--- a/code/unused/limbs.dm
+++ b/code/unused/limbs.dm
@@ -1,140 +1,140 @@
-/datum/limb
- var/name = "limb"
- var/mob/owner = null
- var/icon_name = null
- var/body_part = null
- var/brutestate = 0
- var/burnstate = 0
- var/brute_dam = 0
- var/burn_dam = 0
- var/max_damage = 0
-
-/datum/limb/chest
- name = "chest"
- icon_name = "chest"
- max_damage = 200
- body_part = CHEST
-
-/datum/limb/head
- name = "head"
- icon_name = "head"
- max_damage = 200
- body_part = HEAD
-
-/datum/limb/l_arm
- name = "l_arm"
- icon_name = "l_arm"
- max_damage = 75
- body_part = ARM_LEFT
-
-/datum/limb/l_leg
- name = "l_leg"
- icon_name = "l_leg"
- max_damage = 75
- body_part = LEG_LEFT
-
-/datum/limb/r_arm
- name = "r_arm"
- icon_name = "r_arm"
- max_damage = 75
- body_part = ARM_RIGHT
-
-/datum/limb/r_leg
- name = "r_leg"
- icon_name = "r_leg"
- max_damage = 75
- body_part = LEG_RIGHT
-
-/*Leaving these here in case we want to use them later
-/datum/limb/l_foot
- name = "l foot"
- icon_name = "l_foot"
- body_part = FOOT_LEFT
-
-/datum/limb/r_foot
- name = "r foot"
- icon_name = "r_foot"
- body_part = FOOT_RIGHT
-
-/datum/limb/r_hand
- name = "r hand"
- icon_name = "r_hand"
- body_part = HAND_RIGHT
-
-/datum/limb/l_hand
- name = "l hand"
- icon_name = "l_hand"
- body_part = HAND_LEFT
-
-/datum/limb/groin
- name = "groin"
- icon_name = "groin"
- body_part = GROIN
-*/
-
-//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
-//Damage will not exceed max_damage using this proc
-//Cannot apply negative damage
-/datum/limb/proc/take_damage(brute, burn)
- if(owner && (owner.status_flags & GODMODE)) return 0 //godmode
- brute = max(brute,0)
- burn = max(burn,0)
-
- var/can_inflict = max_damage - (brute_dam + burn_dam)
- if(!can_inflict) return 0
-
- if((brute + burn) < can_inflict)
- brute_dam += brute
- burn_dam += burn
- else
- if(brute > 0)
- if(burn > 0)
- brute = round( (brute/(brute+burn)) * can_inflict, 1 )
- burn = can_inflict - brute //gets whatever damage is left over
- brute_dam += brute
- burn_dam += burn
- else
- brute_dam += can_inflict
- else
- if(burn > 0)
- burn_dam += can_inflict
- else
- return 0
- return update_icon()
-
-
-//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
-//Damage cannot go below zero.
-//Cannot remove negative damage (i.e. apply damage)
-/datum/limb/proc/heal_damage(brute, burn)
- brute = max(brute, 0)
- burn = max(burn, 0)
- brute_dam = max(brute_dam - brute, 0)
- burn_dam = max(burn_dam - burn, 0)
- return update_icon()
-
-
-//Returns total damage...kinda pointless really
-/datum/limb/proc/get_damage()
- return brute_dam + burn_dam
-
-
-//Updates an organ's brute/burn states for use by update_damage_overlays()
-//Returns 1 if we need to update overlays. 0 otherwise.
-/datum/limb/proc/update_icon()
- var/tbrute = round( (brute_dam/max_damage)*3, 1 )
- var/tburn = round( (burn_dam/max_damage)*3, 1 )
- if((tbrute != brutestate) || (tburn != burnstate))
- brutestate = tbrute
- burnstate = tburn
- return 1
- return 0
-
-//Returns a display name for the organ
-/datum/limb/proc/getDisplayName()
- switch(name)
- if("l_leg") return "left leg"
- if("r_leg") return "right leg"
- if("l_arm") return "left arm"
- if("r_arm") return "right arm"
- else return name
+/datum/limb
+ var/name = "limb"
+ var/mob/owner = null
+ var/icon_name = null
+ var/body_part = null
+ var/brutestate = 0
+ var/burnstate = 0
+ var/brute_dam = 0
+ var/burn_dam = 0
+ var/max_damage = 0
+
+/datum/limb/chest
+ name = "chest"
+ icon_name = "chest"
+ max_damage = 200
+ body_part = CHEST
+
+/datum/limb/head
+ name = "head"
+ icon_name = "head"
+ max_damage = 200
+ body_part = HEAD
+
+/datum/limb/l_arm
+ name = "l_arm"
+ icon_name = "l_arm"
+ max_damage = 75
+ body_part = ARM_LEFT
+
+/datum/limb/l_leg
+ name = "l_leg"
+ icon_name = "l_leg"
+ max_damage = 75
+ body_part = LEG_LEFT
+
+/datum/limb/r_arm
+ name = "r_arm"
+ icon_name = "r_arm"
+ max_damage = 75
+ body_part = ARM_RIGHT
+
+/datum/limb/r_leg
+ name = "r_leg"
+ icon_name = "r_leg"
+ max_damage = 75
+ body_part = LEG_RIGHT
+
+/*Leaving these here in case we want to use them later
+/datum/limb/l_foot
+ name = "l foot"
+ icon_name = "l_foot"
+ body_part = FOOT_LEFT
+
+/datum/limb/r_foot
+ name = "r foot"
+ icon_name = "r_foot"
+ body_part = FOOT_RIGHT
+
+/datum/limb/r_hand
+ name = "r hand"
+ icon_name = "r_hand"
+ body_part = HAND_RIGHT
+
+/datum/limb/l_hand
+ name = "l hand"
+ icon_name = "l_hand"
+ body_part = HAND_LEFT
+
+/datum/limb/groin
+ name = "groin"
+ icon_name = "groin"
+ body_part = GROIN
+*/
+
+//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
+//Damage will not exceed max_damage using this proc
+//Cannot apply negative damage
+/datum/limb/proc/take_damage(brute, burn)
+ if(owner && (owner.status_flags & GODMODE)) return 0 //godmode
+ brute = max(brute,0)
+ burn = max(burn,0)
+
+ var/can_inflict = max_damage - (brute_dam + burn_dam)
+ if(!can_inflict) return 0
+
+ if((brute + burn) < can_inflict)
+ brute_dam += brute
+ burn_dam += burn
+ else
+ if(brute > 0)
+ if(burn > 0)
+ brute = round( (brute/(brute+burn)) * can_inflict, 1 )
+ burn = can_inflict - brute //gets whatever damage is left over
+ brute_dam += brute
+ burn_dam += burn
+ else
+ brute_dam += can_inflict
+ else
+ if(burn > 0)
+ burn_dam += can_inflict
+ else
+ return 0
+ return update_icon()
+
+
+//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
+//Damage cannot go below zero.
+//Cannot remove negative damage (i.e. apply damage)
+/datum/limb/proc/heal_damage(brute, burn)
+ brute = max(brute, 0)
+ burn = max(burn, 0)
+ brute_dam = max(brute_dam - brute, 0)
+ burn_dam = max(burn_dam - burn, 0)
+ return update_icon()
+
+
+//Returns total damage...kinda pointless really
+/datum/limb/proc/get_damage()
+ return brute_dam + burn_dam
+
+
+//Updates an organ's brute/burn states for use by update_damage_overlays()
+//Returns 1 if we need to update overlays. 0 otherwise.
+/datum/limb/proc/update_icon()
+ var/tbrute = round( (brute_dam/max_damage)*3, 1 )
+ var/tburn = round( (burn_dam/max_damage)*3, 1 )
+ if((tbrute != brutestate) || (tburn != burnstate))
+ brutestate = tbrute
+ burnstate = tburn
+ return 1
+ return 0
+
+//Returns a display name for the organ
+/datum/limb/proc/getDisplayName()
+ switch(name)
+ if("l_leg") return "left leg"
+ if("r_leg") return "right leg"
+ if("l_arm") return "left arm"
+ if("r_arm") return "right arm"
+ else return name
diff --git a/code/unused/pipe.dm b/code/unused/pipe.dm
index 60e552e3406..d8ee5fd7826 100644
--- a/code/unused/pipe.dm
+++ b/code/unused/pipe.dm
@@ -379,7 +379,7 @@ var/linenums = 0
stat |= BROKEN
update()
-/obj/machinery/pipes/Del()
+/obj/machinery/pipes/Delete()
stat |= BROKEN
update()
..()
diff --git a/code/unused/pipe_filter.dm b/code/unused/pipe_filter.dm
index f12b36be467..10f0673728a 100644
--- a/code/unused/pipe_filter.dm
+++ b/code/unused/pipe_filter.dm
@@ -1,243 +1,243 @@
-// *** pipefilter
-
-/obj/machinery/pipefilter/New()
- ..()
- p_dir = (NORTH|SOUTH|EAST|WEST) ^ turn(dir, 180)
-
- src.gas = new /datum/gas_mixture/()
- src.ngas = new /datum/gas_mixture/()
-
- src.f_gas = new /datum/gas_mixture/()
- src.f_ngas = new /datum/gas_mixture/()
-
- gasflowlist += src
-
-/obj/machinery/pipefilter/buildnodes()
- var/turf/T = src.loc
-
- n1dir = turn(dir, 90)
- n2dir = turn(dir,-90)
-
- node1 = get_machine( level, T , n1dir ) // the main flow dir
- node2 = get_machine( level, T , n2dir )
- node3 = get_machine( level, T, dir ) // the ejector port
-
- if(node1) vnode1 = node1.getline()
- if(node2) vnode2 = node2.getline()
- if(node3) vnode3 = node3.getline()
-
-/obj/machinery/pipefilter/gas_flow()
- gas.copy_from(ngas)
- f_gas.copy_from(f_ngas)
-
-/obj/machinery/pipefilter/process()
-/* var/delta_gt
-
- if(vnode1)
- delta_gt = FLOWFRAC * ( vnode1.get_gas_val(src) - gas.total_moles() / capmult)
- calc_delta( src, gas, ngas, vnode1, delta_gt)
- else
- leak_to_turf(1)
- if(vnode2)
- delta_gt = FLOWFRAC * ( vnode2.get_gas_val(src) - gas.total_moles() / capmult)
- calc_delta( src, gas, ngas, vnode2, delta_gt)
- else
- leak_to_turf(2)
- if(vnode3)
- delta_gt = FLOWFRAC * ( vnode3.get_gas_val(src) - f_gas.total_moles() / capmult)
- calc_delta( src, f_gas, f_ngas, vnode3, delta_gt)
- else
- leak_to_turf(3)
-
- // transfer gas from ngas->f_ngas according to extraction rate, but only if we have power
- if(! (stat & NOPOWER) )
- use_power(min(src.f_per, 100),ENVIRON)
- var/datum/gas_mixture/ndelta = src.get_extract()
- ngas.sub_delta(ndelta)
- f_ngas.add_delta(ndelta)
- AutoUpdateAI(src)
- src.updateUsrDialog()*/ //TODO: FIX
-
-/obj/machinery/pipefilter/get_gas_val(from)
- return ((from == vnode3) ? f_gas.total_moles() : gas.total_moles())/capmult
-
-/obj/machinery/pipefilter/get_gas(from)
- return (from == vnode3) ? f_gas : gas
-
-/obj/machinery/pipefilter/proc/leak_to_turf(var/port)
- var/turf/T
-
- switch(port)
- if(1)
- T = get_step(src, n1dir)
- if(2)
- T = get_step(src, n2dir)
- if(3)
- T = get_step(src, dir)
- if(T.density)
- T = src.loc
- if(T.density)
- return
- flow_to_turf(f_gas, f_ngas, T)
- return
-
- if(T.density)
- T = src.loc
- if(T.density)
- return
-
- flow_to_turf(gas, ngas, T)
-
-/obj/machinery/pipefilter/proc/get_extract()
- /*
- var/datum/gas_mixture/ndelta = new()
- if (src.f_mask & GAS_O2)
- ndelta.oxygen = min(src.f_per, src.ngas.oxygen)
- if (src.f_mask & GAS_N2)
- ndelta.n2 = min(src.f_per, src.ngas.n2)
- if (src.f_mask & GAS_PL)
- ndelta.plasma = min(src.f_per, src.ngas.plasma)
- if (src.f_mask & GAS_CO2)
- ndelta.co2 = min(src.f_per, src.ngas.co2)
- if (src.f_mask & GAS_N2O)
- ndelta.sl_gas = min(src.f_per, src.ngas.sl_gas)
- return ndelta
- */ //TODO: FIX
-
-/obj/machinery/pipefilter/attackby(obj/item/weapon/W, mob/user as mob)
- if(istype(W, /obj/item/weapon/detective_scanner))
- return ..()
- if(istype(W, /obj/item/weapon/screwdriver))
- if(bypassed)
- user.show_message(text("\red Remove the foreign wires first!"), 1)
- return
- src.add_fingerprint(user)
- user.show_message(text("\red Now []securing the access system panel...", (src.locked) ? "un" : "re"), 1)
- sleep(30)
- locked =! locked
- user.show_message(text("\red Done!"),1)
- src.updateicon()
- return
- if(istype(W, /obj/item/stack/cable_coil) && !bypassed)
- if(src.locked)
- user.show_message(text("\red You must remove the panel first!"),1)
- return
- var/obj/item/stack/cable_coil/C = W
- if(C.use(4))
- user.show_message(text("\red You unravel some cable.."),1)
- else
- user.show_message(text("\red Not enough cable! (Requires four pieces)"),1)
- src.add_fingerprint(user)
- user.show_message(text("\red Now bypassing the access system... (This may take a while)"), 1)
- sleep(100)
- bypassed = 1
- src.updateicon()
- return
- if(istype(W, /obj/item/weapon/wirecutters) && bypassed)
- src.add_fingerprint(user)
- user.show_message(text("\red Now removing the bypass wires... (This may take a while)"), 1)
- sleep(50)
- bypassed = 0
- src.updateicon()
- return
- if(istype(W, /obj/item/weapon/card/emag) && (!emagged))
- emagged++
- src.add_fingerprint(user)
- for(var/mob/O in viewers(user, null))
- O.show_message(text("\red [] has shorted out the [] with an electromagnetic card!", user, src), 1)
- src.overlays += image('icons/obj/pipes2.dmi', "filter-spark")
- sleep(6)
- src.updateicon()
- return src.attack_hand(user)
- return src.attack_hand(user)
-
-// pipefilter interact/topic
-/obj/machinery/pipefilter/attack_paw(mob/user as mob)
- return src.attack_hand(user)
-
-/obj/machinery/pipefilter/attack_ai(mob/user as mob)
- return src.attack_hand(user)
-
-/obj/machinery/pipefilter/attack_hand(mob/user as mob)
-/* if(stat & NOPOWER)
- user << browse(null, "window=pipefilter")
- user.machine = null
- return
-
- var/list/gases = list("O2", "N2", "Plasma", "CO2", "N2O")
- user.machine = src
- var/dat = "Filter Release Rate:
\nM - - - - - [src.f_per] + + + + + M
\n"
- for (var/i = 1; i <= gases.len; i++)
- dat += "[gases[i]]: [(src.f_mask & 1 << (i - 1)) ? "Releasing" : "Passing"]
\n"
- if(gas.total_moles())
- var/totalgas = gas.total_moles()
- var/pressure = round(totalgas / gas.maximum * 100)
- var/nitrogen = gas.n2 / totalgas * 100
- var/oxygen = gas.oxygen / totalgas * 100
- var/plasma = gas.plasma / totalgas * 100
- var/co2 = gas.co2 / totalgas * 100
- var/no2 = gas.sl_gas / totalgas * 100
-
- dat += "
Gas Levels:
\nPressure: [pressure]%
\nNitrogen: [nitrogen]%
\nOxygen: [oxygen]%
\nPlasma: [plasma]%
\nCO2: [co2]%
\nN2O: [no2]%
\n"
- else
- dat += "
Gas Levels:
\nPressure: 0%
\nNitrogen: 0%
\nOxygen: 0%
\nPlasma: 0%
\nCO2: 0%
\nN2O: 0%
\n"
- dat += "
\nClose
\n"
-
- user << browse(dat, "window=pipefilter;size=300x365")*/ //TODO: FIX
- //onclose(user, "pipefilter")
-
-/obj/machinery/pipefilter/Topic(href, href_list)
- ..()
- if(usr.restrained() || usr.lying)
- return
- if ((((get_dist(src, usr) <= 1 || usr.telekinesis == 1) || istype(usr, /mob/living/silicon/ai)) && istype(src.loc, /turf)))
- usr.machine = src
- if (href_list["close"])
- usr << browse(null, "window=pipefilter;")
- usr.machine = null
- return
- if (src.allowed(usr) || src.emagged || src.bypassed)
- if (href_list["fp"])
- src.f_per = min(max(round(src.f_per + text2num(href_list["fp"])), 0), src.maxrate)
- else if (href_list["tg"])
- // toggle gas
- src.f_mask ^= text2num(href_list["tg"])
- src.updateicon()
- else
- usr.see("\red Access Denied ([src.name] operation restricted to authorized atmospheric technicians.)")
- AutoUpdateAI(src)
- src.updateUsrDialog()
- src.add_fingerprint(usr)
- else
- usr << browse(null, "window=pipefilter")
- usr.machine = null
- return
-
-/obj/machinery/pipefilter/power_change()
- if(powered(ENVIRON))
- stat &= ~NOPOWER
- else
- stat |= NOPOWER
- spawn(rand(1,15)) //so all the filters don't come on at once
- updateicon()
-
-/obj/machinery/pipefilter/proc/updateicon()
- src.overlays.Cut()
- if(stat & NOPOWER)
- icon_state = "filter-off"
- else
- icon_state = "filter"
- if(emagged) //only show if powered because presumeably its the interface that has been fried
- src.overlays += image('icons/obj/pipes2.dmi', "filter-emag")
- if (src.f_mask & (GAS_N2O|GAS_PL))
- src.overlays += image('icons/obj/pipes2.dmi', "filter-tox")
- if (src.f_mask & GAS_O2)
- src.overlays += image('icons/obj/pipes2.dmi', "filter-o2")
- if (src.f_mask & GAS_N2)
- src.overlays += image('icons/obj/pipes2.dmi', "filter-n2")
- if (src.f_mask & GAS_CO2)
- src.overlays += image('icons/obj/pipes2.dmi', "filter-co2")
- if(!locked)
- src.overlays += image('icons/obj/pipes2.dmi', "filter-open")
- if(bypassed) //should only be bypassed if unlocked
+// *** pipefilter
+
+/obj/machinery/pipefilter/New()
+ ..()
+ p_dir = (NORTH|SOUTH|EAST|WEST) ^ turn(dir, 180)
+
+ src.gas = new /datum/gas_mixture/()
+ src.ngas = new /datum/gas_mixture/()
+
+ src.f_gas = new /datum/gas_mixture/()
+ src.f_ngas = new /datum/gas_mixture/()
+
+ gasflowlist += src
+
+/obj/machinery/pipefilter/buildnodes()
+ var/turf/T = src.loc
+
+ n1dir = turn(dir, 90)
+ n2dir = turn(dir,-90)
+
+ node1 = get_machine( level, T , n1dir ) // the main flow dir
+ node2 = get_machine( level, T , n2dir )
+ node3 = get_machine( level, T, dir ) // the ejector port
+
+ if(node1) vnode1 = node1.getline()
+ if(node2) vnode2 = node2.getline()
+ if(node3) vnode3 = node3.getline()
+
+/obj/machinery/pipefilter/gas_flow()
+ gas.copy_from(ngas)
+ f_gas.copy_from(f_ngas)
+
+/obj/machinery/pipefilter/process()
+/* var/delta_gt
+
+ if(vnode1)
+ delta_gt = FLOWFRAC * ( vnode1.get_gas_val(src) - gas.total_moles() / capmult)
+ calc_delta( src, gas, ngas, vnode1, delta_gt)
+ else
+ leak_to_turf(1)
+ if(vnode2)
+ delta_gt = FLOWFRAC * ( vnode2.get_gas_val(src) - gas.total_moles() / capmult)
+ calc_delta( src, gas, ngas, vnode2, delta_gt)
+ else
+ leak_to_turf(2)
+ if(vnode3)
+ delta_gt = FLOWFRAC * ( vnode3.get_gas_val(src) - f_gas.total_moles() / capmult)
+ calc_delta( src, f_gas, f_ngas, vnode3, delta_gt)
+ else
+ leak_to_turf(3)
+
+ // transfer gas from ngas->f_ngas according to extraction rate, but only if we have power
+ if(! (stat & NOPOWER) )
+ use_power(min(src.f_per, 100),ENVIRON)
+ var/datum/gas_mixture/ndelta = src.get_extract()
+ ngas.sub_delta(ndelta)
+ f_ngas.add_delta(ndelta)
+ AutoUpdateAI(src)
+ src.updateUsrDialog()*/ //TODO: FIX
+
+/obj/machinery/pipefilter/get_gas_val(from)
+ return ((from == vnode3) ? f_gas.total_moles() : gas.total_moles())/capmult
+
+/obj/machinery/pipefilter/get_gas(from)
+ return (from == vnode3) ? f_gas : gas
+
+/obj/machinery/pipefilter/proc/leak_to_turf(var/port)
+ var/turf/T
+
+ switch(port)
+ if(1)
+ T = get_step(src, n1dir)
+ if(2)
+ T = get_step(src, n2dir)
+ if(3)
+ T = get_step(src, dir)
+ if(T.density)
+ T = src.loc
+ if(T.density)
+ return
+ flow_to_turf(f_gas, f_ngas, T)
+ return
+
+ if(T.density)
+ T = src.loc
+ if(T.density)
+ return
+
+ flow_to_turf(gas, ngas, T)
+
+/obj/machinery/pipefilter/proc/get_extract()
+ /*
+ var/datum/gas_mixture/ndelta = new()
+ if (src.f_mask & GAS_O2)
+ ndelta.oxygen = min(src.f_per, src.ngas.oxygen)
+ if (src.f_mask & GAS_N2)
+ ndelta.n2 = min(src.f_per, src.ngas.n2)
+ if (src.f_mask & GAS_PL)
+ ndelta.plasma = min(src.f_per, src.ngas.plasma)
+ if (src.f_mask & GAS_CO2)
+ ndelta.co2 = min(src.f_per, src.ngas.co2)
+ if (src.f_mask & GAS_N2O)
+ ndelta.sl_gas = min(src.f_per, src.ngas.sl_gas)
+ return ndelta
+ */ //TODO: FIX
+
+/obj/machinery/pipefilter/attackby(obj/item/weapon/W, mob/user as mob)
+ if(istype(W, /obj/item/weapon/detective_scanner))
+ return ..()
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(bypassed)
+ user.show_message(text("\red Remove the foreign wires first!"), 1)
+ return
+ src.add_fingerprint(user)
+ user.show_message(text("\red Now []securing the access system panel...", (src.locked) ? "un" : "re"), 1)
+ sleep(30)
+ locked =! locked
+ user.show_message(text("\red Done!"),1)
+ src.updateicon()
+ return
+ if(istype(W, /obj/item/stack/cable_coil) && !bypassed)
+ if(src.locked)
+ user.show_message(text("\red You must remove the panel first!"),1)
+ return
+ var/obj/item/stack/cable_coil/C = W
+ if(C.use(4))
+ user.show_message(text("\red You unravel some cable.."),1)
+ else
+ user.show_message(text("\red Not enough cable! (Requires four pieces)"),1)
+ src.add_fingerprint(user)
+ user.show_message(text("\red Now bypassing the access system... (This may take a while)"), 1)
+ sleep(100)
+ bypassed = 1
+ src.updateicon()
+ return
+ if(istype(W, /obj/item/weapon/wirecutters) && bypassed)
+ src.add_fingerprint(user)
+ user.show_message(text("\red Now removing the bypass wires... (This may take a while)"), 1)
+ sleep(50)
+ bypassed = 0
+ src.updateicon()
+ return
+ if(istype(W, /obj/item/weapon/card/emag) && (!emagged))
+ emagged++
+ src.add_fingerprint(user)
+ for(var/mob/O in viewers(user, null))
+ O.show_message(text("\red [] has shorted out the [] with an electromagnetic card!", user, src), 1)
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-spark")
+ sleep(6)
+ src.updateicon()
+ return src.attack_hand(user)
+ return src.attack_hand(user)
+
+// pipefilter interact/topic
+/obj/machinery/pipefilter/attack_paw(mob/user as mob)
+ return src.attack_hand(user)
+
+/obj/machinery/pipefilter/attack_ai(mob/user as mob)
+ return src.attack_hand(user)
+
+/obj/machinery/pipefilter/attack_hand(mob/user as mob)
+/* if(stat & NOPOWER)
+ user << browse(null, "window=pipefilter")
+ user.machine = null
+ return
+
+ var/list/gases = list("O2", "N2", "Plasma", "CO2", "N2O")
+ user.machine = src
+ var/dat = "Filter Release Rate:
\nM - - - - - [src.f_per] + + + + + M
\n"
+ for (var/i = 1; i <= gases.len; i++)
+ dat += "[gases[i]]: [(src.f_mask & 1 << (i - 1)) ? "Releasing" : "Passing"]
\n"
+ if(gas.total_moles())
+ var/totalgas = gas.total_moles()
+ var/pressure = round(totalgas / gas.maximum * 100)
+ var/nitrogen = gas.n2 / totalgas * 100
+ var/oxygen = gas.oxygen / totalgas * 100
+ var/plasma = gas.plasma / totalgas * 100
+ var/co2 = gas.co2 / totalgas * 100
+ var/no2 = gas.sl_gas / totalgas * 100
+
+ dat += "
Gas Levels:
\nPressure: [pressure]%
\nNitrogen: [nitrogen]%
\nOxygen: [oxygen]%
\nPlasma: [plasma]%
\nCO2: [co2]%
\nN2O: [no2]%
\n"
+ else
+ dat += "
Gas Levels:
\nPressure: 0%
\nNitrogen: 0%
\nOxygen: 0%
\nPlasma: 0%
\nCO2: 0%
\nN2O: 0%
\n"
+ dat += "
\nClose
\n"
+
+ user << browse(dat, "window=pipefilter;size=300x365")*/ //TODO: FIX
+ //onclose(user, "pipefilter")
+
+/obj/machinery/pipefilter/Topic(href, href_list)
+ ..()
+ if(usr.restrained() || usr.lying)
+ return
+ if ((((get_dist(src, usr) <= 1 || usr.telekinesis == 1) || istype(usr, /mob/living/silicon/ai)) && istype(src.loc, /turf)))
+ usr.machine = src
+ if (href_list["close"])
+ usr << browse(null, "window=pipefilter;")
+ usr.machine = null
+ return
+ if (src.allowed(usr) || src.emagged || src.bypassed)
+ if (href_list["fp"])
+ src.f_per = min(max(round(src.f_per + text2num(href_list["fp"])), 0), src.maxrate)
+ else if (href_list["tg"])
+ // toggle gas
+ src.f_mask ^= text2num(href_list["tg"])
+ src.updateicon()
+ else
+ usr.see("\red Access Denied ([src.name] operation restricted to authorized atmospheric technicians.)")
+ AutoUpdateAI(src)
+ src.updateUsrDialog()
+ src.add_fingerprint(usr)
+ else
+ usr << browse(null, "window=pipefilter")
+ usr.machine = null
+ return
+
+/obj/machinery/pipefilter/power_change()
+ if(powered(ENVIRON))
+ stat &= ~NOPOWER
+ else
+ stat |= NOPOWER
+ spawn(rand(1,15)) //so all the filters don't come on at once
+ updateicon()
+
+/obj/machinery/pipefilter/proc/updateicon()
+ src.overlays.Cut()
+ if(stat & NOPOWER)
+ icon_state = "filter-off"
+ else
+ icon_state = "filter"
+ if(emagged) //only show if powered because presumeably its the interface that has been fried
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-emag")
+ if (src.f_mask & (GAS_N2O|GAS_PL))
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-tox")
+ if (src.f_mask & GAS_O2)
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-o2")
+ if (src.f_mask & GAS_N2)
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-n2")
+ if (src.f_mask & GAS_CO2)
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-co2")
+ if(!locked)
+ src.overlays += image('icons/obj/pipes2.dmi', "filter-open")
+ if(bypassed) //should only be bypassed if unlocked
src.overlays += image('icons/obj/pipes2.dmi', "filter-bypass")
\ No newline at end of file
diff --git a/code/unused/splash_simulation.dm b/code/unused/splash_simulation.dm
index d7352ff7128..b2d185d260c 100644
--- a/code/unused/splash_simulation.dm
+++ b/code/unused/splash_simulation.dm
@@ -131,7 +131,7 @@ obj/effect/liquid/proc/apply_calculated_effect()
obj/effect/liquid/Move()
return 0
-obj/effect/liquid/Del()
+obj/effect/liquid/Delete()
src.controller.liquid_objects.Remove(src)
..()
diff --git a/config/game_options.txt b/config/game_options.txt
index a01b8ef2450..0c059ce64d0 100644
--- a/config/game_options.txt
+++ b/config/game_options.txt
@@ -18,6 +18,10 @@ REVIVAL_CLONING 1
# amount of time (in hundredths of seconds) for which a brain retains the "spark of life" after the person's death (set to -1 for infinite)
REVIVAL_BRAIN_LIFE -1
+### RENAMING ###
+
+# Whether cyborgs can rename themselves at roundstart or when built. Has no effect on roboticists renaming cyborgs the normal way. Set to 0 to disable self-renaming.
+#RENAME_CYBORG
### MOB MOVEMENT ###
diff --git a/html/changelog.html b/html/changelog.html
index a8d4a7ced17..474612e7494 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -53,6 +53,32 @@ should be listed in the changelog upon commit tho. Thanks. -->
+
+
25 March 2014
+
Ikarrus updated:
+
+ - A security review committee has approved an update to all Nanotrasen airlocks to better resist cryptographic attacks by the enemy.
+
*New internal wiring will be able to withstand attacks, and panel wires will no longer be left unusable after an attack.
+
*Welding tools will now be able to cut through welded doors that have been damaged.
+
*Damaged electronics are now removable and replaceable following standard procedure.
+
*Airlocks will not be able to operate autonomously until the electronics are replaced.
+ - Hair sprites have been given a visual lift. For best results, set your hair color to be slightly lighter than how you want it to look. For dark hair, do not use a color darker than 80% black.
+
+
+
+
+
22 March 2014
+
MrPerson updated:
+
+ - Added a new, somewhat experimental system to delete things. This is basically a port from /vg/, so big thanks to N3X15.
+ - As a result, bombs and the singularity should be much less laggy.
+ - There may be issues with "phantom objects" or other problems with stuff that's suppoed to be deleted or objects interacting with deleted objects. Please report any issues right away!
+
+
Giacom updated:
+
+ - Gravity is no longer beamed from CentCom! Instead, there is a new gravity generator stored near Engineering that will provide all the gravity for the station and the z level. Please remember that it gives off a lot of radiation when charging or discharging, so wear protection.
+
+
18 March 2014
diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi
index afe6dad66b1..a639ab31162 100644
Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ
diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi
index e55fb7cec98..8634b61f79d 100644
Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ
diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi
index bf443312009..2628bc48b9d 100644
Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ
diff --git a/icons/mob/human_face.dmi b/icons/mob/human_face.dmi
index 8b4ddeed26a..515a69547df 100644
Binary files a/icons/mob/human_face.dmi and b/icons/mob/human_face.dmi differ
diff --git a/icons/mob/items_lefthand.dmi b/icons/mob/items_lefthand.dmi
index 6f8ea7af516..6e4b095e8c1 100644
Binary files a/icons/mob/items_lefthand.dmi and b/icons/mob/items_lefthand.dmi differ
diff --git a/icons/mob/items_righthand.dmi b/icons/mob/items_righthand.dmi
index 454630e4935..0bc19db3c47 100644
Binary files a/icons/mob/items_righthand.dmi and b/icons/mob/items_righthand.dmi differ
diff --git a/icons/mob/robots.dmi b/icons/mob/robots.dmi
index f89176d1d22..823c3c3db0f 100644
Binary files a/icons/mob/robots.dmi and b/icons/mob/robots.dmi differ
diff --git a/icons/mob/screen_cyborg.dmi b/icons/mob/screen_cyborg.dmi
index 8fad55192be..3492672b32e 100644
Binary files a/icons/mob/screen_cyborg.dmi and b/icons/mob/screen_cyborg.dmi differ
diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi
index 98fc2ab41f8..90a6095b3ee 100644
Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ
diff --git a/icons/mob/ties.dmi b/icons/mob/ties.dmi
index c0d073039bb..c2f21ea8cc7 100644
Binary files a/icons/mob/ties.dmi and b/icons/mob/ties.dmi differ
diff --git a/icons/mob/uniform.dmi b/icons/mob/uniform.dmi
index 77312526ac2..4f0f2b071ea 100644
Binary files a/icons/mob/uniform.dmi and b/icons/mob/uniform.dmi differ
diff --git a/icons/obj/aibots.dmi b/icons/obj/aibots.dmi
index f0393979b54..7b559aad634 100644
Binary files a/icons/obj/aibots.dmi and b/icons/obj/aibots.dmi differ
diff --git a/icons/obj/bureaucracy.dmi b/icons/obj/bureaucracy.dmi
index 347bad28ac0..dbd74d4f445 100644
Binary files a/icons/obj/bureaucracy.dmi and b/icons/obj/bureaucracy.dmi differ
diff --git a/icons/obj/card.dmi b/icons/obj/card.dmi
index a064ea3d649..30878cd97e3 100644
Binary files a/icons/obj/card.dmi and b/icons/obj/card.dmi differ
diff --git a/icons/obj/closet.dmi b/icons/obj/closet.dmi
index 6208ccc3b02..38e89b591ed 100644
Binary files a/icons/obj/closet.dmi and b/icons/obj/closet.dmi differ
diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi
index 3beb3b2f2b1..89e94d21bb1 100644
Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ
diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi
index 1612bfde40e..201f6e42e7d 100644
Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ
diff --git a/icons/obj/clothing/ties.dmi b/icons/obj/clothing/ties.dmi
index a424ea49f5e..80722813075 100644
Binary files a/icons/obj/clothing/ties.dmi and b/icons/obj/clothing/ties.dmi differ
diff --git a/icons/obj/clothing/uniforms.dmi b/icons/obj/clothing/uniforms.dmi
index 63a21591aa3..23efbe3ecb3 100644
Binary files a/icons/obj/clothing/uniforms.dmi and b/icons/obj/clothing/uniforms.dmi differ
diff --git a/icons/obj/cryogenics.dmi b/icons/obj/cryogenics.dmi
index b4f68b30bad..1159725b91a 100644
Binary files a/icons/obj/cryogenics.dmi and b/icons/obj/cryogenics.dmi differ
diff --git a/icons/obj/decals.dmi b/icons/obj/decals.dmi
index a38a213dec5..12791090e09 100644
Binary files a/icons/obj/decals.dmi and b/icons/obj/decals.dmi differ
diff --git a/icons/obj/doors/doormed.dmi b/icons/obj/doors/doormed.dmi
index 3e131b5788b..da561d3f619 100644
Binary files a/icons/obj/doors/doormed.dmi and b/icons/obj/doors/doormed.dmi differ
diff --git a/icons/obj/doors/doormedglass.dmi b/icons/obj/doors/doormedglass.dmi
index 397f0ced0db..42292469311 100644
Binary files a/icons/obj/doors/doormedglass.dmi and b/icons/obj/doors/doormedglass.dmi differ
diff --git a/icons/obj/drinks.dmi b/icons/obj/drinks.dmi
index 669c3461697..d4cbb96c20d 100644
Binary files a/icons/obj/drinks.dmi and b/icons/obj/drinks.dmi differ
diff --git a/icons/obj/food.dmi b/icons/obj/food.dmi
index 68dab1900b8..3619504282e 100644
Binary files a/icons/obj/food.dmi and b/icons/obj/food.dmi differ
diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi
index b6cabec2b38..95f63945904 100644
Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ
diff --git a/icons/obj/kitchen.dmi b/icons/obj/kitchen.dmi
index ee76458d822..7cb334987a1 100644
Binary files a/icons/obj/kitchen.dmi and b/icons/obj/kitchen.dmi differ
diff --git a/icons/obj/lighting.dmi b/icons/obj/lighting.dmi
index 2e59c8155b4..5379d6e70e0 100644
Binary files a/icons/obj/lighting.dmi and b/icons/obj/lighting.dmi differ
diff --git a/icons/obj/machines/gravity_generator.dmi b/icons/obj/machines/gravity_generator.dmi
new file mode 100644
index 00000000000..69395034dc8
Binary files /dev/null and b/icons/obj/machines/gravity_generator.dmi differ
diff --git a/icons/obj/pda.dmi b/icons/obj/pda.dmi
index 41d14c7f1a6..cf23e987632 100644
Binary files a/icons/obj/pda.dmi and b/icons/obj/pda.dmi differ
diff --git a/icons/obj/radio.dmi b/icons/obj/radio.dmi
index bff28d7f30b..f38c5a5085d 100644
Binary files a/icons/obj/radio.dmi and b/icons/obj/radio.dmi differ
diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi
index a759f4fc3d8..49455882710 100644
Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ
diff --git a/icons/obj/vending.dmi b/icons/obj/vending.dmi
index de6de2b2fa2..7ae9dadfd3b 100644
Binary files a/icons/obj/vending.dmi and b/icons/obj/vending.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index 922408e0335..a56f4e00b2c 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -104,6 +104,7 @@
#include "code\controllers\_DynamicAreaLighting_TG.dm"
#include "code\controllers\configuration.dm"
#include "code\controllers\failsafe.dm"
+#include "code\controllers\garbage.dm"
#include "code\controllers\lighting_controller.dm"
#include "code\controllers\master_controller.dm"
#include "code\controllers\shuttle_controller.dm"
@@ -727,6 +728,8 @@
#include "code\modules\admin\verbs\randomverbs.dm"
#include "code\modules\admin\verbs\ticklag.dm"
#include "code\modules\admin\verbs\tripAI.dm"
+#include "code\modules\admin\verbs\SDQL2\SDQL_2.dm"
+#include "code\modules\admin\verbs\SDQL2\SDQL_2_parser.dm"
#include "code\modules\assembly\assembly.dm"
#include "code\modules\assembly\bomb.dm"
#include "code\modules\assembly\helpers.dm"
@@ -753,6 +756,7 @@
#include "code\modules\awaymissions\maploader\writer.dm"
#include "code\modules\awaymissions\mission_code\Academy.dm"
#include "code\modules\awaymissions\mission_code\blackmarketpackers.dm"
+#include "code\modules\awaymissions\mission_code\box2550Away.dm"
#include "code\modules\awaymissions\mission_code\centcomAway.dm"
#include "code\modules\awaymissions\mission_code\challenge.dm"
#include "code\modules\awaymissions\mission_code\spacebattle.dm"
@@ -1225,7 +1229,6 @@
#include "code\modules\telesci\telesci_computer.dm"
#include "code\WorkInProgress\buildmode.dm"
#include "code\WorkInProgress\explosion_particles.dm"
-#include "code\WorkInProgress\Sigyn\Department Sec\jobs.dm"
#include "interface\interface.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"