mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Moved engineering, research and mining shuttles to a generalized system with its own directory structure.
This commit is contained in:
@@ -38,132 +38,6 @@
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
|
||||
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
var/mining_shuttle_tickstomove = 10
|
||||
var/mining_shuttle_moving = 0
|
||||
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
|
||||
|
||||
proc/move_mining_shuttle()
|
||||
if(mining_shuttle_moving) return
|
||||
mining_shuttle_moving = 1
|
||||
spawn(mining_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (mining_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/mining/outpost)
|
||||
toArea = locate(/area/shuttle/mining/station)
|
||||
|
||||
else
|
||||
fromArea = locate(/area/shuttle/mining/station)
|
||||
toArea = locate(/area/shuttle/mining/outpost)
|
||||
|
||||
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()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
|
||||
pest.gib()
|
||||
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
|
||||
for(var/mob/M in toArea)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
shake_camera(M, 3, 1) // buckled, not a lot of shaking
|
||||
else
|
||||
shake_camera(M, 10, 1) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
||||
if(istype(M, /mob/living/carbon))
|
||||
if(!M.buckled)
|
||||
M.Weaken(3)
|
||||
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "mining shuttle console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
circuit = "/obj/item/weapon/circuitboard/mining_shuttle"
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
|
||||
dat = "<center>Mining Shuttle Control<hr>"
|
||||
|
||||
if(mining_shuttle_moving)
|
||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||
else
|
||||
dat += "Location: [mining_shuttle_location ? "Outpost" : "Station"] <br>"
|
||||
|
||||
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x150")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
//if(ticker.mode.name == "blob")
|
||||
// if(ticker.mode:declared)
|
||||
// usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
// return
|
||||
|
||||
if (!mining_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_mining_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
else
|
||||
..()
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
|
||||
Reference in New Issue
Block a user