Conflicts:
	.travis.yml
	code/controllers/configuration.dm
	code/game/gamemodes/changeling/modularchangling.dm
	code/game/jobs/job/medical.dm
	code/game/jobs/job/security.dm
	code/game/machinery/Sleeper.dm
	code/game/machinery/computer/communications.dm
	code/game/machinery/cryopod.dm
	code/game/objects/items/weapons/RCD.dm
	code/game/objects/items/weapons/storage/boxes.dm
	code/game/turfs/simulated/floor.dm
	code/game/turfs/simulated/floor_types.dm
	code/global.dm
	code/modules/materials/materials.dm
	code/modules/mob/living/silicon/ai/ai.dm
	code/modules/projectiles/guns/projectile/automatic.dm
	polaris.dme
This commit is contained in:
Neerti
2015-08-23 01:30:46 -04:00
792 changed files with 19715 additions and 17049 deletions

View File

@@ -0,0 +1,47 @@
/obj/proc/analyze_gases(var/obj/A, var/mob/user)
if(src != A)
user.visible_message("<span class='notice'>\The [user] has used \an [src] on \the [A]</span>")
A.add_fingerprint(user)
var/list/result = A.atmosanalyze(user)
if(result && result.len)
user << "<span class='notice'>Results of the analysis[src == A ? "" : " of \the [A]"]</span>"
for(var/line in result)
user << "<span class='notice'>[line]</span>"
return 1
user << "<span class='warning'>Your [src] flashes a red light as it fails to analyze \the [A].</span>"
return 0
/proc/atmosanalyzer_scan(var/obj/target, var/datum/gas_mixture/mixture, var/mob/user)
var/pressure = mixture.return_pressure()
var/total_moles = mixture.total_moles
var/list/results = list()
if (total_moles>0)
results += "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>"
for(var/mix in mixture.gas)
results += "<span class='notice'>[gas_data.name[mix]]: [round((mixture.gas[mix] / total_moles) * 100)]%</span>"
results += "<span class='notice'>Temperature: [round(mixture.temperature-T0C)]&deg;C</span>"
else
results += "<span class='notice'>\The [target] is empty!</span>"
return results
/obj/proc/atmosanalyze(var/mob/user)
return
/obj/item/weapon/tank/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.air_contents, user)
/obj/machinery/portable_atmospherics/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.air_contents, user)
/obj/machinery/atmospherics/pipe/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.parent.air, user)
/obj/machinery/power/rad_collector/atmosanalyze(var/mob/user)
if(P) return atmosanalyzer_scan(src, src.P.air_contents, user)
/obj/item/weapon/flamethrower/atmosanalyze(var/mob/user)
if(ptank) return atmosanalyzer_scan(src, ptank.air_contents, user)

View File

@@ -130,9 +130,9 @@ var/global/list/endgame_safespawns = list()
S.race_key = rkey //Used in mob icon caching.
all_species[S.name] = S
if(!(S.flags & IS_RESTRICTED))
if(!(S.spawn_flags & IS_RESTRICTED))
playable_species += S.name
if(S.flags & IS_WHITELISTED)
if(S.spawn_flags & IS_WHITELISTED)
whitelisted_species += S.name
//Posters

View File

@@ -635,7 +635,7 @@ The _flatIcons list is a cache for generated icon files.
*/
proc // Creates a single icon from a given /atom or /image. Only the first argument is required.
getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT)
getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT, always_use_defdir = 0)
// We start with a blank canvas, otherwise some icon procs crash silently
var/icon/flat = icon('icons/effects/effects.dmi', "icon_state"="nothing") // Final flattened icon
if(!A)
@@ -666,7 +666,7 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu
noIcon = TRUE // Do not render this object.
var/curdir
if(A.dir != 2)
if(A.dir != 2 && !always_use_defdir)
curdir = A.dir
else
curdir = defdir

View File

@@ -599,7 +599,7 @@ proc/dd_sortedTextList(list/incoming)
return dd_sortedtextlist(incoming, case_sensitive)
datum/proc/dd_SortValue()
/datum/proc/dd_SortValue()
return "[src]"
/obj/machinery/dd_SortValue()
@@ -611,10 +611,13 @@ datum/proc/dd_SortValue()
/datum/alarm/dd_SortValue()
return "[sanitize_old(last_name)]"
/proc/subtypes(prototype)
return (typesof(prototype) - prototype)
//creates every subtype of prototype (excluding prototype) and adds it to list L.
//if no list/L is provided, one is created.
/proc/init_subtypes(prototype, list/L)
if(!istype(L)) L = list()
for(var/path in (typesof(prototype) - prototype))
for(var/path in subtypes(prototype))
L += new path()
return L

View File

@@ -109,6 +109,12 @@
M = whom
C = M.client
key = M.key
else if(istype(whom, /datum/mind))
var/datum/mind/D = whom
key = D.key
M = D.current
if(D.current)
C = D.current.client
else if(istype(whom, /datum))
var/datum/D = whom
return "*invalid:[D.type]*"

View File

@@ -20,7 +20,7 @@ var/command_name = null
if (command_name)
return command_name
var/name = "Central Command"
var/name = "[boss_name]"
command_name = name
return name

View File

@@ -55,7 +55,7 @@
//If you have a problem with sanitize() in chat, when quotes and >, < are displayed as html entites -
//this is a problem of double-encode(when & becomes &amp;), use sanitize() with encode=0, but not the sanitizeSafe()!
/proc/sanitizeSafe(var/input, var/max_length = MAX_MESSAGE_LEN, var/encode = 1, var/trim = 1, var/extra = 1)
return sanitize(replace_characters(input, list(">"=" ","<"=" ", "\""="'"), max_length, encode, trim, extra))
return sanitize(replace_characters(input, list(">"=" ","<"=" ", "\""="'")), max_length, encode, trim, extra)
//Filters out undesirable characters from names
/proc/sanitizeName(var/input, var/max_length = MAX_NAME_LEN, var/allow_numbers = 0)
@@ -116,7 +116,7 @@
if(last_char_group == 1)
output = copytext(output,1,length(output)) //removes the last character (in this case a space)
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai","plating")) //prevents these common metagamey names
if(cmptext(output,bad_name)) return //(not case sensitive)
return output

View File

@@ -6,13 +6,13 @@
var/roundstart_hour = 0
//Returns the world time in english
proc/worldtime2text(time = world.time)
proc/worldtime2text(time = world.time, timeshift = 1)
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
return "[(round(time / 36000)+roundstart_hour) % 24]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"
return timeshift ? time2text(time+(36000*roundstart_hour), "hh:mm") : time2text(time, "hh:mm")
proc/worlddate2text()
return num2text((text2num(time2text(world.timeofday, "YYYY"))+544)) + "-" + time2text(world.timeofday, "MM-DD")
proc/time_stamp()
return time2text(world.timeofday, "hh:mm:ss")
@@ -27,3 +27,18 @@ proc/isDay(var/month, var/day)
// Uncomment this out when debugging!
//else
//return 1
var/next_duration_update = 0
var/last_round_duration = 0
proc/round_duration()
if(last_round_duration && world.time < next_duration_update)
return last_round_duration
var/mills = world.time // 1/10 of a second, not real milliseconds but whatever
//var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something
var/mins = (mills % 36000) / 600
var/hours = mills / 36000
last_round_duration = "[round(hours)]h [round(mins)]m"
next_duration_update = world.time + 1 MINUTES
return last_round_duration

View File

@@ -38,7 +38,7 @@
// Returns the hex value of a number given a value assumed to be a base-ten value
/proc/num2hex(num, padlength)
var/global/list/hexdigits = list("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
. = ""
while(num > 0)
var/hexdigit = hexdigits[(num & 0xF) + 1]
@@ -46,7 +46,7 @@
num >>= 4 //go to the next half-byte
//pad with zeroes
var/left = padlength - length(.)
var/left = padlength - length(.)
while (left-- > 0)
. = "0[.]"
@@ -275,13 +275,6 @@ proc/tg_list2text(list/list, glue=",")
if (rights & R_MENTOR) . += "[seperator]+MENTOR"
return .
/proc/ui_style2icon(ui_style)
switch (ui_style)
if ("old") return 'icons/mob/screen1_old.dmi'
if ("Orange") return 'icons/mob/screen1_Orange.dmi'
if ("Midnight") return 'icons/mob/screen1_Midnight.dmi'
else return 'icons/mob/screen1_White.dmi'
// heat2color functions. Adapted from: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
/proc/heat2color(temp)
return rgb(heat2color_r(temp), heat2color_g(temp), heat2color_b(temp))

View File

@@ -4,6 +4,9 @@
* A large number of misc global procs.
*/
//Checks if all high bits in req_mask are set in bitfield
#define BIT_TEST_ALL(bitfield, req_mask) ((~(bitfield) & (req_mask)) == 0)
//Inverts the colour of an HTML string
/proc/invertHTML(HTMLstring)
@@ -562,10 +565,13 @@ proc/GaussRandRound(var/sigma,var/roundto)
return toReturn
//Step-towards method of determining whether one atom can see another. Similar to viewers()
/proc/can_see(var/atom/source, var/atom/target, var/length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate.
/proc/can_see(var/atom/source, var/atom/target, var/length=5) // I couldn't be arsed to do actual raycasting :I This is horribly inaccurate.
var/turf/current = get_turf(source)
var/turf/target_turf = get_turf(target)
var/steps = 0
if(!current || !target_turf)
return 0
while(current != target_turf)
if(steps > length) return 0
@@ -774,11 +780,15 @@ proc/GaussRandRound(var/sigma,var/roundto)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
var/old_overlays = T.overlays.Copy()
var/old_underlays = T.underlays.Copy()
var/turf/X = B.ChangeTurf(T.type)
X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
X.overlays = old_overlays
X.underlays = old_underlays
var/turf/simulated/ST = T
if(istype(ST) && ST.zone)
@@ -824,7 +834,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
if(!istype(O,/obj)) continue
O.loc = X
for(var/mob/M in T)
if(!istype(M,/mob) || istype(M, /mob/aiEye)) continue // If we need to check for more mobs, I'll add a variable
if(!istype(M,/mob) || istype(M, /mob/eye)) continue // If we need to check for more mobs, I'll add a variable
M.loc = X
// var/area/AR = X.loc
@@ -921,6 +931,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
var/old_overlays = T.overlays.Copy()
var/old_underlays = T.underlays.Copy()
if(platingRequired)
if(istype(B, get_base_turf(B.z)))
@@ -931,7 +943,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
X.overlays = old_overlays
X.underlays = old_underlays
var/list/objs = new/list()
var/list/newobjs = new/list()
@@ -955,7 +968,7 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
for(var/mob/M in T)
if(!istype(M,/mob) || istype(M, /mob/aiEye)) continue // If we need to check for more mobs, I'll add a variable
if(!istype(M,/mob) || istype(M, /mob/eye)) continue // If we need to check for more mobs, I'll add a variable
mobs += M
for(var/mob/M in mobs)