Merge pull request #949 from Erthilo/TGUpdates

TG Updates up to 3350
This commit is contained in:
Mloc
2012-04-30 10:31:25 -07:00
9 changed files with 3693 additions and 3179 deletions
+1
View File
@@ -377,6 +377,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"
+169 -9
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
@@ -64,7 +65,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
@@ -102,6 +103,47 @@ datum/shuttle_controller
// sound_siren = 1
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, NORTH)
//pods
start_location = locate(/area/shuttle/escape_pod1/transit)
end_location = locate(/area/shuttle/escape_pod1/centcom)
start_location.move_contents_to(end_location, null, NORTH)
start_location = locate(/area/shuttle/escape_pod2/transit)
end_location = locate(/area/shuttle/escape_pod2/centcom)
start_location.move_contents_to(end_location, null, NORTH)
start_location = locate(/area/shuttle/escape_pod3/transit)
end_location = locate(/area/shuttle/escape_pod3/centcom)
start_location.move_contents_to(end_location, null, NORTH)
start_location = locate(/area/shuttle/escape_pod5/transit)
end_location = locate(/area/shuttle/escape_pod5/centcom)
start_location.move_contents_to(end_location, null, EAST)
online = 0
return 1
/* --- Shuttle has docked centcom after being recalled --- */
if(timeleft>timelimit)
online = 0
direction = 1
@@ -114,6 +156,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)
@@ -159,16 +202,133 @@ datum/shuttle_controller
if(timeleft>0)
return 0
/* --- Shuttle leaves the station, enters transit --- */
else
departed = 1
location = 2
var/area/start_location = locate(/area/shuttle/escape/station)
var/area/end_location = locate(/area/shuttle/escape/centcom)
start_location.move_contents_to(end_location)
online = 0
// 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()
*/
departed = 1 // It's going!
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/transit)
settimeleft(SHUTTLETRANSITTIME)
start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.close()
//pods
start_location = locate(/area/shuttle/escape_pod1/station)
end_location = locate(/area/shuttle/escape_pod1/transit)
start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.close()
start_location = locate(/area/shuttle/escape_pod2/station)
end_location = locate(/area/shuttle/escape_pod2/transit)
start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.close()
start_location = locate(/area/shuttle/escape_pod3/station)
end_location = locate(/area/shuttle/escape_pod3/transit)
start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.close()
start_location = locate(/area/shuttle/escape_pod5/station)
end_location = locate(/area/shuttle/escape_pod5/transit)
start_location.move_contents_to(end_location, null, EAST)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.close()
captain_announce("The Emergency Shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.")
// 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()
+34 -4
View File
@@ -44,10 +44,41 @@
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 = "[rand(1,25)]"
if(!istype(src, /turf/space/transit))
..()
icon_state = "[rand(1,25)]"
/turf/simulated
name = "station"
@@ -91,6 +122,7 @@
icon = 'shuttle.dmi'
thermal_conductivity = 0.05
heat_capacity = 0
layer = 2.1
/turf/simulated/shuttle/wall
name = "wall"
@@ -136,13 +168,11 @@
if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t))
L.Add(t)
return L
Distance(turf/t)
if(get_dist(src,t) == 1)
var/cost = (src.x - t.x) * (src.x - t.x) + (src.y - t.y) * (src.y - t.y)
cost *= (pathweight+t.pathweight)/2
return cost
else
return get_dist(src,t)
+114
View File
@@ -0,0 +1,114 @@
/* 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
anchored = 1
/obj/step_trigger/proc/Trigger(var/atom/movable/A)
return 0
/obj/step_trigger/HasEntered(H as mob|obj)
..()
if(!H)
return
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 = 1 // 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(A in T.affecting)
return
if(ismob(A))
var/mob/M = A
if(immobilize)
M.canmove = 0
affecting.Add(A)
while(A && !stopthrow)
if(tiles)
if(curtiles >= tiles)
break
if(A.z != src.z)
break
curtiles++
sleep(speed)
// 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
else
for(var/obj/step_trigger/teleporter/T in get_step(A, direction))
if(T.stopper)
stopthrow = 1
if(A)
var/predir = A.dir
step(A, direction)
if(!facedir)
A.dir = predir
affecting.Remove(A)
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)
+9 -1
View File
@@ -12,8 +12,11 @@
s["host"] = host ? host : null
s["players"] = list()
s["admins"] = 0
var/admins = 0
var/n = 0
for(var/client/C)
n++
if(C.holder && C.holder.level >= 0) //not retired admin
if(!C.stealth) //stealthmins dont count as admins
@@ -25,4 +28,9 @@
s["player[n]"] = "[C.key]"
s["players"] = n
s["end"] = "#end"
return list2params(s)
// 7 + s["players"] + 1 = index of s["revinfo"]
s["revision"] = revdata.revision
s["admins"] = admins
return list2params(s)
@@ -84,6 +84,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)
@@ -95,6 +98,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
+1 -1
View File
@@ -186,7 +186,7 @@
// a.hallucinate(src)
if(!handling_hal && hallucination > 20)
spawn handle_hallucinations() //The not boring kind!
hallucination = max(hallucination - 2, 0)
hallucination = max(hallucination - 2, 0) // A more compact way of doing it. DMTG
//if(health < 0)
// for(var/obj/a in hallucinations)
// del a
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

+3359 -3164
View File
File diff suppressed because it is too large Load Diff