Files
Paradise/code/game/master_controller.dm
VivianFoxfoot@gmail.com 3385621585 Adds randomlly spawning rooms to the mining asteroid that contain various goodies. (Among them are a modified traitor beacon, a cloaking device and a closet full of resources so you can go build your own honk.)
These rooms will spawn at least out of range of space and the explored pathways, so at the very least some mining is required to even detect them with mesons.
Adds a borg upgrade system. Right now, it just contians a borg reset module that allows the borg to choose their module again.  Adds some support code to borgs to suppot flashproofing and renaming.
Adds a few various admin commands like a quick-list of objects (which is hardcoded) and a command to break the local air group.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3415 316c924e-a436-60f5-8080-3fe189b3f50e
2012-04-09 02:19:28 +00:00

129 lines
2.6 KiB
Plaintext

var/global/datum/controller/game_controller/master_controller //Set in world.New()
var/global/controllernum = "no"
datum/controller/game_controller
var/processing = 1
proc
setup()
setup_objects()
process()
setup()
if(master_controller && (master_controller != src))
del(src)
return
//There can be only one master.
if(!air_master)
air_master = new /datum/controller/air_system()
air_master.setup()
if(!job_master)
job_master = new /datum/controller/occupations()
if(job_master.SetupOccupations())
world << "\red \b Job setup complete"
job_master.LoadJobs("config/jobs.txt")
if(!tension_master)
tension_master = new /datum/tension()
world.tick_lag = 0.6
setup_objects()
setupgenetics()
for(var/i = 0, i < max_secret_rooms, i++)
make_mining_asteroid_secret()
syndicate_code_phrase = generate_code_phrase()//Sets up code phrase for traitors, for the round.
syndicate_code_response = generate_code_phrase()
emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle()
if(!ticker)
ticker = new /datum/controller/gameticker()
spawn
ticker.pregame()
setup_objects()
world << "\red \b Initializing objects"
sleep(-1)
for(var/obj/object in world)
object.initialize()
world << "\red \b Initializing pipe networks"
sleep(-1)
for(var/obj/machinery/atmospherics/machine in world)
machine.build_network()
world << "\red \b Initializing atmos machinery."
sleep(-1)
for(var/obj/machinery/atmospherics/unary/vent_pump/T in world)
T.broadcast_status()
for(var/obj/machinery/atmospherics/unary/vent_scrubber/T in world)
T.broadcast_status()
world << "\red \b Initializations complete."
process()
if(!processing)
return 0
controllernum = "yes"
spawn (100) controllernum = "no"
var/start_time = world.timeofday
air_master.process()
tension_master.process()
sleep(1)
sun.calc_position()
sleep(-1)
for(var/mob/M in world)
M.Life()
sleep(-1)
for(var/datum/disease/D in active_diseases)
D.process()
for(var/obj/machinery/machine in machines)
if(machine)
machine.process()
if(machine && machine.use_power)
machine.auto_use_power()
sleep(-1)
sleep(1)
for(var/obj/object in processing_objects)
object.process()
for(var/datum/pipe_network/network in pipe_networks)
network.process()
for(var/datum/powernet/P in powernets)
P.reset()
sleep(-1)
ticker.process()
sleep(world.timeofday+12-start_time)
spawn process()
return 1