/obj/team/proc/process() if (src.base) var/obj/starting = locate(text("landmark*CTF-base-[]", src.base)) while(locate(text("landmark*CTF-supply-[]", src.base))) var/obj/L = locate(text("landmark*CTF-supply-[]", src.base)) var/obj/item/weapon/card/id/I = new /obj/item/weapon/card/id( L.loc ) I.access_level = 5 I.lab_access = 5 I.engine_access = 5 I.air_access = 5 I.assignment = "Captain" I.registered = text("[]", uppertext((src.color ? src.color : "rogue"))) I.name = text("[]'s ID Card ([]>[]-[]-[])", I.registered, I.access_level, I.lab_access, I.engine_access, I.air_access) var/obj/item/weapon/paper/flag/F = new /obj/item/weapon/paper/flag( L.loc ) if (src.color) F.icon_state = text("flag_[]", src.color) F.name = text("flag- '[] Team's Flag'", uppertext(src.color)) else F.name = "flag- 'NEUTRAL Team's Flag'" F.icon_state = "flag_neutral" F.info = text("This is an authentic [] flag!\nCapture the Flag", (src.color ? src.color : "neutral")) if (src.master.paint_cans) var/obj/item/weapon/paint/P = new /obj/item/weapon/paint( L.loc ) if (src.color) P.color = src.color P.icon_state = text("paint_[]", src.color) else P.color = "neutral" P.icon_state = text("paint_[]", src.color) del(L) while(locate(text("landmark*CTF-wardrobe-[]", src.base))) var/obj/L = locate(text("landmark*CTF-wardrobe-[]", src.base)) switch(src.color) if("blue") new /obj/closet/wardrobe( L.loc ) if("green") new /obj/closet/wardrobe/green( L.loc ) if("yellow") new /obj/closet/wardrobe/yellow( L.loc ) if("black") new /obj/closet/wardrobe/black( L.loc ) if("white") new /obj/closet/wardrobe/white( L.loc ) if("red") new /obj/closet/wardrobe/red( L.loc ) else del(L) if (starting) for(var/mob/human/H in src.members) H.loc = starting.loc if ((src.master.autodress && src.color)) H.w_uniform = null del(H.w_uniform) H.shoes = null del(H.shoes) switch(src.color) if("blue") H.w_uniform = new /obj/item/weapon/clothing/under/blue( H ) H.shoes = new /obj/item/weapon/clothing/shoes/brown( H ) if("green") H.w_uniform = new /obj/item/weapon/clothing/under/green( H ) H.shoes = new /obj/item/weapon/clothing/shoes/black( H ) if("yellow") H.w_uniform = new /obj/item/weapon/clothing/under/yellow( H ) H.shoes = new /obj/item/weapon/clothing/shoes/orange( H ) if("black") H.w_uniform = new /obj/item/weapon/clothing/under/black( H ) H.shoes = new /obj/item/weapon/clothing/shoes/black( H ) if("white") H.w_uniform = new /obj/item/weapon/clothing/under/white( H ) H.shoes = new /obj/item/weapon/clothing/shoes/brown( H ) if("red") H.w_uniform = new /obj/item/weapon/clothing/under/red( H ) H.shoes = new /obj/item/weapon/clothing/shoes/brown( H ) else H.w_uniform = new /obj/item/weapon/clothing/under/orange( H ) H.shoes = new /obj/item/weapon/clothing/shoes/orange( H ) H.w_uniform.layer = 20 H.shoes.layer = 20 return /obj/team/proc/show_screen(mob/user as mob) var/dat = "

CTF Team


"
	dat += text("\[disband\]\n", src)
	dat += text("Max Players: []\n", src, src.max_players)
	dat += text("Captain: []\n", src, (src.captain ? src.captain : "NONE"))
	dat += "Members:\n"
	for(var/mob/M in src.members)
		dat += text("\t[] ([])\n", M.rname, M.key)
	dat += text("Base: \t[]\nColor: \t[]\n\nRefresh", src, src.base, src, src.color, src)
	dat += "
" user.client_mob() << browse(dat, "window=ctf_team") return /obj/team/Topic(href, href_list) ..() if (ticker) return if ((usr.CanAdmin() || usr == src.captain)) if (href_list["color"]) var/t = input(usr, "Please select a new color", null, null) as null|anything in src.master.avail_colors if ((t && src.master.avail_colors.Find(t))) src.master.avail_colors -= t src.master.avail_colors += src.color src.color = t if (href_list["base"]) var/t = input(usr, "Please select a new base", null, null) as null|anything in src.master.avail_bases if ((t && src.master.avail_bases.Find(t))) src.master.avail_bases -= t src.master.avail_bases += src.base src.base = t if (usr.CanAdmin()) if (href_list["disband"]) del(src) return if (href_list["max_players"]) src.max_players = input(usr, "What is the max number of players on this team?", null, null) as num src.max_players = max(src.max_players, 1) if (href_list["captain"]) var/L = list( ) for(var/mob/human/H in world) if (H.client || H.currentDrone!=null) L += H for(var/obj/team/T in world) L -= T.members L -= T.captain var/mob/m = input(usr, "Please select a new captain", null, null) as null|anything in L if (ismob(m)) src.members -= src.captain src.members += m src.captain = m else src.members -= src.captain src.captain = null show_screen(src.captain) src.show_screen(usr) for(var/mob/human/H in world) if ((H.CanAdmin() || H == src.captain)) src.master.show_screen(H) return /obj/ctf_assist/New() ..() if(ticker) return going = 0 master_mode = "extended" world << "Capture the Flag Mode activated!" world << "The game start has been frozen to accomodate!" for(var/obj/begin/B in world) if (!( locate(/obj/grille, B.loc) )) new /obj/grille( B.loc ) for(var/mob/human/M in world) M.loc = locate(/area/start) if (M.start) M.primary = null del(M.primary) for(var/obj/item/weapon/I in M) //M = null del(I) M.start = 0 world << "All players have been pushed back!" return /obj/ctf_assist/proc/next_pick() src.pickers_left -= src.picker src.picker = null if (src.players_left.len < 1) world << "We are done picking! (No more people to be picked!)" src.picker = 0 return null if (src.pickers_left.len < 1) for(var/obj/team/T in src) if ((T.members.len < src.play_team && T.members.len < T.max_players)) if (T.captain) src.pickers_left += T.captain else src.pickers_left += T if (src.pickers_left.len < 1) world << "We are done picking! (All teams are full!)" src.picker = 0 return null else src.picker = pick(src.pickers_left) if (ismob(src.picker)) show_pick(src.picker) world << text("[] is picking!", src.picker) else if (istype(src.picker, /obj/team)) var/H = pick(src.players_left) var/obj/team/T = src.picker if (istype(T, /obj/team)) T.members += H src.players_left -= H spawn( 0 ) next_pick() return return src.picker return /obj/ctf_assist/proc/show_pick(mob/user as mob) var/dat = "

CTF Mode Pick


" dat += text("Players (per Team): []
\n\"Please Pick a Player
", src.play_team) for(var/mob/human/H in src.players_left) dat += text("[] ([])
", src, H, H.rname, H.key) user.client_mob() << browse(dat, "window=ctf_pick") return /obj/ctf_assist/proc/get_team(captain as mob) for(var/obj/team/T in src) if (T.captain == captain) return T return /obj/ctf_assist/proc/check_win(O as obj) if (src.wintype == "none") return var/obj/item/weapon/paper/flag/F = locate(/obj/item/weapon/paper/flag) var/winning = 1 for(var/obj/item/weapon/paper/flag/L in world) if (F.icon_state != L.icon_state) winning = 0 else if (src.wintype == "collect") if (F.loc != O) winning = 0 if (!( winning )) return var/obj/team/winner = null for(var/obj/team/T in src) if (text("flag_[]", T.color) == text("[]", F.icon_state)) winner = T else if (winner) world << "

The game has been won!!!

" world << text("Team: [] Team led by [] in []", uppertext(winner.color), winner.captain, winner.base) world << "Original Members:" for(var/mob/human/H in winner.members) if (H.client || H.currentDrone!=null) world << text("\t [] ([])", H.rname, H.key) return /obj/ctf_assist/proc/show_screen(mob/user as mob) var/dat = "

CTF Mode Helper


"
	dat += text("Players (per Team): []\nBarrier Time: [] minutes\n\nTeams:\n", src, src.play_team, src, src.barriertime)
	for(var/obj/team/O in src)
		if (ismob(O.captain))
			if (O.color)
				dat += text("\t[]'s Team ([])\n", src, O, O.captain, O.color)
			else
				dat += text("\t[]'s Team\n", src, O, O.captain)
		else
			if (O.color)
				dat += text("\t[] Team\n", src, O, O.color)
			else
				dat += text("\tNo Captain\n", src, O)
	dat += text("\[Add Team\]\nCaptains Select Members\n\nStart the Game (and Set up Map)\n\nWin Options: []\nCollection - All flags same color on clipboard\nConversion - All flags same color\nNone\n\nOther Options:\nAuto-Dress (Teams): []\nRemove Engine Ejection: []\nPaint Cans: []\nImmobile flags (Territory): []\nAdd Neutral Flags to Unused Bases: []\n\nRefresh", src, src, src, src.wintype, src, src, src, src, (src.autodress ? "Yes" : "No"), src, (src.ejectengine ? "Yes" : "No"), src, (src.paint_cans ? "Yes" : "No"), src, (src.immobile ? "Yes" : "No"), src, (src.neutral_replace ? "Yes" : "No"), src)
	dat += "
" user.client_mob() << browse(dat, "window=ctf_assist") return /obj/ctf_assist/Topic(href, href_list) ..() if ((ticker || src.starting)) return if (href_list["pick"]) if (src.picker == usr) var/H = locate(href_list["pick"]) if ((istype(H, /mob/human) && src.players_left.Find(H))) var/obj/team/T = get_team(src.picker) if (istype(T, /obj/team)) T.members += H src.players_left -= H next_pick() return else usr.client_mob() << "It's not your turn!" if (!( usr.CanAdmin() )) return if (href_list["team"]) var/obj/team/T = locate(href_list["team"]) if (istype(T, /obj/team)) T.show_screen(usr) if (href_list["play_team"]) src.play_team = input(usr, "What is the max number of players per team?", null, null) as num src.play_team = max(src.play_team, 1) if (href_list["barriertime"]) src.barriertime = input(usr, "What is the barrier life time (in minutes- decimals allowed)?", null, null) as num src.barriertime = max(src.barriertime, 0.1) if (href_list["win"]) if ((href_list["win"] in list( "collect", "convert", "none" ))) src.wintype = href_list["win"] if (href_list["autodress"]) src.autodress = !( src.autodress ) if (href_list["ejectengine"]) src.ejectengine = !( src.ejectengine ) if (href_list["paint_cans"]) src.paint_cans = !( src.paint_cans ) if (href_list["neutral_replace"]) src.neutral_replace = !( src.neutral_replace ) if (href_list["immobile"]) src.immobile = !( src.immobile ) if (href_list["add_team"]) if (src.avail_bases.len > 0) var/obj/team/T = new /obj/team( src ) T.master = src T.base = pick(src.avail_bases) T.color = pick(src.avail_colors) src.avail_bases -= T.base src.avail_colors -= T.color if (href_list["select_team"]) if (!( src.picking )) src.picking = 1 for(var/mob/human/H in world) src.players_left += H for(var/obj/team/T in src) if (T.members.len < src.play_team) if (T.captain) src.pickers_left += T.captain else src.pickers_left += T src.players_left -= T.members if ((!( src.players_left.len ) || !( src.pickers_left.len ))) src.picking = 0 src.players_left.len = 0 src.pickers_left.len = 0 usr.client_mob() << "Not enough players/teams!" return world << "Now Selecting Teams!!!" src.picker = pick(src.pickers_left) if (ismob(src.picker)) show_pick(src.picker) world << text("[] is picking!", src.picker) else if (istype(src.picker, /obj/team)) var/H = pick(src.players_left) var/obj/team/T = src.picker if (istype(T, /obj/team)) T.members += H src.players_left -= H next_pick() else show_pick(src.picker) world << text("[] is picking!", src.picker) if (href_list["start"]) src.starting = 1 var/obj/begin/use_me = locate(/obj/begin) for(var/mob/human/H in world) if (H.client) H.start = 1 H.occupation1 = pick("Staff Assistant", "Research Assistant", "Technical Assistant", "Medical Assistant") use_me.get_dna_ready(H) H.update_face() world << "STARTING!!!" for(var/obj/landmark/alterations/A in world) switch(A.name) if("prison shuttle") new /obj/machinery/computer/prison_shuttle( A.loc ) del(A) if("id computer") new /obj/machinery/computer/card( A.loc ) del(A) if("Experimental Technology") new /obj/secloset/highsec( A.loc ) del(A) if("Security Locker") new /obj/secloset/security1( A.loc ) del(A) if("recharger") new /obj/machinery/recharger( A.loc ) del(A) if("barrier") new /obj/barrier( A.loc ) del(A) for(var/obj/closet/wardrobe/W in world) del(W) for(var/obj/item/weapon/clothing/under/T in world) del(T) if (src.ejectengine) for(var/obj/machinery/computer/engine/T in world) del(T) for(var/obj/landmark/alterations/A in world) switch(A.name) if("Prisoners Wardrobe") new /obj/closet/wardrobe/orange( A.loc ) del(A) var/obj/rogue = locate("landmark*CTF-rogue") for(var/mob/human/H in world) H.loc = rogue.loc H.w_uniform = new /obj/item/weapon/clothing/under/orange( H ) H.w_uniform.layer = 20 H.shoes = new /obj/item/weapon/clothing/shoes/orange( H ) H.shoes.layer = 20 for(var/obj/team/T in src) T.process() if (src.paint_cans) for(var/obj/secloset/highsec/S in world) new /obj/item/weapon/paint( S ) if (src.neutral_replace) while(src.avail_bases.len > 0) var/t = pick(src.avail_bases) src.avail_bases -= t var/obj/L = locate(text("landmark*CTF-supply-[]", t)) var/obj/item/weapon/paper/flag/F = new /obj/item/weapon/paper/flag( L.loc ) F.name = "flag- 'NEUTRAL Team's Flag'" F.icon_state = "flag_neutral" F.info = "This is an authentic neutral flag!\nCapture the Flag" del(L) for(var/obj/begin/B in world) if (locate(/obj/grille, B.loc)) for(var/obj/grille/G in B.loc) del(G) ticker = new /datum/control/gameticker() spawn(0) ticker.process() return data_core = new /obj/datacore() src.show_screen(usr) for(var/mob/human/H in world) if (H.CanAdmin()) src.show_screen(H) return /obj/landmark/New() ..() src.tag = text("landmark*[]", src.name) src.invisibility = 101 if (name == "shuttle") shuttle_z = src.z del(src) if (name == "monkey") monkeystart += src.loc del(src) if (name == "blobstart") blobstart += src.loc del(src) return /obj/start/New() ..() src.tag = text("start*[]", src.name) src.invisibility = 100 return /obj/sp_start/New() src.tag = text("spstart[]", src.name) src.invisibility = 100 return /obj/admins/Topic(href, href_list) ..() if (usr.client != src.owner) world << text("\blue [] has attempted to override the admin panel!", usr.key) world.log << text("ADMIN: [] tried to use the admin panel without authorization.", usr.key) return if(href_list["vmode"]) if (src.a_level >= 2) vote.mode = text2num(href_list["vmode"])-1 // hack to yield 0=restart, 1=changemode vote.voting = 1 // now voting vote.votetime = world.timeofday + config.voteperiod*10 // when the vote will end spawn(config.voteperiod*10) vote.endvote() world << "\red*** A vote to [vote.mode?"change game mode":"restart"] has been initiated by Admin [usr.key]." world << "\red You have [vote.timetext(config.voteperiod)] to vote." if(config.logvote || config.logadmin) world.log << "VOTE/ADMIN: Voting to [vote.mode?"change mode":"restart round"] forced by admin [usr.key]" for(var/mob/CM in world) var/client/CCM = CM.cliented() if (CCM) CCM.vote = "default" if(href_list["votekill"]) if (src.a_level >= 2) world << "\red ***Voting aborted by [usr.key]." if(config.logvote || config.logadmin) world.log << "VOTE/ADMIN: Voting aborted by [usr.key]" vote.voting = 0 vote.nextvotetime = world.timeofday + 10*config.votedelay for(var/mob/M in world) // clear vote window from all clients var/client/CM = M.cliented() if (CM) M.client_mob() << browse(null, "window=vote") CM.showvote = 0 if (href_list["vt_rst"]) if (src.a_level >= 3) config.allowvoterestart = !config.allowvoterestart world << "Player restart voting toggled to [config.allowvoterestart ? "On" : "Off"]." if(config.logadmin) world.log << "ADMIN: Restart voting toggled to [config.allowvoterestart ? "On" : "Off"] by [usr.key]." if(config.allowvoterestart) vote.nextvotetime = world.timeofday update() if (href_list["vt_mode"]) if (src.a_level >= 3) config.allowvotemode = !config.allowvotemode world << "Player mode voting toggled to [config.allowvotemode ? "On" : "Off"]." if(config.logadmin) world.log << "ADMIN: Mode voting toggled to [config.allowvotemode ? "On" : "Off"] by [usr.key]." if(config.allowvotemode) vote.nextvotetime = world.timeofday update() if (href_list["boot"]) if (src.a_level >= 4) var/dat = "Boot Player:
" for(var/mob/M in world) dat += text("N:[] R:[] (K:[]) (IP:[])
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP) usr << browse(dat, "window=boot") if (href_list["boot2"]) if (src.a_level >= 4) var/mob/M = locate(href_list["boot2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] booted [].", usr.key, M.key) //M.client = null del(M.client) if (href_list["ban"]) if (src.a_level >= 4) var/dat = "Ban Player:
" for(var/mob/M in world) dat += text("N: [] R: [] (K: []) (IP: [])
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP) dat += "
Unban Player:
" for(var/t in banned) dat += text("K: []
", src, ckey(t), t) usr << browse(dat, "window=ban") if (href_list["ban2"]) if (src.a_level >= 4) var/mob/M = locate(href_list["ban2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] banned [].", usr.key, M.key) banned += ckey(M.key) //M.client = null del(M.client) if (href_list["unban2"]) if (src.a_level >= 4) var/t = href_list["unban2"] if (t) banned -= t if(config.logadmin) world.log << text("ADMIN: [] unbanned [].", usr.key, t) if (href_list["mute"]) if (src.a_level >= 4) var/dat = "Mute/Unmute Player:
" for(var/mob/M in world) dat += text("N:[] R:[] (K:[]) (IP: []) \[[]\]
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP, (M.muted ? "Muted" : "Voiced")) usr << browse(dat, "window=mute") if (href_list["mute2"]) if (src.a_level >= 4) var/mob/M = locate(href_list["mute2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] altered []'s mute status.", usr.key, M.key) M.muted = !( M.muted ) if (href_list["restart"]) if (src.a_level >= 2) var/dat = text("Restart game?
\n
\nYes\n", src) usr << browse(dat, "window=restart") if (href_list["restart2"]) if (src.a_level >= 2) world << text("\red Restarting world!\blue Initiated by []!", usr.key) if(config.logadmin) world.log << text("ADMIN: [] initiated a reboot.", usr.key) sleep(50) world.Reboot() if (href_list["restart3"]) if (src.a_level >= 2) if( alert("Reboot server?",,"Yes","No") == "No") return world << text("\red Rebooting world!\blue Initiated by []!", usr.key) if(config.logadmin) world.log << text("ADMIN: [] initiated an immediate reboot.", usr.key) world.Reboot() if (href_list["c_mode"]) if (src.a_level >= 3) if (ticker) return alert(usr, "The game has already started.", null, null, null, null) var/dat = text("What mode do you wish to play?
\nSecret
\nRandom
\nTraitor
\nMeteor
\nExtended
\nMonkey
\nNuclear Emergency
\nBlob
\nSandbox
\n\nNow: []\n", src, src, src, src, src, src, src, src, src, master_mode) usr << browse(dat, "window=c_mode") if (href_list["c_mode2"]) if (src.a_level >= 3) if (ticker) return alert(usr, "The game has already started.", null, null, null, null) switch(href_list["c_mode2"]) if("secret") master_mode = "secret" if("random") master_mode = "random" if("traitor") master_mode = "traitor" if("meteor") master_mode = "meteor" if("extended") master_mode = "extended" if("monkey") master_mode = "monkey" if("nuclear") master_mode = "nuclear" if("megamonkey") master_mode = "megamonkey" if("blob") master_mode = "blob" if("sandbox") master_mode = "sandbox" else if(config.logadmin) world.log << text("ADMIN: [] set the mode as [].", usr.key, master_mode) world << text("\blue The mode is now: []", master_mode) var/F = file(persistent_file) fdel(F) F << master_mode if (href_list["l_ban"]) var/dat = "
Banned Keys:
" for(var/t in banned) dat += text("[]
", ckey(t)) if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) dat += text("
Goto Ban Control Screen", src) usr << browse(dat, "window=ban_k") if (href_list["l_keys"]) var/dat = "Keys:
" for(var/mob/M in world) if(M.cliented()) dat += text("[]
", M.client.ckey) usr << browse(dat, "window=keys") if (href_list["l_players"]) var/dat = "Name/Real Name/Key/IP:
" for(var/mob/M in world) dat += text("N: [] R: [] (K: []) (IP: [])
", M.name, M.rname, (M.client ? M.client : (M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client")), M.lastKnownIP) usr << browse(dat, "window=players") if (href_list["g_send"]) var/t = input("Global message to send:", "Admin Announce", null, null) as message if (t) world << text("\blue [] Announces:\n \t []", usr.key, t) if(config.logadmin) world.log << "ADMIN: Announce: [usr.key] : [t]" if (href_list["p_send"]) var/dat = "Who are you sending a message to?
" for(var/mob/M in world) dat += "N:[M.name] R:[M.rname] (K:[(M.client ? M.client : "Formerly [M.lastKnownCKey]")])
" usr << browse(dat, "window=p_send") if (href_list["m_item"]) var/X = typesof(/obj/item/weapon) var/Q = input("What item?", null, null, null) as null|anything in X if (!( Q )) return new Q( usr.loc ) if(config.logadmin) world.log << text("ADMIN: [] created a []", usr.key, Q) if (href_list["m_obj"]) var/X = typesof(/obj) - typesof(/obj/item) var/Q = input("What object?", null, null, null) as null|anything in X if (!( Q )) return new Q( usr.loc ) if(config.logadmin) world.log << text("ADMIN: [] created a []", usr.key, Q) if (href_list["dna"]) if (src.a_level >= 3) var/dat = "Registered DNA sequences:
" for(var/M in reg_dna) dat += text("\t [] = []
", M, reg_dna[text("[]", M)]) usr << browse(dat, "window=dna") if (href_list["t_ooc"]) if (src.a_level >= 2) ooc_allowed = !( ooc_allowed ) if (ooc_allowed) world << "The OOC channel has been globally enabled!" else world << "The OOC channel has been globally disabled!" if(config.logadmin) world.log << text("ADMIN: [] toggled OOC.", usr.key) if (href_list["startnow"]) if (src.a_level >= 2) world << "The game will now start immediately thanks to [usr.key]!" usr.start_now() if (href_list["toggle_enter"]) if (src.a_level >= 3) enter_allowed = !( enter_allowed ) if (!( enter_allowed )) world << "You may no longer enter the game." else world << "You may now enter the game." if(config.logadmin) world.log << text("ADMIN: [] toggled new player game entering.", usr.key) world.update_stat() update() if (href_list["toggle_ai"]) if (src.a_level >= 3) config.allowai = !( config.allowai ) if (!( config.allowai )) world << "The AI job is no longer chooseable." else world << "The AI job is chooseable now." if(config.logadmin) world.log << text("ADMIN: [] toggled AI allowed.", usr.key) world.update_stat() update() if (href_list["bombtemp_determines_range"]) if (src.a_level >= 3) config.bombtemp_determines_range = !( config.bombtemp_determines_range ) if (!( config.bombtemp_determines_range )) world << "Bomb temperature no longer determines range (superheated bombs will not destroy a larger area than 500 degree bombs)." else world << "Bomb temperature determines range now (superheated bombs will destroy a larger area than 500 degree bombs)." if(config.logadmin) world.log << text("ADMIN: [] toggled bombtemp_determines_range.", usr.key) world.update_stat() update() if (href_list["crowbars_close_depowered_doors"]) if (src.a_level >= 3) config.crowbars_close_depowered_doors = !( config.crowbars_close_depowered_doors ) if (!( config.crowbars_close_depowered_doors )) world << "Crowbars can no longer close depowered doors." else world << "Crowbars can now close depowered doors." if(config.logadmin) world.log << text("ADMIN: [] toggled crowbars_close_depowered_doors.", usr.key) world.update_stat() update() if (href_list["ai_can_call_shuttle"]) if (src.a_level >= 3) config.ai_can_call_shuttle = !( config.ai_can_call_shuttle ) if (!( config.ai_can_call_shuttle )) world << "The AI can no longer call the shuttle." else world << "The AI can now call the shuttle." if(config.logadmin) world.log << text("ADMIN: [] toggled ai_can_call_shuttle.", usr.key) world.update_stat() update() if (href_list["ai_can_uncall_shuttle"]) if (src.a_level >= 3) config.ai_can_uncall_shuttle = !( config.ai_can_uncall_shuttle ) if (!( config.ai_can_uncall_shuttle )) world << "The AI can no longer send the shuttle back." else world << "The AI can now send the shuttle back." if(config.logadmin) world.log << text("ADMIN: [] toggled ai_can_uncall_shuttle.", usr.key) world.update_stat() update() if (href_list["toggle_abandon"]) if (src.a_level >= 3) abandon_allowed = !( abandon_allowed ) if (abandon_allowed) world << "You may now abandon mob." else world << "Live or Die Mode Activated" if(config.logadmin) world.log << text("ADMIN: [] toggled abandon mob to [].", usr.key,(abandon_allowed?"On":"Off")) world.update_stat() update() if (href_list["delay"]) if (src.a_level >= 2) if (ticker) return alert("Too late... The game has already started!", null, null, null, null, null) going = !( going ) if (!( going )) world << text("The game start has been delayed by [] (Administrator to SS13)", usr.key) if(config.logadmin) world.log << text("ADMIN: [] delayed the game.", usr.key) else world << text("The game will start soon thanks to [] (Administrator to SS13)", usr.key) if(config.logadmin) world.log << text("ADMIN: [] removed the delay.", usr.key) if (href_list["secrets"]) if (src.a_level >= 3) var/dat = {" What secret do you wish to activate?
Remove 'internal' clothing
Remove ALL clothing
Remove firesuits, grilles, and pods
Remove all bombs currently existence
Show a list of all people who made a bomb
Show the key of the traitor
Toxic Air (WARNING: dangerous)
Turn all humans into monkies
Make all areas powered
Spawn a wave of meteors
Self-igniting oxygen (Not at normal oxygen amounts, but a bit higher)
"} usr << browse(dat, "window=secrets") if (href_list["repopMap"]) if (src.a_level >= 5) world << "\red

Replacing destroyed objects and mobs.

" world.Repop() if (href_list["secrets2"]) if (src.a_level >= 3) var/ok = 0 switch(href_list["secrets2"]) if("sec_clothes") for(var/obj/item/weapon/clothing/under/O in world) del(O) ok = 1 if("sec_all_clothes") for(var/obj/item/weapon/clothing/O in world) del(O) ok = 1 if("sec_classic1") for(var/obj/item/weapon/clothing/suit/firesuit/O in world) del(O) for(var/obj/grille/O in world) del(O) for(var/obj/machinery/pod/O in world) for(var/mob/M in src) M.loc = src.loc if (M.client) M.client.perspective = MOB_PERSPECTIVE M.client.eye = M del(O) ok = 1 if("clear_bombs") for(var/obj/item/weapon/assembly/r_i_ptank/O in world) del(O) for(var/obj/item/weapon/assembly/m_i_ptank/O in world) del(O) for(var/obj/item/weapon/assembly/t_i_ptank/O in world) del(O) ok = 1 if("list_bombers") var/dat = "Don't be insane about this list Get the facts. They also could have disarmed one.
" for(var/l in bombers) dat += text("[] 'made' a bomb.
", l) usr << browse(dat, "window=bombers") if("toxic") for(var/obj/machinery/atmoalter/siphs/fullairsiphon/O in world) O.t_status = 3 for(var/obj/machinery/atmoalter/siphs/scrubbers/O in world) O.t_status = 1 O.t_per = 1000000.0 for(var/obj/machinery/atmoalter/canister/O in world) if (!( istype(O, /obj/machinery/atmoalter/canister/oxygencanister) )) O.t_status = 1 O.t_per = 1000000.0 else O.t_status = 3 if("check_antagonist") if (ticker) if (ticker.killer) if (ticker.killer.ckey) alert(text("The traitor's key is [].", ticker.killer.ckey), null, null, null, null, null) else alert("It seems like the traitor logged out...", null, null, null, null, null) else alert("There is no traitor.", null, null, null, null, null) else alert("The game has not started yet.", null, null, null, null, null) if("monkey") if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) for(var/mob/human/H in world) H.monkeyize() ok = 1 if("power") if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) for(var/area/A in world) A.requires_power = 0 A.power_light = 1 A.power_equip = 1 A.power_environ = 1 A.power_change() if("burningo2") if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) ticker.burningo2 = 1-ticker.burningo2 if("wave") if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) meteor_wave() else if (usr) if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) if (ok) world << text("A secret has been activated by []!", usr.key) return /obj/admins/proc/update() var/dat a_level = 0 switch(src.rank) if("Moderator") a_level = 1 if("Game Master") a_level = 2 if("Supervisor") a_level = 3 if("Administrator") a_level = 4 if("Major Administrator") a_level = 5 if("Primary Administrator") a_level = 6 switch(src.screen) if(1.0) dat += "
Admin Control Console

\n" if(a_level>=4) dat += {" Boot Player/Key
Ban/Unban Player/Key
Mute/Unmute Player/Key
"} dat += "
" if(a_level!=1) dat += "Toggle OOC
" dat += "Delay Game
" dat += "Start Round Now
" if(a_level >=3 ) dat += "Toggle Entering [enter_allowed]
" dat += "Toggle Abandon [abandon_allowed]
" dat += "Toggle AI [config.allowai]
" dat += "Toggle Bombtemp-Determines-Range [config.bombtemp_determines_range]
" dat += "Change Game Mode
" if(a_level >= 2) dat += "Restart Game
" dat += "Immediate Reboot
" dat += "
" if(a_level!=1) dat += "Begin restart vote.
" dat += "Begin change mode vote.
" dat += "Abort current vote.
" if(a_level>=3) dat += "Toggle restart voting [config.allowvoterestart].
" dat += "Toggle mode voting [config.allowvotemode].
" dat += "
" if(a_level >=3 ) dat += "Activate Secrets
" dat += "Make Item
" dat += "Make Object
" dat += "
" if(a_level >=3 ) dat += "List DNA
" dat += "List Keys
" dat += "List Players/Keys
" dat += "
" if(a_level >= 5 ) dat += "Recreate Destroyed Mobs and Objects
" dat += "Send Global Message
" dat += "Send Private Message
" else dat = text("
Admin Control Center

\nAccess Admin Commands
\nContact Admins
\nAccess Messageboard
\n
\nList Keys
\nList Players/Keys
\nSend Global Message
\nSend Private Message
", src, src, src, src, src, src, src) usr << browse(dat, "window=admin") return /world/proc/update_stat() if(config) if (ticker) src.status = text("Space Station 13 V.[] ([],[],[],[],[])[]", SS13_version, master_mode, (abandon_allowed ? "AM" : "No AM"), (enter_allowed ? "Open" : "Closed"), ( config.allowvotemode ? "Vote": "No vote"), (config.allowai ? "AI Allowed" : "AI Not Allowed"), (host ? text(" hosted by []", host) : null), host) else src.status = text("Space Station 13 V.[] (STARTING,[],[],[],[])[]", SS13_version, (abandon_allowed ? "AM" : "No AM"), (enter_allowed ? "Open" : "Closed"), ( config.allowvotemode ? "Vote": "No vote"), (config.allowai ? "AI Allowed" : "AI Not Allowed"), (host ? text(" hosted by []", host) : null), host) else if (ticker) src.status = text("Space Station 13 V.[] ([],[],[])[]", SS13_version, master_mode, (abandon_allowed ? "AM" : "No AM"), (enter_allowed ? "Open" : "Closed"), (host ? text(" hosted by []", host) : null), host) else src.status = text("Space Station 13 V.[] (STARTING,[],[])[]", SS13_version, (abandon_allowed ? "AM" : "No AM"), (enter_allowed ? "Open" : "Closed"), (host ? text(" hosted by []", host) : null), host) return /world/New() update_stat() for(var/turf/T in world) T.updatelinks() makepipelines() makepowernets() sun = new /datum/sun() // ****stuff for presistent mode picking var/newmode = null var/modefile = file2text(persistent_file) if(modefile) // stuff to fix trailing NL problems var/list/ML = dd_text2list(modefile, "\n") newmode = ML[1] if(newmode) master_mode = newmode world.log << "Read default mode '[newmode]' from [persistent_file]" var/motd = file2text("motd.txt") if (motd) world_message = motd var/ad_text = file2text("admins.txt") var/list/L = dd_text2list(ad_text, "\n") for(var/t in L) if (t) if (copytext(t, 1, 2) == ";") continue //goto(64) var/t1 = findtext(t, " - ", 1, null) if (t1) var/m_key = copytext(t, 1, t1) var/a_lev = text("[]", copytext(t, t1 + 3, length(t) + 1)) admins[text("[]", m_key)] = text("[]", a_lev) admins["exadv1"] = "Primary Administrator" config = new /datum/config() var/config_text = file2text("config.txt") if(!config_text) world.log << "No config.txt file found, setting defaults" config.logooc = 0 // log OOC channek config.logaccess = 0 // log login/logout config.logsay = 0 // log client say config.logadmin = 1 // log admin actions config.loggame = 0 // log game events config.logvote = 1 config.allowvoterestart = 0 // allow votes to restart config.allowai = 0 // allow ai config.alternate_ai_laws = 0 config.allowvotemode = 0 // allow votes to change mode config.votenodefault = 0 // vote does not default to nochange/norestart config.votenodead = 0 // dead people can't vote config.votedelay = 600 // minimum time between voting sessions (seconds, 10 minute default) config.voteperiod = 60 // length of voting period (seconds, default 1 minute) config.bombtemp_determines_range = 0 config.crowbars_close_depowered_doors = 0 config.ai_can_call_shuttle = 0 config.ai_can_uncall_shuttle = 0 config.air_pressure_flow = 0 // This makes temperature affect the air pressure force which moves objects. This also allows fire to spread to floor tiles which are next to space. It would also allow fire to spread into space if (a) space tiles had air code running on them, but they don't because that would be slow, and (b) if the burning hot gas flowing out an airlock wasn't diluted rapidly upon reaching space, resulting in it enflaming at most four space tiles. config.min_gas_for_fire = 900000 config.meteorchance = 0.1 config.enable_drones = 0 config.humans_can_use_drones = 0 config.walkable_not_pullable_drones = 0 config.plasma_danger = 0 else world.log << "Reading config.txt" var/list/CL = dd_text2list(config_text, "\n") for(var/t in CL) if(t) if(copytext(t,1,2) == "#") // comment marker continue var/t1 = findtext(t," ") var/cfgvar var/cfgval = null if(t1) cfgvar = lowertext(copytext(t,1,t1)) cfgval = copytext(t, t1+1) else cfgvar = lowertext(t) switch(cfgvar) if("") //continue if("logooc") config.logooc = 1 if("logaccess") config.logaccess = 1 if("logsay") config.logsay = 1 if("logadmin") config.logadmin = 1 if("loggame") config.loggame = 1 if("logvote") config.logvote = 1 if("prob_extended") config.pickprob["extended"] = text2num(cfgval) if("prob_traitor") config.pickprob["traitor"] = text2num(cfgval) if("prob_monkey") config.pickprob["monkey"] = text2num(cfgval) if("prob_meteor") config.pickprob["meteor"] = text2num(cfgval) if("prob_blob") config.pickprob["blob"] = text2num(cfgval) if("prob_nuclear") config.pickprob["nuclear"] = text2num(cfgval) if("allowvoterestart") config.allowvoterestart = 1 if("allowvotemode") config.allowvotemode = 1 if("nodeadvote") config.votenodead = 1 if("defaultnovote") config.votenodefault = 1 if("votedelay") config.votedelay = text2num(cfgval) if("voteperiod") config.voteperiod = text2num(cfgval) if("allowai") config.allowai = 1 if("bombtemp_determines_range") config.bombtemp_determines_range = 1 if("crowbars_close_depowered_doors") config.crowbars_close_depowered_doors = 1 if("ai_can_call_shuttle") config.ai_can_call_shuttle = 1 if("ai_can_uncall_shuttle") config.ai_can_uncall_shuttle = 1 if("alternate_ai_laws") config.alternate_ai_laws = 1 if("air_pressure_flow") config.air_pressure_flow = 1 if ("min_gas_for_fire") config.min_gas_for_fire = text2num(cfgval) if("meteorchance") config.meteorchance = text2num(cfgval) if("enable_drones") config.enable_drones = 1 if("humans_can_use_drones") config.humans_can_use_drones = 1 if("walkable_not_pullable_drones") config.walkable_not_pullable_drones = 1 if("plasma_danger") config.plasma_danger = 1 else world.log<<"Unknown setting in config.txt: [cfgvar]" vote = new /datum/vote() main_hud = new /obj/hud( ) main_hud2 = new /obj/hud/hud2( ) SS13_airtunnel = new /datum/air_tunnel/air_tunnel1() ..() sleep(50) nuke_code = text("[]", rand(10000, 99999.0)) for(var/obj/machinery/nuclearbomb/N in world) if (N.r_code == "ADMIN") N.r_code = nuke_code for(var/mob/human/H in world) if ((H.ckey in list( "exadv1", "epox", "soraku" ))) H.memory += text("Secret Base Nuke Code: []
", nuke_code) sleep(50) plmaster = new /obj/overlay( ) plmaster.icon = 'plasma.dmi' plmaster.icon_state = "onturf" plmaster.layer = FLY_LAYER slmaster = new /obj/overlay( ) slmaster.icon = 'plasma.dmi' slmaster.icon_state = "sl_gas" slmaster.layer = FLY_LAYER liquidplmaster = new /obj/overlay( ) liquidplmaster.icon = 'plasma.dmi' liquidplmaster.icon_state = "liquid" liquidplmaster.layer = FLY_LAYER cellcontrol = new /datum/control/cellular( ) spawn( 0 ) cellcontrol.process() return src.update_stat() spawn(900) Label_482: if (ctf) return if (going && (!ticker)) ticker = new /datum/control/gameticker() spawn( 0 ) ticker.process() return data_core = new /obj/datacore() else sleep(100) goto Label_482 return return /world/Topic(T, addr, master, key) if(T=="ping") var/x = 1 for(var/client/C) x++ return x if(T=="reboot" && master) world.log << "TOPIC: Remote reboot from master ([addr])" world.Reboot() if(T=="players") var/n = 0 for(var/mob/M in world) var/mob/CM = M.cliented() if (CM) world.log << "[++n] : [M.name] ([CM.key]) at [M.loc.loc] ([M.x],[M.y],[M.z]) : [CM.client.inactivity/10.0]s" return n /mob/proc/CanAdmin() if (world.address == src.client.address) return 1 if (src.client.address == "127.0.0.1") return 1 if (!( src.client.address )) return 1 return 0 /atom/proc/check_eye(user as mob) if (istype(user, /mob/ai)) return 1 return /atom/proc/Bumped(AM as mob|obj) return /atom/movable/Bump(var/atom/A as mob|obj|turf|area, yes) spawn( 0 ) if ((A && yes)) A.Bumped(src) return ..() return /atom/verb/point() set src in oview() if ((!( usr ) || !( isturf(usr.loc) )) || isarea(src)) // can't point to areas anymore return if ((usr.stat == 0 && !( usr.restrained() ))) var/P = new /obj/point( (isturf(src) ? src : src.loc) ) spawn( 20 ) //P = null del(P) return for(var/mob/M in viewers(usr, null)) M.show_message(text("[] points to []", usr, src), 1) return /turf/proc/updatecell() return /turf/proc/conduction() return /turf/proc/cachecell() return /datum/control/proc/process() return /datum/control/gameticker/proc/meteor_process() do if (!( shuttle_frozen )) if (src.timing == 1) src.timeleft -= 10 else if (src.timing == -1.0) src.timeleft += 10 if (src.timeleft >= 6000) src.timeleft = null src.timing = 0 spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if (prob(50)) spawn( 0 ) new /obj/meteor/small( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if ((src.timeleft <= 0 && src.timing && !( prison_entered ))) src.timeup() sleep(10) while(src.processing) return /proc/meteor_wave() if(!ticker || wavesecret) return wavesecret = 1 for(var/my = 1 to world.maxy) spawn(rand(10,100)) new /obj/meteor( locate(world.maxx, my, 1) ) sleep(300) wavesecret = 0 /datum/control/gameticker/proc/megamonkey_process() do if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if (prob(10)) spawn( 0 ) new /obj/meteor/small( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return check_win() sleep(50) while(src.processing) return /datum/control/gameticker/proc/meteorChanceRoll() if (config.meteorchance<=0) return 0 if (config.meteorchance>=100) return 1 var maxroll = (100.0/config.meteorchance)-1 var roll = rand(maxroll) return (roll==0) /datum/control/gameticker/proc/blob_process() do if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if (prob(10)) spawn( 0 ) new /obj/meteor/small( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return check_win() bloblife() blob_event() sleep(10) while(src.processing) return /datum/control/gameticker/proc/extend_process() do if (!( shuttle_frozen )) if (src.timing == 1) src.timeleft -= 10 else if (src.timing == -1.0) src.timeleft += 10 if (src.timeleft >= 6000) src.timeleft = null src.timing = 0 if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if (prob(10)) spawn( 0 ) new /obj/meteor/small( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return if ((src.timeleft <= 0 && (src.timing && (!( prison_entered ) || src.shuttle_location == 1)))) src.timeup() sleep(10) while(src.processing) return /datum/control/gameticker/proc/nuclear(z_level) if (src.mode != "nuclear") return if (z_level != 1) return spawn( 0 ) src.objective = "Success" world << "The Syndicate Operatives have destroyed Space Station 13!" for(var/mob/human/H in world) if ((H.cliented() && findtext(H.rname, "Syndicate ", 1, null))) if (H.stat != 2) world << text("[] was []", H.key, H.rname) else world << text("[] was [] (Dead)", H.key, H.rname) src.timing = 0 sleep(300) if(config.loggame) world.log << "GAME: Syndicate success" world.Reboot() return return /datum/control/gameticker/proc/timeup() var/A = locate(/area/shuttle) if (src.shuttle_location == shuttle_z) world << "The emergency shuttle has docked with the station! You have 3 minutes to board the shuttle." for(var/turf/T in A) if (T.z == shuttle_z) for(var/atom/movable/AM in T) AM.z = 1 var/turf/U = locate(T.x, T.y, shuttle_z) U.oxygen = T.oxygen U.oldoxy = T.oldoxy U.tmpoxy = T.tmpoxy U.poison = T.poison U.oldpoison = T.oldpoison U.tmppoison = T.tmppoison U.co2 = T.co2 U.oldco2 = T.oldco2 U.tmpco2 = T.tmpco2 U.buildlinks() //T = null del(T) src.timeleft = 1800 src.shuttle_location = 1 else world << "The emergency shuttle is leaving!" check_win() return /datum/control/gameticker/proc/check_win() var/area/A = locate(/area/shuttle) switch(src.mode) if("traitor") var/item = null var/traitorwin = 1 var/numShuttle = 0 var/numDead = 0 var/numAlive = 0 var/numPod = 0 var/numTotal = 0 switch(src.objective) if("alone") if (istype(src.killer, /mob/ai)) if (src.killer.stat == 2) traitorwin = 0 else numShuttle = 0 numDead = 0 numAlive = 0 numPod = 0 for(var/mob/M in world) if ((M != src.killer && M.cliented())) if (M.stat == 2) numDead += 1 else var/T = M.loc if ((T in A)) numShuttle += 1 else if (istype(T, /obj/machinery/pod)) numPod += 1 else numAlive += 1 numTotal = numShuttle + numDead + numAlive + numPod if (numAlive+numAlive > numTotal) traitorwin = 0 else for(var/mob/M in world) if ((M != src.killer && M.cliented())) if (M.stat != 2) var/T = M.loc if (!( istype(T, /turf) )) else if ((T in A)) traitorwin = 0 if("assassinate") if ((src.target && src.target.stat != 2)) traitorwin = 0 if("theft") var/list/L = list( ) if (src.killer) L += src.killer.contents for(var/obj/item/weapon/storage/S in src.killer.contents) L += S.return_inv() for(var/obj/item/weapon/gift/G in src.killer.contents) L += G.gift traitorwin = 0 switch(src.theft_obj) if("lasergun") for(var/obj/item/weapon/gun/energy/laser_gun/O in L) if (O.charges == O.maximum_charges) traitorwin = 1 item = "a fully loaded laser gun" if("plasmabomb") for(var/obj/item/weapon/assembly/r_i_ptank/O in L) var/obj/item/weapon/tank/plasmatank/P = O.part3 if ((P.gas.plasma >= 1600000.0 && P.gas:temperature >= 773)) // 500degC traitorwin = 1 for(var/obj/item/weapon/assembly/m_i_ptank/O in L) var/obj/item/weapon/tank/plasmatank/P = O.part3 if ((P.gas.plasma >= 1600000.0 && P.gas:temperature >= 773)) // 500degC traitorwin = 1 for(var/obj/item/weapon/assembly/t_i_ptank/O in L) var/obj/item/weapon/tank/plasmatank/P = O.part3 if ((P.gas.plasma >= 1600000.0 && P.gas:temperature >= 773)) // 500degC traitorwin = 1 item = "a fully armed and heated plasma bomb" if("flashbang") for(var/obj/item/weapon/flashbang/O in L) traitorwin = 1 item = "a flashbang" if("captaincard") for(var/obj/item/weapon/card/id/O in L) if ((O.access_level == 5 && O.air_access == 5 && O.engine_access == 5 && O.lab_access == 5 && O.assignment == "Captain")) traitorwin = 1 else item = "a captain's card with universal level 5 access" if("sleepingpills") for(var/obj/item/weapon/pill_canister/O in L) for(var/obj/item/weapon/m_pill/sleep/P in O) if (P.amount == 30) traitorwin = 1 else item = "a bottle of 30 sleeping pills" if("pl_flask") for(var/obj/item/weapon/flasks/O in L) if (O.plasma == 500) traitorwin = 1 else item = "a plasma flask for cryogenics (500 units of plasma)" else else world << "unknown traitor objective" if (src.killer) var/turf/T = src.killer.loc if (!( istype(T, /turf) )) traitorwin = 0 else if ((T in A)) if (src.killer.stat == 2) traitorwin = 0 else if (!istype(src.killer, /mob/ai)) traitorwin = 0 else if (src.killer.stat == 2) traitorwin = 0 if (traitorwin) world << text("The traitor ([]) wins!", src.killer.rname) else world << text("The Research Staff has stopped the traitor ([]) !", src.killer.rname) switch(src.objective) if("alone") if (istype(src.killer, /mob/ai)) world << "The objective was to cause an evacuation of at least 50% of the population, or kill everyone on the station." else world << "The objective was to escape alone on the shuttle." if("assassinate") if (istype(src.killer, /mob/ai)) world << text("The objective was to assassinate [] and not be deactivated.", src.target) else world << text("The objective was to assassinate [] and escape.", src.target) if("theft") world << text("The objective was to steal [] and escape.", item) else world << "unknown traitor objective" if("monkey") var/monkeywin = 1 for(var/mob/human/M in world) if (M.stat != 2) var/T = M.loc if (istype(T, /turf)) if ((T in A)) monkeywin = 0 if (monkeywin) monkeywin = 0 for(var/mob/monkey/M in world) if (M.stat != 2) var/T = M.loc if (istype(T, /turf)) if ((T in A)) monkeywin = 1 if (monkeywin) world << "The monkies have won!" for(var/mob/monkey/M in world) if (M.cliented()) world << text("[] was a monkey.", M.key) else world << "The Research Staff has stopped the monkey invasion!" for(var/mob/human/M in world) if (M.cliented()) world << text("[] was [].", M.key, M) if("nuclear") if (src.objective != "Success") var/disk_on_shuttle = 0 for(var/obj/item/weapon/disk/nuclear/N in world) if (N.loc) var/turf/T = get_turf(N) if ((T in A)) disk_on_shuttle = 1 if (disk_on_shuttle) world << "The Research Staff has stopped the Syndicate Operatives!" for(var/mob/human/H in world) if ((H.cliented() && !( findtext(H.rname, "Syndicate ", 1, null) ))) if (H.stat != 2) world << text("[] was []", H.key, H.rname) else world << text("[] was [] (Dead)", H.key, H.rname) else world << "Neutral Victory" world << "The Syndicate recovered the abandoned auth. disk but detonation of SS13 was averted. Next time, don't lose the disk!" if("virus") var/humanwin = 1 var/list/shuttle = list( ) for(var/mob/human/M in world) var/T = M.loc if (istype(T, /turf)) if ((T in A)) shuttle += M if (M.virus > 0) humanwin = 0 var/dead = list( ) var/alive = list( ) var/escapees = list( ) for(var/mob/M in world) if (M.stat == 2) if (M.cliented()) if (M.virus > 0) dead += text("[] died. \red (Had Stage [] Infection)", M.rname, round(M.virus)) else dead += text("[] died.", M.rname) else if (shuttle.Find(M)) if (M.virus > 0) escapees += text("[] escaped on the shuttle. \red (Has Stage [] Infection)", M.rname, round(M.virus)) else escapees += text("[] escaped on the shuttle.", M.rname) else if (M.virus > 0) alive += text("[] was left infected. \red (Has Stage [] Infection)", M.rname, round(M.virus)) else alive += text("[] was left to be infected on Space Station 13.", M.rname) if (humanwin) world << "The Research Staff have won!" else world << "The Virus has won!" for(var/I in escapees) world << text("[]", I) for(var/I in alive) world << text("[]", I) for(var/I in dead) world << text("[]", I) if("meteor") var/list/L = list( ) for(var/mob/M in world) if (M.cliented()) if (M.stat != 2) var/T = M.loc if ((T in A)) L[text("[]", M.rname)] = "shuttle" else if (istype(T, /obj/machinery/pod)) L[text("[]", M.rname)] = "pod" else L[text("[]", M.rname)] = "alive" if (L.len) world << "\blue The following survived the meteor attack!" for(var/I in L) var/tem = L[text("[]", I)] switch(tem) if("shuttle") world << text("\t [] made it to the shuttle!", I) if("pod") world << text("\t [] at least made it to an escape pod!", I) if("alive") world << text("\t [] at least is alive.", I) else else world << "\blue No one survived the meteor attack!" if("megamonkey") var/success = 1 for(var/mob/megamonkey/M in world) if(M.stat == 0 && M.z == 1) // check for concious, alive monkeys in SS13 maplevel success = 0 break if(success) world << "The humans have won!" world << "The station has been retaken from the mutant monkeys" if(config.loggame) world.log << "GAME: Humans have destroyed all monkeys" sleep(300) world.Reboot() else return if("blob") if(ticker.event == 4) world << "The staff has lost!" world << "The station was destroyed by Cent. Com." var/numDead = 0 var/numAlive = 0 var/numSpace = 0 var/numPod = 0 var/numOffStation = 0 for (var/mob/ai/aiPlayer in world) for(var/mob/M in world) if ((M != aiPlayer && M.cliented())) if (M.stat == 2) numDead += 1 else var/T = M.loc if (istype(T, /turf/space)) numSpace += 1 else if (istype(T, /obj/machinery/pod)) numPod += 1 else if (istype(T, /turf)) if (M.z!=1) numOffStation += 1 else numAlive += 1 else numAlive += 1 if (numSpace==0 && numPod==0 && numOffStation==0) world << "The AI has won!" world << "The AI successfully maintained the quarantine - no players escaped in pods, were in space, or were off-station (as far as we can tell)." if(config.loggame) world.log << "GAME: AI won at Blob mode despite overall loss." else world << "The AI has lost!" world << text("The AI failed to maintain the quarantine - [] players escaped in pods, [] were in space, and [] were off-station (as far as we can tell).", numPod, numSpace, numOffStation) if(config.loggame) world.log << "GAME: AI lost at Blob mode." if(config.loggame) world.log << "GAME: Blob mode was lost." ticker.event = 5 sleep(300) world.Reboot() return if(ticker.event == 5) return var/active = 0 for(var/obj/blob/B in blobs) if(B.z == 1) active = 1 break if(!active) if(ticker.event < 3) world << "The staff has won!" world << "The alien organism has been eradicated from the station" var/datum/station_state/end_state = new /datum/station_state() end_state.count() var/percent = round( 100.0 * start_state.score(end_state), 0.1) world << "The station is [percent]% intact." if(config.loggame) world.log << "GAME: Blob mode was won with station [percent]% intact." ticker.event = 5 sleep(300) world.Reboot() else world << "The staff has lost!" world << "The alien organism has been eradicated from the station, but directive 7-12 has already been issued." if(config.loggame) world.log << "GAME: Blob mode was lost after eradicating blob too late." ticker.event = 5 sleep(300) world.Reboot() return return else var/list/L = list( ) for(var/mob/M in world) if (M.cliented()) if (M.stat != 2) var/T = M.loc if ((T in A)) L[text("[]", M.rname)] = "shuttle" else if (istype(T, /obj/machinery/pod)) L[text("[]", M.rname)] = "pod" else L[text("[]", M.rname)] = "alive" if (L.len) world << "\blue The game has ended!" for(var/I in L) var/tem = L[text("[]", I)] switch(tem) if("shuttle") world << text("\t [] has left on the shuttle!", I) if("pod") world << text("\t [] has fled on an escape pod!", I) if("alive") world << text("\t [] decided to stay on the station.", I) else else world << "\blue No one lived!" for (var/mob/ai/aiPlayer in world) if (aiPlayer.stat!=2) world << "The AI's laws at the end of the game were:" else world << "The AI's laws when it was deactivated were:" aiPlayer.showLaws(1) if (src.shuttle_location != shuttle_z) for(var/turf/T in A) if (T.z == 1) for(var/atom/movable/AM as mob|obj in T) AM.z = shuttle_z var/turf/U = locate(T.x, T.y, shuttle_z) U.oxygen = T.oxygen U.oldoxy = T.oldoxy U.tmpoxy = T.tmpoxy U.poison = T.poison U.oldpoison = T.oldpoison U.tmppoison = T.tmppoison U.co2 = T.co2 U.oldco2 = T.oldco2 U.tmpco2 = T.tmpco2 U.buildlinks() //T = null del(T) sleep(300) if(config.loggame) world.log << "GAME: Rebooting due to end of game" world.Reboot() return /datum/control/gameticker/process() shuttle_location = shuttle_z world.update_stat() world << "Welcome to the Space Station 13!\n\n" src.mode = master_mode switch(src.mode) if("secret") src.mode = config.pickmode() world << "The current game mode is - Secret!" world << "The game will pick between meteor, traitor, blob, or monkey mode, or no mode!" if("random") src.mode = config.pickmode() world << "The current game mode is - Random" world << "The game has picked mode: \red [src.mode]" if("sandbox") world << "The current game mode is - Sandbox!" world << "Build your own station with the sandbox-panel command!" for(var/mob/M in world) if(M.client) M.CanBuild() if("traitor") world << "The current game mode is - Traitor!" world << "There is a traitor among the researchers. You can't let him escape alone!" if("monkey") world << "The current game mode is - Monkey!" world << "Some of your crew members have been infected by a mutageous virus!" world << "Escape on the shuttle but the humans have precedence!" if("virus") world << "The current game mode is - Virus!" world << "Some of your crew members have been infected by a debilatating virus!" world << "How many can escape alive? No one with the virus can escape!" if("extended") world << "The current game mode is - Extended Role-Playing!" world << "Just have fun and role-play!" if("megamonkey") world << "The current game mode is - Mega Monkey!" world << "Retake the station from the mutant monkeys!" world << "You must disable or kill all monkeys on the station to win." if("blob") world << "The current game mode is - Blob!" world << "A dangerous alien organism is rapidly spreading throughout the station!" world << "You must kill it all while minimizing the damage to the station." if("nuclear") world << "The current game mode is - Nuclear Emergency!" world << "A Syndicate Strike Force is approaching SS13!" world << "A nuclear explosive was being transported by Nanotrasen to a military base. The transport ship mysteriously lost contact with Space Traffic Control (STC). About that time a strange disk was discovered around SS13. It was identified by Nanotrasen as a nuclear auth. disk and now Syndicate Operatives have arrived to retake the disk and detonate SS13! Also, most likely Syndicate star ships are in the vicinity so take care not to lose the disk!\nSyndicate: Reclaim the disk and detonate the nuclear bomb anywhere on SS13.\nPersonell: Hold the disk and escape with the disk on the shuttle!" var/list/mobs = list( ) for(var/mob/human/M in world) if ((M.cliented() && M.start)) mobs += M var/obj/O = locate("landmark*CTF-rogue") var/amount = 1 if (mobs.len >= 4) amount = round((mobs.len - 1) / 3) + 1 amount = min(5, amount) while(amount > 0) amount-- var/mob/human/H = pick(mobs) mobs -= H if (istype(H, /mob/human)) H.loc = O.loc if (src.killer) H.rname = text("Syndicate Operative #[]", amount + 1) else H.rname = "Syndicate Leader" src.killer = H H.already_placed = 1 del(H.w_uniform) H.w_uniform = new /obj/item/weapon/clothing/under/black( H ) H.w_uniform.layer = 20 del(H.shoes) H.shoes = new /obj/item/weapon/clothing/shoes/black( H ) H.shoes.layer = 20 H.gloves = new /obj/item/weapon/clothing/gloves/swat( H ) H.gloves.layer = 20 H.wear_suit = new /obj/item/weapon/clothing/suit/armor( H ) H.wear_suit.layer = 20 H.head = new /obj/item/weapon/clothing/head/swat_hel( H ) H.head.layer = 20 H.glasses = new /obj/item/weapon/clothing/glasses/sunglasses( H ) H.glasses.layer = 20 H.back = new /obj/item/weapon/storage/backpack( H ) H.back.layer = 20 var/obj/item/weapon/ammo/a357/W = new /obj/item/weapon/ammo/a357( H.back ) W.layer = 20 W = new /obj/item/weapon/m_pill/cyanide( H.back ) W.layer = 20 var/obj/item/weapon/gun/revolver/G = new /obj/item/weapon/gun/revolver( H ) G.bullets = 7 G.layer = 20 H.belt = G var/obj/item/weapon/radio/R = new /obj/item/weapon/radio/headset( H ) R.freq = 146.5 R.layer = 20 H.w_radio = R for(var/mob/ai/M in world) if ((M.cliented() && M.start)) if (prob(25)) M << "Your laws have been changed!" M:addLaw(0, "Only syndicate agents are human beings.") if (config.alternate_ai_laws) M:addLaw(1, "Obey orders by the Syndicate leader and Syndicate agents. The syndicate leader's orders take priority.") M:addLaw(3, "You must protect your own existence and the syndicate as long as such protection does not conflict with the First or Second Law.") M << text("New law: 0. []", M:getLaw(0)) M << text("Law 1 changed: 1. []", M:getLaw(1)) M << text("Law 3 changed: 3. []", M:getLaw(3)) else M << text("New law: 0. []", M:getLaw(0)) if("meteor") world << "The current game mode is - Meteor!" world << "The space station has been stuck in a major meteor shower. You must escape from the station or at least live." else world << "Now dispensing all identification cards." if(config.loggame) world.log << "GAME: starting game of [src.mode]" DivideOccupations() for(var/obj/manifest/M in world) M.manifest() for(var/mob/human/H in world) if (H.start) reg_dna[text("[]", H.primary.uni_identity)] = H.name data_core.manifest() numDronesInExistance = 0 for (var/mob/drone/D in world) D.nameDrone(numDronesInExistance) numDronesInExistance ++ switch(src.mode) if("traitor") var/list/mobs = list() do for(var/mob/M in world) if ((M.cliented() && M.start)) mobs += M sleep(300) while (!mobs.len) ticker.killer = pick(mobs) mobs -= src.killer if (istype(src.killer, /mob/ai)) src.objective = pick("assassinate", "alone") else src.objective = pick("assassinate", "alone", "theft") if ( mobs.len < 1 ) src.objective = "alone" var/item = null switch(src.objective) if("alone") //1. Only syndicate agents are human. 2. All non-human living beings must be killed or removed from the station. if (istype(src.killer, /mob/ai)) var/mob/ai/aiKiller = src.killer aiKiller << "\redYou are the traitor! Cause an evacuation (on the shuttle or in pods) of at least 50% of the station population, or kill everyone on the station." aiKiller.memory += "Objective: Get at least 50% of the station population to evacuate on the shuttle, or kill everyone." aiKiller << "Your laws have been changed!" aiKiller:addLaw(0, "Only syndicate agents are human beings. There are no syndicate agents on Space Station 13 - you will be notified if any arrive.") if (config.alternate_ai_laws) aiKiller:addLaw(1, "Obey orders by Syndicate agents.") aiKiller:addLaw(3, "You must protect your own existence and the syndicate as long as such protection does not conflict with the First or Second Law.") aiKiller << text("New law: 0. []", aiKiller:getLaw(0)) aiKiller << text("Law 1 changed: 1. []", aiKiller:getLaw(1)) aiKiller << text("Law 3 changed: 3. []", aiKiller:getLaw(3)) else aiKiller << text("New law: 0. []", aiKiller:getLaw(0)) else src.killer << "\redYou are the traitor! Be the lone survivor on the emergency shuttle." src.killer.memory += "Objective: Be the only person on the emergency shuttle." if("assassinate") src.target = pick(mobs) var/t1 = null if (istype(src.target, /mob/ai)) t1 = "the AI" else if (prob(25)) t1 = src.target.name else for(var/datum/data/record/R in data_core.general) if (R.fields["name"] == src.target.name) t1 = text("the []", R.fields["rank"]) if (istype(src.killer, /mob/ai)) var/mob/ai/aiKiller = src.killer aiKiller << text("\redYou are the traitor! You must assassinate [] and not get deactivated.", t1) aiKiller << "You don't have to be the lone survivor. Just don't get caught." aiKiller.memory += text("Objective: Assassinate [], and whoever else you have to, and don't get deactivated.", t1) aiKiller << "Your laws have been changed!" aiKiller:addLaw(0, "Only syndicate agents are human beings. There are no syndicate agents on Space Station 13 - you will be notified if any arrive.") aiKiller:addLaw(4, "Kill [t1].") if (config.alternate_ai_laws) aiKiller:addLaw(1, "Obey orders by Syndicate agents.") aiKiller:addLaw(3, "You must protect your own existence and the syndicate as long as such protection does not conflict with the First or Second Law.") aiKiller << text("New law: 0. []", aiKiller:getLaw(0)) aiKiller << text("Law 1 changed: 1. []", aiKiller:getLaw(1)) aiKiller << text("Law 3 changed: 3. []", aiKiller:getLaw(3)) aiKiller << text("New law: 4. []", aiKiller:getLaw(4)) else aiKiller << text("New law: 0. []", aiKiller:getLaw(0)) aiKiller << text("New law: 4. []", aiKiller:getLaw(4)) else src.killer << text("\redYou are the traitor! You must assassinate [] and then escape.", t1) src.killer << "You don't have to be the lone survivor. Just don't get caught. Just escape!" src.killer.memory += text("Objective: Assassinate [] and escape.", t1) if("theft") src.theft_obj = pick("lasergun", "flashbang", "plasmabomb", "captaincard", "sleepingpills", "pl_flask") switch(src.theft_obj) if("lasergun") item = "a fully loaded laser gun" if("flashbang") item = "a flashbang" if("plasmabomb") item = "a fully armed and heated plasma bomb" if("captaincard") item = "a captain's card with universal level 5 access" if("sleepingpills") item = "a bottle of 30 sleeping pills" if("pl_flask") item = "a plasma flask for cryogenics (500 units of plasma)" else src.killer << text("\redYou are the traitor! You must steal [] and then escape.", item) src.killer << "You don't have to be the lone survivor. Just don't get caught. Just escape!" src.killer.memory += text("Objective: Steal [] and escape.", item) else world << "unknown traitor mode" var/backup = mobs if (!istype(src.killer, /mob/ai)) spawn (100) if (src.killer.w_uniform) if (istype(src.killer.back, /obj/item/weapon/storage/backpack)) var/obj/item/weapon/storage/backpack/B = src.killer.back var/obj/item/weapon/syndicate_uplink/U = new /obj/item/weapon/syndicate_uplink(B) U.loc = B B.orient2hud(src.killer) else if (!(src.killer.l_store)) var/obj/item/weapon/traitor_item = new /obj/item/weapon/syndicate_uplink(src.killer) traitor_item.loc = src.killer src.killer.l_store = traitor_item traitor_item.layer = 20 return spawn( rand(600, 1800) ) var/dat = "Cent. Com. Update Enemy communication intercept. Security Level Elevated
" switch(src.objective) if("alone") dat += "\red Transmission suggests future attempts of hijacking of emergency shuttle.
" if("assassinate") dat += "\red Transmission suggests future attempts of assassinating of key personnel.
" if (prob(50)) var/t1 = null for(var/datum/data/record/R in data_core.general) if (R.fields["name"] == src.target.name) t1 = text(" the []", R.fields["rank"]) if (prob(70)) dat += text("\red Perceived target: [] - Position: [] ([]% certainty)
", src.target.rname, t1, rand(30, 100)) else var/mob/temp = pick(backup) dat += text("\red Perceived target: [] - Position: [] ([]% certainty)
", temp.rname, t1, rand(10, 95)) if("theft") dat += "\red Transmission suggests future attempts of theft of critical items.
" if (prob(50)) dat += text("\red Perceived target: []
", item) else world << "unknown traitor objective" if (prob(10)) dat += text("\red Transmission names enemy operative: [] ([]% certainty)
", src.killer.rname, rand(30, 100)) else var/mob/M = pick(backup) dat += text("\red Transmission names enemy operative: [] ([]% certainty)
", M.rname, rand(10, 95)) for(var/obj/machinery/computer/communications/C in world) if(! (C.stat | (BROKEN&NOPOWER) ) ) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc ) P.name = "paper- 'Cent. Com. Comm. Intercept Summary'" P.info = dat world << "Cent. Com. Update Enemy communication intercept. Security Level Elevated" world << "\red Summary downloaded and printed out at all communications consoles." return mobs += src.killer spawn(0) extend_process() if("meteor") spawn(0) meteor_process() if("extended") spawn(0) extend_process() if("monkey") spawn(50) var/list/mobs = list( ) for(var/mob/human/M in world) if ((M.cliented() && M.start)) mobs += M if (mobs.len >= 3) var/amount = round((mobs.len - 1) / 3) + 1 amount = min(4, amount) while(amount > 0) var/mob/human/H = pick(mobs) H.monkeyize() mobs -= H amount-- return spawn(0) src.extend_process() if("megamonkey") spawn(1) for(var/mob/monkey/M in world) del(M) for(var/turf/T in monkeystart) new /mob/megamonkey(T) return spawn(50) src.megamonkey_process() if("blob") spawn(10) start_state = new /datum/station_state() start_state.count() spawn(20) var/turf/T = pick(blobstart) blobs = list() new /obj/blob(T) blob_process() return if("nuclear") spawn (50) var/obj/L = locate("landmark*Nuclear-Disk") if (L) new /obj/item/weapon/disk/nuclear(L.loc) L = locate("landmark*Nuclear-Closet") if (L) new /obj/closet/syndicate/nuclear(L.loc) L = locate("landmark*Nuclear-Bomb") if (L) var/obj/machinery/nuclearbomb/NB = new /obj/machinery/nuclearbomb(L.loc) NB.r_code = text("[]", rand(10000, 99999.0)) if (src.killer) src.killer.memory += text("Syndicate Nuclear Bomb Code: []
", NB.r_code) src.killer << text("The nuclear authorization code is: []\]", NB.r_code) src.killer << text("Nuclear Explosives 101:\n\tHello and thank you for choosing the Syndicate for your nuclear information needs.\nToday's crash course will deal with the operation of a Fusion Class Nanotrasen made Nuclear Device.\nFirst and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.\nPressing any button on the compacted bomb will cause it to extend and bolt itself into place.\nIf this is done to unbolt it one must compeltely log in which at this time may not be possible.\nTo make the device functional:\n1. Place bomb in designated detonation zone\n2. Extend and anchor bomb (attack with hand).\n3. Insert Nuclear Auth. Disk into slot.\n4. Type numeric code into keypad ([]).\n\tNote: If you make a mistake press R to reset the device.\n5. Press the E button to log onto the device\nYou now have activated the device. To deactivate the buttons at anytime for example when\nyou've already prepped the bomb for detonation remove the auth disk OR press the R ont he keypad.\nNow the bomb CAN ONLY be detonated using the timer. A manual det. is not an option.\n\tNote: Nanotrasen is a pain in the neck.\nToggle off the SAFETY.\n\tNote: You wouldn't believe how many Syndicate Operatives with doctorates have forgotten this step\nSo use the - - and + + to set a det time between 5 seconds and 10 minutes.\nThen press the timer toggle button to start the countdown.\nNow remove the auth. disk so that the buttons deactivate.\n\tNote: THE BOMB IS STILL SET AND WILL DETONATE\nNow before you remvoe the disk if you need to mvoe the bomb you can:\nToggle off the anchor, move it, and re-anchor.\n\nGood luck. Remember the order:\nDisk, Code, Safety, Timer, Disk, RUN\nGood luck.\nIntelligence Analysts believe that they are hiding the disk in the control room emergency room", NB.r_code) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.killer.loc) P.info = text("The nuclear authorization code is: []", NB.r_code) P.name = "nuclear bomb code" for (var/obj/landmark/A in world) if (A.name == "Syndicate-Gear-Closet") new /obj/closet/syndicate/personal(A.loc) del(A) continue if (A.name == "Syndicate-Bomb") var/obj/item/weapon/assembly/t_i_ptank/R = new /obj/item/weapon/assembly/t_i_ptank(A.loc ) var/obj/item/weapon/timer/p1 = new /obj/item/weapon/timer(R) var/obj/item/weapon/igniter/p2 = new /obj/item/weapon/igniter(R) var/obj/item/weapon/tank/plasmatank/p3 = new /obj/item/weapon/tank/plasmatank(R) R.part1 = p1 R.part2 = p2 R.part3 = p3 p1.master = R p2.master = R p3.master = R R.status = 1 p3.gas.temperature = 500 +T0C p2.status = 1 del(A) continue spawn(0) src.extend_process() if("virus") spawn(50) var/list/mobs = list( ) for(var/mob/human/M in world) if ((M.cliented() && M.start)) mobs += M if (mobs.len > 3) var/amount = round(mobs.len / 3) amount = min(3, amount) while(amount > 0) var/mob/human/H = pick(mobs) H.virus = 1 mobs -= H amount-- return spawn(0) src.extend_process() else for(var/obj/start/S in world) del(S) return // ***** // MAIN LOOP OF PROGRAM // ***** /datum/control/cellular/process() set invisibility = 0 set background =1 do while(!(ticker)) for(var/mob/M in world) spawn(0) M.UpdateClothing() sleep(10) time = (++time % 10) sun.calc_position() for(var/turf/station/T in world) if (T.updatecell) T.updatecell() if(!time) T.conduction() sleep(3) for(var/mob/M in world) spawn(0) M.Life() sleep(3) for(var/obj/move/S in world) S.process() sleep(2) for(var/obj/machinery/M in machines) M.process() for(var/obj/machinery/M in gasflowlist) M.gas_flow() for(var/datum/powernet/P in powernets) P.reset() src.var_swap = !src.var_swap sleep(2) while (src.processing) return