Split the gateway/center into two objects, stationcenter and stationaway. The gates actually search for and detect eachother, and warp to eachother (suck it Pete)

The away gate doesn't require power to make away mission mapping possible in unpowered areas like caves, the station gate requires less power than it did (for the time being, it'd be nice if people could actually use the gate. Makes no sense to make new content so hard to use. If it becomes a problem, I can up the power requirement again).

Added a "calibrated" var to the away gate. If it's uncalibrated, you'll warp to the destination landmarks. Hitting the gate with a multitool with calibrate it, and any more warping to the gate will be on target.

It defaults to calibrated, so remember to set it to 0 if you want people to appear somehwere other than at the gate.

Updated Cheridans map with the new gate type (and made it uncalibrated)

Updated the example map to use the new gate type

Updated the station to use the new gate type

Changed the gateway description to reflect it's unknown origin

To do: Make gates able to block sending from the other gate (so you can exile people), make damaging gates so they can't send/recieve (and still do the other) possible. Give the station gateway unique sprites (for Nanotrasens own prototype gate, with appropriate description)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4718 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
Kortgstation@gmail.com
2012-09-18 05:59:36 +00:00
parent be04c81a27
commit 84308d4042
5 changed files with 129 additions and 66 deletions

View File

@@ -171,8 +171,7 @@ var/list/AAlarmWireColorToIndex
//away missions //away missions
var/list/awaydestinations = list() //a list of landmarks that the warpgate can take you to var/list/awaydestinations = list() //a list of landmarks that the warpgate can take you to
var/returndestination //the location immediately south of the station gateway var/returndestination //the location immediately south of the station gateway
var/calibrateddestination //If you actually arrive at the away gate
// MySQL configuration // MySQL configuration

View File

@@ -1,6 +1,6 @@
/obj/machinery/gateway /obj/machinery/gateway
name = "gateway" name = "gateway"
desc = "It's a Nanotrasen approved one-way experimental teleporter that will take you places. Still has the pricetag on it." desc = "A mysterious gateway built by unknown hands, it allows for faster than light travel to far-flung locations."
icon = 'icons/obj/machines/gateway.dmi' icon = 'icons/obj/machines/gateway.dmi'
icon_state = "off" icon_state = "off"
density = 1 density = 1
@@ -21,53 +21,39 @@
//this is da important part wot makes things go //this is da important part wot makes things go
/obj/machinery/gateway/center /obj/machinery/gateway/centerstation
density = 1 density = 1
icon_state = "offcenter" icon_state = "offcenter"
use_power = 1 use_power = 1
//warping vars //warping vars
var/list/linked = list() //a list of the connected gateway chunks var/list/linked = list()
var/ready = 0 //have we got all the parts for a gateway? var/ready = 0 //have we got all the parts for a gateway?
var/wait = 0 //this just grabs world.time at world start var/wait = 0 //this just grabs world.time at world start
var/obj/machinery/gateway/centeraway/awaygate = null //inb4 this doesnt work at all
//power vars /obj/machinery/gateway/centerstation/initialize()
var/obj/structure/cable/attached = null
/obj/machinery/gateway/center/initialize()
update_icon() update_icon()
attemptAttach() returndestination = get_step(loc, SOUTH)
wait = world.time + 18000 //+ thirty minutes
awaygate = locate(/obj/machinery/gateway/centeraway, world)
if(src.z == 1) //if it's the station gate /obj/machinery/gateway/centerstation/update_icon()
returndestination = get_step(loc, SOUTH)
wait = world.time + 18000 //+ thirty minutes
/obj/machinery/gateway/center/update_icon()
if(active) if(active)
icon_state = "oncenter" icon_state = "oncenter"
return return
icon_state = "offcenter" icon_state = "offcenter"
//stolen from syndie beacon code.
/obj/machinery/gateway/center/proc/checkWirePower()
if(!attached)
return 0
var/datum/powernet/PN = attached.get_powernet()
if(!PN)
return 0
if(PN.avail < 128000)
return 0
return 1
obj/machinery/gateway/center/process() obj/machinery/gateway/centerstation/process()
if(stat & (NOPOWER)) if(stat & (NOPOWER))
if(active) toggleoff() if(active) toggleoff()
return return
if(active) if(active)
use_power(128000) use_power(5000)
/obj/machinery/gateway/center/proc/detect() /obj/machinery/gateway/centerstation/proc/detect()
linked = list() //clear the list linked = list() //clear the list
var/turf/T = loc var/turf/T = loc
@@ -86,19 +72,16 @@ obj/machinery/gateway/center/process()
if(linked.len == 8) if(linked.len == 8)
ready = 1 ready = 1
/obj/machinery/gateway/center/proc/toggleon(mob/user as mob) /obj/machinery/gateway/centerstation/proc/toggleon(mob/user as mob)
if(!ready) return if(!ready) return
if(linked.len != 8) return if(linked.len != 8) return
if(!powered()) return if(!powered()) return
if(world.time < wait) if(world.time < wait)
user << "<span class='notice'>Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.</span>" user << "<span class='notice'>Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.</span>"
return return
if(!awaydestinations.len) if(awaygate == null)
user << "<span class='notice'>Error: No destination found.</span>" user << "<span class='notice'>Error: No destination found.</span>"
return return
if(!checkWirePower())
user << "<span class='notice'>Error: Inadequate electricity reserve.</span>"
return
for(var/obj/machinery/gateway/G in linked) for(var/obj/machinery/gateway/G in linked)
G.active = 1 G.active = 1
@@ -107,7 +90,7 @@ obj/machinery/gateway/center/process()
update_icon() update_icon()
density = 0 density = 0
/obj/machinery/gateway/center/proc/toggleoff() /obj/machinery/gateway/centerstation/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked) for(var/obj/machinery/gateway/G in linked)
G.active = 0 G.active = 0
G.update_icon() G.update_icon()
@@ -115,7 +98,7 @@ obj/machinery/gateway/center/process()
update_icon() update_icon()
density = 1 density = 1
/obj/machinery/gateway/center/attack_hand(mob/user as mob) /obj/machinery/gateway/centerstation/attack_hand(mob/user as mob)
if(!ready) if(!ready)
detect() detect()
return return
@@ -124,40 +107,121 @@ obj/machinery/gateway/center/process()
return return
toggleoff() toggleoff()
/obj/machinery/gateway/center/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
attemptAttach(user, 1)
//this is kinda ugly i know, but i want the attach proc seperate so we can call it in initialize()
/obj/machinery/gateway/center/proc/attemptAttach(mob/user as mob, tilesafe = 0)
var/turf/T = loc
if(tilesafe && T.intact)
return
if(attached)
attached = null
user << "<span class='notice'>You detach the cable from [src].</span>"
return
if(isturf(T))
attached = locate() in T
if(user)
if(!attached)
user << "<span class='notice'>There isn't a cable to connect to [src].</span>"
return
user << "<span class='notice'>You attach the cable to [src].</span>"
//okay, here's the good teleporting stuff //okay, here's the good teleporting stuff
/obj/machinery/gateway/center/HasEntered(mob/user as mob) /obj/machinery/gateway/centerstation/HasEntered(mob/user as mob)
if(!ready) return if(!ready) return
if(!active) return if(!active) return
if(awaygate == null) return
if(src.z == 1) //if it's the station gate if(awaygate.calibrated)
calibrateddestination = get_step(awaygate.loc, SOUTH)
user.loc = calibrateddestination
return
else
var/obj/effect/landmark/dest = pick(awaydestinations) var/obj/effect/landmark/dest = pick(awaydestinations)
if(dest) if(dest)
//i'm sorry did i say good?
user.loc = dest.loc user.loc = dest.loc
use_power(128000) user.dir = SOUTH
use_power(5000)
return return
else //they made it back to the station!
user.loc = returndestination
user.dir = SOUTH
use_power(128000)
/////////////////////////////////////Away////////////////////////
/obj/machinery/gateway/centeraway
density = 1
icon_state = "offcenter"
use_power = 0
var/calibrated = 1
var/list/linked = list() //a list of the connected gateway chunks
var/ready = 0
var/stationgate = null
/obj/machinery/gateway/centeraway/initialize()
update_icon()
calibrateddestination = get_step(loc, SOUTH)
stationgate = locate(/obj/machinery/gateway/centerstation, world)
/obj/machinery/gateway/centeraway/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"
/obj/machinery/gateway/centeraway/proc/detect()
linked = list() //clear the list
var/turf/T = loc
for(var/i in alldirs)
T = get_step(loc, i)
var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T
if(G)
linked.Add(G)
continue
//this is only done if we fail to find a part
ready = 0
toggleoff()
break
if(linked.len == 8)
ready = 1
/obj/machinery/gateway/centeraway/proc/toggleon(mob/user as mob)
if(!ready) return
if(linked.len != 8) return
if(stationgate == null)
user << "<span class='notice'>Error: No destination found.</span>"
return
for(var/obj/machinery/gateway/G in linked)
G.active = 1
G.update_icon()
active = 1
update_icon()
density = 0
/obj/machinery/gateway/centeraway/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked)
G.active = 0
G.update_icon()
active = 0
update_icon()
density = 1
/obj/machinery/gateway/centeraway/attack_hand(mob/user as mob)
if(!ready)
detect()
return
if(!active)
toggleon(user)
return
toggleoff()
/obj/machinery/gateway/centeraway/HasEntered(mob/user as mob)
if(!ready) return
if(!active) return
user.loc = returndestination
user.dir = SOUTH
/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/multitool))
if(calibrated == 1)
user << "\black The gate is already calibrated, there is no work for you to do here."
return
else
user << "\blue <b>Recalibration successful!</b>: \black The gates systems have been fine tuned, travel to the gate will now be on target."
calibrated = 1
return

View File

@@ -76,7 +76,7 @@
"bx" = (/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = ""},/turf/simulated/floor/plating,/area/awaymission/BMPship1) "bx" = (/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = ""},/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"by" = (/obj/structure/closet/crate/freezer,/obj/item/weapon/reagent_containers/food/drinks/beer,/obj/item/weapon/reagent_containers/food/drinks/beer,/turf/simulated/floor/plating,/area/awaymission/BMPship1) "by" = (/obj/structure/closet/crate/freezer,/obj/item/weapon/reagent_containers/food/drinks/beer,/obj/item/weapon/reagent_containers/food/drinks/beer,/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"bz" = (/obj/machinery/gateway{dir = 8},/turf/simulated/floor/plating,/area/awaymission/BMPship1) "bz" = (/obj/machinery/gateway{dir = 8},/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"bA" = (/obj/machinery/gateway/center,/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor/plating,/area/awaymission/BMPship1) "bA" = (/obj/machinery/gateway/centeraway{calibrated = 0},/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"bB" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0; tag = ""},/obj/machinery/gateway{dir = 4},/turf/simulated/floor/plating,/area/awaymission/BMPship1) "bB" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0; tag = ""},/obj/machinery/gateway{dir = 4},/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"bC" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/awaymission/BMPship1) "bC" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/awaymission/BMPship1)
"bD" = (/obj/structure/largecrate,/turf/simulated/floor/plating{tag = "icon-warnplate (EAST)"; icon_state = "warnplate"; dir = 4},/area/awaymission/BMPship1) "bD" = (/obj/structure/largecrate,/turf/simulated/floor/plating{tag = "icon-warnplate (EAST)"; icon_state = "warnplate"; dir = 4},/area/awaymission/BMPship1)

View File

@@ -12,7 +12,7 @@
"al" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/turf/simulated/floor,/area/awaymission/example) "al" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/turf/simulated/floor,/area/awaymission/example)
"am" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/turf/simulated/floor,/area/awaymission/example) "am" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/turf/simulated/floor,/area/awaymission/example)
"an" = (/obj/machinery/gateway{dir = 8},/turf/simulated/floor,/area/awaymission/example) "an" = (/obj/machinery/gateway{dir = 8},/turf/simulated/floor,/area/awaymission/example)
"ao" = (/obj/machinery/gateway/center,/obj/structure/cable{icon_state = "0-2"; pixel_y = 1; d2 = 2},/turf/simulated/floor,/area/awaymission/example) "ao" = (/obj/structure/cable{icon_state = "0-2"; pixel_y = 1; d2 = 2},/obj/machinery/gateway/centeraway,/turf/simulated/floor,/area/awaymission/example)
"ap" = (/obj/machinery/gateway{dir = 4},/turf/simulated/floor,/area/awaymission/example) "ap" = (/obj/machinery/gateway{dir = 4},/turf/simulated/floor,/area/awaymission/example)
"aq" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor,/area/awaymission/example) "aq" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor,/area/awaymission/example)
"ar" = (/obj/item/weapon/cigbutt,/turf/simulated/floor,/area/awaymission/example) "ar" = (/obj/item/weapon/cigbutt,/turf/simulated/floor,/area/awaymission/example)

View File

@@ -1211,7 +1211,7 @@
"axo" = (/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/turf/simulated/floor/plating,/area/storage/tech) "axo" = (/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/turf/simulated/floor/plating,/area/storage/tech)
"axp" = (/obj/machinery/power/apc{dir = 4; name = "Tech. Storage APC"; pixel_x = 24; pixel_y = 0},/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/storage/tech) "axp" = (/obj/machinery/power/apc{dir = 4; name = "Tech. Storage APC"; pixel_x = 24; pixel_y = 0},/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/storage/tech)
"axq" = (/obj/item/weapon/paper{info = "Congratulations,<br><br>Your station has been selected to carry out the Gateway Project.<br><br>The equipment will be shipped to you at the start of the next quarter.<br> You are to prepare a secure location to house the equipment as outlined in the attached documents.<br><br>--Nanotrasen Blue Space Research"; name = "Confidential Correspondence, Pg 1"; pixel_x = 0; pixel_y = 0},/obj/machinery/gateway{dir = 8},/turf/simulated/floor{tag = "icon-vault (WEST)"; icon_state = "vault"; dir = 8},/area/teleporter/gateway) "axq" = (/obj/item/weapon/paper{info = "Congratulations,<br><br>Your station has been selected to carry out the Gateway Project.<br><br>The equipment will be shipped to you at the start of the next quarter.<br> You are to prepare a secure location to house the equipment as outlined in the attached documents.<br><br>--Nanotrasen Blue Space Research"; name = "Confidential Correspondence, Pg 1"; pixel_x = 0; pixel_y = 0},/obj/machinery/gateway{dir = 8},/turf/simulated/floor{tag = "icon-vault (WEST)"; icon_state = "vault"; dir = 8},/area/teleporter/gateway)
"axr" = (/obj/machinery/gateway/center,/obj/structure/cable{icon_state = "0-2"; d2 = 2},/turf/simulated/floor{icon_state = "dark"},/area/teleporter/gateway) "axr" = (/obj/machinery/gateway/centerstation,/turf/simulated/floor{icon_state = "dark"},/area/teleporter/gateway)
"axs" = (/obj/machinery/gateway{dir = 4},/turf/simulated/floor{tag = "icon-vault (WEST)"; icon_state = "vault"; dir = 8},/area/teleporter/gateway) "axs" = (/obj/machinery/gateway{dir = 4},/turf/simulated/floor{tag = "icon-vault (WEST)"; icon_state = "vault"; dir = 8},/area/teleporter/gateway)
"axt" = (/obj/machinery/camera{c_tag = "EVA Maintenance"; dir = 8; network = "SS13"},/obj/machinery/light/small{dir = 4},/turf/simulated/floor/plating,/area/maintenance/fpmaint) "axt" = (/obj/machinery/camera{c_tag = "EVA Maintenance"; dir = 8; network = "SS13"},/obj/machinery/light/small{dir = 4},/turf/simulated/floor/plating,/area/maintenance/fpmaint)
"axu" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/machinery/light{icon_state = "tube1"; dir = 8},/obj/item/device/radio/intercom{freerange = 1; frequency = 1459; name = "Station Intercom (General)"; pixel_x = -30},/obj/item/weapon/tank/jetpack/carbondioxide,/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/ai_monitored/storage/eva) "axu" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/machinery/light{icon_state = "tube1"; dir = 8},/obj/item/device/radio/intercom{freerange = 1; frequency = 1459; name = "Station Intercom (General)"; pixel_x = -30},/obj/item/weapon/tank/jetpack/carbondioxide,/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/ai_monitored/storage/eva)