Remove spaces from module files

This commit is contained in:
Markolie
2015-09-27 07:32:07 +02:00
parent 4bf3bb9c31
commit 0b030a63bd
25 changed files with 385 additions and 1165 deletions
View File
-63
View File
@@ -1,63 +0,0 @@
// Management of available genes.
/datum/genetree
var/list/sectors=list()
var/list/dependencies=list()
var/list/dependants=list()
var/obj/machinery/networked/biomass_controller/biomass = null
/datum/genetree/New(var/obj/machinery/networked/biomass_controller/holder)
biomass = holder
// Build list of all sectors
for(var/typepath in subtypesof(/datum/genetic_sector))
var/datum/genetic_sector/sector = new typepath
sectors[sector.id]=sector
if(sector.prerequisites.len > 0)
sector.locked=1
// Make list of things that depend on this sector.
dependencies[sector.id]=sector.prerequisites
// Generate reverse dependencies
for(var/dependee in sector.prerequisites)
if(!(dependee in dependants))
dependants[dependee]=list(sector.id)
else
var/list/D = dependants[dependee]
D.Add(sector.name)
/datum/genetree/proc/IsActive(var/sname)
var/datum/genetic_sector/sector = sectors[sname]
return sector.active
/datum/genetree/proc/CanActivateSector(var/sname)
var/datum/genetic_sector/sector = sectors[sname]
for(var/dep in sector.prerequisites)
if(!IsActive(sector.id))
return 0
return biomass.available >= sector.required_biomass
// Does NOT check for biomass
/datum/genetree/proc/ActivateSector(var/sname)
var/datum/genetic_sector/sector = sectors[sname]
sector.active = 1
sector.OnActivate()
for(var/subsect in dependants[sname])
var/datum/genetic_sector/subsector = sectors[subsect]
subsector.locked=0
/datum/genetree/proc/CheckSectors()
var/sectors_changed=0
for(var/sname in sectors)
var/datum/genetic_sector/sector = sectors[sname]
var/pstate=sector.active
sector.active=1
for(var/prereq in sector.prerequisites)
if(!IsActive(prereq))
sector.active=0
break
if(pstate != sector.active)
sectors_changed = 1
if(sectors_changed)
CheckSectors()
-110
View File
@@ -1,110 +0,0 @@
var/global/current_sector_id=0
/datum/genetic_sector
var/name = "UNKNOWN SECTOR"
var/desc = "LOLIDK"
var/id = ""
var/uniqid = "" // 3-char ID, shown when locked.
var/list/prerequisites = list()
var/list/blocks_txt = list()
var/list/blocks = list() // DO NOT FUCKING USE THIS
var/required_biomass = 0 // In hominids (/mob/living/carbon)
var/time_required = 300 // Decaseconds required to unlock
var/time_researched = 0
var/active=0 // Accessible
var/locked=0 // Cannot be purchased (yet)
/datum/genetic_sector/New()
uniqid = add_zero2("[current_sector_id++]",3)
// Set blocks
for(var/blockname in blocks_txt)
var/block = assigned_blocks[blockname]
if(block)
blocks += block
///////////////////////////////////////
// SECTORS
///////////////////////////////////////
/datum/genetic_sector/metabolism
id = "metabolism"
name = "Metabolism"
desc = "Grants access to areas of DNA that affect how the body controls its temperature."
required_biomass = 1
time_required = 30 SECONDS
blocks_txt=list(
"COLD",
"FIRE",
"IMMOLATE",
"SOBER",
"MELT",
"FAT"
)
/datum/genetic_sector/mind
id = "mind"
name = "Mental Aptitude"
desc = "Reveals parts of DNA that affect mental capabilities"
required_biomass = 2
time_required = 30 SECONDS
blocks_txt=list(
"PSYRESIST",
"HALLUCINATION",
"TWITCH",
"EPILEPSY",
)
/datum/genetic_sector/teleability
id = "teleability"
name = "Teleability"
desc = "Activates unused portions of the brain that can affect people a great distance away."
prerequisites = list("mind")
required_biomass = 4
time_required = 1 MINUTES
blocks_txt = list(
"REMOTEVIEW",
"REMOTETALK",
"CRYO",
"EMPATH"
)
/datum/genetic_sector/telekinesis
id = "telekinesis"
name = "Telekinesis"
desc = "Activates unused portions of the brain that can affect objects a great distance away."
prerequisites = list("teleability")
required_biomass = 5
time_required = 2 MINUTES
blocks_txt = list(
"TELE",
"FAKE"
)
/datum/genetic_sector/senses
id = "senses"
name = "Senses"
desc = "Accesses genes that affect vision and hearing."
prerequisites = list("mind")
required_biomass = 4
time_required = 30 SECONDS
blocks_txt = list(
"XRAY",
"BLIND",
"GLASSES",
"EMPATH",
"DEAF"
)
/datum/genetic_sector/respiration
id = "respiration"
name = "Respiration"
desc = "Mess around with genes that affect breathing and lungs."
prerequisites = list("metabolism")
time_required = 1 MINUTES
required_biomass = 4
blocks_txt = list(
"NOBREATH",
"COUGH",
"INCREASERUN",
)
-243
View File
@@ -1,243 +0,0 @@
/proc/bsi_cast_ray(icon/I, list/start, list/end)
if(abs(start[1] - end[1]) > abs(start[2] - end[2]))
var/dist = abs(start[1] - end[1]) * 2
for(var/i = 1, i <= dist, i++)
var/x = round((start[1] * i / dist) + (end[1] * (1 - i / dist)))
var/y = round((start[2] * i / dist) + (end[2] * (1 - i / dist)))
if(I.GetPixel(x, y) != null)
return list(x, y)
else
var/dist = abs(start[2] - end[2]) * 2
for(var/i = 1, i <= dist, i++)
var/x = round((start[1] * i / dist) + (end[1] * (1 - i / dist)))
var/y = round((start[2] * i / dist) + (end[2] * (1 - i / dist)))
if(I.GetPixel(x, y) != null)
return list(x, y)
return null
/proc/bsi_split_colors(color)
if(color == null)
return list(0, 0, 0, 0)
var/list/colors = list(0, 0, 0, 0)
colors[1] = hex2num(copytext(color, 2, 4))
colors[2] = hex2num(copytext(color, 4, 6))
colors[3] = hex2num(copytext(color, 6, 8))
colors[4] = (length(color) > 7)? hex2num(copytext(color, 8, 10)) : 255
return colors
/proc/bsi_spread(icon/I, list/start_point)
var/list/queue = list()
queue[++queue.len] = start_point
var/i = 0
while(i++ < length(queue))
var/x = queue[i][1]
var/y = queue[i][2]
var/list/pixel = bsi_split_colors(I.GetPixel(x, y))
if(pixel[4] == 0)
continue
var/list/n = (y < I.Height())? bsi_split_colors(I.GetPixel(x, y + 1)) : list(0, 0, 0, 0)
var/list/s = (y > 1)? bsi_split_colors(I.GetPixel(x, y - 1)) : list(0, 0, 0, 0)
var/list/e = (x < I.Width())? bsi_split_colors(I.GetPixel(x + 1, y)) : list(0, 0, 0, 0)
var/list/w = (x > 1)? bsi_split_colors(I.GetPixel(x - 1, y)) : list(0, 0, 0, 0)
var/value = (i == 1)? 16 : max(n[1] - 1, e[1] - 1, s[1] - 1, w[1] - 1)
if(prob(50))
value = max(0, value - 1)
if(prob(50))
value = max(0, value - 1)
if(prob(50))
value = max(0, value - 1)
if(value <= pixel[1])
continue
var/v2 = 256 - ((16 - value) * (16 - value))
I.DrawBox(rgb(value, v2, pixel[4] - v2, pixel[4]), x, y)
if(n[4] != 0 && n[1] < value - 1)
queue[++queue.len] = list(x, y + 1)
if(s[4] != 0 && s[1] < value - 1)
queue[++queue.len] = list(x, y - 1)
if(e[4] != 0 && e[1] < value - 1)
queue[++queue.len] = list(x + 1, y)
if(w[4] != 0 && w[1] < value - 1)
queue[++queue.len] = list(x - 1, y)
/proc/bsi_generate_mask(icon/source, state)
var/icon/mask = icon(source, state)
mask.MapColors(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 1, 1,
0, 0, 0, 0)
var/hits = 0
for(var/i = 1, i <= 10, i++)
var/point1
var/point2
if(prob(50))
if(prob(50))
point1 = list(rand(1, mask.Width()), mask.Height())
point2 = list(rand(1, mask.Width()), 1)
else
point2 = list(rand(1, mask.Width()), mask.Height())
point1 = list(rand(1, mask.Width()), 1)
else
if(prob(50))
point1 = list(mask.Width(), rand(1, mask.Height()))
point2 = list(1, rand(1, mask.Height()))
else
point2 = list(mask.Width(), rand(1, mask.Height()))
point1 = list(1, rand(1, mask.Height()))
var/hit = bsi_cast_ray(mask, point1, point2)
if(hit == null)
continue
hits++
bsi_spread(mask, hit)
if(prob(20 + hits * 20))
break
if(hits == 0)
return null
else
return mask
/proc/generate_bluespace_icon(icon/source, state)
var/icon/mask = bsi_generate_mask(source, state)
if(mask == null)
return source
var/icon/unaffected = icon(mask)
unaffected.MapColors(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 1,
0, 0, 0, 0,
255, 255, 255, 0)
var/icon/temp = icon(source, state) //Mask already contains the original alpha values, avoid squaring them
temp.MapColors(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 0,
0, 0, 0, 255)
unaffected.Blend(temp, ICON_MULTIPLY)
var/icon/bluespaced = icon(mask)
bluespaced.MapColors(
0, 0, 0, 0,
0, 0, 0, 1,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 0)
bluespaced.Blend(icon(source, state), ICON_MULTIPLY)
var/list/frames = list(
list(0.000,20),
list(0.020, 5),
list(0.050, 4),
list(0.080, 5),
list(0.100,10),
list(0.080, 5),
list(0.050, 4),
list(0.020, 5),
list(0.000,20),
list(0.020, 5),
list(0.050, 4),
list(0.080, 5),
list(0.100,10),
list(0.080, 5),
list(0.050, 4),
list(0.020, 5),
list(0.000,20),
list(0.020, 5),
list(0.050, 4),
list(0.080, 5),
list(0.100,10),
list(0.080, 5),
list(0.050, 4),
list(0.020, 5),
)
var/list/colors = list(
list( 75, 75, 75, 0),
list( 25, 25, 25, 0),
list( 75, 75, 75, 0),
list( 25, 25, 75, 0),
list( 75, 75, 300, 0),
list( 25, 25, 300, 0),
list(255, 255, 255, 0),
list( 0, 0, 0, 255),
list( 0, 0, 0, 0),
list( 0, 0, 0, 0),
)
for(var/i = 1, i <= rand(1, 5), i++)
var/f = rand(1, length(frames))
if(frames[f][2] > 1)
frames[f][2]--
frames.Insert(f, 0)
frames[f] = list(0.8, 1)
var/icon/result = generate_color_animation(bluespaced, colors, frames)
result.Blend(unaffected, ICON_UNDERLAY)
return result
/atom/verb/test()
set src in view()
src.icon = generate_bluespace_icon(src.icon, src.icon_state)
/mob/verb/bluespam()
for(var/turf/t in view(5))
var/obj/s = new /obj/square(t)
s.icon = generate_bluespace_icon(s.icon, s.icon_state)
@@ -1,96 +0,0 @@
//----------------------------------------
//
// Return a copy of the provided icon,
// after calling MapColors on it. The
// color values are linearily interpolated
// between the pairs provided, based on
// the ratio argument.
//
//----------------------------------------
/proc/MapColors_interpolate(icon/input, ratio,
rr1, rg1, rb1, ra1, rr2, rg2, rb2, ra2,
gr1, gg1, gb1, ga1, gr2, gg2, gb2, ga2,
br1, bg1, bb1, ba1, br2, bg2, bb2, ba2,
ar1, ag1, ab1, aa1, ar2, ag2, ab2, aa2,
zr1, zg1, zb1, za1, zr2, zg2, zb2, za2)
var/r = ratio
var/i = 1 - ratio
var/icon/I = icon(input)
I.MapColors(
(rr1 * r + rr2 * i) / 255.0, (rg1 * r + rg2 * i) / 255.0, (rb1 * r + rb2 * i) / 255.0, (ra1 * r + ra2 * i) / 255.0,
(gr1 * r + gr2 * i) / 255.0, (gg1 * r + gg2 * i) / 255.0, (gb1 * r + gb2 * i) / 255.0, (ga1 * r + ga2 * i) / 255.0,
(br1 * r + br2 * i) / 255.0, (bg1 * r + bg2 * i) / 255.0, (bb1 * r + bb2 * i) / 255.0, (ba1 * r + ba2 * i) / 255.0,
(ar1 * r + ar2 * i) / 255.0, (ag1 * r + ag2 * i) / 255.0, (ab1 * r + ab2 * i) / 255.0, (aa1 * r + aa2 * i) / 255.0,
(zr1 * r + zr2 * i) / 255.0, (zg1 * r + zg2 * i) / 255.0, (zb1 * r + zb2 * i) / 255.0, (za1 * r + za2 * i) / 255.0)
return I
//----------------------------------------
//
// Extension of the above that takes a
// list of lists of color values, rather
// than a large number of arguments.
//
//----------------------------------------
/proc/MapColors_interpolate_list(icon/I, ratio, list/colors)
var/list/c[10]
//Provide default values for any missing colors (without altering the original list
for(var/i = 1, i <= 10, i++)
c[i] = list(0, 0, 0, (i == 7 || i == 8)? 255 : 0)
if(istype(colors[i], /list))
for(var/j = 1, j <= 4, j++)
if(j <= length(colors[i]) && isnum(colors[i][j]))
c[i][j] = colors[i][j]
return MapColors_interpolate(I, ratio,
colors[ 1][1], colors[ 1][2], colors[ 1][3], colors[ 1][4], // Red 1
colors[ 2][1], colors[ 2][2], colors[ 2][3], colors[ 2][4], // Red 2
colors[ 3][1], colors[ 3][2], colors[ 3][3], colors[ 3][4], // Green 1
colors[ 4][1], colors[ 4][2], colors[ 4][3], colors[ 4][4], // Green 2
colors[ 5][1], colors[ 5][2], colors[ 5][3], colors[ 5][4], // Blue 1
colors[ 6][1], colors[ 6][2], colors[ 6][3], colors[ 6][4], // Blue 2
colors[ 7][1], colors[ 7][2], colors[ 7][3], colors[ 7][4], // Alpha 1
colors[ 8][1], colors[ 8][2], colors[ 8][3], colors[ 8][4], // Alpha 2
colors[ 9][1], colors[ 9][2], colors[ 9][3], colors[ 9][4], // Added 1
colors[10][1], colors[10][2], colors[10][3], colors[10][4]) // Added 2
//----------------------------------------
//
// Take the source image, and return an animated
// version, that transitions between the provided
// color mappings, according to the provided
// pattern.
//
// Colors should be in a format suitable for
// MapColors_interpolate_list, and frames should
// be a list of 'frames', where each frame is itself
// a list, element 1 being the ratio of the first
// color to the second, and element 2 being how
// long the frame lasts, in tenths of a second.
//
//----------------------------------------
/proc/generate_color_animation(icon/icon, list/colors, list/frames)
var/icon/out = icon('icons/effects/uristrunes.dmi', "")
var/frame_num = 1
for(var/frame in frames)
var/icon/I = MapColors_interpolate_list(icon, frame[1], colors)
out.Insert(I, "", 2, frame_num++, 0, frame[2])
return out
-268
View File
@@ -1,268 +0,0 @@
//----------------------------------------
//
// Take a source icon, convert into a mask,
// then create a border around it.
//
// The output then uses the colors and
// alpha values provided.
//
//----------------------------------------
/proc/create_border_image(icon/input, border_color = "#000000", fill_color = "#000000", border_alpha = 255, fill_alpha = 255)
var/icon/I = icon('icons/effects/uristrunes.dmi', "blank")
I.Blend(input, ICON_OVERLAY)
//Discard the image
I.MapColors(0, 0, 0, 0, //-\ Ignore
0, 0, 0, 0, //--> The
0, 0, 0, 0, //-/ Colors
0,255, 0, 1, //Keep alpha channel, any pixel with non-zero alpha gets max green channel
0, 0, 0, 0)
//Loop over the image, calculating the border value, and storing it in the red channel
//Store border's alpha in the blue channel
for(var/x = 1, x <= 32, x++)
for(var/y = 1, y <= 32, y++)
var/p = I.GetPixel(x, y)
if(p == null)
var/n = I.GetPixel(x, y + 1)
var/s = I.GetPixel(x, y - 1)
var/e = I.GetPixel(x + 1, y)
var/w = I.GetPixel(x - 1, y)
var/ne = I.GetPixel(x + 1, y + 1)
var/se = I.GetPixel(x + 1, y - 1)
var/nw = I.GetPixel(x - 1, y + 1)
var/sw = I.GetPixel(x - 1, y - 1)
var/sum_adj = ((n == "#00ff00"? 1 : 0) \
+ (s == "#00ff00"? 1 : 0) \
+ (e == "#00ff00"? 1 : 0) \
+ (w == "#00ff00"? 1 : 0))
var/sum_diag = ((ne == "#00ff00"? 1 : 0) \
+ (se == "#00ff00"? 1 : 0) \
+ (nw == "#00ff00"? 1 : 0) \
+ (sw == "#00ff00"? 1 : 0))
if(sum_adj)
I.DrawBox(rgb(255, 0, 200, 0), x, y)
else if(sum_diag)
I.DrawBox(rgb(255, 0, 100, 0), x, y)
else
I.DrawBox(rgb(0, 0, 0, 0), x, y)
else if(p != "#00ff00")
var/a = 255
if(length(p) == 9) // "#rrggbbaa", we want the aa
a = hex2num(copytext(p, 8))
I.DrawBox(rgb(255 - a, a, 255 - a, a), x, y)
//Map the red and green channels to the desired output colors
I.MapColors(border_color, fill_color, rgb(0, 0, 0, border_alpha), rgb(0, 0, 0, fill_alpha), "#00000000")
return I
//----------------------------------------
//
// Take a source icon, convert into a mask,
// and border. Color them according to args,
// and animate.
//
//----------------------------------------
/proc/animate_rune_full(icon/input, rr1, rg1, rb1, ra1, rr2, rg2, rb2, ra2, br1, bg1, bb1, ba1, br2, bg2, bb2, ba2, ar1, ag1, ab1, aa1, ar2, ag2, ab2, aa2, or1, og1, ob1, oa1, or2, og2, ob2, oa2, frames)
var/list/colors[10]
colors[ 1] = list(rr1, rg1, rb1, ra1) //Rune color 1
colors[ 2] = list(rr2, rg2, rb2, ra2) //Rune color 2
colors[ 3] = list(br1, bg1, bb1, ba1) //Border color 1
colors[ 4] = list(br2, bg2, bb2, ba2) //Border color 2
colors[ 5] = list( 0, 0, 0, 0) //Unused
colors[ 6] = list( 0, 0, 0, 0) //Unused
colors[ 7] = list(ar1, ag1, ab1, aa1) //Alpha color 1
colors[ 8] = list(ar2, ag2, ab2, aa2) //Alpha color 2
colors[ 9] = list(or1, og1, ob1, oa1) //Added color 1
colors[10] = list(or2, og2, ob2, oa2) //Added color 2
var/icon/base = create_border_image(input, "#00ff0000", "#ff000000")
return generate_color_animation(base, colors, frames)
//----------------------------------------
//
// Calls the above, but accepts colors in
// the form of "#RRGGBBAA", and provides
// default values.
//
// Main limit is that it doesn't accept
// negative values, which you probably
// don't need anyway. Also missing a few
// color inputs, which would also be rarely
// used.
//
//----------------------------------------
/proc/animate_rune(icon/input, rune_color = "#00000000", border_color = "#c8000000", rune_color2 = "#00000000", border_color2 = "#d8380000", alpha = 255, alpha2 = 255, frames = rune_animation)
var/rr1 = hex2num(copytext(rune_color, 2, 4))
var/rg1 = hex2num(copytext(rune_color, 4, 6))
var/rb1 = hex2num(copytext(rune_color, 6, 8))
var/ra1 = hex2num(copytext(rune_color, 8, 10))
var/rr2 = hex2num(copytext(rune_color2, 2, 4))
var/rg2 = hex2num(copytext(rune_color2, 4, 6))
var/rb2 = hex2num(copytext(rune_color2, 6, 8))
var/ra2 = hex2num(copytext(rune_color2, 8, 10))
var/br1 = hex2num(copytext(border_color, 2, 4))
var/bg1 = hex2num(copytext(border_color, 4, 6))
var/bb1 = hex2num(copytext(border_color, 6, 8))
var/ba1 = hex2num(copytext(border_color, 8, 10))
var/br2 = hex2num(copytext(border_color2, 2, 4))
var/bg2 = hex2num(copytext(border_color2, 4, 6))
var/bb2 = hex2num(copytext(border_color2, 6, 8))
var/ba2 = hex2num(copytext(border_color2, 8, 10))
return animate_rune_full(input, rr1, rg1, rb1, ra1, rr2, rg2, rb2, ra2, br1, bg1, bb1, ba1, br2, bg2, bb2, ba2, 0, 0, 0, alpha, 0, 0, 0, alpha2, 0, 0, 0, 0, 0, 0, 0, 0, frames)
/proc/inanimate_rune(icon/input, rune_color = "#00000000", border_color = "#c8000000")
var/icon/base = create_border_image(input, "#00ff0000", "#ff000000")
base.MapColors(rune_color, border_color, "#00000000", "#000000ff", "#00000000")
return base
var/list/rune_animation = list(
list(0.000, 5),
list(0.020, 1),
list(0.050, 1),
list(0.090, 1),
list(0.140, 1),
list(0.200, 1),
list(0.270, 1),
list(0.340, 1),
list(0.420, 1),
list(0.500, 1),
list(0.590, 1),
list(0.675, 1),
list(0.750, 1),
list(0.900, 1),
list(1.000, 6),
list(0.875, 1),
list(0.750, 1),
list(0.625, 1),
list(0.500, 1),
list(0.375, 1),
list(0.250, 1),
list(0.125, 1),
)
/var/list/rune_cache = list()
/proc/get_rune(rune_bits, animated = 0)
var/lookup = "[rune_bits]-[animated]"
if(lookup in rune_cache)
return rune_cache[lookup]
var/icon/base = icon('icons/effects/uristrunes.dmi', "")
for(var/i = 0, i < 10, i++)
if(rune_bits & (1 << i))
base.Blend(icon('icons/effects/uristrunes.dmi', "rune-[1 << i]"), ICON_OVERLAY)
var/icon/result
if(animated == 1)
result = animate_rune(base)
else
result = inanimate_rune(base)
rune_cache[lookup] = result
return result
// Testing procs and Fun procs
/mob/verb/create_rune()
var/obj/o = new(locate(x, y, z))
o.icon = get_rune(rand(1, 1023), 1)
/mob/verb/runes_15x15()
for(var/turf/t in range(7))
var/obj/o = new /obj(t)
o.icon = get_rune(rand(1, 1023), 1)
/*
/mob/verb/create_rune_custom(rune as num, color1 as color, border1 as color, color2 as color, border2 as color, alpha1 as num, alpha2 as num)
var/icon/I = icon('icons/effects/uristrunes.dmi', "blank")
for(var/i = 0, i < 10, i++)
if(rune & (1 << i))
I.Blend(icon('icons/effects/uristrunes.dmi', "rune-[1 << i]"), ICON_OVERLAY)
var/obj/o = new(locate(x, y, z))
o.icon = animate_rune(I, color1, border1, color2, border2, alpha1, alpha2)
/mob/verb/spam()
for(var/turf/t in range(4))
var/icon/I = icon('icons/effects/uristrunes.dmi', "blank")
var/rune = rand(1, 1023)
for(var/i = 0, i < 10, i++)
if(rune & (1 << i))
I.Blend(icon('icons/effects/uristrunes.dmi', "rune-[1 << i]"), ICON_OVERLAY)
var/obj/o = new(t)
o.icon = animate_rune_full(I, rand(0, 255), rand(0, 255), rand(0, 255), rand(-255, 255),
rand(0, 255), rand(0, 255), rand(0, 255), rand(-255, 255),
rand(0, 255), rand(0, 255), rand(0, 255), rand(-255, 255),
rand(0, 255), rand(0, 255), rand(0, 255), rand(-255, 255),
0, 0, 0, rand(0, 255),
0, 0, 0, rand(0, 255),
0, 0, 0, 0,
0, 0, 0, 0,
list(
list(0.000, 5),
list(0.020, 1),
list(0.050, 1),
list(0.090, 1),
list(0.140, 1),
list(0.200, 1),
list(0.270, 1),
list(0.340, 1),
list(0.420, 1),
list(0.500, 1),
list(0.590, 1),
list(0.675, 1),
list(0.750, 1),
list(0.900, 1),
list(1.000, 6),
list(0.875, 1),
list(0.750, 1),
list(0.625, 1),
list(0.500, 1),
list(0.375, 1),
list(0.250, 1),
list(0.125, 1),
))
*/
@@ -1,186 +1,186 @@
/obj/machinery/keycard_auth
name = "Keycard Authentication Device"
desc = "This device is used to trigger station functions, which require more than one ID card to authenticate."
icon = 'icons/obj/monitors.dmi'
icon_state = "auth_off"
var/active = 0 //This gets set to 1 on all devices except the one where the initial request was made.
var/event = ""
var/screen = 1
var/list/ert_chosen = list()
var/confirmed = 0 //This variable is set by the device that confirms the request.
var/confirm_delay = 20 //(2 seconds)
var/busy = 0 //Busy when waiting for authentication or an event request has been sent from this device.
var/obj/machinery/keycard_auth/event_source
var/mob/event_triggered_by
var/mob/event_confirmed_by
var/ert_reason = "Reason for ERT"
//1 = select event
//2 = authenticate
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 6
power_channel = ENVIRON
/obj/machinery/keycard_auth/attack_ai(mob/user as mob)
user << "The station AI is not to interact with these devices."
return
/obj/machinery/keycard_auth/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(stat & (NOPOWER|BROKEN))
user << "This device is not powered."
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/ID = W
if(access_keycard_auth in ID.access)
if(active == 1)
//This is not the device that made the initial request. It is the device confirming the request.
if(event_source)
event_source.confirmed = 1
event_source.event_confirmed_by = usr
else if(screen == 2)
if(event == "Emergency Response Team" && ert_reason == "Reason for ERT")
user << "<span class='notice'>Supply a reason for calling the ERT first!</span>"
return
event_triggered_by = usr
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
/obj/machinery/keycard_auth/power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
icon_state = "auth_off"
else
stat |= NOPOWER
/obj/machinery/keycard_auth/attack_hand(mob/user as mob)
if(!user.IsAdvancedToolUser())
return 0
ui_interact(user)
/obj/machinery/keycard_auth/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(user.stat || stat & (NOPOWER|BROKEN))
user << "This device is not powered."
return
if(busy)
user << "This device is busy."
return
user.set_machine(src)
var/data[0]
data["screen"] = screen
data["event"] = event
data["ertreason"] = ert_reason
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 520, 320)
ui.set_initial_data(data)
ui.open()
/obj/machinery/keycard_auth/Topic(href, href_list)
if(..())
return
if(busy)
usr << "This device is busy."
return
if(usr.stat || stat & (BROKEN|NOPOWER))
usr << "This device is without power."
return
if(href_list["triggerevent"])
event = href_list["triggerevent"]
screen = 2
if(href_list["reset"])
reset()
if(href_list["ert"])
ert_reason = input(usr, "Reason for ERT Call:", "", "")
nanomanager.update_uis(src)
add_fingerprint(usr)
return
/obj/machinery/keycard_auth/proc/reset()
active = 0
event = ""
screen = 1
confirmed = 0
event_source = null
icon_state = "auth_off"
event_triggered_by = null
event_confirmed_by = null
/obj/machinery/keycard_auth/proc/broadcast_request()
icon_state = "auth_on"
for(var/obj/machinery/keycard_auth/KA in world)
if(KA == src) continue
KA.reset()
spawn()
KA.receive_request(src)
sleep(confirm_delay)
if(confirmed)
confirmed = 0
trigger_event(event)
log_game("[key_name(event_triggered_by)] triggered and [key_name(event_confirmed_by)] confirmed event [event]")
message_admins("[key_name_admin(event_triggered_by)] triggered and [key_name_admin(event_confirmed_by)] confirmed event [event]", 1)
reset()
/obj/machinery/keycard_auth/proc/receive_request(var/obj/machinery/keycard_auth/source)
if(stat & (BROKEN|NOPOWER))
return
event_source = source
busy = 1
active = 1
icon_state = "auth_on"
sleep(confirm_delay)
event_source = null
icon_state = "auth_off"
active = 0
busy = 0
/obj/machinery/keycard_auth/proc/trigger_event()
switch(event)
if("Red Alert")
set_security_level(SEC_LEVEL_RED)
feedback_inc("alert_keycard_auth_red",1)
if("Grant Emergency Maintenance Access")
make_maint_all_access()
feedback_inc("alert_keycard_auth_maintGrant",1)
if("Revoke Emergency Maintenance Access")
revoke_maint_all_access()
feedback_inc("alert_keycard_auth_maintRevoke",1)
if("Emergency Response Team")
if(is_ert_blocked())
usr << "\red All Emergency Response Teams are dispatched and can not be called at this time."
return
usr << "<span class = 'notice'>ERT request transmitted.</span>"
if(admins.len)
ERT_Announce(ert_reason , event_triggered_by)
ert_reason = "Reason for ERT"
feedback_inc("alert_keycard_auth_ert",1)
else
trigger_armed_response_team(new /datum/response_team/amber) // No admins? No problem. Automatically send a code amber ERT.
/obj/machinery/keycard_auth/proc/is_ert_blocked()
return ticker.mode && ticker.mode.ert_disabled
var/global/maint_all_access = 0
/proc/make_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 1
D.update_icon(0)
minor_announcement.Announce("The maintenance access requirement has been revoked on all airlocks.")
maint_all_access = 1
/proc/revoke_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 0
D.update_icon(0)
minor_announcement.Announce("The maintenance access requirement has been readded on all maintenance airlocks.")
/obj/machinery/keycard_auth
name = "Keycard Authentication Device"
desc = "This device is used to trigger station functions, which require more than one ID card to authenticate."
icon = 'icons/obj/monitors.dmi'
icon_state = "auth_off"
var/active = 0 //This gets set to 1 on all devices except the one where the initial request was made.
var/event = ""
var/screen = 1
var/list/ert_chosen = list()
var/confirmed = 0 //This variable is set by the device that confirms the request.
var/confirm_delay = 20 //(2 seconds)
var/busy = 0 //Busy when waiting for authentication or an event request has been sent from this device.
var/obj/machinery/keycard_auth/event_source
var/mob/event_triggered_by
var/mob/event_confirmed_by
var/ert_reason = "Reason for ERT"
//1 = select event
//2 = authenticate
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 6
power_channel = ENVIRON
/obj/machinery/keycard_auth/attack_ai(mob/user as mob)
user << "The station AI is not to interact with these devices."
return
/obj/machinery/keycard_auth/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(stat & (NOPOWER|BROKEN))
user << "This device is not powered."
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/ID = W
if(access_keycard_auth in ID.access)
if(active == 1)
//This is not the device that made the initial request. It is the device confirming the request.
if(event_source)
event_source.confirmed = 1
event_source.event_confirmed_by = usr
else if(screen == 2)
if(event == "Emergency Response Team" && ert_reason == "Reason for ERT")
user << "<span class='notice'>Supply a reason for calling the ERT first!</span>"
return
event_triggered_by = usr
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
/obj/machinery/keycard_auth/power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
icon_state = "auth_off"
else
stat |= NOPOWER
/obj/machinery/keycard_auth/attack_hand(mob/user as mob)
if(!user.IsAdvancedToolUser())
return 0
ui_interact(user)
/obj/machinery/keycard_auth/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(user.stat || stat & (NOPOWER|BROKEN))
user << "This device is not powered."
return
if(busy)
user << "This device is busy."
return
user.set_machine(src)
var/data[0]
data["screen"] = screen
data["event"] = event
data["ertreason"] = ert_reason
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 520, 320)
ui.set_initial_data(data)
ui.open()
/obj/machinery/keycard_auth/Topic(href, href_list)
if(..())
return
if(busy)
usr << "This device is busy."
return
if(usr.stat || stat & (BROKEN|NOPOWER))
usr << "This device is without power."
return
if(href_list["triggerevent"])
event = href_list["triggerevent"]
screen = 2
if(href_list["reset"])
reset()
if(href_list["ert"])
ert_reason = input(usr, "Reason for ERT Call:", "", "")
nanomanager.update_uis(src)
add_fingerprint(usr)
return
/obj/machinery/keycard_auth/proc/reset()
active = 0
event = ""
screen = 1
confirmed = 0
event_source = null
icon_state = "auth_off"
event_triggered_by = null
event_confirmed_by = null
/obj/machinery/keycard_auth/proc/broadcast_request()
icon_state = "auth_on"
for(var/obj/machinery/keycard_auth/KA in world)
if(KA == src) continue
KA.reset()
spawn()
KA.receive_request(src)
sleep(confirm_delay)
if(confirmed)
confirmed = 0
trigger_event(event)
log_game("[key_name(event_triggered_by)] triggered and [key_name(event_confirmed_by)] confirmed event [event]")
message_admins("[key_name_admin(event_triggered_by)] triggered and [key_name_admin(event_confirmed_by)] confirmed event [event]", 1)
reset()
/obj/machinery/keycard_auth/proc/receive_request(var/obj/machinery/keycard_auth/source)
if(stat & (BROKEN|NOPOWER))
return
event_source = source
busy = 1
active = 1
icon_state = "auth_on"
sleep(confirm_delay)
event_source = null
icon_state = "auth_off"
active = 0
busy = 0
/obj/machinery/keycard_auth/proc/trigger_event()
switch(event)
if("Red Alert")
set_security_level(SEC_LEVEL_RED)
feedback_inc("alert_keycard_auth_red",1)
if("Grant Emergency Maintenance Access")
make_maint_all_access()
feedback_inc("alert_keycard_auth_maintGrant",1)
if("Revoke Emergency Maintenance Access")
revoke_maint_all_access()
feedback_inc("alert_keycard_auth_maintRevoke",1)
if("Emergency Response Team")
if(is_ert_blocked())
usr << "\red All Emergency Response Teams are dispatched and can not be called at this time."
return
usr << "<span class = 'notice'>ERT request transmitted.</span>"
if(admins.len)
ERT_Announce(ert_reason , event_triggered_by)
ert_reason = "Reason for ERT"
feedback_inc("alert_keycard_auth_ert",1)
else
trigger_armed_response_team(new /datum/response_team/amber) // No admins? No problem. Automatically send a code amber ERT.
/obj/machinery/keycard_auth/proc/is_ert_blocked()
return ticker.mode && ticker.mode.ert_disabled
var/global/maint_all_access = 0
/proc/make_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 1
D.update_icon(0)
minor_announcement.Announce("The maintenance access requirement has been revoked on all airlocks.")
maint_all_access = 1
/proc/revoke_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 0
D.update_icon(0)
minor_announcement.Announce("The maintenance access requirement has been readded on all maintenance airlocks.")
maint_all_access = 0
@@ -1,184 +1,184 @@
/var/security_level = 0
//0 = code green
//1 = code blue
//2 = code red
//3 = gamma
//4 = epsilon
//5 = code delta
//config.alert_desc_blue_downto
/var/datum/announcement/priority/security/security_announcement_up = new(do_log = 0, do_newscast = 1, new_sound = sound('sound/misc/notice1.ogg'))
/var/datum/announcement/priority/security/security_announcement_down = new(do_log = 0, do_newscast = 1)
/proc/set_security_level(var/level)
switch(level)
if("green")
level = SEC_LEVEL_GREEN
if("blue")
level = SEC_LEVEL_BLUE
if("red")
level = SEC_LEVEL_RED
if("gamma")
level = SEC_LEVEL_GAMMA
if("epsilon")
level = SEC_LEVEL_EPSILON
if("delta")
level = SEC_LEVEL_DELTA
//Will not be announced if you try to set to the same level as it already is
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level)
switch(level)
if(SEC_LEVEL_GREEN)
security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.")
security_level = SEC_LEVEL_GREEN
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.")
else
security_announcement_down.Announce("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.","Attention! Security level lowered to blue.")
security_level = SEC_LEVEL_BLUE
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
else
security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
security_level = SEC_LEVEL_RED
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in world
if(R && (R.z in config.station_levels))
R.locked = 0
R.update_icon()
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
if(SEC_LEVEL_GAMMA)
security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!")
security_level = SEC_LEVEL_GAMMA
move_gamma_ship()
if(security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in world)
if((R.z in config.station_levels))
R.locked = 0
R.update_icon()
for(var/obj/machinery/door/airlock/hatch/gamma/H in world)
if((H.z in config.station_levels))
H.locked = 0
H.update_icon()
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_gamma")
FA.update_icon()
if(SEC_LEVEL_EPSILON)
security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!")
security_level = SEC_LEVEL_EPSILON
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
if(SEC_LEVEL_DELTA)
security_announcement_up.Announce("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.","Attention! Delta security level reached!")
security_level = SEC_LEVEL_DELTA
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
else
return
/proc/get_security_level()
switch(security_level)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_GAMMA)
return "gamma"
if(SEC_LEVEL_EPSILON)
return "epsilon"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/num2seclevel(var/num)
switch(num)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_GAMMA)
return "gamma"
if(SEC_LEVEL_EPSILON)
return "epsilon"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/seclevel2num(var/seclevel)
switch( lowertext(seclevel) )
if("green")
return SEC_LEVEL_GREEN
if("blue")
return SEC_LEVEL_BLUE
if("red")
return SEC_LEVEL_RED
if("gamma")
return SEC_LEVEL_GAMMA
if("epsilon")
return SEC_LEVEL_EPSILON
if("delta")
return SEC_LEVEL_DELTA
/*DEBUG
/mob/verb/set_thing0()
set_security_level(0)
/mob/verb/set_thing1()
set_security_level(1)
/mob/verb/set_thing2()
set_security_level(2)
/mob/verb/set_thing3()
set_security_level(3)
/var/security_level = 0
//0 = code green
//1 = code blue
//2 = code red
//3 = gamma
//4 = epsilon
//5 = code delta
//config.alert_desc_blue_downto
/var/datum/announcement/priority/security/security_announcement_up = new(do_log = 0, do_newscast = 1, new_sound = sound('sound/misc/notice1.ogg'))
/var/datum/announcement/priority/security/security_announcement_down = new(do_log = 0, do_newscast = 1)
/proc/set_security_level(var/level)
switch(level)
if("green")
level = SEC_LEVEL_GREEN
if("blue")
level = SEC_LEVEL_BLUE
if("red")
level = SEC_LEVEL_RED
if("gamma")
level = SEC_LEVEL_GAMMA
if("epsilon")
level = SEC_LEVEL_EPSILON
if("delta")
level = SEC_LEVEL_DELTA
//Will not be announced if you try to set to the same level as it already is
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level)
switch(level)
if(SEC_LEVEL_GREEN)
security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.")
security_level = SEC_LEVEL_GREEN
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.")
else
security_announcement_down.Announce("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.","Attention! Security level lowered to blue.")
security_level = SEC_LEVEL_BLUE
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
else
security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
security_level = SEC_LEVEL_RED
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in world
if(R && (R.z in config.station_levels))
R.locked = 0
R.update_icon()
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
if(SEC_LEVEL_GAMMA)
security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!")
security_level = SEC_LEVEL_GAMMA
move_gamma_ship()
if(security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in world)
if((R.z in config.station_levels))
R.locked = 0
R.update_icon()
for(var/obj/machinery/door/airlock/hatch/gamma/H in world)
if((H.z in config.station_levels))
H.locked = 0
H.update_icon()
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_gamma")
FA.update_icon()
if(SEC_LEVEL_EPSILON)
security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!")
security_level = SEC_LEVEL_EPSILON
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
if(SEC_LEVEL_DELTA)
security_announcement_up.Announce("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.","Attention! Delta security level reached!")
security_level = SEC_LEVEL_DELTA
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
if((FA.z in config.contact_levels))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
else
return
/proc/get_security_level()
switch(security_level)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_GAMMA)
return "gamma"
if(SEC_LEVEL_EPSILON)
return "epsilon"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/num2seclevel(var/num)
switch(num)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_GAMMA)
return "gamma"
if(SEC_LEVEL_EPSILON)
return "epsilon"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/seclevel2num(var/seclevel)
switch( lowertext(seclevel) )
if("green")
return SEC_LEVEL_GREEN
if("blue")
return SEC_LEVEL_BLUE
if("red")
return SEC_LEVEL_RED
if("gamma")
return SEC_LEVEL_GAMMA
if("epsilon")
return SEC_LEVEL_EPSILON
if("delta")
return SEC_LEVEL_DELTA
/*DEBUG
/mob/verb/set_thing0()
set_security_level(0)
/mob/verb/set_thing1()
set_security_level(1)
/mob/verb/set_thing2()
set_security_level(2)
/mob/verb/set_thing3()
set_security_level(3)
*/