Prototype for transit escape shuttle/pods. If there are any bugs, ping doohl on IRC or make an issue.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3350 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
vageyenaman@gmail.com
2012-03-24 01:15:47 +00:00
parent 4782ca36a4
commit 84cbbbcced
9 changed files with 3767 additions and 3451 deletions
+130 -11
View File
@@ -5,14 +5,15 @@
// and the time before it leaves again
#define SHUTTLEARRIVETIME 600 // 10 minutes = 600 seconds
#define SHUTTLELEAVETIME 180 // 3 minutes = 180 seconds
#define SHUTTLETRANSITTIME 120 // 2 minutes = 120 seconds
var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
datum/shuttle_controller
var
location = 0 //0 = somewhere far away, 1 = at SS13, 2 = returned from SS13
location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
online = 0
direction = 1 //-1 = going back to central command, 1 = going back to SS13
direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
endtime // timeofday that shuttle arrives
timelimit //important when the shuttle gets called for more than shuttlearrivetime
@@ -48,7 +49,7 @@ datum/shuttle_controller
proc/timeleft()
if(online)
var/timeleft = round((endtime - world.timeofday)/10 ,1)
if(direction == 1)
if(direction == 1 || direction == 2)
return timeleft
else
return SHUTTLEARRIVETIME-timeleft
@@ -81,6 +82,47 @@ datum/shuttle_controller
timeleft = 0
switch(location)
if(0)
/* --- Shuttle is in transit to Central Command from SS13 --- */
if(direction == 2)
if(timeleft>0)
return 0
/* --- Shuttle has arrived at Centrcal Command --- */
else
// turn off the star spawners
/*
for(var/obj/effect/starspawner/S in world)
S.spawning = 0
*/
location = 2
//main shuttle
var/area/start_location = locate(/area/shuttle/escape/transit)
var/area/end_location = locate(/area/shuttle/escape/centcom)
start_location.move_contents_to(end_location, null, 4)
//pods
start_location = locate(/area/shuttle/escape_pod1/transit)
end_location = locate(/area/shuttle/escape_pod1/centcom)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod2/transit)
end_location = locate(/area/shuttle/escape_pod2/centcom)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod3/transit)
end_location = locate(/area/shuttle/escape_pod3/centcom)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod5/transit)
end_location = locate(/area/shuttle/escape_pod5/centcom)
start_location.move_contents_to(end_location)
online = 0
return 1
/* --- Shuttle has docked centcom after being recalled --- */
if(timeleft>timelimit)
online = 0
direction = 1
@@ -93,6 +135,7 @@ datum/shuttle_controller
return 0
/* --- Shuttle has docked with the station - begin countdown to transit --- */
else if(timeleft <= 0)
location = 1
var/area/start_location = locate(/area/shuttle/escape/centcom)
@@ -134,35 +177,111 @@ datum/shuttle_controller
return 1
if(1)
if(timeleft>0)
return 0
/* --- Shuttle leaves the station, enters transit --- */
else
location = 2
// Turn on the star effects
/* // kinda buggy atm, i'll fix this later
for(var/obj/effect/starspawner/S in world)
if(!S.spawning)
spawn() S.startspawn()
*/
location = 0 // in deep space
direction = 2 // heading to centcom
//main shuttle
var/area/start_location = locate(/area/shuttle/escape/station)
var/area/end_location = locate(/area/shuttle/escape/centcom)
var/area/end_location = locate(/area/shuttle/escape/transit)
start_location.move_contents_to(end_location)
settimeleft(SHUTTLETRANSITTIME)
start_location.move_contents_to(end_location, null, EAST)
//pods
start_location = locate(/area/shuttle/escape_pod1/station)
end_location = locate(/area/shuttle/escape_pod1/centcom)
end_location = locate(/area/shuttle/escape_pod1/transit)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod2/station)
end_location = locate(/area/shuttle/escape_pod2/centcom)
end_location = locate(/area/shuttle/escape_pod2/transit)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod3/station)
end_location = locate(/area/shuttle/escape_pod3/centcom)
end_location = locate(/area/shuttle/escape_pod3/transit)
start_location.move_contents_to(end_location)
start_location = locate(/area/shuttle/escape_pod5/station)
end_location = locate(/area/shuttle/escape_pod5/centcom)
end_location = locate(/area/shuttle/escape_pod5/transit)
start_location.move_contents_to(end_location)
online = 0
world << "<B>The Emergency Shuttle has left the station! [timeleft()/60] until the shuttle docks in Central Command.</B>"
// Some aesthetic turbulance shaking
for(var/mob/M in end_location)
if(M.client)
spawn()
if(M.buckled)
shake_camera(M, 4, 1) // buckled, not a lot of shaking
else
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
return 1
else
return 1
/*
Some slapped-together star effects for maximum spess immershuns. Basically consists of a
spawner, an ender, and bgstar. Spawners create bgstars, bgstars shoot off into a direction
until they reach a starender.
*/
/obj/effect/bgstar
name = "star"
var/speed = 10
var/direction = SOUTH
layer = 2 // TURF_LAYER
New()
..()
pixel_x += rand(-2,30)
pixel_y += rand(-2,30)
var/starnum = pick("1", "1", "1", "2", "3", "4")
icon_state = "star"+starnum
speed = rand(2, 5)
proc/startmove()
while(src)
sleep(speed)
step(src, direction)
for(var/obj/effect/starender/E in loc)
del(src)
/obj/effect/starender
invisibility = 101
/obj/effect/starspawner
invisibility = 101
var/spawndir = SOUTH
var/spawning = 0
West
spawndir = WEST
proc/startspawn()
spawning = 1
while(spawning)
sleep(rand(2, 30))
var/obj/effect/bgstar/S = new/obj/effect/bgstar(locate(x,y,z))
S.direction = spawndir
spawn()
S.startmove()
@@ -147,6 +147,9 @@ proc/process_ghost_teleport_locs()
/area/shuttle/escape/centcom
icon_state = "shuttle"
/area/shuttle/escape/transit // the area to pass through for 3 minute transit
icon_state = "shuttle"
/area/shuttle/escape_pod1
name = "Escape Pod One"
music = "music/escape.ogg"
@@ -157,6 +160,9 @@ proc/process_ghost_teleport_locs()
/area/shuttle/escape_pod1/centcom
icon_state = "shuttle"
/area/shuttle/escape_pod1/transit
icon_state = "shuttle"
/area/shuttle/escape_pod2
name = "Escape Pod Two"
music = "music/escape.ogg"
@@ -167,6 +173,9 @@ proc/process_ghost_teleport_locs()
/area/shuttle/escape_pod2/centcom
icon_state = "shuttle"
/area/shuttle/escape_pod2/transit
icon_state = "shuttle"
/area/shuttle/escape_pod3
name = "Escape Pod Three"
music = "music/escape.ogg"
@@ -177,6 +186,9 @@ proc/process_ghost_teleport_locs()
/area/shuttle/escape_pod3/centcom
icon_state = "shuttle"
/area/shuttle/escape_pod3/transit
icon_state = "shuttle"
/area/shuttle/escape_pod5 //Pod 4 was lost to meteors
name = "Escape Pod Five"
music = "music/escape.ogg"
@@ -187,6 +199,9 @@ proc/process_ghost_teleport_locs()
/area/shuttle/escape_pod5/centcom
icon_state = "shuttle"
/area/shuttle/escape_pod5/transit
icon_state = "shuttle"
/area/shuttle/mining
name = "Mining Shuttle"
music = "music/escape.ogg"
+33 -1
View File
@@ -44,9 +44,40 @@
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
heat_capacity = 700000
transit
var/pushdirection // push things that get caught in the transit tile this direction
north // moving to the north
pushdirection = SOUTH
one
icon_state = "1_south" // south because the space tile is scrolling south
two
icon_state = "2_south"
three
icon_state = "3_south"
east // moving to the east
pushdirection = WEST
one
icon_state = "1_west" // space tile is scrolling west
two
icon_state = "2_west"
three
icon_state = "3_west"
/turf/space/New()
// icon = 'space.dmi'
icon_state = "[pick(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)]"
if(!istype(src, /turf/space/transit))
icon_state = "[pick(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)]"
/turf/simulated
name = "station"
@@ -90,6 +121,7 @@
icon = 'shuttle.dmi'
thermal_conductivity = 0.05
heat_capacity = 0
layer = 2.1
/turf/simulated/shuttle/wall
name = "wall"
+107
View File
@@ -0,0 +1,107 @@
/* Simple object type, calls a proc when "stepped" on by something */
/obj/step_trigger
var/affect_ghosts = 0
var/stopper = 1 // stops throwers
invisibility = 101 // nope cant see this shit
/obj/step_trigger/proc/Trigger(var/atom/movable/A)
return 0
/obj/step_trigger/HasEntered(H as mob|obj)
..()
if(istype(H, /mob/dead/observer) && !affect_ghosts)
return
Trigger(H)
/* Tosses things in a certain direction */
/obj/step_trigger/thrower
var/direction = SOUTH // the direction of throw
var/tiles = 3 // if 0: forever until atom hits a stopper
var/immobilize = 0 // if nonzero: prevents mobs from moving while they're being flung
var/speed = 1 // delay of movement
var/facedir = 0 // if 1: atom faces the direction of movement
var/nostop = 0 // if 1: will only be stopped by teleporters
var/list/affecting = list()
Trigger(var/atom/movable/A)
var/curtiles = 0
var/stopthrow = 0
for(var/obj/step_trigger/thrower/T in orange(2, src))
if(T.affecting.Find(A))
return
if(ismob(A))
var/mob/M = A
if(immobilize)
M.canmove = 0
affecting.Add(A)
while(A && !stopthrow)
if(tiles)
if(curtiles >= tiles)
affecting.Remove(A)
break
curtiles++
// Calculate if we should stop the process
if(!nostop)
for(var/obj/step_trigger/T in get_step(A, direction))
if(T.stopper && T != src)
stopthrow = 1
affecting.Remove(A)
else
for(var/obj/step_trigger/teleporter/T in get_step(A, direction))
if(T.stopper)
stopthrow = 1
affecting.Remove(A)
var/predir = A.dir
step(A, direction)
if(!facedir)
A.dir = predir
sleep(speed)
if(ismob(A))
var/mob/M = A
if(immobilize)
M.canmove = 1
/* Stops things thrown by a thrower, doesn't do anything */
/obj/step_trigger/stopper
/* Instant teleporter */
/obj/step_trigger/teleporter
var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!)
var/teleport_y = 0
var/teleport_z = 0
Trigger(var/atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
A.x = teleport_x
A.y = teleport_y
A.z = teleport_z
/* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */
/obj/step_trigger/teleporter/random
var/teleport_x_offset = 0
var/teleport_y_offset = 0
var/teleport_z_offset = 0
Trigger(var/atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
if(teleport_x_offset && teleport_y_offset && teleport_z_offset)
A.x = rand(teleport_x, teleport_x_offset)
A.y = rand(teleport_y, teleport_y_offset)
A.z = rand(teleport_z, teleport_z_offset)
@@ -82,6 +82,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/Move(NewLoc, direct)
if(NewLoc)
loc = NewLoc
for(var/obj/step_trigger/S in NewLoc)
S.HasEntered(src)
return
loc = get_turf(src) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
@@ -93,6 +96,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if((direct & WEST) && x > 1)
x--
for(var/obj/step_trigger/S in locate(x, y, z))
S.HasEntered(src)
/mob/dead/observer/examine()
if(usr)
usr << desc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

+3475 -3439
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -357,6 +357,7 @@
#include "code\game\sound.dm"
#include "code\game\specops_shuttle.dm"
#include "code\game\status.dm"
#include "code\game\step_triggers.dm"
#include "code\game\supplyshuttle.dm"
#include "code\game\syndicate_shuttle.dm"
#include "code\game\syndicate_specops_shuttle.dm"