mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
More work on away missions. They're almost playable now.
Things left to do mainly involves stuff interacting with Z8 - counting people as dead, making sure teleports don't work, etc. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4661 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -66,6 +66,8 @@
|
||||
return
|
||||
if(status)
|
||||
bombtank.ignite() //if its not a dud, boom (or not boom if you made shitty mix) the ignite proc is below, in this file
|
||||
else
|
||||
bombtank.release()
|
||||
|
||||
/obj/item/device/onetankbomb/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(bombassembly)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "gateway"
|
||||
desc = "It's a Nanotrasen approved one-way experimental teleporter that will take you places. Still has the pricetag on it."
|
||||
icon = 'icons/obj/machines/gateway.dmi'
|
||||
icon_state = "off"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/active = 0
|
||||
@@ -13,25 +14,58 @@
|
||||
|
||||
/obj/machinery/gateway/update_icon()
|
||||
if(active)
|
||||
icon_state = "on[dir]"
|
||||
icon_state = "on"
|
||||
return
|
||||
icon_state = "off[dir]"
|
||||
|
||||
/obj/machinery/gateway/attack_hand(mob/user as mob)
|
||||
update_icon()
|
||||
icon_state = "off"
|
||||
|
||||
|
||||
|
||||
//this is da important part wot makes things go
|
||||
/obj/machinery/gateway/center
|
||||
density = 1
|
||||
dir = 3 //this doesn't work for some reason? see below
|
||||
icon_state = "offcenter"
|
||||
use_power = 1
|
||||
|
||||
//warping vars
|
||||
var/list/linked = list() //a list of the connected gateway chunks
|
||||
var/ready = 0
|
||||
var/ready = 0 //have we got all the parts for a gateway?
|
||||
var/wait = 0 //this just grabs world.time at world start
|
||||
|
||||
//power vars
|
||||
var/obj/structure/cable/attached = null
|
||||
|
||||
/obj/machinery/gateway/center/initialize()
|
||||
dir = 3 //see above
|
||||
update_icon()
|
||||
attemptAttach()
|
||||
|
||||
if(src.z == 1) //if it's the station gate
|
||||
returndestination = get_step(loc, SOUTH)
|
||||
wait = world.time + 18000 //+ thirty minutes
|
||||
|
||||
/obj/machinery/gateway/center/update_icon()
|
||||
if(active)
|
||||
icon_state = "oncenter"
|
||||
return
|
||||
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()
|
||||
if(stat & (NOPOWER))
|
||||
if(active) toggleoff()
|
||||
return
|
||||
|
||||
if(active)
|
||||
use_power(128000)
|
||||
|
||||
/obj/machinery/gateway/center/proc/detect()
|
||||
linked = list() //clear the list
|
||||
@@ -52,9 +86,19 @@
|
||||
if(linked.len == 8)
|
||||
ready = 1
|
||||
|
||||
/obj/machinery/gateway/center/proc/toggleon()
|
||||
/obj/machinery/gateway/center/proc/toggleon(mob/user as mob)
|
||||
if(!ready) return
|
||||
if(linked.len != 8) return
|
||||
if(!powered()) return
|
||||
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>"
|
||||
return
|
||||
if(!awaydestinations.len)
|
||||
user << "<span class='notice'>Error: No destination found.</span>"
|
||||
return
|
||||
if(!checkWirePower())
|
||||
user << "<span class='notice'>Error: Inadequate electricity reserve.</span>"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/gateway/G in linked)
|
||||
G.active = 1
|
||||
@@ -76,16 +120,40 @@
|
||||
detect()
|
||||
return
|
||||
if(!active)
|
||||
toggleon()
|
||||
toggleon(user)
|
||||
return
|
||||
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(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
|
||||
/obj/machinery/gateway/center/HasEntered(mob/user as mob)
|
||||
if(!ready) return
|
||||
if(!active) return
|
||||
|
||||
var/obj/effect/landmark/dest = pick(awaydestinations)
|
||||
if(dest)
|
||||
user.loc = dest.loc
|
||||
return
|
||||
if(src.z == 1) //if it's the station gate
|
||||
var/obj/effect/landmark/dest = pick(awaydestinations)
|
||||
if(dest)
|
||||
//i'm sorry did i say good?
|
||||
user.loc = dest.loc
|
||||
use_power(128000)
|
||||
return
|
||||
else //they made it back to the station!
|
||||
user.loc = returndestination
|
||||
user.dir = SOUTH
|
||||
use_power(128000)
|
||||
@@ -9,6 +9,7 @@
|
||||
var/list/things = params2list(loot)
|
||||
if(things && things.len)
|
||||
for(var/i = lootcount, i > 0, i--)
|
||||
if(!things.len) return
|
||||
var/lootspawn = text2path(pick(things))
|
||||
if(!lootdoubles)
|
||||
things.Remove(lootspawn)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/obj/item/weapon/paper/pamphlet
|
||||
name = "pamphlet"
|
||||
icon_state = "pamphlet"
|
||||
info = "<b>Welcome to the Nanotrasen Gateway project...</b><br>\
|
||||
Congratulations! If you're reading this, you and your superiors have decided that you're \
|
||||
ready to commit to a life spent colonising the rolling hills of far away worlds. You \
|
||||
must be ready for a lifetime of adventure, a little bit of hard work, and an award \
|
||||
winning dental plan- but that's not all the Nanotrasen Gateway project has to offer.<br> \
|
||||
<br>Because we care about you, we feel it is only fair to make sure you know the risks \
|
||||
before you commit to joining the Nanotrasen Gateway project. All away destinations have \
|
||||
been fully scanned by a Nanotrasen expeditionary team, and are certified to be 100% safe. \
|
||||
We've even left a case of space beer along with the basic materials you'll need to expand \
|
||||
Nanotrasen's operational area and start your new life."
|
||||
@@ -1,6 +1,8 @@
|
||||
var/list/potentialRandomZlevels = list()
|
||||
|
||||
proc/createRandomZlevel()
|
||||
if(awaydestinations.len) //crude, but it saves another var!
|
||||
return
|
||||
|
||||
var/list/potentialRandomZlevels = list()
|
||||
|
||||
var/text = file2text("maps/RandomZLevels/fileList.txt")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user