Telescience!

This commit is contained in:
ZomgPonies
2013-11-04 07:48:43 -05:00
parent bd24ed42d8
commit 8bf368f547
17 changed files with 8562 additions and 7963 deletions
+5
View File
@@ -1075,6 +1075,11 @@ proc/process_ghost_teleport_locs()
icon_state = "teleporter"
music = "signal"
/area/toxins/telesci
name = "\improper Telescience Lab"
icon_state = "toxmisc"
//MedBay
/area/medical/medbay
+236
View File
@@ -0,0 +1,236 @@
/obj/machinery/computer/telescience
name = "Telepad Control Console"
desc = "Used to teleport objects to and from the telescience telepad."
icon_state = "teleport-sci"
// VARIABLES //
var/teles_left // How many teleports left until it becomes uncalibrated
var/x_off // X offset
var/y_off // Y offset
var/x_co // X coordinate
var/y_co // Y coordinate
var/z_co // Z coordinate
var/trueX // X + offset
var/trueY // Y + offset
var/obj/machinery/telepad
var/tele_id = "Telesci"
/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)
usr << "You are too primitive to use this computer."
return
/obj/machinery/telescience/station/attack_ai(mob/user)
src.attack_hand()
/obj/machinery/computer/telescience/attack_hand(mob/user)
if(..())
return
if(stat & (NOPOWER|BROKEN))
return
var/t = ""
t += "<A href='?src=\ref[src];setx=1'>Set X</A>"
t += "<A href='?src=\ref[src];sety=1'>Set Y</A>"
t += "<A href='?src=\ref[src];setz=1'>Set Z</A>"
t += "<BR><BR>Current set coordinates:"
t += "([x_co], [y_co], [z_co])"
t += "<BR><BR><A href='?src=\ref[src];send=1'>Send</A>"
t += " <A href='?src=\ref[src];receive=1'>Receive</A>"
t += "<BR><BR><A href='?src=\ref[src];recal=1'>Recalibrate</A>"
var/datum/browser/popup = new(user, "telesci", name, 640, 480)
popup.set_content(t)
popup.open()
return
/obj/machinery/computer/telescience/proc/telefail(var/level)
var/teleturf = get_turf(telepad)
switch(level)
if(1)
for(var/mob/O in hearers(telepad, null))
O.show_message("\red The telepad weakly fizzles.", 2)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, teleturf)
s.start()
if(2)
for(var/mob/living/carbon/human/M in viewers(telepad, null))
M.apply_effect((rand(50, 100)), IRRADIATE, 0)
M << "\red You feel irradiated."
if(3)
for(var/turf/simulated/floor/target_tile in range(0,telepad))
var/datum/gas_mixture/napalm = new
napalm.toxins = 25
napalm.temperature = 2000
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(700, 400)
for(var/mob/O in hearers(telepad, null))
O.show_message("\red The telepad sets on fire!", 2)
if(4)
var/blocked = list(/mob/living/simple_animal/hostile,
/mob/living/simple_animal/hostile/alien/queen/large,
/mob/living/simple_animal/hostile/pirate,
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/simple_animal/hostile/russian,
/mob/living/simple_animal/hostile/russian/ranged,
/mob/living/simple_animal/hostile/syndicate,
/mob/living/simple_animal/hostile/syndicate/melee,
/mob/living/simple_animal/hostile/syndicate/melee/space,
/mob/living/simple_animal/hostile/syndicate/ranged,
/mob/living/simple_animal/hostile/syndicate/ranged/space,
/mob/living/simple_animal/hostile/retaliate,
/mob/living/simple_animal/hostile/giant_spider/nurse)
var/list/hostiles = typesof(/mob/living/simple_animal/hostile) - blocked
playsound(teleturf, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(telepad, null))
flick("e_flash", M.flash)
var/chosen = pick(hostiles)
var/mob/living/simple_animal/hostile/H = new chosen
H.loc = teleturf
return
/obj/machinery/computer/telescience/proc/teleprep(var/type)
if(!telepad)
usr << "\red Error: no associated telepad. Please recalibrate and try again."
return
var/numpick
var/failure = checkFail()
if(failure > 0)
numpick = pick(1,1,1,1,1,2,2,2,2,3)
telefail(numpick)
return
if(teles_left > 0)
if(prob(75))
teles_left -= 1
tele(type)
if(teles_left == 0)
for(var/mob/O in hearers(src, null))
O.show_message("\red The telepad has become uncalibrated.", 2)
return
else
if(prob(35))
tele(type)
else
numpick = pick(1,1,1,2,2,3,4)
telefail(numpick)
return
numpick = pick(1,1,1,1,1,2,2,2,2,3)
telefail(numpick)
return
/obj/machinery/computer/telescience/proc/tele(var/type)
var/tele = get_turf(telepad)
trueX = (x_co + x_off)
trueY = (y_co + y_off)
var/target = locate(trueX, trueY, z_co)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, tele)
s.start()
flick("pad-beam", telepad)
var/list/teleportables = list()
switch(type)
if(0)
for(var/atom/A in tele)
if(!istype(A, /obj/effect) && !istype(A, /mob/living/silicon/ai) && !istype(A, /obj/item/device/radio/intercom) && !istype(A, /obj/structure/closet/secure_closet/brig))
if(istype(A, /obj/structure))
var/obj/structure/S = A
if(!S.anchored)
teleportables += S
else if(istype(A, /obj/machinery))
var/obj/machinery/M = A
if(!M.anchored)
teleportables += M
else
teleportables += A
for(var/atom/T in teleportables)
do_teleport(T, target, 0)
usr << "\blue Teleport successful."
if(1)
for(var/atom/A in target)
if(!istype(A, /obj/effect) && !istype(A, /mob/living/silicon/ai) && !istype(A, /obj/item/device/radio/intercom))
if(istype(A, /obj/structure))
var/obj/structure/S = A
if(!S.anchored)
teleportables += S
else if(istype(A, /obj/machinery))
var/obj/machinery/M = A
if(!M.anchored)
teleportables += M
else
teleportables += A
for(var/atom/T in teleportables)
do_teleport(T, tele, 0)
usr << "\blue Teleport successful."
return
/obj/machinery/computer/telescience/proc/checkFail()
var/fail = 0
if(x_co == "")
usr << "\red Error: set X coordinates."
fail = 1
if(y_co == "")
usr << "\red Error: set Y coordinates."
fail = 1
if(z_co == "")
usr << "\red Error: set Z coordinates."
fail = 1
if(x_co < 11 || x_co > 245)
usr << "\red Error: X is less than 11 or greater than 245."
fail = 1
if(y_co < 11 || y_co > 245)
usr << "\red Error: Y is less than 11 or greater than 245."
fail = 1
if(z_co == 2 || z_co < 1 || z_co > 6)
usr << "\red Error: Z is less than 1, greater than 6, or equal to 2."
fail = 1
return fail
/obj/machinery/computer/telescience/Topic(href, href_list)
if(..())
return
if(href_list["setx"])
var/a = input("Please input desired X coordinate.", name, x_co) as num
a = copytext(sanitize(a), 1, 20)
x_co = a
x_co = text2num(x_co)
return
if(href_list["sety"])
var/b = input("Please input desired Y coordinate.", name, y_co) as num
b = copytext(sanitize(b), 1, 20)
y_co = b
y_co = text2num(y_co)
return
if(href_list["setz"])
var/c = input("Please input desired Z coordinate.", name, z_co) as num
c = copytext(sanitize(c), 1, 20)
z_co = c
z_co = text2num(z_co)
return
if(href_list["send"])
teleprep(0)
return
if(href_list["receive"])
teleprep(1)
return
if(href_list["recal"])
if(telepad == null)
for(var/obj/machinery/telepad/T in range(src,10))
telepad = T
if(!telepad) return
var/teleturf = get_turf(telepad)
teles_left = rand(8,12)
x_off = rand(-10,10)
y_off = rand(-10,10)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, teleturf)
s.start()
usr << "\blue Calibration successful."
return
+46
View File
@@ -0,0 +1,46 @@
/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 = 2
active_power_usage = 50
/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 = 2
active_power_usage = 50
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 << "\blue The [src] can now be moved."
else if(!anchored)
anchored = 1
user << "\blue The [src] is now secured."
if(istype(W, /obj/item/weapon/screwdriver))
if(stage == 0)
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
user << "\blue You unscrew the telepad's tracking beacon."
stage = 1
else if(stage == 1)
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
user << "\blue 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 << "\blue You disassemble the telepad."
new /obj/item/stack/sheet/metal(get_turf(src))
new /obj/item/stack/sheet/glass(get_turf(src))
del(src)
+66
View File
@@ -0,0 +1,66 @@
/obj/item/device/gps
name = "Space Positioning System"
desc = "Helping lost spacemen find their way through the galaxy since 3016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = 2.0
flags = FPRINT
slot_flags = SLOT_BELT
origin_tech = "programming=2;engineering=2"
var/gpstag = "COM0"
var/emped = 0
/obj/item/device/gps/New()
name = "Space Positioning System ([gpstag])"
overlays += "working"
/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 = ""
if(emped)
t += "ERROR"
else
t += "<BR><A href='?src=\ref[src];tag=1'>Set Tag</A> "
t += "<BR>Tag: [gpstag]"
for(var/obj/item/device/gps/G in world)
var/turf/pos = get_turf(G)
var/area/gps_area = get_area(G)
var/tracked_gpstag = G.gpstag
if(G.emped == 1)
t += "<BR>[tracked_gpstag]: ERROR"
else
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
var/datum/browser/popup = new(user, "SPS", name, 600, 450)
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 = copytext(sanitize(a), 1, 20)
if(length(a) != 4)
usr << "\blue The tag must be four letters long!"
return
else
gpstag = a
name = "Space Positioning System ([gpstag])"
return
/obj/item/device/gps/science
icon_state = "gps-s"
gpstag = "SCI0"
/obj/item/device/gps/engineering
icon_state = "gps-e"
gpstag = "ENG0"
@@ -46,4 +46,22 @@
new /obj/machinery/singularity_beacon/syndicate( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
del(src)
return
/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 << "\blue Locked In"
new /obj/machinery/telepad_cargo(user.loc)
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
del(src)
return
+59
View File
@@ -0,0 +1,59 @@
/obj/item/weapon/rcs
name = "rapid-crate-sender (RCS)"
desc = "Use this to send crates and closets to cargo telepads."
icon = 'icons/obj/items.dmi'
icon_state = "rcs"
opacity = 0
density = 0
anchored = 0.0
flags = FPRINT | CONDUCT
force = 10.0
throwforce = 10.0
throw_speed = 1
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)
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++
desc = "Use this to send crates and closets to cargo telepads. There are [rcharges] charges left."
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 << "\red The telepad locator has become uncalibrated."
else
mode = 0
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
user << "\blue 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 << "\red You emag the RCS. Click on it to toggle between modes."
return
@@ -178,6 +178,68 @@
del(src)
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/rcs) && !src.opened)
var/obj/item/weapon/rcs/E = W
if(E.rcharges != 0)
if(E.mode == 0)
if(!E.teleporting)
var/list/L = list()
var/list/areaindex = list()
for(var/obj/machinery/telepad_cargo/R in world)
if(R.stage == 0)
var/turf/T = get_turf(R)
var/tmpname = T.loc.name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
else
areaindex[tmpname] = 1
L[tmpname] = R
var/desc = input("Please select a telepad.", "RCS") in L
E.pad = L[desc]
playsound(E.loc, 'sound/machines/click.ogg', 50, 1)
user << "\blue Teleporting [src.name]..."
E.teleporting = 1
sleep(50)
E.teleporting = 0
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
do_teleport(src, E.pad, 0)
E.rcharges--
if(E.rcharges != 1)
user << "\blue Teleport successful. [E.rcharges] charges left."
E.desc = "Use this to send crates and closets to cargo telepads. There are [E.rcharges] charges left."
return
else
user << "\blue Teleport successful. [E.rcharges] charge left."
E.desc = "Use this to send crates and closets to cargo telepads. There is [E.rcharges] charge left."
return
else
E.rand_x = rand(50,200)
E.rand_y = rand(50,200)
var/L = locate(E.rand_x, E.rand_y, 6)
playsound(E.loc, 'sound/machines/click.ogg', 50, 1)
user << "\blue Teleporting [src.name]..."
E.teleporting = 1
sleep(50)
E.teleporting = 0
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
do_teleport(src, L)
E.rcharges--
if(E.rcharges != 1)
user << "\blue Teleport successful. [E.rcharges] charges left."
E.desc = "Use this to send crates and closets to cargo telepads. There are [E.rcharges] charges left."
return
else
user << "\blue Teleport successful. [E.rcharges] charge left."
E.desc = "Use this to send crates and closets to cargo telepads. There is [E.rcharges] charge left."
return
else
user << "\red Out of charges."
return
if(src.opened)
if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
@@ -393,6 +393,9 @@
return attack_hand(user)
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/rcs) && !src.opened)
..()
return
if(opened)
if(isrobot(user))
return
+3
View File
@@ -221,6 +221,8 @@
// ++++ROCKDTBEN++++ MOB PROCS //END
/*
/mob/living/carbon/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null) // -- TLE -- Merged by Carn
if(stat)
src << "You must be conscious to do this!"
@@ -311,6 +313,7 @@
if(new_area)
new_area.Entered(src)
*/
/mob/living/carbon/clean_blood()
. = ..()
+81
View File
@@ -0,0 +1,81 @@
/mob/living/proc/handle_ventcrawl()
for(var/obj/machinery/atmospherics/unary/vent_pump/V in range(src,1))
if(V.welded) continue
src.Move(V)
return
src << "You can only enter an unwelded vent!"
/obj/machinery/atmospherics/relaymove(mob/user as mob,var/mdir)
if(!anchored)
user.loc = get_turf(src.loc)
return
if(user.stat || !isturf(src.loc))
return
if(!(mdir&initialize_directions))
visible_message(pick("clang","CLANG","Clang","clong","CLONG","Clong","tink","tak","tok","DOK","DAK"))
user << "donk" // find the user and put a donk on it
user.Stun(1)
return
var/turf/T = get_step(loc,mdir)
var/fromdir = turn(mdir,180)
for(var/obj/machinery/atmospherics/OMA in T)
if(!(OMA.initialize_directions&fromdir))
continue
user.Move(OMA)
return
user.Move(T) // broken pipe
/obj/machinery/atmospherics/Entered(mob/M)
if(istype(M) && M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = loc
/obj/machinery/atmospherics/unary/vent_pump/Entered(mob/user, atom/oldloc)
if(istype(oldloc, /obj/machinery/atmospherics)) // this is a unary device, came from a pipe rather than the world
if(welded)
user << "\red [src] is welded shut!"
return ..()
user.Move(loc)
user.visible_message("\blue [user] scrambles out of [src].")
if(user.client)
user.client.perspective = MOB_PERSPECTIVE
user.client.eye = user
return ..()
/obj/machinery/atmospherics/binary/pump/Enter(mob/M,atom/oldloc)
if(stat || !on) return 1
if(get_dir(src,oldloc) == dir) // output
M << "You can't move against the flow of [src]!"
return 0
return 1
/obj/machinery/atmospherics/binary/pump/Entered(mob/living/M as mob)
if(on)
M << "[src] spits you violently out the other side!"
M.apply_damage(5)
src.relaymove(M,dir)
return ..()
/obj/machinery/atmospherics/binary/volume_pump/Enter(mob/M,atom/oldloc)
if(stat || !on) return 1
if(get_dir(src,oldloc) == dir) // output
M << "You can't move against the flow of [src]!"
return 0
return 1
/obj/machinery/atmospherics/binary/volume_pump/Entered(mob/living/M as mob)
if(on)
M << "[src] spits you violently out the other side!"
M.apply_damage(5)
src.relaymove(M,dir)
return ..()
/obj/machinery/atmospherics/valve/Enter(mob/M,atom/oldloc)
if(!stat && !open)
M << "You can't get past [src]."
return 0
return 1
/obj/machinery/atmospherics/Del()
for(var/atom/movable/AM in src)
AM.loc = loc
..()
+10
View File
@@ -1593,6 +1593,16 @@ datum/design/beacon
materials = list ("$metal" = 20, "$glass" = 10)
build_path = "/obj/item/device/radio/beacon"
datum/design/telepad_beacon
name = "Telepad Beacon"
desc = "Use to warp in a cargo telepad."
id = "telepad_beacon"
req_tech = list("bluespace" = 3, "materials" = 4)
build_type = PROTOLATHE
materials = list ("$metal" = 2000, "$glass" = 1750, "$silver" = 500)
build_path = "/obj/item/device/telepad_beacon"
datum/design/bag_holding
name = "Bag of Holding"
desc = "A backpack that opens into a localized pocket of Blue Space."