Merge tgstation13 r4570 into bs12_with_tgport

Conflicts:
	baystation12.dme
	code/defines/obj.dm
	code/defines/procs/helpers.dm
	code/defines/turf.dm
	code/game/gamemodes/changeling/modularchangling.dm
	code/game/gamemodes/cult/cult_structures.dm
	code/game/gamemodes/events.dm
	code/game/machinery/telecomms/machine_interactions.dm
	code/game/master_controller.dm
	code/game/objects/items/blueprints.dm
	code/game/objects/items/devices/uplinks.dm
	code/game/objects/items/item.dm
	code/game/objects/items/weapons/gift_wrappaper.dm
	code/game/objects/items/weapons/wires.dm
	code/game/objects/weapons.dm
	code/game/turfs/turf.dm
	code/modules/clothing/head/hardhat.dm
	code/modules/mining/mine_items.dm
	code/modules/mining/mine_turfs.dm
	code/modules/mob/living/silicon/robot/life.dm
	code/modules/mob/mob_defines.dm
	code/modules/mob/new_player/login.dm
	code/modules/paperwork/pen.dm
	code/modules/paperwork/stamps.dm
	code/unused/toilets.dm
	html/changelog.html
	icons/effects/alert.dmi

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-08-28 19:57:11 +10:00
269 changed files with 14389 additions and 13349 deletions

View File

@@ -0,0 +1,305 @@
/*
Modified DynamicAreaLighting for TGstation - Coded by Carnwennan
This is TG's 'new' lighting system. It's basically a heavily modified mix of combination of Forum_Account's and
ShadowDarke's respective lighting libraries. Credits, where due, to them.
Like sd_DAL (what we used to use), it changes the shading overlays of areas by splitting each type of area into sub-areas
by using the var/tag variable and moving turfs into the contents list of the correct sub-area.
Unlike sd_DAL however it uses a queueing system. Everytime we call a change to opacity or luminosity
(through SetOpacity() or SetLuminosity()) we are simply updating variables and scheduling certain lights/turfs for an
update. Actual updates are handled periodically by the lighting_controller. This carries additional overheads, however it
means that each thing is changed only once per lighting_controller.processing_interval ticks. Allowing for greater control
over how much priority we'd like lighting updates to have. It also makes it possible for us to simply delay updates by
setting lighting_controller.processing = 0 at say, the start of a large explosion, waiting for it to finish, and then
turning it back on with lighting_controller.processing = 1.
Unlike our old system there is a hardcoded maximum luminosity. This is to discourage coders using large luminosity values
for dynamic lighting, as the cost of lighting grows rapidly at large luminosity levels (especially when changing opacity
at runtime)
Also, in order for the queueing system to work, each light remembers the effect it casts on each turf. This is going to
have larger memory requirements than our previous system but hopefully it's worth the hassle for the greater control we
gain. Besides, there are far far worse uses of needless lists in the game, it'd be worth pruning some of them to offset
costs.
Known Issues/TODO:
admin-spawned turfs will have broken lumcounts. Not willing to fix it at this moment
mob luminosity will be lower than expected when one of multiple light sources is dropped after exceeding the maximum luminosity
Shuttles still do not have support for dynamic lighting (I hope to fix this at some point)
No directional lighting support. Fairly easy to add this and the code is ready.
When opening airlocks etc, lighting does not always update to account for the change in opacity.
*/
#define LIGHTING_MAX_LUMINOSITY 12 //Hard maximum luminosity to prevet lag which could be caused by coders making mini-suns
#define LIGHTING_MAX_LUMINOSITY_MOB 7 //Mobs get their own max because 60-odd human suns running around would be pretty silly
#define LIGHTING_LAYER 10 //Drawing layer for lighting overlays
#define LIGHTING_ICON 'icons/effects/ss13_dark_alpha7.dmi' //Icon used for lighting shading effects
datum/controller/lighting/New() //moved here so its in the define. eek :S
lighting_states = max( 0, length(icon_states(LIGHTING_ICON))-1 )
datum/light_source
var/atom/owner
var/changed = 1
var/mobile = 1
var/list/effect = list()
var/__x = 0 //x coordinate at last update
var/__y = 0 //y coordinate at last update
New(atom/A)
if(!istype(A))
CRASH("The first argument to the light object's constructor must be the atom that is the light source. Expected atom, received '[A]' instead.")
..()
owner = A
if(istype(owner, /atom/movable)) mobile = 1 //apparantly this is faster than type-checking
else mobile = 0 //Perhaps removing support for luminous turfs would be a good idea.
__x = owner.x
__y = owner.y
// the lighting object maintains a list of all light sources
lighting_controller.lights += src
//Check a light to see if its effect needs reprocessing. If it does, remove any old effect and create a new one
proc/check()
if(!owner)
remove_effect()
return 1 //causes it to be removed from our list of lights. The garbage collector will then destroy it.
if(mobile)
// check to see if we've moved since last update
if(owner.x != __x || owner.y != __y)
__x = owner.x
__y = owner.y
changed = 1
if(changed)
changed = 0
remove_effect()
return add_effect()
return 0
proc/remove_effect()
// before we apply the effect we remove the light's current effect.
if(effect.len)
for(var/turf in effect) // negate the effect of this light source
var/turf/T = turf
T.update_lumcount(-effect[T])
effect.Cut() // clear the effect list
proc/add_effect()
// only do this if the light is turned on and is on the map
if(owner.loc && owner.luminosity > 0)
effect = new_effect() // identify the effects of this light source
for(var/turf in effect)
var/turf/T = turf
T.update_lumcount(effect[T]) // apply the effect
return 0
else
owner.light = null
return 1 //cause the light to be removed from the lights list and garbage collected once it's no
//longer referenced by the queue
proc/new_effect()
. = list()
for(var/turf/T in view(owner.luminosity, owner))
// var/area/A = T.loc
// if(!A) continue
var/change_in_lumcount = lum(T)
if(change_in_lumcount > 0)
.[T] = change_in_lumcount
return .
proc/lum(turf/A)
return owner.luminosity - max(abs(A.x-__x),abs(A.y-__y))
// var/dist = cheap_hypotenuse(A.x,A.y,__x,__y) //fetches the pythagorean distance between A and the light
// if(owner.luminosity < dist) //if the turf is outside the radius the light doesn't illuminate it
// return 0
// return round(owner.luminosity - (dist/2),0.1)
atom
var/datum/light_source/light
//Turfs with opacity when they are constructed will trigger nearby lights to update
//Turfs atoms with luminosity when they are constructed will create a light_source automatically
//TODO: lag reduction
turf/New()
..()
if(opacity)
UpdateAffectingLights()
if(luminosity)
world.log << "[type] has luminosity at New()"
if(light) world.log << "## WARNING: [type] - Don't set lights up manually during New(), We do it automatically."
light = new(src)
//Movable atoms with opacity when they are constructed will trigger nearby lights to update
//Movable atoms with luminosity when they are constructed will create a light_source automatically
//TODO: lag reduction
atom/movable/New()
..()
if(opacity)
UpdateAffectingLights()
if(luminosity)
if(light) world.log << "## WARNING: [type] - Don't set lights up manually during New(), We do it automatically."
light = new(src)
//Turfs with opacity will trigger nearby lights to update at next lighting process.
//TODO: is this really necessary? Removing it could help reduce lag during singulo-mayhem somewhat
turf/Del()
if(opacity)
UpdateAffectingLights()
..()
//Objects with opacity will trigger nearby lights to update at next lighting process.
atom/movable/Del()
if(opacity)
UpdateAffectingLights()
..()
//Sets our luminosity. Enforces a hardcoded maximum luminosity by default. This maximum can be overridden but it is extremely
//unwise to do so.
//If we have no light it will create one.
//If we are setting luminosity to 0 the light will be cleaned up and delted once all its queues are complete
//if we have a light already it is merely updated
atom/proc/SetLuminosity(new_luminosity, max_luminosity = LIGHTING_MAX_LUMINOSITY)
if(new_luminosity < 0)
new_luminosity = 0
// world.log << "## WARNING: [type] - luminosity cannot be negative"
else if(max_luminosity < new_luminosity)
new_luminosity = max_luminosity
// if(luminosity != new_luminosity)
// world.log << "## WARNING: [type] - LIGHT_MAX_LUMINOSITY exceeded"
if(isturf(loc))
if(light)
if(luminosity != new_luminosity) //TODO: remove lights from the light list when they're not luminous? DONE in add_effect
light.changed = 1
else
if(new_luminosity)
light = new(src)
luminosity = new_luminosity
//Snowflake code to prevent mobs becoming suns (lag-prevention)
mob/SetLuminosity(new_luminosity)
..(new_luminosity,LIGHTING_MAX_LUMINOSITY_MOB)
//change our opacity (defaults to toggle), and then update all lights that affect us.
atom/proc/SetOpacity(var/new_opacity)
if(new_opacity == null) new_opacity = !opacity
else if(opacity == new_opacity) return
opacity = new_opacity
UpdateAffectingLights()
//set the changed status of all lights which could have possibly lit this atom.
//We don't need to worry about lights which lit us but moved away, since they will have change status set already
atom/proc/UpdateAffectingLights()
var/turf/T = src
if(!isturf(T))
T = loc
if(!isturf(T)) return
for(var/atom in range(LIGHTING_MAX_LUMINOSITY,T)) //TODO: this will probably not work very well :(
var/atom/A = atom
if(A.light && A.luminosity)
A.light.changed = 1 //force it to update at next process()
// for(var/light in lighting_controller.lights) //TODO: this will probably laaaaaag
// var/datum/light_source/L = light
// if(L.changed) continue
// if(!L.owner) continue
// if(!L.owner.luminosity) continue
// if(src in L.effect)
// L.changed = 1
turf
var/lighting_lumcount = 0
var/lighting_changed = 0
turf/space
lighting_lumcount = 4 //starlight
turf/proc/update_lumcount(amount)
lighting_lumcount += amount
// if(lighting_lumcount < 0 || lighting_lumcount > 100)
// world.log << "## WARNING: [type] ([src]) lighting_lumcount = [lighting_lumcount]"
if(!lighting_changed)
lighting_controller.changed_turfs += src
lighting_changed = 1
turf/proc/shift_to_subarea()
lighting_changed = 0
var/area/Area = loc
if(!istype(Area) || !Area.lighting_use_dynamic) return
// change the turf's area depending on its brightness
// restrict light to valid levels
var/light = min(max(round(lighting_lumcount,1),0),lighting_controller.lighting_states)
var/new_tag = "[Area.type]sd_L[light]"
if(Area.tag!=new_tag) //skip if already in this area
var/area/A = locate(new_tag) // find an appropriate area
if(!A)
A = new Area.type() // create area if it wasn't found
// replicate vars
for(var/V in Area.vars)
switch(V)
if("contents","lighting_overlay","overlays") continue
else
if(issaved(Area.vars[V])) A.vars[V] = Area.vars[V]
A.tag = new_tag
A.lighting_subarea = 1
A.SetLightLevel(light)
Area.related += A
A.contents += src // move the turf into the area
area
var/lighting_use_dynamic = 1 //Turn this flag off to prevent sd_DynamicAreaLighting from affecting this area
var/image/lighting_overlay //tracks the darkness image of the area for easy removal
var/lighting_subarea = 0 //tracks whether we're a lighting sub-area
proc/SetLightLevel(light)
if(!src) return
if(light < 0)
light = 0
luminosity = 0
else
if(light > lighting_controller.lighting_states)
light = lighting_controller.lighting_states
luminosity = 1
if(lighting_overlay)
overlays -= lighting_overlay
lighting_overlay.icon_state = "[light]"
else
lighting_overlay = image(LIGHTING_ICON,,num2text(light),LIGHTING_LAYER)
overlays += lighting_overlay
proc/InitializeLighting() //TODO: could probably improve this bit ~Carn
if(!tag) tag = "[type]"
if(!lighting_use_dynamic)
if(!lighting_subarea) // see if this is a lighting subarea already
//show the dark overlay so areas, not yet in a lighting subarea, won't be bright as day and look silly.
SetLightLevel(4)
#undef LIGHTING_MAX_LUMINOSITY
#undef LIGHTING_MAX_LUMINOSITY_MOB
#undef LIGHTING_LAYER
#undef LIGHTING_ICON

View File

@@ -0,0 +1,481 @@
/datum/configuration
var/server_name = null // server name (for world name / status)
var/server_suffix = 0 // generate numeric suffix based on server port
var/log_ooc = 0 // log OOC channel
var/log_access = 0 // log login/logout
var/log_say = 0 // log client say
var/log_admin = 0 // log admin actions
var/log_game = 0 // log game events
var/log_vote = 0 // log voting
var/log_whisper = 0 // log client whisper
var/log_emote = 0 // log emotes
var/log_attack = 0 // log attack messages
var/log_adminchat = 0 // log admin chat messages
var/log_adminwarn = 0 // log warnings admins get about bomb construction and such
var/log_pda = 0 // log pda messages
var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits
var/sql_enabled = 1 // for sql switching
var/allow_vote_restart = 0 // allow votes to restart
var/allow_vote_mode = 0 // allow votes to change mode
var/allow_admin_jump = 1 // allows admin jumping
var/allow_admin_spawning = 1 // allows admin item spawning
var/allow_admin_rev = 1 // allows admin revives
var/vote_delay = 600 // minimum time between voting sessions (seconds, 10 minute default)
var/vote_period = 60 // length of voting period (seconds, default 1 minute)
var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi)
var/vote_no_dead = 0 // dead people can't vote (tbi)
// var/enable_authentication = 0 // goon authentication
var/del_new_on_log = 1 // del's new players if they log before they spawn in
var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
var/traitor_scaling = 0 //if amount of traitors scales based on amount of players
var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other
var/allow_Metadata = 0 // Metadata is supported.
var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
var/Ticklag = 0.9
var/Tickcomp = 0
var/socket_talk = 0 // use socket_talk to communicate with other processes
var/list/mode_names = list()
var/list/modes = list() // allowed modes
var/list/votable_modes = list() // votable modes
var/list/probabilities = list() // relative probability of each mode
var/humans_need_surnames = 0
var/allow_random_events = 0 // enables random events mid-round when set to 1
var/allow_ai = 1 // allow ai job
var/hostedby = null
var/respawn = 1
var/guest_jobban = 1
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players
var/load_jobs_from_txt = 0
var/ToRban = 0
var/usealienwhitelist = 0
var/server
var/banappeals
var/wikiurl
var/forumurl
//Alert level description
var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed."
var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
var/alert_desc_red_downto = "The self-destruct mechanism has been deactivated, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
var/alert_desc_delta = "The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
var/forbid_singulo_possession = 0
var/useircbot = 0
//game_options.txt configs
var/health_threshold_crit = 0
var/health_threshold_dead = -100
var/revival_pod_plants = 1
var/revival_cloning = 1
var/revival_brain_life = -1
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
var/datum/game_mode/M = new T()
if (M.config_tag)
if(!(M.config_tag in modes)) // ensure each mode is added only once
diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
src.modes += M.config_tag
src.mode_names[M.config_tag] = M.name
src.probabilities[M.config_tag] = M.probability
if (M.votable)
src.votable_modes += M.config_tag
del(M)
src.votable_modes += "secret"
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
var/text = file2text(filename)
if (!text)
diary << "No [filename] file found, setting defaults"
src = new /datum/configuration()
return
diary << "Reading configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
continue
if(type == "config")
switch (name)
if ("log_ooc")
config.log_ooc = 1
if ("log_access")
config.log_access = 1
if ("sql_enabled")
config.sql_enabled = text2num(value)
if ("log_say")
config.log_say = 1
if ("log_admin")
config.log_admin = 1
if ("log_game")
config.log_game = 1
if ("log_vote")
config.log_vote = 1
if ("log_whisper")
config.log_whisper = 1
if ("log_attack")
config.log_attack = 1
if ("log_emote")
config.log_emote = 1
if ("log_adminchat")
config.log_adminchat = 1
if ("log_adminwarn")
config.log_adminwarn = 1
if ("log_pda")
config.log_pda = 1
if ("log_hrefs")
config.log_hrefs = 1
if ("allow_vote_restart")
config.allow_vote_restart = 1
if ("allow_vote_mode")
config.allow_vote_mode = 1
if ("allow_admin_jump")
config.allow_admin_jump = 1
if("allow_admin_rev")
config.allow_admin_rev = 1
if ("allow_admin_spawning")
config.allow_admin_spawning = 1
if ("no_dead_vote")
config.vote_no_dead = 1
if ("default_no_vote")
config.vote_no_default = 1
if ("vote_delay")
config.vote_delay = text2num(value)
if ("vote_period")
config.vote_period = text2num(value)
if ("allow_ai")
config.allow_ai = 1
// if ("authentication")
// config.enable_authentication = 1
if ("norespawn")
config.respawn = 0
if ("servername")
config.server_name = value
if ("serversuffix")
config.server_suffix = 1
if ("hostedby")
config.hostedby = value
if ("server")
config.server = value
if ("banappeals")
config.banappeals = value
if ("wikiurl")
config.wikiurl = value
if ("forumurl")
config.forumurl = value
if ("guest_jobban")
config.guest_jobban = 1
if ("guest_ban")
guests_allowed = 0
if ("usewhitelist")
config.usewhitelist = 1
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
if ("allow_metadata")
config.allow_Metadata = 1
if ("traitor_scaling")
config.traitor_scaling = 1
if("protect_roles_from_antagonist")
config.protect_roles_from_antagonist = 1
if ("probability")
var/prob_pos = findtext(value, " ")
var/prob_name = null
var/prob_value = null
if (prob_pos)
prob_name = lowertext(copytext(value, 1, prob_pos))
prob_value = copytext(value, prob_pos + 1)
if (prob_name in config.modes)
config.probabilities[prob_name] = text2num(prob_value)
else
diary << "Unknown game mode probability configuration definition: [prob_name]."
else
diary << "Incorrect probability configuration definition: [prob_name] [prob_value]."
if("allow_random_events")
config.allow_random_events = 1
if("kick_inactive")
config.kick_inactive = 1
if("load_jobs_from_txt")
load_jobs_from_txt = 1
if("alert_red_upto")
config.alert_desc_red_upto = value
if("alert_red_downto")
config.alert_desc_red_downto = value
if("alert_blue_downto")
config.alert_desc_blue_downto = value
if("alert_blue_upto")
config.alert_desc_blue_upto = value
if("alert_green")
config.alert_desc_green = value
if("alert_delta")
config.alert_desc_delta = value
if("forbid_singulo_possession")
forbid_singulo_possession = 1
if("popup_admin_pm")
config.popup_admin_pm = 1
if("allow_holidays")
Holiday = 1
if("useircbot")
useircbot = 1
if("ticklag")
Ticklag = text2num(value)
if("socket_talk")
socket_talk = text2num(value)
if("tickcomp")
Tickcomp = 1
if("humans_need_surnames")
humans_need_surnames = 1
if("tor_ban")
ToRban = 1
else
diary << "Unknown setting in configuration: '[name]'"
else if(type == "game_options")
if(!value)
diary << "Unknown value for setting [name] in [filename]."
value = text2num(value)
switch(name)
if("health_threshold_crit")
config.health_threshold_crit = value
if("health_threshold_dead")
config.health_threshold_dead = value
if("revival_pod_plants")
config.revival_pod_plants = value
if("revival_cloning")
config.revival_cloning = value
if("revival_brain_life")
config.revival_brain_life = value
else
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No dbconfig.txt file found, retaining defaults"
world << "No dbconfig.txt file found, retaining defaults"
return
diary << "Reading database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
continue
switch (name)
if ("address")
sqladdress = value
if ("port")
sqlport = value
if ("database")
sqldb = value
if ("login")
sqllogin = value
if ("password")
sqlpass = value
if ("feedback_database")
sqlfdbkdb = value
if ("feedback_login")
sqlfdbklogin = value
if ("feedback_password")
sqlfdbkpass = value
if ("enable_stat_tracking")
sqllogging = 1
else
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadforumsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No forumdbconfig.txt file found, retaining defaults"
world << "No forumdbconfig.txt file found, retaining defaults"
return
diary << "Reading forum database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
continue
switch (name)
if ("address")
forumsqladdress = value
if ("port")
forumsqlport = value
if ("database")
forumsqldb = value
if ("login")
forumsqllogin = value
if ("password")
forumsqlpass = value
if ("activatedgroup")
forum_activated_group = value
if ("authenticatedgroup")
forum_authenticated_group = value
else
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
for (var/T in (typesof(/datum/game_mode) - /datum/game_mode))
var/datum/game_mode/M = new T()
if (M.config_tag && M.config_tag == mode_name)
return M
del(M)
return null
/datum/configuration/proc/get_runnable_modes()
var/list/datum/game_mode/runnable_modes = new
for (var/T in (typesof(/datum/game_mode) - /datum/game_mode))
var/datum/game_mode/M = new T()
//world << "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]"
if (!(M.config_tag in modes))
del(M)
continue
if (probabilities[M.config_tag]<=0)
del(M)
continue
if (M.can_start())
runnable_modes[M] = probabilities[M.config_tag]
//world << "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]"
return runnable_modes

View File

@@ -0,0 +1,81 @@
var/datum/controller/lighting/lighting_controller = new ()
datum/controller/lighting
var/processing = 0
var/processing_interval = 5 //setting this too low will probably kill the server. Don't be silly with it!
var/process_cost = 0
var/iteration = 0
var/lighting_states = 7
var/list/lights = list()
var/lights_workload_max = 0
// var/list/changed_lights() //TODO: possibly implement this to reduce on overheads?
var/list/changed_turfs = list()
var/changed_turfs_workload_max = 0
//Workhorse of lighting. It cycles through each light to see which ones need their effects updating. It updates their
//effects and then processes every turf in the queue, moving the turfs to the corresponing lighting sub-area.
//All queue lists prune themselves, which will cause lights with no luminosity to be garbage collected (cheaper and safer
//than deleting them). Processing interval should be roughly half a second for best results.
//By using queues we are ensuring we don't perform more updates than are necessary
datum/controller/lighting/proc/process()
processing = 1
spawn(0)
set background = 1
while(1)
if(processing)
iteration++
var/started = world.timeofday
lights_workload_max = max(lights_workload_max,lights.len)
for(var/i=1, i<=lights.len, i++)
var/datum/light_source/L = lights[i]
if(L.check())
lights.Cut(i,i+1)
i--
sleep(-1)
changed_turfs_workload_max = max(changed_turfs_workload_max,changed_turfs.len)
for(var/i=1, i<=changed_turfs.len, i++)
var/turf/T = changed_turfs[i]
if(T && T.lighting_changed)
T.shift_to_subarea()
changed_turfs.Cut() // reset the changed list
process_cost = (world.timeofday - started)
sleep(processing_interval)
//same as above except it attempts to shift ALL turfs in the world regardless of lighting_changed status
//Does not loop. Should be run prior to process() being called for the first time.
//Note: if we get additional z-levels at runtime (e.g. if the gateway thin ever gets finished) we can initialize specific
//z-levels with the z_level argument
datum/controller/lighting/proc/Initialize(var/z_level)
processing = 0
spawn(-1)
set background = 1
for(var/i=1, i<=lights.len, i++)
var/datum/light_source/L = lights[i]
if(L.check())
lights.Cut(i,i+1)
i--
var/z_start = 1
var/z_finish = world.maxz
if(z_level)
z_level = round(z_level,1)
if(z_level > 0 && z_level <= world.maxz)
z_start = z_level
z_finish = z_level
for(var/k=z_start,k<=z_finish,k++)
for(var/i=1,i<=world.maxx,i++)
for(var/j=1,j<=world.maxy,j++)
var/turf/T = locate(i,j,k)
if(T) T.shift_to_subarea()
changed_turfs.Cut() // reset the changed list

View File

@@ -0,0 +1,211 @@
var/global/datum/controller/game_controller/master_controller //Set in world.New()
var/global/datum/failsafe/Failsafe
var/global/controller_iteration = 0
var/global/last_tick_timeofday = world.timeofday
var/global/last_tick_duration = 0
datum/controller/game_controller
var/processing = 0
var/global/air_master_ready = 0
var/global/sun_ready = 0
var/global/mobs_ready = 0
var/global/diseases_ready = 0
var/global/machines_ready = 0
var/global/objects_ready = 0
var/global/networks_ready = 0
var/global/powernets_ready = 0
var/global/ticker_ready = 0
//Used for MC 'proc break' debugging
var/global/obj/last_obj_processed
var/global/datum/disease/last_disease_processed
var/global/obj/machinery/last_machine_processed
var/global/mob/last_mob_processed
proc/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")
world.tick_lag = config.Ticklag
createRandomZlevel()
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()
setupfactions()
spawn
ticker.pregame()
proc/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."
proc/process()
processing = 1
spawn(0)
set background = 1
while(1)
var/currenttime = world.timeofday
var/diff = (currenttime - last_tick_timeofday) / 10
last_tick_timeofday = currenttime
last_tick_duration = diff
if(processing)
controller_iteration++
var/start_time = world.timeofday
air_master_ready = 0
sun_ready = 0
mobs_ready = 0
diseases_ready = 0
machines_ready = 0
objects_ready = 0
networks_ready = 0
powernets_ready = 0
ticker_ready = 0
//skytodo:
/*spawn(0)
air_master.process()
air_master_ready = 1*/
sleep(1)
spawn(0)
sun.calc_position()
sun_ready = 1
sleep(-1)
spawn(0)
for(var/mob/M in world)
last_mob_processed = M
M.Life()
mobs_ready = 1
sleep(-1)
spawn(0)
for(var/datum/disease/D in active_diseases)
last_disease_processed = D
D.process()
diseases_ready = 1
spawn(0)
for(var/obj/machinery/machine in machines)
if(machine)
last_machine_processed = machine
machine.process()
if(machine && machine.use_power)
machine.auto_use_power()
machines_ready = 1
sleep(1)
spawn(-1)
for(var/obj/object in processing_objects)
last_obj_processed = object
object.process()
objects_ready = 1
sleep(-1)
spawn(-1)
for(var/datum/pipe_network/network in pipe_networks)
network.process()
networks_ready = 1
spawn(-1)
for(var/datum/powernet/P in powernets)
P.reset()
powernets_ready = 1
sleep(-1)
spawn(-1)
ticker.process()
ticker_ready = 1
var/IL_check = 0 //Infinite loop check (To report when the master controller breaks.)
while(!air_master_ready || !sun_ready || !mobs_ready || !diseases_ready || !machines_ready || !objects_ready || !networks_ready || !powernets_ready || !ticker_ready)
IL_check++
if(IL_check > 600)
var/MC_report = "air_master_ready = [air_master_ready]; sun_ready = [sun_ready]; mobs_ready = [mobs_ready]; diseases_ready = [diseases_ready]; machines_ready = [machines_ready]; objects_ready = [objects_ready]; networks_ready = [networks_ready]; powernets_ready = [powernets_ready]; ticker_ready = [ticker_ready];"
message_admins("<b><font color='red'>PROC BREAKAGE WARNING:</font> The game's master contorller appears to be stuck in one of it's cycles. It has looped through it's delaying loop [IL_check] times.</b>")
message_admins("<b>The master controller reports: [MC_report]</b>")
if(!diseases_ready)
if(last_disease_processed)
message_admins("<b>DISEASE PROCESSING stuck on </b><A HREF='?src=%holder_ref%;adminplayervars=\ref[last_disease_processed]'>[last_disease_processed]</A>", 0, 1)
else
message_admins("<b>DISEASE PROCESSING stuck on </b>unknown")
if(!machines_ready)
if(last_machine_processed)
message_admins("<b>MACHINE PROCESSING stuck on </b><A HREF='?src=%holder_ref%;adminplayervars=\ref[last_machine_processed]'>[last_machine_processed]</A>", 0, 1)
else
message_admins("<b>MACHINE PROCESSING stuck on </b>unknown")
if(!objects_ready)
if(last_obj_processed)
message_admins("<b>OBJ PROCESSING stuck on </b><A HREF='?src=ADMINHOLDERREF;adminplayervars=\ref[last_obj_processed]'>[last_obj_processed]</A>", 0, 1)
else
message_admins("<b>OBJ PROCESSING stuck on </b>unknown")
log_admin("PROC BREAKAGE WARNING: infinite_loop_check = [IL_check]; [MC_report];")
message_admins("<font color='red'><b>Master controller breaking out of delaying loop. Restarting the round is advised if problem persists. DO NOT manually restart the master controller.</b></font>")
break;
sleep(1)
sleep(world.timeofday+12-start_time)
else
sleep(10)

View File

@@ -0,0 +1,437 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
// Controls the emergency shuttle
// these define the time taken for the shuttle to get to SS13
// 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 (in spess), 1 = at SS13, 2 = returned from SS13
var/online = 0
var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
var/endtime // timeofday that shuttle arrives
var/timelimit //important when the shuttle gets called for more than shuttlearrivetime
//timeleft = 360 //600
var/fake_recall = 0 //Used in rounds to prevent "ON NOES, IT MUST [INSERT ROUND] BECAUSE SHUTTLE CAN'T BE CALLED"
// call the shuttle
// if not called before, set the endtime to T+600 seconds
// otherwise if outgoing, switch to incoming
proc/incall(coeff = 1)
if(endtime)
if(direction == -1)
setdirection(1)
else
settimeleft(SHUTTLEARRIVETIME*coeff)
online = 1
proc/recall()
if(direction == 1)
var/timeleft = timeleft()
if(timeleft >= 600)
return
captain_announce("The emergency shuttle has been recalled.")
world << sound('sound/AI/shuttlerecalled.ogg')
setdirection(-1)
online = 1
// returns the time (in seconds) before shuttle arrival
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
proc/timeleft()
if(online)
var/timeleft = round((endtime - world.timeofday)/10 ,1)
if(direction == 1 || direction == 2)
return timeleft
else
return SHUTTLEARRIVETIME-timeleft
else
return SHUTTLEARRIVETIME
// sets the time left to a given delay (in seconds)
proc/settimeleft(var/delay)
endtime = world.timeofday + delay * 10
timelimit = delay
// sets the shuttle direction
// 1 = towards SS13, -1 = back to centcom
proc/setdirection(var/dirn)
if(direction == dirn)
return
direction = dirn
// if changing direction, flip the timeleft by SHUTTLEARRIVETIME
var/ticksleft = endtime - world.timeofday
endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft)
return
proc/process()
emergency_shuttle
process()
if(!online)
return
var/timeleft = timeleft()
if(timeleft > 1e5) // midnight rollover protection
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, NORTH)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.open()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
//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)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.open()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.open()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.open()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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)
for(var/obj/machinery/door/D in world)
if( get_area(D) == end_location )
spawn(0)
D.open()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
online = 0
return 1
/* --- Shuttle has docked centcom after being recalled --- */
if(timeleft>timelimit)
online = 0
direction = 1
endtime = null
return 0
else if((fake_recall != 0) && (timeleft <= fake_recall))
recall()
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)
var/area/end_location = locate(/area/shuttle/escape/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
// NOTE: Commenting this out to avoid recreating mass driver glitch
/*
spawn(0)
AM.throw_at(E, 1, 1)
return
*/
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
start_location.move_contents_to(end_location)
settimeleft(SHUTTLELEAVETIME)
send2irc("Server", "The Emergency Shuttle has docked with the station.")
captain_announce("The Emergency Shuttle has docked with the station. You have [round(timeleft()/60,1)] minutes to board the Emergency Shuttle.")
world << sound('sound/AI/shuttledock.ogg')
return 1
if(1)
if(timeleft>0)
return 0
/* --- Shuttle leaves the station, enters transit --- */
else
// 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/transit)
settimeleft(SHUTTLETRANSITTIME)
start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/D in end_location)
spawn(0)
D.close()
// Some aesthetic turbulance shaking
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
//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 end_location)
spawn(0)
D.close()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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 end_location)
spawn(0)
D.close()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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 end_location)
spawn(0)
D.close()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
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 end_location)
spawn(0)
D.close()
for(var/mob/M in end_location)
if(M.client)
spawn(0)
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
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(5)
captain_announce("The Emergency Shuttle has left the station. Estimate [round(timeleft()/60,1)] minutes until the shuttle docks at Central Command.")
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()

View File

@@ -0,0 +1,876 @@
#define PLAYER_WEIGHT 5
#define HUMAN_DEATH -5000
#define OTHER_DEATH -5000
#define EXPLO_SCORE -10000 //boum
#define COOLDOWN_TIME 12000 // Twenty minutes
#define MIN_ROUND_TIME 18000
#define FLAT_PERCENT 0
//estimated stats
//80 minute round
//60 player server
//48k player-ticks
//60 deaths (ideally)
//20 explosions
var/global/datum/tension/tension_master
/datum/tension
var/score
var/deaths
var/human_deaths
var/explosions
var/adminhelps
var/air_alarms
var/nuketeam = 0
var/malfAI = 0
var/wizard = 0
var/forcenexttick = 0
var/supress = 0
var/eversupressed = 0
var/cooldown = 0
var/round1 = 0
var/round2 = 0
var/round3 = 0
var/round4 = 0
var/list/antagonistmodes = null
var/list/potentialgames = list()
New()
score = 0
deaths=0
human_deaths=0
explosions=0
adminhelps=0
air_alarms=0
if(FLAT_PERCENT) // I cannot into balance
antagonistmodes = list (
"POINTS_FOR_TRATIOR" = 6,
"POINTS_FOR_CHANGLING" = 6,
"POINTS_FOR_REVS" = 3,
"POINTS_FOR_MALF" = 1,
"POINTS_FOR_WIZARD" = 2,
"POINTS_FOR_CULT" = 3,
"POINTS_FOR_NUKETEAM" = 2,
"POINTS_FOR_ALIEN" = 5,
"POINTS_FOR_NINJA" = 3,
"POINTS_FOR_DEATHSQUAD" = 2,
"POINTS_FOR_BORGDEATHSQUAD" = 2
)
else
antagonistmodes = list (
"POINTS_FOR_TRATIOR" = 100000,
"POINTS_FOR_CHANGLING" = 120000,
"POINTS_FOR_REVS" = 150000,
"POINTS_FOR_MALF" = 250000,
"POINTS_FOR_WIZARD" = 150000,
"POINTS_FOR_CULT" = 150000,
"POINTS_FOR_NUKETEAM" = 250000,
"POINTS_FOR_ALIEN" = 200000,
"POINTS_FOR_NINJA" = 200000,
"POINTS_FOR_DEATHSQUAD" = 500000,
"POINTS_FOR_BORGDEATHSQUAD" = 500000
)
proc/process()
score += get_num_players()*PLAYER_WEIGHT
if(config.Tensioner_Active)
if(world.time > MIN_ROUND_TIME)
round1++
if(!supress && !cooldown)
if(prob(1) || forcenexttick)
round2++
if(prob(10) || forcenexttick)
round3++
if(forcenexttick)
forcenexttick = 0
for (var/client/C in admin_list)
C << "<font color='red' size='3'><b> The tensioner wishes to create additional antagonists! Press (<a href='?src=\ref[tension_master];Supress=1'>this</a>) in 60 seconds to abort!</b></font>"
spawn(600)
if(!supress)
cooldown = 1
spawn(COOLDOWN_TIME)
cooldown = 0
round4++
if(!antagonistmodes.len)
return
var/thegame = null
if(FLAT_PERCENT)
thegame = pickweight(antagonistmodes)
antagonistmodes.Remove(thegame)
else
for(var/V in antagonistmodes) // OH SHIT SOMETHING IS GOING TO HAPPEN NOW
if(antagonistmodes[V] < score)
potentialgames.Add(V)
antagonistmodes.Remove(V)
if(potentialgames.len)
thegame = pick(potentialgames)
if(thegame)
log_admin("The tensioner fired, and decided on [thegame]")
switch(thegame)
if("POINTS_FOR_TRATIOR")
if(!makeTratiors())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_CHANGLING")
if(!makeChanglings())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_REVS")
if(!makeRevs())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_MALF")
if(!makeMalfAImode())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_WIZARD")
if(!makeWizard())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_CULT")
if(!makeCult())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_NUKETEAM")
if(!makeNukeTeam())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_ALIEN")
if(!makeAliens())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_NINJA")
if(!makeSpaceNinja())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_DEATHSQUAD")
if(!makeDeathsquad())
forcenexttick = 1
else
potentialgames.Remove(thegame)
if("POINTS_FOR_BORG_DEATHSQUAD")
if(!makeBorgDeathsquad())
forcenexttick = 1
else
potentialgames.Remove(thegame)
proc/get_num_players()
var/peeps = 0
for (var/mob/M in player_list)
if (!M.client)
continue
peeps += 1
return peeps
proc/death(var/mob/M)
if (!M) return
deaths++
if (istype(M,/mob/living/carbon/human))
score += HUMAN_DEATH
human_deaths++
else
score += OTHER_DEATH
proc/explosion()
score += EXPLO_SCORE
explosions++
proc/new_adminhelp()
adminhelps++
proc/new_air_alarm()
air_alarms++
Topic(href, href_list)
if(!usr || !usr.client)
return //This shouldnt happen
if(!usr.client.holder)
message_admins("\red [key_name(usr)] tried to use the tensioner without authorization.")
log_admin("[key_name(usr)] tried to use the tensioner without authorization.")
return
log_admin("[key_name(usr)] used a tensioner override. The override was [href]")
message_admins("[key_name(usr)] used a tensioner override. The override was [href]")
if(href_list["addScore"])
score += 50000
if (href_list["makeTratior"])
makeTratiors()
else if (href_list["makeChanglings"])
makeChanglings()
else if (href_list["makeRevs"])
makeRevs()
else if (href_list["makeWizard"])
makeWizard()
else if (href_list["makeCult"])
makeCult()
else if (href_list["makeMalf"])
makeMalfAImode()
else if (href_list["makeNukeTeam"])
makeNukeTeam()
else if (href_list["makeAliens"])
makeAliens()
else if (href_list["makeSpaceNinja"])
makeSpaceNinja()
else if (href_list["makeDeathsquad"])
makeDeathsquad()
else if (href_list["makeBorgDeathsquad"])
makeBorgDeathsquad()
else if (href_list["Supress"])
supress = 1
eversupressed++
spawn(6000)
supress = 0
else if (href_list["ToggleStatus"])
config.Tensioner_Active = !config.Tensioner_Active
proc/makeMalfAImode()
var/list/mob/living/silicon/AIs = list()
var/mob/living/silicon/malfAI = null
var/datum/mind/themind = null
for(var/mob/living/silicon/ai/ai in player_list)
if(ai.client)
AIs += ai
if(AIs.len)
malfAI = pick(AIs)
else
return 0
if(malfAI)
themind = malfAI.mind
themind.make_AI_Malf()
return 1
/*
if(BE_CHANGELING) roletext="changeling"
if(BE_TRAITOR) roletext="traitor"
if(BE_OPERATIVE) roletext="operative"
if(BE_WIZARD) roletext="wizard"
if(BE_REV) roletext="revolutionary"
if(BE_CULTIST) roletext="cultist"
for(var/mob/new_player/player in world)
if(player.client && player.ready)
if(player.preferences.be_special & role)
*/
proc/makeTratiors()
var/datum/game_mode/traitor/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
var/datum/preferences/preferences = new
if(applicant.stat < 2)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(applicant.client)
if(preferences.savefile_load(applicant, 0))
if(preferences.be_special & BE_TRAITOR)
candidates += applicant
if(candidates.len)
var/numTratiors = min(candidates.len, 3)
for(var/i = 0, i<numTratiors, i++)
H = pick(candidates)
H.mind.make_Tratior()
candidates.Remove(H)
return 1
else
return 0
proc/makeChanglings()
var/datum/game_mode/changeling/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
var/datum/preferences/preferences = new
if(applicant.stat < 2)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(applicant.client)
if(preferences.savefile_load(applicant, 0))
if(preferences.be_special & BE_CHANGELING)
candidates += applicant
if(candidates.len)
var/numChanglings = min(candidates.len, 3)
for(var/i = 0, i<numChanglings, i++)
H = pick(candidates)
H.mind.make_Changling()
candidates.Remove(H)
return 1
else
return 0
proc/makeRevs()
var/datum/game_mode/revolution/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
var/datum/preferences/preferences = new
if(applicant.stat < 2)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "revolutionary") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(applicant.client)
if(preferences.savefile_load(applicant, 0))
if(preferences.be_special & BE_REV)
candidates += applicant
if(candidates.len)
var/numRevs = min(candidates.len, 3)
for(var/i = 0, i<numRevs, i++)
H = pick(candidates)
H.mind.make_Rev()
candidates.Remove(H)
return 1
else
return 0
proc/makeWizard()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
for(var/mob/dead/observer/G in player_list)
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
spawn(0)
switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.client)
candidates.Remove(G)
spawn(0)
if(candidates.len)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
return 0
var/mob/living/carbon/human/new_character=makeBody(theghost)
new_character.mind.make_Wizard()
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
proc/makeCult()
var/datum/game_mode/cult/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
var/datum/preferences/preferences = new
if(applicant.stat < 2)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "cultist") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(applicant.client)
if(preferences.savefile_load(applicant, 0))
if(preferences.be_special & BE_CULTIST)
candidates += applicant
if(candidates.len)
var/numCultists = min(candidates.len, 4)
// var/list/runeWords = list()
for(var/i = 0, i<numCultists, i++)
H = pick(candidates)
H.mind.make_Cultist()
candidates.Remove(H)
temp.grant_runeword(H)
// runeWords.Add(H)
// for(var/i = 0, i < 4, i++) // Four rune words
return 1
else
return 0
proc/makeNukeTeam()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
for(var/mob/dead/observer/G in player_list)
if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate"))
spawn(0)
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.client)
candidates.Remove(G)
spawn(0)
if(candidates.len)
var/numagents = 5
syndicate_begin()
for(var/i = 0, i<numagents,i++)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
break
var/mob/living/carbon/human/new_character=makeBody(theghost)
new_character.mind.make_Nuke()
var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet")
var/nuke_code = "[rand(10000, 99999)]"
if(nuke_spawn)
var/obj/item/weapon/paper/P = new
P.info = "Sadly, the Syndicate could not get you a nuclear bomb. We have, however, acquired the arming code for the station's onboard nuke. The nuclear authorization code is: <b>[nuke_code]</b>"
P.name = "nuclear bomb code and instructions"
P.loc = nuke_spawn.loc
if(closet_spawn)
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
if (A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
del(A)
continue
if (A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
del(A)
continue
spawn(0)
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
if(synd_mind.current)
if(synd_mind.current.client)
for(var/image/I in synd_mind.current.client.images)
if(I.icon_state == "synd")
del(I)
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
if(synd_mind.current)
if(synd_mind.current.client)
for(var/datum/mind/synd_mind_1 in ticker.mode.syndicates)
if(synd_mind_1.current)
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
synd_mind.current.client.images += I
for (var/obj/machinery/nuclearbomb/bomb in world)
bomb.r_code = nuke_code // All the nukes are set to this code.
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
proc/makeAliens()
alien_infestation(3)
return 1
proc/makeSpaceNinja()
space_ninja_arrival()
return 1
proc/makeDeathsquad()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
var/input = "Purify the station."
if(prob(10))
input = "Save Runtime and any other cute things on the station."
/*
if (emergency_shuttle.direction == 1 && emergency_shuttle.online == 1)
emergency_shuttle.recall()
world << "\blue <B>Alert: The shuttle is going back!</B>"
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
*/
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for an elite syndicate strike team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.key)
candidates.Remove(G)
if(candidates.len)
var/numagents = 6
//Spawns commandos and equips them.
for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
if(numagents<=0)
break
if (L.name == "Syndicate-Commando")
syndicate_leader_selected = numagents == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
del(new_syndicate_commando)
break
new_syndicate_commando.key = theghost.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
new_syndicate_commando.internals.icon_state = "internal1"
//So they don't forget their code or mission.
new_syndicate_commando << "\blue You are an Elite Syndicate. [!syndicate_leader_selected?"commando":"<B>LEADER</B>"] in the service of the Syndicate. \nYour current mission is: \red<B> [input]</B>"
numagents--
//Spawns the rest of the commando gear.
// for (var/obj/effect/landmark/L)
// if (L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
// var/obj/item/weapon/paper/P = new(L.loc)
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
// P.name = "Spec. Ops. Manual"
for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
if (L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
// del(L)
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
proc/makeBorgDeathsquad()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
var/list/namelist = list("Tyr","Fenrir","Lachesis","Clotho","Atropos","Nyx")
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for a cyborg strike team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.client || !G.key)
candidates.Remove(G)
if(candidates.len)
var/numagents = 3
//Spawns commandos and equips them.
for (var/obj/effect/landmark/L in /area/borg_deathsquad)
if(numagents<=0)
break
if (L.name == "Borg-Deathsquad")
var/name = pick(namelist)
namelist.Remove(name)
var/mob/living/silicon/robot/new_borg_deathsquad = create_borg_death_commando(L, name)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
del(new_borg_deathsquad)
break
new_borg_deathsquad.key = theghost.key
//So they don't forget their code or mission.
new_borg_deathsquad << "You are a borg deathsquad operative. Follow your laws."
numagents--
//Spawns the rest of the commando gear.
// for (var/obj/effect/landmark/L)
// if (L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
// var/obj/item/weapon/paper/P = new(L.loc)
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
// P.name = "Spec. Ops. Manual"
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
if(!G_found || !G_found.key) return
//First we spawn a dude.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
new_character.gender = pick(MALE,FEMALE)
var/datum/preferences/A = new()
A.randomize_appearance_for(new_character)
if(new_character.gender == MALE)
new_character.real_name = "[pick(first_names_male)] [pick(last_names)]"
else
new_character.real_name = "[pick(first_names_female)] [pick(last_names)]"
new_character.name = new_character.real_name
new_character.age = rand(17,45)
new_character.dna.ready_dna(new_character)
new_character.key = G_found.key
return new_character
/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
var/mob/living/carbon/human/new_syndicate_commando = new(spawn_location.loc)
var/syndicate_commando_leader_rank = pick("Lieutenant", "Captain", "Major")
var/syndicate_commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/syndicate_commando_name = pick(last_names)
new_syndicate_commando.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_syndicate_commando)
new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]"
new_syndicate_commando.name = new_syndicate_commando.real_name
new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45)
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
//Creates mind stuff.
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
new_syndicate_commando.mind.special_role = "Syndicate Commando"
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_syndicate_commando.mind
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
return new_syndicate_commando
/proc/create_borg_death_commando(obj/spawn_location, name)
var/mob/living/silicon/robot/new_borg_deathsquad = new(spawn_location.loc, 1)
new_borg_deathsquad.real_name = name
new_borg_deathsquad.name = name
//Creates mind stuff.
new_borg_deathsquad.mind_initialize()
new_borg_deathsquad.mind.assigned_role = "MODE"
new_borg_deathsquad.mind.special_role = "Borg Commando"
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_borg_deathsquad.mind
//del(spawn_location) // Commenting this out for multiple commando teams.
return new_borg_deathsquad
/obj/machinery/computer/Borg_station
name = "Cyborg Station Terminal"
icon = 'icons/obj/computer.dmi'
icon_state = "syndishuttle"
req_access = list()
var/temp = null
var/hacked = 0
var/jumpcomplete = 0
/obj/machinery/computer/Borg_station/attack_hand()
if(jumpcomplete)
return
if(alert(usr, "Are you sure you want to send a cyborg deathsquad?", "Confirmation", "Yes", "No") == "Yes")
var/area/start_location = locate(/area/borg_deathsquad/start)
var/area/end_location = locate(/area/borg_deathsquad/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
for(var/obj/machinery/door/poddoor/P in end_location)
P.open()
jumpcomplete = 1
command_alert("DRADIS contact! Set condition one throughout the station!")

67
code/controllers/verbs.dm Normal file
View File

@@ -0,0 +1,67 @@
//TODO: rewrite and standardise all controller datums to the datum/controller type
//TODO: allow all controllers to be deleted for clean restarts (see WIP master controller stuff)
/client/proc/restart_controller(controller in list("Master","Lighting","Supply Shuttle"))
set category = "Debug"
set name = "Restart Controller"
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
if(!holder) return
usr = null
src = null
switch(controller)
if("Master")
master_controller.process()
feedback_add_details("admin_verb","RMC")
if("Lighting")
lighting_controller.process()
feedback_add_details("admin_verb","RLighting")
if("Supply Shuttle")
supply_shuttle.process()
feedback_add_details("admin_verb","RSupply")
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.", 1)
return
/client/proc/debug_controller(controller in list("Master","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
if(!holder) return
switch(controller)
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
if("Ticker")
debug_variables(ticker)
feedback_add_details("admin_verb","DTicker")
if("Lighting")
debug_variables(lighting_controller)
feedback_add_details("admin_verb","DLighting")
if("Air")
debug_variables(air_master)
feedback_add_details("admin_verb","DAir")
if("Jobs")
debug_variables(job_master)
feedback_add_details("admin_verb","DJobs")
if("Sun")
debug_variables(sun)
feedback_add_details("admin_verb","DSun")
if("Radio")
debug_variables(radio_controller)
feedback_add_details("admin_verb","DRadio")
if("Supply Shuttle")
debug_variables(supply_shuttle)
feedback_add_details("admin_verb","DSupply")
if("Emergency Shuttle")
debug_variables(emergency_shuttle)
feedback_add_details("admin_verb","DEmergency")
if("Configuration")
debug_variables(config)
feedback_add_details("admin_verb","DConf")
if("pAI")
debug_variables(paiController)
feedback_add_details("admin_verb","DpAI")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.", 1)
return