mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 17:42:26 +00:00
Cleans out the WiP folder.
Step one: Known unused files.
This commit is contained in:
@@ -1,573 +0,0 @@
|
||||
//All credit for this goes to Uristqwerty.
|
||||
|
||||
//And some to me! -Mini
|
||||
|
||||
|
||||
|
||||
//This file is partly designed around being able to uninclude it to go back to the old ai viewing system completely.
|
||||
//(And therefore also be portable to another similar codebase simply by transferring the file and including it after the other AI code files.)
|
||||
//There are probably a few parts that don't do that at the moment, but I'll fix them at some point.
|
||||
|
||||
|
||||
#define MINIMAP_UPDATE_DELAY 1200
|
||||
|
||||
/turf
|
||||
var/image/obscured
|
||||
var/image/dim
|
||||
|
||||
/turf/proc/visibilityChanged()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
/*
|
||||
/turf/Del()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
*/
|
||||
/datum/camerachunk
|
||||
var/list/obscuredTurfs = list()
|
||||
var/list/visibleTurfs = list()
|
||||
var/list/dimTurfs = list()
|
||||
var/list/obscured = list()
|
||||
var/list/dim = list()
|
||||
var/list/cameras = list()
|
||||
var/list/turfs = list()
|
||||
var/list/seenby = list()
|
||||
var/visible = 0
|
||||
var/changed = 1
|
||||
var/updating = 0
|
||||
|
||||
var/x
|
||||
var/y
|
||||
var/z
|
||||
|
||||
var/minimap_updating = 0
|
||||
|
||||
var/icon/minimap_icon = new('icons/minimap.dmi', "chunk_base")
|
||||
var/obj/minimap_obj/minimap_obj = new()
|
||||
|
||||
/obj/minimap_obj/Click(location, control, params)
|
||||
if(!istype(usr, /mob/dead) && !istype(usr, /mob/living/silicon/ai) && !(usr.client && usr.client.holder && usr.client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/list/par = params2list(params)
|
||||
var/screen_loc = par["screen-loc"]
|
||||
|
||||
if(findtext(screen_loc, "minimap:") != 1)
|
||||
return
|
||||
|
||||
screen_loc = copytext(screen_loc, length("minimap:") + 1)
|
||||
|
||||
var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
|
||||
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
|
||||
|
||||
var/x = (text2num(copytext(x_text, 1, findtext(x_text, ":"))) - 1) * 16
|
||||
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
var/y = (text2num(copytext(y_text, 1, findtext(y_text, ":"))) - 1) * 16
|
||||
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/ai = usr
|
||||
ai.freelook()
|
||||
ai.eyeobj.loc = locate(max(1, x - 1), max(1, y - 1), ai.eyeobj.z)
|
||||
cameranet.visibility(ai.eyeobj)
|
||||
|
||||
else
|
||||
usr.loc = locate(max(1, x - 1), max(1, y - 1), usr.z)
|
||||
|
||||
/mob/dead/verb/Open_Minimap()
|
||||
set category = "Ghost"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
client.screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src
|
||||
|
||||
/mob/living/silicon/ai/verb/Open_Minimap()
|
||||
set category = "AI Commands"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
client.screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src
|
||||
|
||||
/client/proc/Open_Minimap()
|
||||
set category = "Admin"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src.mob
|
||||
|
||||
/datum/camerachunk/proc/update_minimap()
|
||||
if(changed && !updating)
|
||||
update()
|
||||
|
||||
minimap_icon.Blend(rgb(255, 0, 0), ICON_MULTIPLY)
|
||||
|
||||
var/list/turfs = visibleTurfs | dimTurfs
|
||||
|
||||
for(var/turf/turf in turfs)
|
||||
var/x = (turf.x & 0xf) * 2
|
||||
var/y = (turf.y & 0xf) * 2
|
||||
|
||||
if(turf.density)
|
||||
minimap_icon.DrawBox(rgb(100, 100, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
continue
|
||||
|
||||
else if(istype(turf, /turf/space))
|
||||
minimap_icon.DrawBox(rgb(0, 0, 0), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(200, 200, 200), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
for(var/obj/structure/o in turf)
|
||||
if(o.density)
|
||||
if(istype(o, /obj/structure/window) && (o.dir == NORTH || o.dir == SOUTH || o.dir == EAST || o.dir == WEST))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 3, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(150, 150, 150), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
for(var/obj/machinery/door/o in turf)
|
||||
if(istype(o, /obj/machinery/door/window))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 2, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
minimap_obj.screen_loc = "minimap:[src.x / 16],[src.y / 16]"
|
||||
minimap_obj.icon = minimap_icon
|
||||
|
||||
/mob/aiEye
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/ai = null
|
||||
density = 0
|
||||
|
||||
/datum/camerachunk/proc/add(mob/aiEye/ai)
|
||||
ai.visibleCameraChunks += src
|
||||
if(ai.ai.client)
|
||||
ai.ai.client.images += obscured
|
||||
ai.ai.client.images += dim
|
||||
visible++
|
||||
seenby += ai
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/aiEye/ai)
|
||||
ai.visibleCameraChunks -= src
|
||||
if(ai.ai.client)
|
||||
ai.ai.client.images -= obscured
|
||||
ai.ai.client.images -= dim
|
||||
seenby -= ai
|
||||
if(visible > 0)
|
||||
visible--
|
||||
|
||||
/datum/camerachunk/proc/visibilityChanged(turf/loc)
|
||||
if(!(loc in visibleTurfs))
|
||||
return
|
||||
|
||||
hasChanged()
|
||||
|
||||
/datum/camerachunk/proc/hasChanged()
|
||||
if(visible)
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(10)//Batch large changes, such as many doors opening or closing at once
|
||||
update()
|
||||
updating = 0
|
||||
else
|
||||
changed = 1
|
||||
|
||||
if(!minimap_updating)
|
||||
minimap_updating = 1
|
||||
|
||||
spawn(MINIMAP_UPDATE_DELAY)
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
update_minimap()
|
||||
minimap_updating = 0
|
||||
|
||||
/datum/camerachunk/proc/update()
|
||||
|
||||
var/list/newDimTurfs = list()
|
||||
var/list/newVisibleTurfs = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
newDimTurfs |= turfs & view(7, c)
|
||||
newVisibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
var/list/dimAdded = newDimTurfs - dimTurfs
|
||||
var/list/dimRemoved = dimTurfs - newDimTurfs
|
||||
var/list/visAdded = newVisibleTurfs - visibleTurfs
|
||||
var/list/visRemoved = visibleTurfs - newVisibleTurfs
|
||||
|
||||
visibleTurfs = newVisibleTurfs
|
||||
dimTurfs = newDimTurfs
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in dimRemoved)
|
||||
if(t.dim)
|
||||
dim -= t.dim
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.dim
|
||||
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.obscured
|
||||
|
||||
for(var/turf/t in dimAdded)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", 15)
|
||||
t.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.dim
|
||||
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.obscured
|
||||
|
||||
for(var/turf/t in visAdded)
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.obscured
|
||||
|
||||
for(var/turf/t in visRemoved)
|
||||
if(t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.obscured
|
||||
|
||||
|
||||
/datum/camerachunk/New(loc, x, y, z)
|
||||
x &= ~0xf
|
||||
y &= ~0xf
|
||||
|
||||
src.x = x
|
||||
src.y = y
|
||||
src.z = z
|
||||
|
||||
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
||||
if(c.status)
|
||||
cameras += c
|
||||
|
||||
turfs = block(locate(x, y, z), locate(min(world.maxx, x + 15), min(world.maxy, y + 15), z))
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
dimTurfs |= turfs & view(7, c)
|
||||
visibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
|
||||
for(var/turf/t in dimTurfs)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", TURF_LAYER)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
|
||||
cameranet.minimap += minimap_obj
|
||||
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
/datum/cameranet
|
||||
var/list/cameras = list()
|
||||
var/list/chunks = list()
|
||||
var/network = "net1"
|
||||
var/ready = 0
|
||||
|
||||
var/list/minimap = list()
|
||||
|
||||
var/generating_minimap = TRUE
|
||||
var/list/minimap_viewers = list()
|
||||
|
||||
/datum/cameranet/New()
|
||||
..()
|
||||
|
||||
spawn(200)
|
||||
for(var/x = 0, x <= world.maxx, x += 16)
|
||||
for(var/y = 0, y <= world.maxy, y += 16)
|
||||
sleep(1)
|
||||
var/datum/camerachunk/c = getCameraChunk(x, y, 1)
|
||||
c.update_minimap()
|
||||
|
||||
for(var/mob/m in minimap_viewers)
|
||||
m.client.screen |= c.minimap_obj
|
||||
|
||||
generating_minimap = FALSE
|
||||
minimap_viewers = list()
|
||||
|
||||
/datum/cameranet/proc/chunkGenerated(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
return key in chunks
|
||||
|
||||
/datum/cameranet/proc/getCameraChunk(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
|
||||
if(!(key in chunks))
|
||||
chunks[key] = new /datum/camerachunk(null, x, y, z)
|
||||
|
||||
return chunks[key]
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/aiEye/ai)
|
||||
var/x1 = max(0, ai.x - 16) & ~0xf
|
||||
var/y1 = max(0, ai.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, ai.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, ai.y + 16) & ~0xf
|
||||
|
||||
var/list/visibleChunks = list()
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
visibleChunks += getCameraChunk(x, y, ai.z)
|
||||
|
||||
var/list/remove = ai.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - ai.visibleCameraChunks
|
||||
|
||||
for(var/datum/camerachunk/c in remove)
|
||||
c.remove(ai)
|
||||
|
||||
for(var/datum/camerachunk/c in add)
|
||||
c.add(ai)
|
||||
|
||||
/datum/cameranet/proc/updateVisibility(turf/loc)
|
||||
if(!chunkGenerated(loc.x & ~0xf, loc.y & ~0xf, loc.z))
|
||||
return
|
||||
|
||||
var/datum/camerachunk/chunk = getCameraChunk(loc.x & ~0xf, loc.y & ~0xf, loc.z)
|
||||
chunk.visibilityChanged(loc)
|
||||
|
||||
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
if(!(c in chunk.cameras))
|
||||
chunk.cameras += c
|
||||
chunk.hasChanged()
|
||||
|
||||
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
if(!c)
|
||||
chunk.hasChanged()
|
||||
if(c in chunk.cameras)
|
||||
chunk.cameras -= c
|
||||
chunk.hasChanged()
|
||||
|
||||
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
|
||||
|
||||
/mob/living/silicon/ai/New()
|
||||
..()
|
||||
eyeobj.ai = src
|
||||
spawn(20)
|
||||
freelook()
|
||||
|
||||
/mob/living/silicon/ai/death(gibbed)
|
||||
if(client && client.eye == eyeobj)
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
client.eye = src
|
||||
return ..(gibbed)
|
||||
|
||||
/mob/living/silicon/ai/verb/freelook()
|
||||
set category = "AI Commands"
|
||||
set name = "freelook"
|
||||
current = null //cancel camera view first, it causes problems
|
||||
cameraFollow = null
|
||||
// machine = null
|
||||
if(!eyeobj) //if it got deleted somehow (like an admin trying to fix things <.<')
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
client.eye = eyeobj
|
||||
eyeobj.loc = loc
|
||||
cameranet.visibility(eyeobj)
|
||||
cameraFollow = null
|
||||
|
||||
/mob/aiEye/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
cameranet.visibility(src)
|
||||
|
||||
/client/AIMove(n, direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
user.eyeobj.loc = get_step(user.eyeobj, direct)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/*
|
||||
/client/AIMoveZ(direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
var/dif = 0
|
||||
if(direct == UP && user.eyeobj.z > 1)
|
||||
dif = -1
|
||||
else if(direct == DOWN && user.eyeobj.z < 4)
|
||||
dif = 1
|
||||
user.eyeobj.loc = locate(user.eyeobj.x, user.eyeobj.y, user.eyeobj.z + dif)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
else
|
||||
return ..()
|
||||
*/
|
||||
|
||||
/turf/move_camera_by_click()
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
if(AI.client.eye == AI.eyeobj)
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/door/update_nearby_tiles(need_rebuild)
|
||||
. = ..(need_rebuild)
|
||||
cameranet.updateVisibility(loc)
|
||||
|
||||
/obj/machinery/camera/New()
|
||||
..()
|
||||
cameranet.addCamera(src)
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
cameranet.removeCamera(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
. = ..(W, user)
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if(status)
|
||||
cameranet.addCamera(src)
|
||||
else
|
||||
cameranet.removeCamera(src)
|
||||
|
||||
/proc/checkcameravis(atom/A)
|
||||
for(var/obj/machinery/camera/C in view(A,7))
|
||||
if(!C.status || C.stat == 2)
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
|
||||
if (user != src)
|
||||
return
|
||||
|
||||
if (stat == 2)
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in world)
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
L = camera_network_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
for (var/obj/machinery/camera/C in L)
|
||||
if ( C.network in src.networks )
|
||||
D[text("[]: [][]", C.network, C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
D["Cancel"] = "Cancel"
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
|
||||
if (!t || t == "Cancel")
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
eyeobj.loc = C.loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
set category = "OOC"
|
||||
reset_view(null)
|
||||
machine = null
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if (client)
|
||||
if(!eyeobj)
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
|
||||
client.eye = eyeobj
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
eyeobj.loc = locate(A.x, A.y, A.z)
|
||||
|
||||
else
|
||||
eyeobj.loc = locate(src.x, src.y, src.z)
|
||||
|
||||
cameranet.visibility(eyeobj)
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
/mob/aiEye
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/ai = null
|
||||
density = 0
|
||||
|
||||
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
|
||||
|
||||
/mob/living/silicon/ai/New()
|
||||
..()
|
||||
eyeobj.ai = src
|
||||
spawn(20)
|
||||
freelook()
|
||||
|
||||
/mob/living/silicon/ai/death(gibbed)
|
||||
if(client && client.eye == eyeobj)
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
client.eye = src
|
||||
return ..(gibbed)
|
||||
|
||||
/mob/living/silicon/ai/verb/freelook()
|
||||
set category = "AI Commands"
|
||||
set name = "freelook"
|
||||
current = null //cancel camera view first, it causes problems
|
||||
cameraFollow = null
|
||||
if(!eyeobj) //if it got deleted somehow (like an admin trying to fix things <.<')
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
client.eye = eyeobj
|
||||
eyeobj.loc = loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
/mob/aiEye/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
cameranet.visibility(src)
|
||||
|
||||
/client/AIMove(n, direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
user.eyeobj.loc = get_step(user.eyeobj, direct)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/turf/move_camera_by_click()
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
if(AI.client.eye == AI.eyeobj)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
|
||||
if (user != src)
|
||||
return
|
||||
|
||||
if (stat == 2)
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in world)
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
L = camera_network_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
for (var/obj/machinery/camera/C in L)
|
||||
if ( C.network in src.networks )
|
||||
D[text("[]: [][]", C.network, C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
D["Cancel"] = "Cancel"
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
|
||||
if (!t || t == "Cancel")
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
eyeobj.loc = C.loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
set category = "OOC"
|
||||
reset_view(null)
|
||||
machine = null
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if (client)
|
||||
if(!eyeobj)
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
|
||||
client.eye = eyeobj
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
eyeobj.loc = locate(A.x, A.y, A.z)
|
||||
|
||||
else
|
||||
eyeobj.loc = locate(src.x, src.y, src.z)
|
||||
|
||||
cameranet.visibility(eyeobj)
|
||||
@@ -1,156 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
//
|
||||
// The Cameranet
|
||||
//
|
||||
// The cameranet is a single global instance of a unique
|
||||
// datum, which contains logic for managing the individual
|
||||
// chunks.
|
||||
//
|
||||
//------------------------------------------------------------
|
||||
|
||||
/datum/cameranet
|
||||
var/list/cameras = list()
|
||||
var/list/chunks = list()
|
||||
var/network = "net1"
|
||||
var/ready = 0
|
||||
|
||||
var/list/minimap = list()
|
||||
|
||||
var/generating_minimap = TRUE
|
||||
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
|
||||
|
||||
/datum/cameranet/New()
|
||||
..()
|
||||
|
||||
spawn(100)
|
||||
init_minimap()
|
||||
|
||||
|
||||
/datum/cameranet/proc/init_minimap()
|
||||
for(var/x = 0, x <= world.maxx, x += 16)
|
||||
for(var/y = 0, y <= world.maxy, y += 16)
|
||||
sleep(1)
|
||||
getCameraChunk(x, y, 5)
|
||||
getCameraChunk(x, y, 1)
|
||||
|
||||
generating_minimap = FALSE
|
||||
|
||||
|
||||
/datum/cameranet/proc/chunkGenerated(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
return key in chunks
|
||||
|
||||
|
||||
/datum/cameranet/proc/getCameraChunk(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
|
||||
if(!(key in chunks))
|
||||
chunks[key] = new /datum/camerachunk(null, x, y, z)
|
||||
|
||||
return chunks[key]
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates what chunks are considered seen
|
||||
// by an aiEye. As part of the process, it will force
|
||||
// any newly visible chunks with pending unscheduled
|
||||
// updates to update, and show the correct obscuring
|
||||
// and dimming image sets. If you do not call this
|
||||
// after the eye has moved, it may result in the
|
||||
// affected AI gaining (partial) xray, seeing through
|
||||
// now-closed doors, not seeing through open doors,
|
||||
// or other visibility oddities, depending on if/when
|
||||
// they last visited any of the chunks in the nearby
|
||||
// area.
|
||||
|
||||
// It must be called manually, as there is no way to
|
||||
// have a proc called automatically every time an
|
||||
// object's loc changes.
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/aiEye/ai)
|
||||
var/x1 = max(0, ai.x - 16) & ~0xf
|
||||
var/y1 = max(0, ai.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, ai.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, ai.y + 16) & ~0xf
|
||||
|
||||
var/list/visibleChunks = list()
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
visibleChunks += getCameraChunk(x, y, ai.z)
|
||||
|
||||
var/list/remove = ai.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - ai.visibleCameraChunks
|
||||
|
||||
for(var/datum/camerachunk/c in remove)
|
||||
c.remove(ai)
|
||||
|
||||
for(var/datum/camerachunk/c in add)
|
||||
c.add(ai)
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc should be called if a turf, or the contents
|
||||
// of a turf, changes opacity. This includes such things
|
||||
// as changing the turf, opening or closing a door, or
|
||||
// anything else that would alter line of sight in the
|
||||
// general area.
|
||||
|
||||
/datum/cameranet/proc/updateVisibility(turf/loc)
|
||||
if(!chunkGenerated(loc.x & ~0xf, loc.y & ~0xf, loc.z))
|
||||
return
|
||||
|
||||
var/datum/camerachunk/chunk = getCameraChunk(loc.x & ~0xf, loc.y & ~0xf, loc.z)
|
||||
chunk.visibilityChanged(loc)
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates all relevant chunks when enabling or
|
||||
// creating a camera, allowing freelook and the minimap to
|
||||
// respond correctly.
|
||||
|
||||
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
|
||||
if(!(c in chunk.cameras))
|
||||
chunk.cameras += c
|
||||
chunk.hasChanged()
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates all relevant chunks when disabling or
|
||||
// deleting a camera, allowing freelook and the minimap to
|
||||
// respond correctly.
|
||||
|
||||
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
|
||||
if(!c)
|
||||
chunk.hasChanged()
|
||||
|
||||
if(c in chunk.cameras)
|
||||
chunk.cameras -= c
|
||||
chunk.hasChanged()
|
||||
@@ -1,224 +0,0 @@
|
||||
#define MINIMAP_UPDATE_DELAY 1200
|
||||
|
||||
/datum/camerachunk
|
||||
var/list/turfs = list()
|
||||
|
||||
var/list/obscuredTurfs = list()
|
||||
var/list/visibleTurfs = list()
|
||||
var/list/dimTurfs = list()
|
||||
|
||||
var/list/obscured = list()
|
||||
var/list/dim = list()
|
||||
|
||||
var/list/cameras = list()
|
||||
var/list/seenby = list()
|
||||
|
||||
var/changed = 1
|
||||
var/updating = 0
|
||||
var/minimap_updating = 0
|
||||
|
||||
var/x
|
||||
var/y
|
||||
var/z
|
||||
|
||||
|
||||
var/icon/minimap_icon = new('icons/minimap.dmi', "chunk_base")
|
||||
var/obj/minimap_obj/minimap_obj = new()
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/New(loc, x, y, z)
|
||||
//Round X and Y down to a multiple of 16, if nessecary
|
||||
src.x = x & ~0xF
|
||||
src.y = y & ~0xF
|
||||
src.z = z
|
||||
|
||||
rebuild_chunk()
|
||||
|
||||
|
||||
|
||||
// Completely re-calculate the whole chunk.
|
||||
|
||||
/datum/camerachunk/proc/rebuild_chunk()
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(!eye.ai)
|
||||
seenby -= eye
|
||||
continue
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= obscured
|
||||
eye.ai.client.images -= dim
|
||||
|
||||
var/start = locate(x, y, z)
|
||||
var/end = locate(min(x + 15, world.maxx), min(y + 15, world.maxy), z)
|
||||
|
||||
turfs = block(start, end)
|
||||
dimTurfs = list()
|
||||
visibleTurfs = list()
|
||||
obscured = list()
|
||||
dim = list()
|
||||
cameras = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
||||
if(c.status)
|
||||
cameras += c
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
dimTurfs |= turfs & view(7, c)
|
||||
visibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
|
||||
for(var/turf/t in dimTurfs)
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", TURF_LAYER)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
|
||||
cameranet.minimap |= minimap_obj
|
||||
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images |= obscured
|
||||
eye.ai.client.images |= dim
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/proc/add(mob/aiEye/eye)
|
||||
eye.visibleCameraChunks |= src
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images |= obscured
|
||||
eye.ai.client.images |= dim
|
||||
|
||||
seenby |= eye
|
||||
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/aiEye/eye)
|
||||
eye.visibleCameraChunks -= src
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= obscured
|
||||
eye.ai.client.images -= dim
|
||||
|
||||
seenby -= eye
|
||||
|
||||
/datum/camerachunk/proc/visibilityChanged(turf/loc)
|
||||
if(!(loc in visibleTurfs))
|
||||
return
|
||||
|
||||
hasChanged()
|
||||
|
||||
/datum/camerachunk/proc/hasChanged()
|
||||
if(length(seenby) > 0)
|
||||
if(!updating)
|
||||
updating = 1
|
||||
|
||||
spawn(10)//Batch large changes, such as many doors opening or closing at once
|
||||
update()
|
||||
updating = 0
|
||||
|
||||
else
|
||||
changed = 1
|
||||
|
||||
if(!minimap_updating)
|
||||
minimap_updating = 1
|
||||
|
||||
spawn(MINIMAP_UPDATE_DELAY)
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
update_minimap()
|
||||
minimap_updating = 0
|
||||
|
||||
/datum/camerachunk/proc/update()
|
||||
|
||||
var/list/newDimTurfs = list()
|
||||
var/list/newVisibleTurfs = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
newDimTurfs |= turfs & view(7, c)
|
||||
newVisibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
var/list/dimAdded = newDimTurfs - dimTurfs
|
||||
var/list/dimRemoved = dimTurfs - newDimTurfs
|
||||
var/list/visAdded = newVisibleTurfs - visibleTurfs
|
||||
var/list/visRemoved = visibleTurfs - newVisibleTurfs
|
||||
|
||||
visibleTurfs = newVisibleTurfs
|
||||
dimTurfs = newDimTurfs
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
var/list/images_added = list()
|
||||
var/list/images_removed = list()
|
||||
|
||||
for(var/turf/t in dimRemoved)
|
||||
if(t.dim)
|
||||
dim -= t.dim
|
||||
images_removed += t.dim
|
||||
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
images_added += t.obscured
|
||||
|
||||
for(var/turf/t in dimAdded)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", 15)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
images_added += t.dim
|
||||
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
images_removed += t.obscured
|
||||
|
||||
for(var/turf/t in visAdded)
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
images_removed += t.obscured
|
||||
|
||||
for(var/turf/t in visRemoved)
|
||||
if(t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
images_added += t.obscured
|
||||
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(eye.ai)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= images_removed
|
||||
eye.ai.client.images |= images_added
|
||||
else
|
||||
seenby -= eye
|
||||
@@ -1,137 +0,0 @@
|
||||
/client/var/minimap_view_z = 1
|
||||
|
||||
/obj/minimap_obj
|
||||
var/datum/camerachunk/chunk
|
||||
|
||||
/obj/minimap_obj/Click(location, control, params)
|
||||
if(!istype(usr, /mob/dead) && !istype(usr, /mob/living/silicon/ai) && !(usr.client && usr.client.holder && usr.client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/list/par = params2list(params)
|
||||
var/screen_loc = par["screen-loc"]
|
||||
|
||||
if(findtext(screen_loc, "minimap:") != 1)
|
||||
return
|
||||
|
||||
screen_loc = copytext(screen_loc, length("minimap:") + 1)
|
||||
|
||||
var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
|
||||
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
|
||||
|
||||
var/x = chunk.x
|
||||
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
var/y = chunk.y
|
||||
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/ai = usr
|
||||
ai.freelook()
|
||||
ai.eyeobj.loc = locate(max(1, x - 1), max(1, y - 1), usr.client.minimap_view_z)
|
||||
cameranet.visibility(ai.eyeobj)
|
||||
|
||||
else
|
||||
usr.loc = locate(max(1, x - 1), max(1, y - 1), usr.client.minimap_view_z)
|
||||
|
||||
/mob/dead/verb/Open_Minimap()
|
||||
set category = "Ghost"
|
||||
cameranet.show_minimap(client)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/Open_Minimap()
|
||||
set category = "AI Commands"
|
||||
cameranet.show_minimap(client)
|
||||
|
||||
|
||||
/client/proc/Open_Minimap()
|
||||
set category = "Admin"
|
||||
cameranet.show_minimap(src)
|
||||
|
||||
|
||||
/mob/verb/Open_Minimap_Z()
|
||||
set hidden = 1
|
||||
|
||||
if(!istype(src, /mob/dead) && !istype(src, /mob/living/silicon/ai) && !(client && client.holder && client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/level = input("Select a Z level", "Z select", null) as null | anything in cameranet.minimap
|
||||
|
||||
if(level != null)
|
||||
cameranet.show_minimap(client, level)
|
||||
|
||||
|
||||
|
||||
/datum/cameranet/proc/show_minimap(client/client, z_level = "z-1")
|
||||
if(!istype(client.mob, /mob/dead) && !istype(client.mob, /mob/living/silicon/ai) && !(client.holder && client.holder.level >= 4))
|
||||
return
|
||||
|
||||
if(z_level in cameranet.minimap)
|
||||
winshow(client, "minimapwindow", 1)
|
||||
|
||||
for(var/key in cameranet.minimap)
|
||||
client.screen -= cameranet.minimap[key]
|
||||
|
||||
client.screen |= cameranet.minimap[z_level]
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
spawn(50)
|
||||
show_minimap(client, z_level)
|
||||
|
||||
client.minimap_view_z = text2num(copytext(z_level, 3))
|
||||
|
||||
|
||||
/datum/camerachunk/proc/update_minimap()
|
||||
if(changed && !updating)
|
||||
update()
|
||||
|
||||
minimap_icon.Blend(rgb(255, 0, 0), ICON_MULTIPLY)
|
||||
|
||||
var/list/turfs = visibleTurfs | dimTurfs
|
||||
|
||||
for(var/turf/turf in turfs)
|
||||
var/x = (turf.x & 0xf) * 2
|
||||
var/y = (turf.y & 0xf) * 2
|
||||
|
||||
if(turf.density)
|
||||
minimap_icon.DrawBox(rgb(100, 100, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
continue
|
||||
|
||||
else if(istype(turf, /turf/space))
|
||||
minimap_icon.DrawBox(rgb(0, 0, 0), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(200, 200, 200), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
for(var/obj/structure/o in turf)
|
||||
if(o.density)
|
||||
if(istype(o, /obj/structure/window) && (o.dir == NORTH || o.dir == SOUTH || o.dir == EAST || o.dir == WEST))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 3, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(150, 150, 150), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
for(var/obj/machinery/door/o in turf)
|
||||
if(istype(o, /obj/machinery/door/window))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 2, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
minimap_obj.screen_loc = "minimap:[src.x / 16],[src.y / 16]"
|
||||
minimap_obj.icon = minimap_icon
|
||||
@@ -1,38 +0,0 @@
|
||||
|
||||
/turf
|
||||
var/image/obscured
|
||||
var/image/dim
|
||||
|
||||
/turf/proc/visibilityChanged()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/obj/machinery/door/update_nearby_tiles(need_rebuild)
|
||||
. = ..(need_rebuild)
|
||||
cameranet.updateVisibility(loc)
|
||||
|
||||
/obj/machinery/camera/New()
|
||||
..()
|
||||
cameranet.addCamera(src)
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
cameranet.removeCamera(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
. = ..(W, user)
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if(status)
|
||||
cameranet.addCamera(src)
|
||||
else
|
||||
cameranet.removeCamera(src)
|
||||
|
||||
/proc/checkcameravis(atom/A)
|
||||
for(var/obj/machinery/camera/C in view(A,7))
|
||||
if(!C.status || C.stat == 2)
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
@@ -1,132 +0,0 @@
|
||||
//mostly replaced these with emitter code
|
||||
//they're functionally identical
|
||||
|
||||
/obj/machinery/computer/laser
|
||||
name = "Zero-point laser"
|
||||
desc = "A super-powerful laser"
|
||||
var/visible = 1
|
||||
var/state = 1.0
|
||||
//var/obj/beam/e_beam/first
|
||||
var/power = 500
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "laser"
|
||||
anchored = 1
|
||||
var/id
|
||||
var/on = 0
|
||||
var/freq = 50000
|
||||
var/phase = 0
|
||||
var/phase_variance = 0
|
||||
|
||||
/obj/machinery/computer/laser/process()
|
||||
/*if(on)
|
||||
if(!first)
|
||||
src.first = new /obj/beam/e_beam(src.loc)
|
||||
src.first.master = src
|
||||
src.first.set_dir(src.dir)
|
||||
src.first.power = src.power
|
||||
src.first.freq = src.freq
|
||||
src.first.phase = src.phase
|
||||
src.first.phase_variance = src.phase_variance
|
||||
step(first, dir)
|
||||
if(first)
|
||||
src.first.updatebeam()
|
||||
else
|
||||
src.first.updatebeam()
|
||||
else
|
||||
if(first)
|
||||
del first*/
|
||||
|
||||
/obj/machinery/computer/laser/proc/setpower(var/powera)
|
||||
/*src.power = powera
|
||||
if(first)
|
||||
first.setpower(src.power)*/
|
||||
|
||||
/*
|
||||
/obj/beam/e_beam
|
||||
name = "Laser beam"
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "u_laser"
|
||||
var/obj/machinery/engine/laser/master = null
|
||||
var/obj/beam/e_beam/next = null
|
||||
var/power
|
||||
var/freq = 50000
|
||||
var/phase = 0
|
||||
var/phase_variance = 0
|
||||
anchored = 1
|
||||
|
||||
/obj/beam/e_beam/New()
|
||||
sd_SetLuminosity(1, 1, 4)
|
||||
|
||||
/obj/beam/e_beam/proc/updatebeam()
|
||||
if(!next)
|
||||
if(get_step(src.loc,src.dir))
|
||||
var/obj/beam/e_beam/e = new /obj/beam/e_beam(src.loc)
|
||||
e.set_dir(src.dir)
|
||||
src.next = e
|
||||
e.master = src.master
|
||||
e.power = src.power
|
||||
e.phase = src.phase
|
||||
src.phase+=src.phase_variance
|
||||
e.freq = src.freq
|
||||
e.phase_variance = src.phase_variance
|
||||
if(src.loc.density == 0)
|
||||
for(var/atom/o in src.loc.contents)
|
||||
if(o.density || o == src.master || (ismob(o) && !istype(o, /mob/dead)) )
|
||||
o.laser_act(src)
|
||||
del src
|
||||
return
|
||||
else
|
||||
src.loc.laser_act(src)
|
||||
del e
|
||||
return
|
||||
step(e,e.dir)
|
||||
if(e)
|
||||
e.updatebeam()
|
||||
else
|
||||
next.updatebeam()
|
||||
|
||||
/atom/proc/laser_act(var/obj/beam/e_beam/b)
|
||||
return
|
||||
|
||||
/mob/living/carbon/laser_act(var/obj/beam/e_beam/b)
|
||||
for(var/t in organs)
|
||||
var/datum/organ/external/affecting = organs["[t]"]
|
||||
if (affecting.take_damage(0, b.power/400,0,0))
|
||||
UpdateDamageIcon()
|
||||
else
|
||||
UpdateDamage()
|
||||
|
||||
/obj/beam/e_beam/Bump(atom/Obstacle)
|
||||
Obstacle.laser_act(src)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/beam/e_beam/proc/setpower(var/powera)
|
||||
src.power = powera
|
||||
if(src.next)
|
||||
src.next.setpower(powera)
|
||||
|
||||
/obj/beam/e_beam/Bumped()
|
||||
src.hit()
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/HasEntered(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/beam))
|
||||
return
|
||||
spawn( 0 )
|
||||
AM.laser_act(src)
|
||||
src.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/Del()
|
||||
if(next)
|
||||
del(next)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/proc/hit()
|
||||
del src
|
||||
return
|
||||
*/
|
||||
@@ -1,261 +0,0 @@
|
||||
#define MISSILE_SPEED 5
|
||||
|
||||
//automated turret that shoots missiles at meteors
|
||||
|
||||
/obj/item/projectile/missile
|
||||
name = "missile"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/meteor_turret.dmi'
|
||||
icon_state = "missile"
|
||||
var/turf/target
|
||||
var/tracking = 0
|
||||
density = 1
|
||||
desc = "It's sparking and shaking slightly."
|
||||
|
||||
/obj/item/projectile/missile/process(var/turf/newtarget)
|
||||
target = newtarget
|
||||
set_dir(get_dir(src.loc, target))
|
||||
walk_towards(src, target, MISSILE_SPEED)
|
||||
|
||||
/obj/item/projectile/missile/Bump(atom/A)
|
||||
spawn(0)
|
||||
if(istype(A,/obj/effect/meteor))
|
||||
del(A)
|
||||
explode()
|
||||
return
|
||||
|
||||
/obj/item/projectile/missile/proc/explode()
|
||||
explosion(src.loc, 1, 1, 2, 7, 0)
|
||||
playsound(src.loc, "explosion", 50, 1)
|
||||
del(src)
|
||||
|
||||
/obj/item/projectile/missile/attack_hand(mob/user)
|
||||
..()
|
||||
return attackby(null, user)
|
||||
|
||||
/obj/item/projectile/missile/attackby(obj/item/weapon/W, mob/user)
|
||||
//can't touch this
|
||||
..()
|
||||
explode()
|
||||
|
||||
/obj/machinery/meteor_battery
|
||||
name = "meteor battery"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/meteor_turret.dmi'
|
||||
icon_state = "turret0"
|
||||
var/raised = 0
|
||||
var/enabled = 1
|
||||
anchored = 1
|
||||
layer = 3
|
||||
invisibility = 2
|
||||
density = 1
|
||||
var/health = 18
|
||||
var/id = ""
|
||||
var/obj/machinery/turretcover/cover = null
|
||||
var/popping = 0
|
||||
var/wasvalid = 0
|
||||
var/lastfired = 0
|
||||
var/shot_delay = 50
|
||||
var/datum/effect/effect/system/spark_spread/spark_system
|
||||
use_power = 1
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 300
|
||||
var/atom/movable/cur_target
|
||||
var/targeting_active = 0
|
||||
var/protect_range = 30
|
||||
var/tracking_missiles = 0
|
||||
var/list/fired_missiles
|
||||
|
||||
/obj/machinery/meteor_battery/New()
|
||||
spark_system = new /datum/effect/effect/system/spark_spread
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
fired_missiles = new/list()
|
||||
// targets = new
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/isPopping()
|
||||
return (popping!=0)
|
||||
|
||||
/obj/machinery/meteor_battery/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.enabled)
|
||||
icon_state = "turret1"
|
||||
else
|
||||
icon_state = "turret0"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "turret0"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/meteor_battery/proc/setState(var/enabled)
|
||||
src.enabled = enabled
|
||||
src.power_change()
|
||||
|
||||
/obj/machinery/meteor_battery/proc/get_new_target()
|
||||
var/list/new_targets = new
|
||||
var/new_target
|
||||
for(var/obj/effect/meteor/M in view(protect_range, get_turf(src)))
|
||||
new_targets += M
|
||||
if(new_targets.len)
|
||||
new_target = pick(new_targets)
|
||||
return new_target
|
||||
|
||||
/obj/machinery/meteor_battery/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(src.cover==null)
|
||||
src.cover = new /obj/machinery/turretcover(src.loc)
|
||||
src.cover.host = src
|
||||
if(!enabled)
|
||||
if(!isDown() && !isPopping())
|
||||
popDown()
|
||||
return
|
||||
|
||||
//update our missiles
|
||||
for(var/obj/item/projectile/missile/M in fired_missiles)
|
||||
if(!M)
|
||||
fired_missiles.Remove(M)
|
||||
continue
|
||||
if(tracking_missiles && cur_target)
|
||||
//update homing missile target
|
||||
M.target = get_turf(cur_target)
|
||||
walk_towards(M, M.target, MISSILE_SPEED)
|
||||
|
||||
if(get_turf(M) == M.target && M)
|
||||
//missile has arrived at destination
|
||||
fired_missiles.Remove(M)
|
||||
if( istype(get_turf(M), /turf/space) )
|
||||
//send the missile shooting off into the distance
|
||||
walk(M, get_dir(src,M), MISSILE_SPEED)
|
||||
spawn(rand(3,10) * 10)
|
||||
if(M)
|
||||
M.explode()
|
||||
else if(rand(3) == 3)
|
||||
//chance to blow up later (between 4 seconds and 2 minutes), or just sit there being ominous
|
||||
spawn(rand(4,120) * 10)
|
||||
M.explode()
|
||||
for(var/mob/P in view(7))
|
||||
P.visible_message("\red The missile skids to a halt, vibrating and sparking ominously!")
|
||||
|
||||
if(!cur_target)
|
||||
cur_target = get_new_target() //get new target
|
||||
|
||||
if(cur_target) //if it's found, proceed
|
||||
if(!isPopping())
|
||||
if(isDown())
|
||||
popUp()
|
||||
use_power = 2
|
||||
else
|
||||
spawn()
|
||||
if(!targeting_active)
|
||||
targeting_active = 1
|
||||
target()
|
||||
targeting_active = 0
|
||||
else if(!isPopping())//else, pop down
|
||||
if(!isDown())
|
||||
popDown()
|
||||
use_power = 1
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/target()
|
||||
while(src && enabled && !stat)
|
||||
src.set_dir(get_dir(src, cur_target))
|
||||
shootAt(cur_target)
|
||||
sleep(shot_delay)
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/shootAt(var/atom/movable/target)
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/U = get_turf(target)
|
||||
if (!T || !U)
|
||||
return
|
||||
use_power(500)
|
||||
var/obj/item/projectile/missile/A = new(T)
|
||||
A.tracking = tracking_missiles
|
||||
fired_missiles.Add(A)
|
||||
spawn(0)
|
||||
A.process(U)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/meteor_battery/proc/isDown()
|
||||
return (invisibility!=0)
|
||||
|
||||
/obj/machinery/meteor_battery/proc/popUp()
|
||||
if ((!isPopping()) || src.popping==-1)
|
||||
invisibility = 0
|
||||
popping = 1
|
||||
if (src.cover!=null)
|
||||
flick("popup", src.cover)
|
||||
src.cover.icon_state = "openTurretCover"
|
||||
spawn(10)
|
||||
if (popping==1) popping = 0
|
||||
|
||||
/obj/machinery/meteor_battery/proc/popDown()
|
||||
if ((!isPopping()) || src.popping==1)
|
||||
popping = -1
|
||||
if (src.cover!=null)
|
||||
flick("popdown", src.cover)
|
||||
src.cover.icon_state = "turretCover"
|
||||
spawn(10)
|
||||
if (popping==-1)
|
||||
invisibility = 2
|
||||
popping = 0
|
||||
|
||||
/obj/machinery/meteor_battery/bullet_act(var/obj/item/projectile/Proj)
|
||||
src.health -= Proj.damage
|
||||
..()
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N
|
||||
..()
|
||||
playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1)
|
||||
src.spark_system.start()
|
||||
src.health -= W.force * 0.5
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
enabled = 0
|
||||
power_change()
|
||||
..()
|
||||
|
||||
/obj/machinery/meteor_battery/ex_act(severity)
|
||||
if(severity < 3)
|
||||
src.die()
|
||||
|
||||
/obj/machinery/meteor_battery/proc/die()
|
||||
src.health = 0
|
||||
src.density = 0
|
||||
src.stat |= BROKEN
|
||||
src.icon_state = "broke"
|
||||
if (cover!=null)
|
||||
del(cover)
|
||||
sleep(3)
|
||||
flick("explosion", src)
|
||||
spawn(13)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/meteor_battery/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if(!(stat & BROKEN))
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
|
||||
src.health -= 15
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
else
|
||||
M << "\green That object is useless to you."
|
||||
return
|
||||
@@ -1,262 +0,0 @@
|
||||
|
||||
//sculpture
|
||||
//SCP-173, nothing more need be said
|
||||
/mob/living/simple_animal/sculpture
|
||||
name = "\improper sculpture"
|
||||
real_name = "sculpture"
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. "
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/unknown.dmi'
|
||||
icon_state = "sculpture"
|
||||
icon_living = "sculpture"
|
||||
icon_dead = "sculpture"
|
||||
emote_hear = list("makes a faint scraping sound")
|
||||
emote_see = list("twitches slightly", "shivers")
|
||||
response_help = "touches the"
|
||||
response_disarm = "pushes the"
|
||||
response_harm = "hits the"
|
||||
var/obj/item/weapon/grab/G
|
||||
var/observed = 0
|
||||
var/allow_escape = 0 //set this to 1 for src to drop it's target next Life() call and try to escape
|
||||
var/hibernate = 0
|
||||
var/random_escape_chance = 0.5
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/GrabMob(var/mob/living/target)
|
||||
if(target && target != src && ishuman(target))
|
||||
G = new /obj/item/weapon/grab(target)
|
||||
G.assailant = src
|
||||
G.layer = 20
|
||||
G.affecting = target
|
||||
G.synch()
|
||||
target.LAssailant = src
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red [src] has grabbed [target]!")
|
||||
target << "\red <b>You feel something suddenly grab you around the neck from behind!</b> Everything goes black..."
|
||||
|
||||
G.state = 3
|
||||
G.killing = 1
|
||||
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. [G ? "\red The sculpture is holding [G.affecting] in a vice-like grip." : ""]"
|
||||
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been grabbed by SCP-173, and is being strangled!</font>")
|
||||
log_admin("[target] ([target.ckey]) has been grabbed and is being strangled by SCP-173.")
|
||||
message_admins("Alert: [target.real_name] has been grabbed and is being strangled by SCP-173. Set var/allow_escape = 1 to allow this player to escape temporarily, or var/hibernate = 1 to disable it entirely.")
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/Escape()
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(50,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
src.set_dir(get_dir(src, target_turf))
|
||||
src.loc = target_turf
|
||||
|
||||
hibernate = 1
|
||||
spawn(rand(20,35) * 10)
|
||||
hibernate = 0
|
||||
|
||||
/mob/living/simple_animal/sculpture/Life()
|
||||
|
||||
observed = 0
|
||||
|
||||
//update the desc
|
||||
if(!G)
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid."
|
||||
|
||||
//if we are sent into forced hibernation mode, allow our victim to escape
|
||||
if(hibernate && G && G.killing == 1)
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.killing = 0
|
||||
G.state = 1
|
||||
return
|
||||
|
||||
//
|
||||
if(allow_escape)
|
||||
allow_escape = 0
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.killing = 0
|
||||
G.state = 1
|
||||
if(!observed)
|
||||
Escape()
|
||||
observed = 1
|
||||
|
||||
//can't do anything in space at all
|
||||
if(istype(get_turf(src), /turf/space) || hibernate)
|
||||
return
|
||||
|
||||
for(var/mob/living/M in view(7, src))
|
||||
if(M.stat || M == src)
|
||||
continue
|
||||
var/xdif = M.x - src.x
|
||||
var/ydif = M.y - src.y
|
||||
if(abs(xdif) < abs(ydif))
|
||||
//mob is either above or below src
|
||||
if(ydif < 0 && M.dir == NORTH)
|
||||
//mob is below src and looking up
|
||||
observed = 1
|
||||
break
|
||||
else if(ydif > 0 && M.dir == SOUTH)
|
||||
//mob is above src and looking down
|
||||
observed = 1
|
||||
break
|
||||
else if(abs(xdif) > abs(ydif))
|
||||
//mob is either left or right of src
|
||||
if(xdif < 0 && M.dir == EAST)
|
||||
//mob is to the left of src and looking right
|
||||
observed = 1
|
||||
break
|
||||
else if(xdif > 0 && M.dir == WEST)
|
||||
//mob is to the right of src and looking left
|
||||
observed = 1
|
||||
break
|
||||
else if (xdif == 0 && ydif == 0)
|
||||
//mob is on the same tile as src
|
||||
observed = 1
|
||||
break
|
||||
|
||||
//account for darkness
|
||||
var/turf/T = get_turf(src)
|
||||
var/in_darkness = 0
|
||||
if(T.luminosity == 0 && !istype(T, /turf/simulated))
|
||||
in_darkness = 1
|
||||
|
||||
//see if we're able to do stuff
|
||||
if(!observed || in_darkness)
|
||||
if(G)
|
||||
if(prob(random_escape_chance))
|
||||
//chance to allow the stranglee to escape
|
||||
allow_escape = 1
|
||||
if(G.affecting.stat == 2)
|
||||
del G
|
||||
else if(!G)
|
||||
//see if we're able to strangle anyone
|
||||
var/turf/myTurf = get_turf(src)
|
||||
for(var/mob/living/M in myTurf)
|
||||
GrabMob(M)
|
||||
if(G)
|
||||
break
|
||||
|
||||
//find out what mobs we can see
|
||||
var/list/incapacitated = list()
|
||||
var/list/conscious = list()
|
||||
for(var/mob/living/carbon/M in view(7, src))
|
||||
//this may not be quite the right test
|
||||
if(M == src)
|
||||
continue
|
||||
if(M.stat == 1)
|
||||
incapacitated.Add(M)
|
||||
else if(!M.stat)
|
||||
conscious.Add(M)
|
||||
|
||||
//pick the nearest valid conscious target
|
||||
var/mob/living/carbon/target_mob
|
||||
for(var/mob/living/carbon/M in conscious)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
|
||||
if(!target_mob)
|
||||
//get an unconscious mob
|
||||
for(var/mob/living/carbon/M in incapacitated)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
if(target_mob)
|
||||
var/turf/target_turf
|
||||
if(in_darkness)
|
||||
//move to right behind them
|
||||
target_turf = get_step(target_mob, src)
|
||||
else
|
||||
//move to them really really fast and knock them down
|
||||
target_turf = get_turf(target_mob)
|
||||
|
||||
//rampage along a path to get to them, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_mob)
|
||||
var/num_turfs = get_dist(src,target_mob)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.ex_act(2)
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.set_dir(get_dir(src, target_mob))
|
||||
next_turf = get_step(src, get_dir(next_turf,target_mob))
|
||||
num_turfs--
|
||||
|
||||
//if we reached them, knock them down and start strangling them
|
||||
if(get_turf(src) == target_turf)
|
||||
target_mob.Stun(1)
|
||||
target_mob.Paralyse(1)
|
||||
GrabMob(target_mob)
|
||||
|
||||
//if we're not strangling anyone, take a stroll
|
||||
if(!G && prob(10))
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(7,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
|
||||
//rampage along a path to get to it, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_turf)
|
||||
var/num_turfs = get_dist(src,target_turf)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.ex_act(2)
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.set_dir(get_dir(src, target_mob))
|
||||
next_turf = get_step(src, get_dir(next_turf,target_turf))
|
||||
num_turfs--
|
||||
else if(G)
|
||||
//we can't move while observed, so we can't effectively strangle any more
|
||||
//our grip is still rock solid, but the victim has a chance to escape
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.state = 1
|
||||
G.killing = 0
|
||||
|
||||
/mob/living/simple_animal/sculpture/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bump(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bumped(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/ex_act(var/severity)
|
||||
//nothing
|
||||
@@ -1,590 +0,0 @@
|
||||
/mob/living/carbon/amorph
|
||||
name = "amorph"
|
||||
real_name = "amorph"
|
||||
voice_name = "amorph"
|
||||
icon = 'icons/mob/amorph.dmi'
|
||||
icon_state = ""
|
||||
|
||||
|
||||
var/species = "Amorph"
|
||||
age = 30.0
|
||||
|
||||
var/used_skillpoints = 0
|
||||
var/skill_specialization = null
|
||||
var/list/skills = null
|
||||
|
||||
var/obj/item/l_ear = null
|
||||
|
||||
// might use this later to recolor armorphs with icon.SwapColor
|
||||
var/slime_color = null
|
||||
|
||||
var/examine_text = ""
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/New()
|
||||
|
||||
..()
|
||||
|
||||
// Amorphs don't have a blood vessel, but they can have reagents in their body
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
// Amorphs have no DNA(they're more like carbon-based machines)
|
||||
|
||||
// Amorphs don't have organs
|
||||
..()
|
||||
|
||||
/mob/living/carbon/amorph/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
return
|
||||
now_pushing = 1
|
||||
if (ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
|
||||
//BubbleWrap - Should stop you pushing a restrained person out of the way
|
||||
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
|
||||
for(var/mob/M in range(tmob, 1))
|
||||
if( ((M.pulling == tmob && ( tmob.restrained() && !( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, tmob.grabbed_by.len)) )
|
||||
if ( !(world.time % 5) )
|
||||
src << "\red [tmob] is restrained, you cannot push past"
|
||||
now_pushing = 0
|
||||
return
|
||||
if( tmob.pulling == M && ( M.restrained() && !( tmob.restrained() ) && tmob.stat == 0) )
|
||||
if ( !(world.time % 5) )
|
||||
src << "\red [tmob] is restraining [M], you cannot push past"
|
||||
now_pushing = 0
|
||||
return
|
||||
|
||||
//BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
|
||||
if((tmob.a_intent == "help" || tmob.restrained()) && (a_intent == "help" || src.restrained()) && tmob.canmove && canmove) // mutual brohugs all around!
|
||||
var/turf/oldloc = loc
|
||||
loc = tmob.loc
|
||||
tmob.loc = oldloc
|
||||
now_pushing = 0
|
||||
for(var/mob/living/carbon/metroid/Metroid in view(1,tmob))
|
||||
if(Metroid.Victim == tmob)
|
||||
Metroid.UpdateFeed()
|
||||
return
|
||||
|
||||
if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
|
||||
if(prob(99))
|
||||
now_pushing = 0
|
||||
return
|
||||
if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
|
||||
if(prob(99))
|
||||
now_pushing = 0
|
||||
return
|
||||
if(tmob.nopush)
|
||||
now_pushing = 0
|
||||
return
|
||||
|
||||
tmob.LAssailant = src
|
||||
|
||||
now_pushing = 0
|
||||
spawn(0)
|
||||
..()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
if (!now_pushing)
|
||||
now_pushing = 1
|
||||
|
||||
if (!AM.anchored)
|
||||
var/t = get_dir(src, AM)
|
||||
if (istype(AM, /obj/structure/window))
|
||||
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(AM,t))
|
||||
now_pushing = 0
|
||||
return
|
||||
step(AM, t)
|
||||
now_pushing = 0
|
||||
return
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/movement_delay()
|
||||
var/tally = 2 // amorphs are a bit slower than humans
|
||||
var/mob/M = pulling
|
||||
|
||||
if(reagents.has_reagent("hyperzine")) return -1
|
||||
|
||||
if(reagents.has_reagent("nuka_cola")) return -1
|
||||
|
||||
if(analgesic) return -1
|
||||
|
||||
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
|
||||
|
||||
var/health_deficiency = traumatic_shock
|
||||
if(health_deficiency >= 40) tally += (health_deficiency / 25)
|
||||
|
||||
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
|
||||
if (hungry >= 70) tally += hungry/300
|
||||
|
||||
if (bodytemperature < 283.222)
|
||||
tally += (283.222 - bodytemperature) / 10 * 1.75
|
||||
if (stuttering < 10)
|
||||
stuttering = 10
|
||||
|
||||
if(shock_stage >= 10) tally += 3
|
||||
|
||||
if(tally < 0)
|
||||
tally = 0
|
||||
|
||||
if(istype(M) && M.lying) //Pulling lying down people is slower
|
||||
tally += 3
|
||||
|
||||
if(mRun in mutations)
|
||||
tally = 0
|
||||
|
||||
return tally
|
||||
|
||||
/mob/living/carbon/amorph/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
|
||||
stat(null, "Intent: [a_intent]")
|
||||
stat(null, "Move Mode: [m_intent]")
|
||||
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
|
||||
if(ticker.mode:malf_mode_declared)
|
||||
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
||||
if(emergency_shuttle)
|
||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
||||
var/timeleft = emergency_shuttle.timeleft()
|
||||
if (timeleft)
|
||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||
|
||||
if (client.statpanel == "Status")
|
||||
if (internal)
|
||||
if (!internal.air_contents)
|
||||
del(internal)
|
||||
else
|
||||
stat("Internal Atmosphere Info", internal.name)
|
||||
stat("Tank Pressure", internal.air_contents.return_pressure())
|
||||
stat("Distribution Pressure", internal.distribute_pressure)
|
||||
if (mind)
|
||||
if (mind.special_role == "Changeling" && changeling)
|
||||
stat("Chemical Storage", changeling.chem_charges)
|
||||
stat("Genetic Damage Time", changeling.geneticdamage)
|
||||
|
||||
/mob/living/carbon/amorph/ex_act(severity)
|
||||
flick("flash", flash)
|
||||
|
||||
var/shielded = 0
|
||||
var/b_loss = null
|
||||
var/f_loss = null
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
b_loss += 500
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
gib()
|
||||
return
|
||||
else
|
||||
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
|
||||
throw_at(target, 200, 4)
|
||||
|
||||
if (2.0)
|
||||
if (!shielded)
|
||||
b_loss += 60
|
||||
|
||||
f_loss += 60
|
||||
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
b_loss = b_loss/1.5
|
||||
f_loss = f_loss/1.5
|
||||
|
||||
if(3.0)
|
||||
b_loss += 30
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
b_loss = b_loss/2
|
||||
if (prob(50) && !shielded)
|
||||
Paralyse(10)
|
||||
|
||||
src.bruteloss += b_loss
|
||||
src.fireloss += f_loss
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/blob_act()
|
||||
if(stat == 2) return
|
||||
show_message("\red The blob attacks you!")
|
||||
src.bruteloss += rand(30,40)
|
||||
UpdateDamageIcon()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/u_equip(obj/item/W as obj)
|
||||
// These are the only slots an amorph has
|
||||
if (W == l_ear)
|
||||
l_ear = null
|
||||
else if (W == r_hand)
|
||||
r_hand = null
|
||||
|
||||
update_clothing()
|
||||
|
||||
/mob/living/carbon/amorph/db_click(text, t1)
|
||||
var/obj/item/W = equipped()
|
||||
var/emptyHand = (W == null)
|
||||
if ((!emptyHand) && (!istype(W, /obj/item)))
|
||||
return
|
||||
if (emptyHand)
|
||||
usr.next_move = usr.prev_move
|
||||
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
|
||||
switch(text)
|
||||
if("l_ear")
|
||||
if (l_ear)
|
||||
if (emptyHand)
|
||||
l_ear.DblClick()
|
||||
return
|
||||
else if(emptyHand)
|
||||
return
|
||||
if (!( istype(W, /obj/item/clothing/ears) ) && !( istype(W, /obj/item/device/radio/headset) ) && W.w_class != 1)
|
||||
return
|
||||
u_equip(W)
|
||||
l_ear = W
|
||||
W.equipped(src, text)
|
||||
|
||||
update_clothing()
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/meteorhit(O as obj)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message(text("\red [] has been hit by []", src, O), 1)
|
||||
if (health > 0)
|
||||
if (istype(O, /obj/effect/immovablerod))
|
||||
src.bruteloss += 101
|
||||
else
|
||||
src.bruteloss += 25
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/Move(a, b, flag)
|
||||
|
||||
if (buckled)
|
||||
return
|
||||
|
||||
if (restrained())
|
||||
pulling = null
|
||||
|
||||
|
||||
var/t7 = 1
|
||||
if (restrained())
|
||||
for(var/mob/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
|
||||
var/turf/T = loc
|
||||
. = ..()
|
||||
|
||||
if (pulling && pulling.loc)
|
||||
if(!( isturf(pulling.loc) ))
|
||||
pulling = null
|
||||
return
|
||||
else
|
||||
if(Debug)
|
||||
diary <<"pulling disappeared? at [__LINE__] in mob.dm - pulling = [pulling]"
|
||||
diary <<"REPORT THIS"
|
||||
|
||||
/////
|
||||
if(pulling && pulling.anchored)
|
||||
pulling = null
|
||||
return
|
||||
|
||||
if (!restrained())
|
||||
var/diag = get_dir(src, pulling)
|
||||
if ((diag - 1) & diag)
|
||||
else
|
||||
diag = null
|
||||
if ((get_dist(src, pulling) > 1 || diag))
|
||||
if (ismob(pulling))
|
||||
var/mob/M = pulling
|
||||
var/ok = 1
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by))
|
||||
if (prob(75))
|
||||
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
|
||||
if (istype(G, /obj/item/weapon/grab))
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
|
||||
//G = null
|
||||
del(G)
|
||||
else
|
||||
ok = 0
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
|
||||
ok = 0
|
||||
if (ok)
|
||||
var/t = M.pulling
|
||||
M.pulling = null
|
||||
|
||||
//this is the gay blood on floor shit -- Added back -- Skie
|
||||
if (M.lying && (prob(M.getBruteLoss() / 6)))
|
||||
var/turf/location = M.loc
|
||||
if (istype(location, /turf/simulated))
|
||||
location.add_blood(M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/H = M
|
||||
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
|
||||
if(blood_volume > 0)
|
||||
H:vessel.remove_reagent("blood",1)
|
||||
if(prob(5))
|
||||
M.adjustBruteLoss(1)
|
||||
visible_message("\red \The [M]'s wounds open more from being dragged!")
|
||||
if(M.pull_damage())
|
||||
if(prob(25))
|
||||
M.adjustBruteLoss(2)
|
||||
visible_message("\red \The [M]'s wounds worsen terribly from being dragged!")
|
||||
var/turf/location = M.loc
|
||||
if (istype(location, /turf/simulated))
|
||||
location.add_blood(M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/H = M
|
||||
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
|
||||
if(blood_volume > 0)
|
||||
H:vessel.remove_reagent("blood",1)
|
||||
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
M.pulling = t
|
||||
else
|
||||
if (pulling)
|
||||
if (istype(pulling, /obj/structure/window))
|
||||
if(pulling:ini_dir == NORTHWEST || pulling:ini_dir == NORTHEAST || pulling:ini_dir == SOUTHWEST || pulling:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
|
||||
pulling = null
|
||||
if (pulling)
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
else
|
||||
pulling = null
|
||||
. = ..()
|
||||
if ((s_active && !( s_active in contents ) ))
|
||||
s_active.close(src)
|
||||
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
M.UpdateFeed(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/proc/misc_clothing_updates()
|
||||
// Temporary proc to shove stuff in that was put into update_clothing()
|
||||
// for questionable reasons
|
||||
|
||||
if (client)
|
||||
if (i_select)
|
||||
if (intent)
|
||||
client.screen += hud_used.intents
|
||||
|
||||
var/list/L = dd_text2list(intent, ",")
|
||||
L[1] += ":-11"
|
||||
i_select.screen_loc = dd_list2text(L,",") //ICONS4
|
||||
else
|
||||
i_select.screen_loc = null
|
||||
if (m_select)
|
||||
if (m_int)
|
||||
client.screen += hud_used.mov_int
|
||||
|
||||
var/list/L = dd_text2list(m_int, ",")
|
||||
L[1] += ":-11"
|
||||
m_select.screen_loc = dd_list2text(L,",") //ICONS4
|
||||
else
|
||||
m_select.screen_loc = null
|
||||
|
||||
// Probably a lazy way to make sure all items are on the screen exactly once
|
||||
if (client)
|
||||
client.screen -= contents
|
||||
client.screen += contents
|
||||
|
||||
/mob/living/carbon/amorph/rebuild_appearance()
|
||||
// Lazy method: Just rebuild everything.
|
||||
// This can be called when the mob is created, but on other occasions, rebuild_body_overlays(),
|
||||
// rebuild_clothing_overlays() etc. should be called individually.
|
||||
|
||||
misc_clothing_updates() // silly stuff
|
||||
|
||||
/mob/living/carbon/amorph/update_body_appearance()
|
||||
// Should be called whenever something about the body appearance itself changes.
|
||||
|
||||
misc_clothing_updates() // silly stuff
|
||||
|
||||
if(lying)
|
||||
icon_state = "lying"
|
||||
else
|
||||
icon_state = "standing"
|
||||
|
||||
/mob/living/carbon/amorph/update_lying()
|
||||
// Should be called whenever something about the lying status of the mob might have changed.
|
||||
|
||||
if(lying)
|
||||
icon_state = "lying"
|
||||
else
|
||||
icon_state = "standing"
|
||||
|
||||
/mob/living/carbon/amorph/hand_p(mob/M as mob)
|
||||
// not even sure what this is meant to do
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/restrained()
|
||||
if (handcuffed)
|
||||
return 0 // handcuffs don't work on amorphs
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/var/co2overloadtime = null
|
||||
/mob/living/carbon/amorph/var/temperature_resistance = T0C+75
|
||||
|
||||
/mob/living/carbon/amorph/show_inv(mob/user as mob)
|
||||
// TODO: add a window for extracting stuff from an amorph's mouth
|
||||
|
||||
// called when something steps onto an amorph
|
||||
// this could be made more general, but for now just handle mulebot
|
||||
/mob/living/carbon/amorph/HasEntered(var/atom/movable/AM)
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
if(istype(MB))
|
||||
MB.RunOver(src)
|
||||
|
||||
//gets assignment from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/amorph/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
|
||||
// TODO: get the ID from the amorph's contents
|
||||
return
|
||||
|
||||
//gets name from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/amorph/proc/get_authentification_name(var/if_no_id = "Unknown")
|
||||
// TODO: get the ID from the amorph's contents
|
||||
return
|
||||
|
||||
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
|
||||
/mob/living/carbon/amorph/proc/get_visible_name()
|
||||
// amorphs can't wear clothes or anything, so always return face_name
|
||||
return get_face_name()
|
||||
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
/mob/living/carbon/amorph/proc/get_face_name()
|
||||
// there might later be ways for amorphs to change the appearance of their face
|
||||
return "[real_name]"
|
||||
|
||||
|
||||
//gets ID card object from special clothes slot or null.
|
||||
/mob/living/carbon/amorph/proc/get_idcard()
|
||||
// TODO: get the ID from the amorph's contents
|
||||
|
||||
|
||||
// heal the amorph
|
||||
/mob/living/carbon/amorph/heal_overall_damage(var/brute, var/burn)
|
||||
bruteloss -= brute
|
||||
fireloss -= burn
|
||||
bruteloss = max(bruteloss, 0)
|
||||
fireloss = max(fireloss, 0)
|
||||
|
||||
updatehealth()
|
||||
UpdateDamageIcon()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/carbon/amorph/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
|
||||
bruteloss += brute
|
||||
fireloss += burn
|
||||
|
||||
updatehealth()
|
||||
UpdateDamageIcon()
|
||||
|
||||
/mob/living/carbon/amorph/Topic(href, href_list)
|
||||
if (href_list["refresh"])
|
||||
if((machine)&&(in_range(src, usr)))
|
||||
show_inv(machine)
|
||||
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[]", href_list["mach_close"])
|
||||
machine = null
|
||||
src << browse(null, t1)
|
||||
|
||||
if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = usr
|
||||
O.target = src
|
||||
O.item = usr.equipped()
|
||||
O.s_loc = usr.loc
|
||||
O.t_loc = loc
|
||||
O.place = href_list["item"]
|
||||
if(href_list["loc"])
|
||||
O.internalloc = href_list["loc"]
|
||||
requests += O
|
||||
spawn( 0 )
|
||||
O.process()
|
||||
return
|
||||
|
||||
if (href_list["criminal"])
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
var/perpname = "wot"
|
||||
var/modified = 0
|
||||
|
||||
/*if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else*/
|
||||
perpname = src.name
|
||||
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
|
||||
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
|
||||
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
if(setcriminal != "Cancel")
|
||||
R.fields["criminal"] = setcriminal
|
||||
modified = 1
|
||||
|
||||
spawn()
|
||||
H.handle_regular_hud_updates()
|
||||
|
||||
if(!modified)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
///eyecheck()
|
||||
///Returns a number between -1 to 2
|
||||
/mob/living/carbon/amorph/eyecheck()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/IsAdvancedToolUser()
|
||||
return 1//Amorphs can use guns and such
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/updatehealth()
|
||||
if(src.nodamage)
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
return
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss() - src.getCloneLoss() -src.halloss
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/abiotic(var/full_body = 0)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/abiotic2(var/full_body2 = 0)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/getBruteLoss()
|
||||
return src.bruteloss
|
||||
|
||||
/mob/living/carbon/amorph/adjustBruteLoss(var/amount, var/used_weapon = null)
|
||||
src.bruteloss += amount
|
||||
if(bruteloss < 0) bruteloss = 0
|
||||
|
||||
/mob/living/carbon/amorph/getFireLoss()
|
||||
return src.fireloss
|
||||
|
||||
/mob/living/carbon/amorph/adjustFireLoss(var/amount,var/used_weapon = null)
|
||||
src.fireloss += amount
|
||||
if(fireloss < 0) fireloss = 0
|
||||
|
||||
/mob/living/carbon/amorph/get_visible_gender()
|
||||
return gender
|
||||
@@ -1,246 +0,0 @@
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if ("help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
if (health > 0)
|
||||
attacked += 10
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
|
||||
adjustBruteLoss(rand(0, 1))
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/attack_hand(mob/living/carbon/human/M as mob)
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.charge -= 2500
|
||||
Weaken(5)
|
||||
if (stuttering < 5)
|
||||
stuttering = 5
|
||||
Stun(5)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if (O.client)
|
||||
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall", 2)
|
||||
return
|
||||
else
|
||||
M << "\red Not enough charge! "
|
||||
return
|
||||
|
||||
if (M.a_intent == "help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (M.a_intent == "hurt")
|
||||
var/attack_verb
|
||||
switch(M.mutantrace)
|
||||
if("lizard")
|
||||
attack_verb = "scratch"
|
||||
if("plant")
|
||||
attack_verb = "slash"
|
||||
else
|
||||
attack_verb = "punch"
|
||||
|
||||
if(M.type == /mob/living/carbon/human/tajaran)
|
||||
attack_verb = "slash"
|
||||
|
||||
if ((prob(75) && health > 0))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has [attack_verb]ed [name]!</B>", M), 1)
|
||||
|
||||
var/damage = rand(5, 10)
|
||||
if(M.type != /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
else if(M.type == /mob/living/carbon/human/tajaran)
|
||||
damage += 10
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
adjustBruteLoss(damage/10)
|
||||
updatehealth()
|
||||
else
|
||||
if(M.type != /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
else if(M.type == /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to [attack_verb] [name]!</B>", M), 1)
|
||||
else
|
||||
if (M.a_intent == "grab")
|
||||
if (M == src)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
|
||||
|
||||
else
|
||||
if (!( paralysis ))
|
||||
drop_item()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
|
||||
if ("hurt")
|
||||
if ((prob(95) && health > 0))
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has slashed [name]!</B>", M), 1)
|
||||
adjustBruteLoss(damage/10)
|
||||
updatehealth()
|
||||
react_to_attack(M)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
|
||||
|
||||
if ("disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
var/damage = 5
|
||||
if(prob(95))
|
||||
Weaken(rand(10,15))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down [name]!</B>", M), 1)
|
||||
else
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
react_to_attack(M)
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
bruteloss += damage
|
||||
|
||||
/mob/living/carbon/amorph/attack_metroid(mob/living/carbon/metroid/M as mob)
|
||||
if(M.Victim) return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>The [M.name] has [pick("bit","slashed")] []!</B>", src), 1)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/metroid/adult))
|
||||
damage = rand(10, 35)
|
||||
else
|
||||
damage = rand(5, 25)
|
||||
|
||||
src.cloneloss += damage
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
var/power = M.powerlevel + rand(0,3)
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2) stunprob = 20
|
||||
if(3 to 4) stunprob = 30
|
||||
if(5 to 6) stunprob = 40
|
||||
if(7 to 8) stunprob = 60
|
||||
if(9) stunprob = 70
|
||||
if(10) stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>The [M.name] has shocked []!</B>", src), 1)
|
||||
|
||||
Weaken(power)
|
||||
if (stuttering < power)
|
||||
stuttering = power
|
||||
Stun(power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustFireLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
@@ -1,12 +0,0 @@
|
||||
/mob/living/carbon/amorph/proc/HealDamage(zone, brute, burn)
|
||||
return heal_overall_damage(brute, burn)
|
||||
|
||||
/mob/living/carbon/amorph/UpdateDamageIcon()
|
||||
// no damage sprites for amorphs yet
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/used_weapon = null)
|
||||
if(damagetype == BRUTE)
|
||||
take_overall_damage(damage, 0)
|
||||
else
|
||||
take_overall_damage(0, damage)
|
||||
@@ -1,318 +0,0 @@
|
||||
/obj/hud/proc/amorph_hud(var/ui_style='icons/mob/screen1_old.dmi')
|
||||
|
||||
src.adding = list( )
|
||||
src.other = list( )
|
||||
src.intents = list( )
|
||||
src.mon_blo = list( )
|
||||
src.m_ints = list( )
|
||||
src.mov_int = list( )
|
||||
src.vimpaired = list( )
|
||||
src.darkMask = list( )
|
||||
src.intent_small_hud_objects = list( )
|
||||
|
||||
src.g_dither = new /obj/screen( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon = ui_style
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new /obj/screen(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon = ui_style
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new /obj/screen( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon = ui_style
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new /obj/screen( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon = ui_style
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "act_intent"
|
||||
using.set_dir(SOUTHWEST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
//intent small hud objects
|
||||
var/icon/ico
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
|
||||
//end intent small hud objects
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mov_intent"
|
||||
using.set_dir(SOUTHWEST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
move_intent = using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "drop"
|
||||
using.icon = ui_style
|
||||
using.icon_state = "act_drop"
|
||||
using.screen_loc = ui_dropbutton
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "r_hand"
|
||||
using.set_dir(WEST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_rhand
|
||||
using.layer = 19
|
||||
src.r_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "l_hand"
|
||||
using.set_dir(EAST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && mymob.hand) //This being 1 means the left hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_lhand
|
||||
using.layer = 19
|
||||
src.l_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.set_dir(SOUTH)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand1"
|
||||
using.screen_loc = ui_swaphand1
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.set_dir(SOUTH)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand2"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mask"
|
||||
using.set_dir(NORTH)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_monkey_mask
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "back"
|
||||
using.set_dir(NORTHEAST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_back
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "1,1 to 5,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "5,1 to 10,5"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "6,11 to 10,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "11,1 to 15,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = ui_style
|
||||
mymob.throw_icon.icon_state = "act_throw_off"
|
||||
mymob.throw_icon.name = "throw"
|
||||
mymob.throw_icon.screen_loc = ui_throw
|
||||
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = ui_style
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.pressure = new /obj/screen( null )
|
||||
mymob.pressure.icon = ui_style
|
||||
mymob.pressure.icon_state = "pressure0"
|
||||
mymob.pressure.name = "pressure"
|
||||
mymob.pressure.screen_loc = ui_pressure
|
||||
|
||||
mymob.toxin = new /obj/screen( null )
|
||||
mymob.toxin.icon = ui_style
|
||||
mymob.toxin.icon_state = "tox0"
|
||||
mymob.toxin.name = "toxin"
|
||||
mymob.toxin.screen_loc = ui_toxin
|
||||
|
||||
mymob.internals = new /obj/screen( null )
|
||||
mymob.internals.icon = ui_style
|
||||
mymob.internals.icon_state = "internal0"
|
||||
mymob.internals.name = "internal"
|
||||
mymob.internals.screen_loc = ui_internal
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = ui_style
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon = ui_style
|
||||
mymob.bodytemp.icon_state = "temp1"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = ui_style
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = ui_style
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = ui_style
|
||||
mymob.blind.icon_state = "blackanimate"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1 to 15,15"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = ui_style
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.set_dir(2)
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.set_dir(1)
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.set_dir(1)
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.set_dir(1)
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
//, mymob.i_select, mymob.m_select
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach, mymob.hands, )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
|
||||
|
||||
return
|
||||
@@ -1,516 +0,0 @@
|
||||
/mob/living/carbon/amorph
|
||||
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
|
||||
|
||||
var/oxygen_alert = 0
|
||||
var/phoron_alert = 0
|
||||
var/fire_alert = 0
|
||||
|
||||
var/temperature_alert = 0
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
|
||||
if(src.loc)
|
||||
environment = loc.return_air()
|
||||
|
||||
if (src.stat != 2) //still breathing
|
||||
|
||||
//First, resolve location and get a breath
|
||||
|
||||
if(air_master.current_cycle%4==2)
|
||||
//Only try to take a breath every 4 seconds, unless suffocating
|
||||
breathe()
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
//Disease Check
|
||||
handle_virus_updates()
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
if(environment) // More error checking -- TLE
|
||||
handle_environment(environment)
|
||||
|
||||
//Mutations and radiation
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
//Chemicals in the body
|
||||
handle_chemicals_in_body()
|
||||
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Status updates, death etc.
|
||||
// UpdateLuminosity()
|
||||
handle_regular_status_updates()
|
||||
|
||||
if(client)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
//Being buckled to a chair or bed
|
||||
check_if_buckled()
|
||||
|
||||
// Yup.
|
||||
update_canmove()
|
||||
|
||||
clamp_values()
|
||||
|
||||
// Grabbing
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
|
||||
/mob/living/carbon/amorph
|
||||
proc
|
||||
|
||||
clamp_values()
|
||||
|
||||
AdjustStunned(0)
|
||||
AdjustParalysis(0)
|
||||
AdjustWeakened(0)
|
||||
|
||||
handle_disabilities()
|
||||
if (src.disabilities & 4)
|
||||
if ((prob(5) && src.paralysis <= 1 && src.r_ch_cou < 1))
|
||||
src.drop_item()
|
||||
spawn( 0 )
|
||||
emote("cough")
|
||||
return
|
||||
if (src.disabilities & 8)
|
||||
if ((prob(10) && src.paralysis <= 1 && src.r_Tourette < 1))
|
||||
Stun(10)
|
||||
spawn( 0 )
|
||||
emote("twitch")
|
||||
return
|
||||
if (src.disabilities & 16)
|
||||
if (prob(10))
|
||||
src.stuttering = max(10, src.stuttering)
|
||||
|
||||
update_mind()
|
||||
if(!mind && client)
|
||||
mind = new
|
||||
mind.current = src
|
||||
mind.key = key
|
||||
|
||||
handle_mutations_and_radiation()
|
||||
// amorphs are immune to this stuff
|
||||
|
||||
breathe()
|
||||
if(src.reagents)
|
||||
|
||||
if(src.reagents.has_reagent("lexorin")) return
|
||||
|
||||
if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/gas_mixture/breath
|
||||
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
src.losebreath--
|
||||
if (prob(75)) //High chance of gasping for air
|
||||
spawn emote("gasp")
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
else
|
||||
//First, check for air from internal atmosphere (using an air tank and mask generally)
|
||||
breath = get_breath_from_internal(BREATH_VOLUME)
|
||||
|
||||
//No breath from internal atmosphere so get breath from location
|
||||
if(!breath)
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
// Handle chem smoke effect -- Doohl
|
||||
var/block = 0
|
||||
if(wear_mask)
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas))
|
||||
block = 1
|
||||
|
||||
if(!block)
|
||||
|
||||
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
|
||||
if(smoke.reagents.total_volume)
|
||||
smoke.reagents.reaction(src, INGEST)
|
||||
spawn(5)
|
||||
if(smoke)
|
||||
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
|
||||
break // If they breathe in the nasty stuff once, no need to continue checking
|
||||
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
handle_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
|
||||
|
||||
get_breath_from_internal(volume_needed)
|
||||
if(internal)
|
||||
if (!contents.Find(src.internal))
|
||||
internal = null
|
||||
if (!wear_mask || !(wear_mask.flags|MASKINTERNALS) )
|
||||
internal = null
|
||||
if(internal)
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal1"
|
||||
return internal.remove_air_volume(volume_needed)
|
||||
else
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal0"
|
||||
return null
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
handle_breath(datum/gas_mixture/breath)
|
||||
if(src.nodamage)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles == 0))
|
||||
adjustOxyLoss(7)
|
||||
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
|
||||
return 0
|
||||
|
||||
var/safe_oxygen_min = 8 // Minimum safe partial pressure of O2, in kPa
|
||||
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
|
||||
var/SA_para_min = 0.5
|
||||
var/SA_sleep_min = 5
|
||||
var/oxygen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the O2 in our breath
|
||||
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
|
||||
|
||||
if(O2_pp < safe_oxygen_min) // Too little oxygen
|
||||
if(prob(20))
|
||||
spawn(0) emote("gasp")
|
||||
if (O2_pp == 0)
|
||||
O2_pp = 0.01
|
||||
var/ratio = safe_oxygen_min/O2_pp
|
||||
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
else // We're in safe limits
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
oxygen_alert = 0
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
src.sleeping = max(src.sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
|
||||
return 1
|
||||
|
||||
handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
var/environment_heat_capacity = environment.heat_capacity()
|
||||
if(istype(loc, /turf/space))
|
||||
environment_heat_capacity = loc:heat_capacity
|
||||
|
||||
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
|
||||
var/transfer_coefficient
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
|
||||
transfer_coefficient *= wear_mask.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
if(stat==2)
|
||||
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
|
||||
|
||||
//Account for massive pressure differences
|
||||
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
|
||||
// if(!wear_suit) Monkies cannot into space.
|
||||
// if(!istype(wear_suit, /obj/item/clothing/suit/space))
|
||||
|
||||
/*if(pressure < 20)
|
||||
if(prob(25))
|
||||
src << "You feel the splittle on your lips and the fluid on your eyes boiling away, the capillteries in your skin breaking."
|
||||
adjustBruteLoss(5)
|
||||
*/
|
||||
|
||||
if(pressure > HAZARD_HIGH_PRESSURE)
|
||||
|
||||
adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE))
|
||||
|
||||
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
|
||||
if(src.nodamage) return
|
||||
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
|
||||
if(exposed_temperature > bodytemperature)
|
||||
adjustFireLoss(20.0*discomfort)
|
||||
|
||||
else
|
||||
adjustFireLoss(5.0*discomfort)
|
||||
|
||||
handle_chemicals_in_body()
|
||||
// most chemicals will have no effect on amorphs
|
||||
//if(reagents) reagents.metabolize(src)
|
||||
|
||||
if (src.drowsyness)
|
||||
src.drowsyness--
|
||||
src.eye_blurry = max(2, src.eye_blurry)
|
||||
if (prob(5))
|
||||
src.sleeping += 1
|
||||
Paralyse(5)
|
||||
|
||||
confused = max(0, confused - 1)
|
||||
// decrement dizziness counter, clamped to 0
|
||||
if(resting)
|
||||
dizziness = max(0, dizziness - 5)
|
||||
else
|
||||
dizziness = max(0, dizziness - 1)
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = 100 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
|
||||
if(getOxyLoss() > 25) Paralyse(3)
|
||||
|
||||
if(src.sleeping)
|
||||
Paralyse(5)
|
||||
if (prob(1) && health) spawn(0) emote("snore")
|
||||
|
||||
if(src.resting)
|
||||
Weaken(5)
|
||||
|
||||
if(health < config.health_threshold_dead && stat != 2)
|
||||
death()
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
// shuffle around the chemical effects for amorphs a little ;)
|
||||
if(!src.reagents.has_reagent("antitoxin") && src.stat != 2) src.adjustOxyLoss(2)
|
||||
|
||||
if(src.stat != 2) src.stat = 1
|
||||
Paralyse(5)
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
AdjustStunned(-1)
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
AdjustWeakened(-1)
|
||||
src.lying = 1
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
AdjustParalysis(-1)
|
||||
src.blinded = 1
|
||||
src.lying = 1
|
||||
src.stat = 1
|
||||
var/h = src.hand
|
||||
src.hand = 0
|
||||
drop_item()
|
||||
src.hand = 1
|
||||
drop_item()
|
||||
src.hand = h
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.lying = 1
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
if (src.stuttering) src.stuttering--
|
||||
if (src.slurring) src.slurring--
|
||||
|
||||
if (src.eye_blind)
|
||||
src.eye_blind--
|
||||
src.blinded = 1
|
||||
|
||||
if (src.ear_deaf > 0) src.ear_deaf--
|
||||
if (src.ear_damage < 25)
|
||||
src.ear_damage -= 0.05
|
||||
src.ear_damage = max(src.ear_damage, 0)
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if (src.disabilities & 128)
|
||||
src.blinded = 1
|
||||
if (src.disabilities & 32)
|
||||
src.ear_deaf = 1
|
||||
|
||||
if (src.eye_blurry > 0)
|
||||
src.eye_blurry--
|
||||
src.eye_blurry = max(0, src.eye_blurry)
|
||||
|
||||
if (src.druggy > 0)
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2 || (XRAY in mutations))
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
else if (src.stat != 2)
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 2
|
||||
src.see_invisible = 0
|
||||
|
||||
if (src.sleep)
|
||||
src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0)
|
||||
src.sleep.overlays = null
|
||||
if(src.sleeping_willingly)
|
||||
src.sleep.overlays += icon(src.sleep.icon, "sleep_willing")
|
||||
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(80 to 100)
|
||||
src.healths.icon_state = "health1"
|
||||
if(60 to 80)
|
||||
src.healths.icon_state = "health2"
|
||||
if(40 to 60)
|
||||
src.healths.icon_state = "health3"
|
||||
if(20 to 40)
|
||||
src.healths.icon_state = "health4"
|
||||
if(0 to 20)
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
else
|
||||
src.healths.icon_state = "health7"
|
||||
|
||||
if (pressure)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if(environment)
|
||||
switch(environment.return_pressure())
|
||||
|
||||
if(HAZARD_HIGH_PRESSURE to INFINITY)
|
||||
pressure.icon_state = "pressure2"
|
||||
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
|
||||
pressure.icon_state = "pressure1"
|
||||
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
|
||||
pressure.icon_state = "pressure0"
|
||||
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
|
||||
pressure.icon_state = "pressure-1"
|
||||
else
|
||||
pressure.icon_state = "pressure-2"
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
|
||||
if (src.toxin) src.toxin.icon_state = "tox[src.phoron_alert ? 1 : 0]"
|
||||
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
|
||||
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
|
||||
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
||||
//blame the person who coded them. Temporary fix added.
|
||||
|
||||
if(bodytemp)
|
||||
switch(src.bodytemperature) //310.055 optimal body temp
|
||||
if(345 to INFINITY)
|
||||
src.bodytemp.icon_state = "temp4"
|
||||
if(335 to 345)
|
||||
src.bodytemp.icon_state = "temp3"
|
||||
if(327 to 335)
|
||||
src.bodytemp.icon_state = "temp2"
|
||||
if(316 to 327)
|
||||
src.bodytemp.icon_state = "temp1"
|
||||
if(300 to 316)
|
||||
src.bodytemp.icon_state = "temp0"
|
||||
if(295 to 300)
|
||||
src.bodytemp.icon_state = "temp-1"
|
||||
if(280 to 295)
|
||||
src.bodytemp.icon_state = "temp-2"
|
||||
if(260 to 280)
|
||||
src.bodytemp.icon_state = "temp-3"
|
||||
else
|
||||
src.bodytemp.icon_state = "temp-4"
|
||||
|
||||
src.client.screen -= src.hud_used.blurry
|
||||
src.client.screen -= src.hud_used.druggy
|
||||
src.client.screen -= src.hud_used.vimpaired
|
||||
|
||||
if ((src.blind && src.stat != 2))
|
||||
if ((src.blinded))
|
||||
src.blind.layer = 18
|
||||
else
|
||||
src.blind.layer = 0
|
||||
|
||||
if (src.disabilities & 1)
|
||||
src.client.screen += src.hud_used.vimpaired
|
||||
|
||||
if (src.eye_blurry)
|
||||
src.client.screen += src.hud_used.blurry
|
||||
|
||||
if (src.druggy)
|
||||
src.client.screen += src.hud_used.druggy
|
||||
|
||||
if (src.stat != 2)
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
else
|
||||
if(!client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
return 1
|
||||
|
||||
handle_virus_updates()
|
||||
// amorphs can't come down with human diseases
|
||||
return
|
||||
@@ -1,6 +0,0 @@
|
||||
/mob/living/carbon/amorph/emote(var/act,var/m_type=1,var/message = null)
|
||||
if(act == "me")
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
/mob/living/carbon/amorph/say_quote(var/text)
|
||||
return "[src.say_message], \"[text]\"";
|
||||
@@ -1,600 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
|
||||
|
||||
// === MEMETIC ANOMALY ===
|
||||
// =======================
|
||||
|
||||
/**
|
||||
This life form is a form of parasite that can gain a certain level of control
|
||||
over its host. Its player will share vision and hearing with the host, and it'll
|
||||
be able to influence the host through various commands.
|
||||
**/
|
||||
|
||||
// The maximum amount of points a meme can gather.
|
||||
var/global/const/MAXIMUM_MEME_POINTS = 750
|
||||
|
||||
|
||||
// === PARASITE ===
|
||||
// ================
|
||||
|
||||
// a list of all the parasites in the mob
|
||||
mob/living/carbon/var/list/parasites = list()
|
||||
|
||||
mob/living/parasite
|
||||
var/mob/living/carbon/host // the host that this parasite occupies
|
||||
|
||||
Login()
|
||||
..()
|
||||
|
||||
// make the client see through the host instead
|
||||
client.eye = host
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
|
||||
mob/living/parasite/proc/enter_host(mob/living/carbon/host)
|
||||
// by default, parasites can't share a body with other life forms
|
||||
if(host.parasites.len > 0)
|
||||
return 0
|
||||
|
||||
src.host = host
|
||||
src.loc = host
|
||||
host.parasites.Add(src)
|
||||
|
||||
if(client) client.eye = host
|
||||
|
||||
return 1
|
||||
|
||||
mob/living/parasite/proc/exit_host()
|
||||
src.host.parasites.Remove(src)
|
||||
src.host = null
|
||||
src.loc = null
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
// === MEME ===
|
||||
// ============
|
||||
|
||||
// Memes use points for many actions
|
||||
mob/living/parasite/meme/var/meme_points = 100
|
||||
mob/living/parasite/meme/var/dormant = 0
|
||||
|
||||
// Memes have a list of indoctrinated hosts
|
||||
mob/living/parasite/meme/var/list/indoctrinated = list()
|
||||
|
||||
mob/living/parasite/meme/Life()
|
||||
..()
|
||||
|
||||
if(client)
|
||||
if(blinded) client.eye = null
|
||||
else client.eye = host
|
||||
|
||||
if(!host) return
|
||||
|
||||
// recover meme points slowly
|
||||
var/gain = 3
|
||||
if(dormant) gain = 9 // dormant recovers points faster
|
||||
|
||||
meme_points = min(meme_points + gain, MAXIMUM_MEME_POINTS)
|
||||
|
||||
// if there are sleep toxins in the host's body, that's bad
|
||||
if(host.reagents.has_reagent("stoxin"))
|
||||
src << "\red <b>Something in your host's blood makes you lose consciousness.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
// a host without brain is no good
|
||||
if(!host.mind)
|
||||
src << "\red <b>Your host has no mind.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
if(host.stat == 2)
|
||||
src << "\red <b>Your host has died.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
|
||||
if(host.blinded && host.stat != 1) src.blinded = 1
|
||||
else src.blinded = 0
|
||||
|
||||
|
||||
mob/living/parasite/meme/death()
|
||||
// make sure the mob is on the actual map before gibbing
|
||||
if(host) src.loc = host.loc
|
||||
src.stat = 2
|
||||
..()
|
||||
del src
|
||||
|
||||
// When a meme speaks, it speaks through its host
|
||||
mob/living/parasite/meme/say(message as text)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(!host)
|
||||
usr << "\red You can't speak without host!"
|
||||
return
|
||||
|
||||
return host.say(message)
|
||||
|
||||
// Same as speak, just with whisper
|
||||
mob/living/parasite/meme/whisper(message as text)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(!host)
|
||||
usr << "\red You can't speak without host!"
|
||||
return
|
||||
|
||||
return host.whisper(message)
|
||||
|
||||
// Make the host do things
|
||||
mob/living/parasite/meme/me_verb(message as text)
|
||||
set name = "Me"
|
||||
|
||||
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
|
||||
if(!host)
|
||||
usr << "\red You can't emote without host!"
|
||||
return
|
||||
|
||||
return host.me_verb(message)
|
||||
|
||||
// A meme understands everything their host understands
|
||||
mob/living/parasite/meme/say_understands(mob/other)
|
||||
if(!host) return 0
|
||||
|
||||
return host.say_understands(other)
|
||||
|
||||
// Try to use amount points, return 1 if successful
|
||||
mob/living/parasite/meme/proc/use_points(amount)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(src.meme_points < amount)
|
||||
src << "<b>* You don't have enough meme points(need [amount]).</b>"
|
||||
return 0
|
||||
|
||||
src.meme_points -= round(amount)
|
||||
return 1
|
||||
|
||||
// Let the meme choose one of his indoctrinated mobs as target
|
||||
mob/living/parasite/meme/proc/select_indoctrinated(var/title, var/message)
|
||||
var/list/candidates
|
||||
|
||||
// Can only affect other mobs thant he host if not blinded
|
||||
if(blinded)
|
||||
candidates = list()
|
||||
src << "\red You are blinded, so you can not affect mobs other than your host."
|
||||
else
|
||||
candidates = indoctrinated.Copy()
|
||||
|
||||
candidates.Add(src.host)
|
||||
|
||||
var/mob/target = null
|
||||
if(candidates.len == 1)
|
||||
target = candidates[1]
|
||||
else
|
||||
var/selected
|
||||
|
||||
var/list/text_candidates = list()
|
||||
var/list/map_text_to_mob = list()
|
||||
|
||||
for(var/mob/living/carbon/human/M in candidates)
|
||||
text_candidates += M.real_name
|
||||
map_text_to_mob[M.real_name] = M
|
||||
|
||||
selected = input(message,title) as null|anything in text_candidates
|
||||
if(!selected) return null
|
||||
|
||||
target = map_text_to_mob[selected]
|
||||
|
||||
return target
|
||||
|
||||
|
||||
// A meme can make people hear things with the thought ability
|
||||
mob/living/parasite/meme/verb/Thought()
|
||||
set category = "Meme"
|
||||
set name = "Thought(50)"
|
||||
set desc = "Implants a thought into the target, making them think they heard someone talk."
|
||||
|
||||
if(meme_points < 50)
|
||||
// just call use_points() to give the standard failure message
|
||||
use_points(50)
|
||||
return
|
||||
|
||||
var/list/candidates = indoctrinated.Copy()
|
||||
if(!(src.host in candidates))
|
||||
candidates.Add(src.host)
|
||||
|
||||
var/mob/target = select_indoctrinated("Thought", "Select a target which will hear your thought.")
|
||||
|
||||
if(!target) return
|
||||
|
||||
var/speaker = input("Select the voice in which you would like to make yourself heard.", "Voice") as null|text
|
||||
if(!speaker) return
|
||||
|
||||
var/message = input("What would you like to say?", "Message") as null
|
||||
if(!message) return
|
||||
|
||||
// Use the points at the end rather than the beginning, because the user might cancel
|
||||
if(!use_points(50)) return
|
||||
|
||||
message = say_quote(message)
|
||||
var/rendered = "<span class='game say'><span class='name'>[speaker]</span> <span class='message'>[message]</span></span>"
|
||||
target.show_message(rendered)
|
||||
|
||||
usr << "<i>You make [target] hear:</i> [rendered]"
|
||||
|
||||
// Mutes the host
|
||||
mob/living/parasite/meme/verb/Mute()
|
||||
set category = "Meme"
|
||||
set name = "Mute(250)"
|
||||
set desc = "Prevents your host from talking for a while."
|
||||
|
||||
if(!src.host) return
|
||||
if(!host.speech_allowed)
|
||||
usr << "\red Your host already can't speak.."
|
||||
return
|
||||
if(!use_points(250)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/host = src.host
|
||||
|
||||
host << "\red Your tongue feels numb.. You lose your ability to speak."
|
||||
usr << "\red Your host can't speak anymore."
|
||||
|
||||
host.speech_allowed = 0
|
||||
|
||||
sleep(1200)
|
||||
|
||||
host.speech_allowed = 1
|
||||
host << "\red Your tongue has feeling again.."
|
||||
usr << "\red [host] can speak again."
|
||||
|
||||
// Makes the host unable to emote
|
||||
mob/living/parasite/meme/verb/Paralyze()
|
||||
set category = "Meme"
|
||||
set name = "Paralyze(250)"
|
||||
set desc = "Prevents your host from using emote for a while."
|
||||
|
||||
if(!src.host) return
|
||||
if(!host.use_me)
|
||||
usr << "\red Your host already can't use body language.."
|
||||
return
|
||||
if(!use_points(250)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/host = src.host
|
||||
|
||||
host << "\red Your body feels numb.. You lose your ability to use body language."
|
||||
usr << "\red Your host can't use body language anymore."
|
||||
|
||||
host.use_me = 0
|
||||
|
||||
sleep(1200)
|
||||
|
||||
host.use_me = 1
|
||||
host << "\red Your body has feeling again.."
|
||||
usr << "\red [host] can use body language again."
|
||||
|
||||
|
||||
|
||||
// Cause great agony with the host, used for conditioning the host
|
||||
mob/living/parasite/meme/verb/Agony()
|
||||
set category = "Meme"
|
||||
set name = "Agony(200)"
|
||||
set desc = "Causes significant pain in your host."
|
||||
|
||||
if(!src.host) return
|
||||
if(!use_points(200)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/living/carbon/host = src.host
|
||||
|
||||
if (host.species && (host.species.flags & NO_PAIN))
|
||||
usr << "Nothing seems to happen."
|
||||
return
|
||||
|
||||
host.paralysis = max(host.paralysis, 2)
|
||||
|
||||
host.flash_weak_pain()
|
||||
host << "\red <font size=5>You feel excrutiating pain all over your body! It is so bad you can't think or articulate yourself properly..</font>"
|
||||
|
||||
usr << "<b>You send a jolt of agonizing pain through [host], they should be unable to concentrate on anything else for half a minute.</b>"
|
||||
|
||||
host.emote("scream")
|
||||
|
||||
for(var/i=0, i<10, i++)
|
||||
host.stuttering = 2
|
||||
sleep(50)
|
||||
if(prob(80)) host.flash_weak_pain()
|
||||
if(prob(10)) host.paralysis = max(host.paralysis, 2)
|
||||
if(prob(15)) host.emote("twitch")
|
||||
else if(prob(15)) host.emote("scream")
|
||||
else if(prob(10)) host.emote("collapse")
|
||||
|
||||
if(i == 10)
|
||||
host << "\red THE PAIN! AGHH, THE PAIN! MAKE IT STOP! ANYTHING TO MAKE IT STOP!"
|
||||
|
||||
host << "\red The pain subsides.."
|
||||
|
||||
// Cause great joy with the host, used for conditioning the host
|
||||
mob/living/parasite/meme/verb/Joy()
|
||||
set category = "Meme"
|
||||
set name = "Joy(200)"
|
||||
set desc = "Causes significant joy in your host."
|
||||
|
||||
if(!src.host) return
|
||||
if(!use_points(200)) return
|
||||
|
||||
spawn
|
||||
var/mob/host = src.host
|
||||
host.druggy = max(host.druggy, 50)
|
||||
host.slurring = max(host.slurring, 10)
|
||||
|
||||
usr << "<b>You stimulate [host.name]'s brain, injecting waves of endorphines and dopamine into the tissue. They should now forget all their worries, particularly relating to you, for around a minute."
|
||||
|
||||
host << "\red You are feeling wonderful! Your head is numb and drowsy, and you can't help forgetting all the worries in the world."
|
||||
|
||||
while(host.druggy > 0)
|
||||
sleep(10)
|
||||
|
||||
host << "\red You are feeling clear-headed again.."
|
||||
|
||||
// Cause the target to hallucinate.
|
||||
mob/living/parasite/meme/verb/Hallucinate()
|
||||
set category = "Meme"
|
||||
set name = "Hallucinate(300)"
|
||||
set desc = "Makes your host hallucinate, has a short delay."
|
||||
|
||||
var/mob/target = select_indoctrinated("Hallucination", "Who should hallucinate?")
|
||||
|
||||
if(!target) return
|
||||
if(!use_points(300)) return
|
||||
|
||||
target.hallucination += 100
|
||||
|
||||
usr << "<b>You make [target] hallucinate.</b>"
|
||||
|
||||
// Jump to a closeby target through a whisper
|
||||
mob/living/parasite/meme/verb/SubtleJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Subtle Jump(350)"
|
||||
set desc = "Move to a closeby human through a whisper."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(1, host)+src))
|
||||
src << "<b>The target is not close enough.</b>"
|
||||
return
|
||||
|
||||
// Find out whether we can speak
|
||||
if (host.silent || (host.disabilities & 64))
|
||||
src << "<b>Your host can't speak..</b>"
|
||||
return
|
||||
|
||||
if(!use_points(350)) return
|
||||
|
||||
for(var/mob/M in view(1, host))
|
||||
M.show_message("<B>[host]</B> whispers something incoherent.",2) // 2 stands for hearable message
|
||||
|
||||
// Find out whether the target can hear
|
||||
if(target.disabilities & 32 || target.ear_deaf)
|
||||
src << "<b>Your target doesn't seem to hear you..</b>"
|
||||
return
|
||||
|
||||
if(target.parasites.len > 0)
|
||||
src << "<b>Your target already is possessed by something..</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// Jump to a distant target through a shout
|
||||
mob/living/parasite/meme/verb/ObviousJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Obvious Jump(750)"
|
||||
set desc = "Move to any mob in view through a shout."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(host)))
|
||||
src << "<b>The target is not close enough.</b>"
|
||||
return
|
||||
|
||||
// Find out whether we can speak
|
||||
if (host.silent || (host.disabilities & 64))
|
||||
src << "<b>Your host can't speak..</b>"
|
||||
return
|
||||
|
||||
if(!use_points(750)) return
|
||||
|
||||
for(var/mob/M in view(host)+src)
|
||||
M.show_message("<B>[host]</B> screams something incoherent!",2) // 2 stands for hearable message
|
||||
|
||||
// Find out whether the target can hear
|
||||
if(target.disabilities & 32 || target.ear_deaf)
|
||||
src << "<b>Your target doesn't seem to hear you..</b>"
|
||||
return
|
||||
|
||||
if(target.parasites.len > 0)
|
||||
src << "<b>Your target already is possessed by something..</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// Jump to an attuned mob for free
|
||||
mob/living/parasite/meme/verb/AttunedJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Attuned Jump(0)"
|
||||
set desc = "Move to a mob in sight that you have already attuned."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(host)))
|
||||
src << "<b>You need to make eye-contact with the target.</b>"
|
||||
return
|
||||
if(!(target in indoctrinated))
|
||||
src << "<b>You need to attune the target first.</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// ATTUNE a mob, adding it to the indoctrinated list
|
||||
mob/living/parasite/meme/verb/Attune()
|
||||
set category = "Meme"
|
||||
set name = "Attune(400)"
|
||||
set desc = "Change the host's brain structure, making it easier for you to manipulate him."
|
||||
|
||||
if(host in src.indoctrinated)
|
||||
usr << "<b>You have already attuned this host.</b>"
|
||||
return
|
||||
|
||||
if(!host) return
|
||||
if(!use_points(400)) return
|
||||
|
||||
src.indoctrinated.Add(host)
|
||||
|
||||
usr << "<b>You successfully indoctrinated [host]."
|
||||
host << "\red Your head feels a bit roomier.."
|
||||
|
||||
log_admin("[src.key] has attuned [host]")
|
||||
message_admins("[src.key] has attuned [host]")
|
||||
|
||||
// Enables the mob to take a lot more damage
|
||||
mob/living/parasite/meme/verb/Analgesic()
|
||||
set category = "Meme"
|
||||
set name = "Analgesic(500)"
|
||||
set desc = "Combat drug that the host to move normally, even under life-threatening pain."
|
||||
|
||||
if(!host) return
|
||||
if(!(host in indoctrinated))
|
||||
usr << "\red You need to attune the host first."
|
||||
return
|
||||
if(!use_points(500)) return
|
||||
|
||||
usr << "<b>You inject drugs into [host]."
|
||||
host << "\red You feel your body strengthen and your pain subside.."
|
||||
host.analgesic = 60
|
||||
while(host.analgesic > 0)
|
||||
sleep(10)
|
||||
host << "\red The dizziness wears off, and you can feel pain again.."
|
||||
|
||||
|
||||
mob/proc/clearHUD()
|
||||
if(client) client.screen.Cut()
|
||||
|
||||
// Take control of the mob
|
||||
mob/living/parasite/meme/verb/Possession()
|
||||
set category = "Meme"
|
||||
set name = "Possession(500)"
|
||||
set desc = "Take direct control of the host for a while."
|
||||
|
||||
if(!host) return
|
||||
if(!(host in indoctrinated))
|
||||
usr << "\red You need to attune the host first."
|
||||
return
|
||||
if(!use_points(500)) return
|
||||
|
||||
usr << "<b>You take control of [host]!</b>"
|
||||
host << "\red Everything goes black.."
|
||||
|
||||
spawn
|
||||
var/mob/dummy = new()
|
||||
dummy.loc = 0
|
||||
dummy.sight = BLIND
|
||||
|
||||
var/datum/mind/host_mind = host.mind
|
||||
var/datum/mind/meme_mind = src.mind
|
||||
|
||||
host_mind.transfer_to(dummy)
|
||||
meme_mind.transfer_to(host)
|
||||
host_mind.current.clearHUD()
|
||||
host.update_clothing()
|
||||
|
||||
dummy << "\blue You feel very drowsy.. Your eyelids become heavy..."
|
||||
|
||||
log_admin("[meme_mind.key] has taken possession of [host]([host_mind.key])")
|
||||
message_admins("[meme_mind.key] has taken possession of [host]([host_mind.key])")
|
||||
|
||||
sleep(600)
|
||||
|
||||
log_admin("[meme_mind.key] has lost possession of [host]([host_mind.key])")
|
||||
message_admins("[meme_mind.key] has lost possession of [host]([host_mind.key])")
|
||||
|
||||
meme_mind.transfer_to(src)
|
||||
host_mind.transfer_to(host)
|
||||
meme_mind.current.clearHUD()
|
||||
host.update_clothing()
|
||||
src << "\red You lose control.."
|
||||
|
||||
del dummy
|
||||
|
||||
// Enter dormant mode, increases meme point gain
|
||||
mob/living/parasite/meme/verb/Dormant()
|
||||
set category = "Meme"
|
||||
set name = "Dormant(100)"
|
||||
set desc = "Speed up point recharging, will force you to cease all actions until all points are recharged."
|
||||
|
||||
if(!host) return
|
||||
if(!use_points(100)) return
|
||||
|
||||
usr << "<b>You enter dormant mode.. You won't be able to take action until all your points have recharged.</b>"
|
||||
|
||||
dormant = 1
|
||||
|
||||
while(meme_points < MAXIMUM_MEME_POINTS)
|
||||
sleep(10)
|
||||
|
||||
dormant = 0
|
||||
|
||||
usr << "\red You have regained all points and exited dormant mode!"
|
||||
|
||||
mob/living/parasite/meme/verb/Show_Points()
|
||||
set category = "Meme"
|
||||
|
||||
usr << "<b>Meme Points: [src.meme_points]/[MAXIMUM_MEME_POINTS]</b>"
|
||||
|
||||
// Stat panel to show meme points, copypasted from alien
|
||||
/mob/living/parasite/meme/Stat()
|
||||
..()
|
||||
|
||||
statpanel("Status")
|
||||
if (client && client.holder)
|
||||
stat(null, "([x], [y], [z])")
|
||||
|
||||
if (client && client.statpanel == "Status")
|
||||
stat(null, "Meme Points: [src.meme_points]")
|
||||
|
||||
// Game mode helpers, used for theft objectives
|
||||
// --------------------------------------------
|
||||
mob/living/parasite/check_contents_for(t)
|
||||
if(!host) return 0
|
||||
|
||||
return host.check_contents_for(t)
|
||||
|
||||
mob/living/parasite/check_contents_for_reagent(t)
|
||||
if(!host) return 0
|
||||
|
||||
return host.check_contents_for_reagent(t)
|
||||
@@ -1,12 +0,0 @@
|
||||
/obj/effect/admin_log_trap
|
||||
name = "Herprpr"
|
||||
desc = "Stepping on this is good."
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x2"
|
||||
anchored = 1.0
|
||||
unacidable = 1
|
||||
invisibility = 101
|
||||
|
||||
/obj/effect/admin_log_trap/HasEntered(AM as mob|obj)
|
||||
if(istype(AM,/mob))
|
||||
message_admins("[AM] ([AM:ckey]) stepped on an alerted tile in [get_area(src)]. <a href=\"byond://?src=%admin_ref%;teleto=\ref[src.loc]\">Jump</a>", admin_ref = 1)
|
||||
@@ -1,84 +0,0 @@
|
||||
//copy pastad freezer
|
||||
//remove this shit when someonething better is done
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "Heat Regulator"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
|
||||
anchored = 1.0
|
||||
|
||||
current_heat_capacity = 1000
|
||||
|
||||
New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
var/temp_text = ""
|
||||
if(air_contents.temperature > (T0C - 20))
|
||||
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
|
||||
else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
temp_text = "<FONT color=black>[air_contents.temperature]</FONT>"
|
||||
else
|
||||
temp_text = "<FONT color=blue>[air_contents.temperature]</FONT>"
|
||||
|
||||
var/dat = {"<B>Cryo gas cooling system</B><BR>
|
||||
Current status: [ on ? "<A href='?src=\ref[src];start=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];start=1'>On</A>"]<BR>
|
||||
Current gas temperature: [temp_text]<BR>
|
||||
Current air pressure: [air_contents.return_pressure()]<BR>
|
||||
Target gas temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=freezer;size=400x500")
|
||||
onclose(user, "freezer")
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["start"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(350, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(150, src.current_temperature+amount)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
@@ -1,65 +0,0 @@
|
||||
/mob/verb/shortcut_changeintent(var/changeto as num)
|
||||
set name = "_changeintent"
|
||||
set hidden = 1
|
||||
if(istype(usr,/mob/living/carbon))
|
||||
if(changeto == 1)
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
|
||||
if("disarm")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small_active"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("hurt")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small_active"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("grab")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small_active"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
else if(changeto == -1)
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small_active"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("disarm")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small_active"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("hurt")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
|
||||
if("grab")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small_active"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
return
|
||||
@@ -1,53 +0,0 @@
|
||||
/obj/item/weapon/storage/syndie_kit
|
||||
name = "Box"
|
||||
desc = "A sleek, sturdy box"
|
||||
icon_state = "box_of_doom"
|
||||
item_state = "syringe_kit"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom
|
||||
name = "Freedom Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/freedom(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_compress
|
||||
name = "Compressed Matter Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_compress/New()
|
||||
new /obj/item/weapon/implanter/compressed(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive
|
||||
name = "Explosive Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/explosive(O)
|
||||
O.name = "(BIO-HAZARD) BIO-detpack"
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink
|
||||
name = "Uplink Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/uplink(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space
|
||||
name = "Space Suit and Helmet"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space/New()
|
||||
new /obj/item/clothing/suit/space/syndicate(src)
|
||||
new /obj/item/clothing/head/helmet/space/syndicate(src)
|
||||
..()
|
||||
return
|
||||
@@ -1,467 +0,0 @@
|
||||
/*
|
||||
|
||||
SYNDICATE UPLINKS
|
||||
|
||||
TO-DO:
|
||||
Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
|
||||
|
||||
Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
|
||||
|
||||
I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
|
||||
to see how uplinks are assigned and if there are any bugs with those.
|
||||
|
||||
|
||||
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
|
||||
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink
|
||||
var/welcome // Welcoming menu message
|
||||
var/menu_message = "" // The actual menu text
|
||||
var/items // List of items
|
||||
var/list/ItemList // Parsed list of items
|
||||
var/uses // Numbers of crystals
|
||||
var/uplink_data // designated uplink items
|
||||
// List of items not to shove in their hands.
|
||||
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
|
||||
|
||||
New()
|
||||
if(!welcome)
|
||||
welcome = ticker.mode.uplink_welcome
|
||||
if(!uplink_data)
|
||||
uplink_data = ticker.mode.uplink_items
|
||||
|
||||
items = replacetext(uplink_data, "\n", "") // Getting the text string of items
|
||||
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
|
||||
uses = ticker.mode.uplink_uses
|
||||
|
||||
//Let's build a menu!
|
||||
proc/generate_menu()
|
||||
src.menu_message = "<B>[src.welcome]</B><BR>"
|
||||
src.menu_message += "Tele-Crystals left: [src.uses]<BR>"
|
||||
src.menu_message += "<HR>"
|
||||
src.menu_message += "<B>Request item:</B><BR>"
|
||||
src.menu_message += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
|
||||
|
||||
var/cost
|
||||
var/item
|
||||
var/name
|
||||
var/path_obj
|
||||
var/path_text
|
||||
var/category_items = 1 //To prevent stupid :P
|
||||
|
||||
for(var/D in ItemList)
|
||||
var/list/O = stringsplit(D, ":")
|
||||
if(O.len != 3) //If it is not an actual item, make a break in the menu.
|
||||
if(O.len == 1) //If there is one item, it's probably a title
|
||||
src.menu_message += "<b>[O[1]]</b><br>"
|
||||
category_items = 0
|
||||
else //Else, it's a white space.
|
||||
if(category_items < 1) //If there were no itens in the last category...
|
||||
src.menu_message += "<i>We apologize, as you could not afford anything from this category.</i><br>"
|
||||
src.menu_message += "<br>"
|
||||
continue
|
||||
|
||||
path_text = O[1]
|
||||
cost = text2num(O[2])
|
||||
|
||||
if(cost>uses)
|
||||
continue
|
||||
|
||||
path_obj = text2path(path_text)
|
||||
item = new path_obj()
|
||||
name = O[3]
|
||||
del item
|
||||
|
||||
src.menu_message += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
|
||||
category_items++
|
||||
|
||||
// src.menu_message += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
|
||||
src.menu_message += "<HR>"
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if (href_list["buy_item"])
|
||||
/* if(href_list["buy_item"] == "random")
|
||||
var/list/randomItems = list()
|
||||
|
||||
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
|
||||
//Add only items the player can afford:
|
||||
if(uses > 19)
|
||||
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
|
||||
|
||||
if(uses > 9)
|
||||
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
|
||||
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
|
||||
|
||||
//if(uses > 8) //Nothing... yet.
|
||||
//if(uses > 7) //Nothing... yet.
|
||||
|
||||
if(uses > 6)
|
||||
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
|
||||
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
|
||||
|
||||
if(uses > 5)
|
||||
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
|
||||
|
||||
if(uses > 4)
|
||||
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
|
||||
randomItems.Add("/obj/item/device/powersink") //Powersink
|
||||
|
||||
if(uses > 3)
|
||||
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
|
||||
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
|
||||
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
|
||||
|
||||
if(uses > 2)
|
||||
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
|
||||
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
|
||||
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
|
||||
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
|
||||
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
|
||||
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
|
||||
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
|
||||
randomItems.Add("/obj/item/clothing/glasses/thermal") //Thermal Imaging Goggles
|
||||
|
||||
if(uses > 1)
|
||||
/*
|
||||
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
|
||||
var/hasRevolver = 0
|
||||
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
|
||||
if(istype(I,/obj/item/weapon/gun/projectile))
|
||||
hasRevolver = 1
|
||||
|
||||
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
*/
|
||||
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
|
||||
randomItems.Add("/obj/item/weapon/plastique") //C4
|
||||
|
||||
if(uses > 0)
|
||||
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
|
||||
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
|
||||
|
||||
if(!randomItems)
|
||||
del(randomItems)
|
||||
return 0
|
||||
else
|
||||
href_list["buy_item"] = pick(randomItems)
|
||||
|
||||
switch(href_list["buy_item"]) //Ok, this gets a little messy, sorry.
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
uses -= 20
|
||||
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
|
||||
uses -= 10
|
||||
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
|
||||
uses -= 7
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
uses -= 6
|
||||
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
|
||||
uses -= 5
|
||||
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
|
||||
uses -= 4
|
||||
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
|
||||
"/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
|
||||
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal")
|
||||
uses -= 3
|
||||
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
|
||||
uses -= 2
|
||||
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
|
||||
uses -= 1
|
||||
|
||||
del(randomItems)
|
||||
return 1
|
||||
*/
|
||||
|
||||
|
||||
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
|
||||
return 0
|
||||
|
||||
if(usr:mind && ticker.mode.traitors[usr:mind])
|
||||
var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
|
||||
info.spawnlist += href_list["buy_item"]
|
||||
|
||||
uses -= text2num(href_list["cost"])
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
*PDA uplink
|
||||
*/
|
||||
|
||||
//Syndicate uplink hidden inside a traitor PDA
|
||||
//Communicate with traitor through the PDA's note function.
|
||||
|
||||
/obj/item/device/uplink/pda
|
||||
name = "uplink module"
|
||||
desc = "An electronic uplink system of unknown origin."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
var/obj/item/device/pda/hostpda = null
|
||||
|
||||
var/orignote = null //Restore original notes when locked.
|
||||
var/active = 0 //Are we currently active?
|
||||
var/lock_code = "" //The unlocking password.
|
||||
|
||||
proc
|
||||
unlock()
|
||||
if ((isnull(src.hostpda)) || (src.active))
|
||||
return
|
||||
|
||||
src.orignote = src.hostpda.note
|
||||
src.active = 1
|
||||
src.hostpda.mode = 1 //Switch right to the notes program
|
||||
|
||||
src.generate_menu()
|
||||
print_to_host(menu_message)
|
||||
|
||||
for (var/mob/M in viewers(1, src.hostpda.loc))
|
||||
if (M.client && M.machine == src.hostpda)
|
||||
src.hostpda.attack_self(M)
|
||||
|
||||
return
|
||||
|
||||
print_to_host(var/text)
|
||||
if (isnull(hostpda))
|
||||
return
|
||||
hostpda.note = text
|
||||
|
||||
for (var/mob/M in viewers(1, hostpda.loc))
|
||||
if (M.client && M.machine == hostpda)
|
||||
hostpda.attack_self(M)
|
||||
return
|
||||
|
||||
shutdown_uplink()
|
||||
if (isnull(src.hostpda))
|
||||
return
|
||||
active = 0
|
||||
hostpda.note = orignote
|
||||
if (hostpda.mode==1)
|
||||
hostpda.mode = 0
|
||||
hostpda.updateDialog()
|
||||
return
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
src.generate_menu()
|
||||
src.hostpda.note = src.menu_message
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((isnull(src.hostpda)) || (!src.active))
|
||||
return
|
||||
|
||||
if (usr.stat || usr.restrained() || !in_range(src.hostpda, usr))
|
||||
return
|
||||
|
||||
if(..() == 1) // We can afford the item
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/mob/A = src.hostpda.loc
|
||||
var/item = new path_obj(get_turf(src.hostpda))
|
||||
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
|
||||
if(!A.r_hand)
|
||||
item:loc = A
|
||||
A.r_hand = item
|
||||
item:layer = 20
|
||||
else if(!A.l_hand)
|
||||
item:loc = A
|
||||
A.l_hand = item
|
||||
item:layer = 20
|
||||
else
|
||||
item:loc = get_turf(A)
|
||||
usr.update_clothing()
|
||||
usr.client.onBought("[item:name]")
|
||||
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
|
||||
del item*/
|
||||
//HEADFINDBACK
|
||||
src.attack_self(usr)
|
||||
src.hostpda.attack_self(usr)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
*Portable radio uplink
|
||||
*/
|
||||
|
||||
//A Syndicate uplink disguised as a portable radio
|
||||
/obj/item/device/uplink/radio/implanted
|
||||
New()
|
||||
..()
|
||||
uses = 5
|
||||
return
|
||||
|
||||
explode()
|
||||
var/turf/location = get_turf(src.loc)
|
||||
if(location)
|
||||
location.hotspot_expose(700,125)
|
||||
explosion(location, 0, 0, 2, 4, 1)
|
||||
|
||||
var/obj/item/weapon/implant/uplink/U = src.loc
|
||||
var/mob/living/A = U.imp_in
|
||||
var/datum/organ/external/head = A:organs["head"]
|
||||
head.destroyed = 1
|
||||
spawn(2)
|
||||
head.droplimb()
|
||||
del(src.master)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/uplink/radio
|
||||
name = "ship bounced radio"
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "radio"
|
||||
var/temp = null //Temporary storage area for a message offering the option to destroy the radio
|
||||
var/selfdestruct = 0 //Set to 1 while the radio is self destructing itself.
|
||||
var/obj/item/device/radio/origradio = null
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
item_state = "radio"
|
||||
throwforce = 5
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
m_amt = 100
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
var/dat
|
||||
|
||||
if (src.selfdestruct)
|
||||
dat = "Self Destructing..."
|
||||
else
|
||||
if (src.temp)
|
||||
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];clear_selfdestruct=1'>Clear</A>"
|
||||
else
|
||||
src.generate_menu()
|
||||
dat = src.menu_message
|
||||
if (src.origradio) // Checking because sometimes the radio uplink may be spawned by itself, not as a normal unlockable radio
|
||||
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</A><BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='byond://?src=\ref[src];selfdestruct=1'>Self-Destruct</A>"
|
||||
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 1
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || istype(src.loc,/obj/item/weapon/implant/uplink)))
|
||||
usr.machine = src
|
||||
|
||||
if(href_list["buy_item"])
|
||||
if(..() == 1) // We can afford the item
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/item = new path_obj(get_turf(src.loc))
|
||||
var/mob/A = src.loc
|
||||
if(istype(src.loc,/obj/item/weapon/implant/uplink))
|
||||
var/obj/item/weapon/implant/uplink/U = src.loc
|
||||
A = U.imp_in
|
||||
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
|
||||
if(!A.r_hand)
|
||||
item:loc = A
|
||||
A.r_hand = item
|
||||
item:layer = 20
|
||||
else if(!A.l_hand)
|
||||
item:loc = A
|
||||
A.l_hand = item
|
||||
item:layer = 20
|
||||
else
|
||||
item:loc = get_turf(A)
|
||||
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
|
||||
del item*/
|
||||
usr.client.onBought("[item:name]")
|
||||
src.attack_self(usr)
|
||||
return
|
||||
|
||||
else if (href_list["lock"] && src.origradio)
|
||||
// presto chango, a regular radio again! (reset the freq too...)
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=radio")
|
||||
var/obj/item/device/radio/T = src.origradio
|
||||
var/obj/item/device/uplink/radio/R = src
|
||||
R.loc = T
|
||||
T.loc = usr
|
||||
// R.layer = initial(R.layer)
|
||||
R.layer = 0
|
||||
if (usr.client)
|
||||
usr.client.screen -= R
|
||||
if (usr.r_hand == R)
|
||||
usr.u_equip(R)
|
||||
usr.r_hand = T
|
||||
|
||||
else
|
||||
usr.u_equip(R)
|
||||
usr.l_hand = T
|
||||
R.loc = T
|
||||
T.layer = 20
|
||||
T.set_frequency(initial(T.frequency))
|
||||
T.attack_self(usr)
|
||||
return
|
||||
|
||||
else if (href_list["selfdestruct"])
|
||||
src.temp = "<A href='byond://?src=\ref[src];selfdestruct2=1'>Self-Destruct</A>"
|
||||
|
||||
else if (href_list["selfdestruct2"])
|
||||
src.selfdestruct = 1
|
||||
spawn (100)
|
||||
explode()
|
||||
return
|
||||
|
||||
else if (href_list["clear_selfdestruct"])
|
||||
src.temp = null
|
||||
|
||||
attack_self(usr)
|
||||
// if (istype(src.loc, /mob))
|
||||
// attack_self(src.loc)
|
||||
// else
|
||||
// for(var/mob/M in viewers(1, src))
|
||||
// if (M.client)
|
||||
// src.attack_self(M)
|
||||
return
|
||||
|
||||
proc/explode()
|
||||
var/turf/location = get_turf(src.loc)
|
||||
if(location)
|
||||
location.hotspot_expose(700,125)
|
||||
explosion(location, 0, 0, 2, 4, 1)
|
||||
|
||||
del(src.master)
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/shutdown_uplink()
|
||||
if (!src.origradio)
|
||||
return
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if (M.client && M.machine == src)
|
||||
M << browse(null, "window=radio")
|
||||
M.machine = null
|
||||
|
||||
var/obj/item/device/radio/T = src.origradio
|
||||
var/obj/item/device/uplink/radio/R = src
|
||||
var/mob/L = src.loc
|
||||
R.loc = T
|
||||
T.loc = L
|
||||
// R.layer = initial(R.layer)
|
||||
R.layer = 0
|
||||
if (istype(L))
|
||||
if (L.client)
|
||||
L.client.screen -= R
|
||||
if (L.r_hand == R)
|
||||
L.u_equip(R)
|
||||
L.r_hand = T
|
||||
else
|
||||
L.u_equip(R)
|
||||
L.l_hand = T
|
||||
T.layer = 20
|
||||
T.set_frequency(initial(T.frequency))
|
||||
return
|
||||
@@ -1,145 +0,0 @@
|
||||
// Contains: copy machine
|
||||
|
||||
/obj/machinery/copier
|
||||
name = "Copy Machine"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "copier_o"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/num_copies = 1 // number of copies selected, will be maintained between jobs
|
||||
var/copying = 0 // are we copying
|
||||
var/job_num_copies = 0 // number of copies remaining
|
||||
var/obj/item/weapon/template // the paper OR photo being scanned
|
||||
var/max_copies = 10 // MAP EDITOR: can set the number of max copies, possibly to 5 or something for public, more for QM, robutist, etc.
|
||||
|
||||
/obj/machinery/copier/attackby(obj/item/weapon/O as obj, mob/user as mob)
|
||||
if(template)
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo))
|
||||
// put it inside
|
||||
template = O
|
||||
usr.drop_item()
|
||||
O.loc = src
|
||||
update()
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/copier/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/copier/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/copier/attack_hand(mob/user as mob)
|
||||
// da UI
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
if(src.stat)
|
||||
user << "[name] does not seem to be responding to your button mashing."
|
||||
return
|
||||
|
||||
dat = "<HEAD><TITLE>Copy Machine</TITLE></HEAD><TT><b>Xeno Corp. Copying Machine</b><hr>"
|
||||
|
||||
if(copying)
|
||||
dat += "[job_num_copies] copies remaining.<br><br>"
|
||||
dat += "<A href='?src=\ref[src];cancel=1'>Cancel</A>"
|
||||
else
|
||||
if(template)
|
||||
dat += "<A href='?src=\ref[src];open=1'>Open Lid</A>"
|
||||
else
|
||||
dat += "<b>No paper to be copied.<br>"
|
||||
dat += "Please place a paper or photograph on top and close the lid.</b>"
|
||||
|
||||
|
||||
dat += "<br><br>Number of Copies: "
|
||||
dat += "<A href='?src=\ref[src];num=-10'>-</A>"
|
||||
dat += "<A href='?src=\ref[src];num=-1'>-</A>"
|
||||
dat += " [num_copies] "
|
||||
dat += "<A href='?src=\ref[src];num=1'>+</A>"
|
||||
dat += "<A href='?src=\ref[src];num=10'>+</A><br>"
|
||||
|
||||
if(template)
|
||||
dat += "<A href='?src=\ref[src];copy=1'>Copy</a>"
|
||||
|
||||
dat += "</TT>"
|
||||
|
||||
user << browse(dat, "window=copy_machine")
|
||||
onclose(user, "copy_machine")
|
||||
|
||||
/obj/machinery/copier/proc/update()
|
||||
if(template)
|
||||
icon_state = "copier"
|
||||
else
|
||||
icon_state = "copier_o"
|
||||
|
||||
/obj/machinery/copier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
|
||||
if(href_list["num"])
|
||||
num_copies += text2num(href_list["num"])
|
||||
if(num_copies < 1)
|
||||
num_copies = 1
|
||||
else if(num_copies > max_copies)
|
||||
num_copies = max_copies
|
||||
updateDialog()
|
||||
if(href_list["open"])
|
||||
if(copying)
|
||||
return
|
||||
template.loc = src.loc
|
||||
template = null
|
||||
updateDialog()
|
||||
update()
|
||||
if(href_list["copy"])
|
||||
if(copying)
|
||||
return
|
||||
job_num_copies = num_copies
|
||||
spawn(0)
|
||||
do_copy(usr)
|
||||
|
||||
if(href_list["cancel"])
|
||||
job_num_copies = 0
|
||||
|
||||
/obj/machinery/copier/proc/do_copy(mob/user)
|
||||
if(!copying && job_num_copies > 0)
|
||||
copying = 1
|
||||
updateDialog()
|
||||
while(job_num_copies > 0)
|
||||
if(stat)
|
||||
copying = 0
|
||||
return
|
||||
|
||||
// fx
|
||||
flick("copier_s", src)
|
||||
playsound(src, 'sound/items/polaroid1.ogg', 50, 1)
|
||||
|
||||
// dup the file
|
||||
if(istype(template, /obj/item/weapon/paper))
|
||||
// make duplicate paper
|
||||
var/obj/item/weapon/paper/P = new(src.loc)
|
||||
P.name = template.name
|
||||
P.info = template:info
|
||||
P.stamped = template:stamped
|
||||
P.icon_state = template.icon_state
|
||||
P.overlays = null
|
||||
for(var/overlay in template.overlays)
|
||||
P.overlays += overlay
|
||||
else if(istype(template, /obj/item/weapon/photo))
|
||||
// make duplicate photo
|
||||
var/obj/item/weapon/photo/P = new(src.loc)
|
||||
P.name = template.name
|
||||
P.desc = template.desc
|
||||
P.icon = template.icon
|
||||
P.img = template:img
|
||||
|
||||
sleep(30)
|
||||
job_num_copies -= 1
|
||||
updateDialog()
|
||||
for(var/mob/O in hearers(src))
|
||||
O.show_message("[name] beeps happily.", 2)
|
||||
copying = 0
|
||||
updateDialog()
|
||||
@@ -1,23 +0,0 @@
|
||||
/obj/structure/filingcabinet
|
||||
name = "Filing Cabinet"
|
||||
desc = "A large cabinet with drawers."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "filingcabinet"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/filingcabinet/attackby(obj/item/weapon/paper/P,mob/M)
|
||||
if(istype(P))
|
||||
M << "You put \the [P] in the [src]."
|
||||
M.drop_item()
|
||||
P.loc = src
|
||||
else
|
||||
M << "You can't put a [P] in the [src]!"
|
||||
|
||||
/obj/structure/filingcabinet/attack_hand(mob/user)
|
||||
if(src.contents.len <= 0)
|
||||
user << "The [src] is empty."
|
||||
return
|
||||
var/obj/item/weapon/paper/P = input(user,"Choose a sheet to take out.","[src]", "Cancel") as null|obj in src.contents
|
||||
if(!isnull(P) && in_range(src,user))
|
||||
P.loc = user.loc
|
||||
@@ -1,208 +0,0 @@
|
||||
/obj/spawner
|
||||
name = "object spawner"
|
||||
|
||||
/obj/spawner/bomb
|
||||
name = "bomb"
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
var/btype = 0 //0 = radio, 1= prox, 2=time
|
||||
var/explosive = 1 // 0= firebomb
|
||||
var/btemp = 500 // bomb temperature (degC)
|
||||
var/active = 0
|
||||
|
||||
/obj/spawner/bomb/radio
|
||||
btype = 0
|
||||
|
||||
/obj/spawner/bomb/proximity
|
||||
btype = 1
|
||||
|
||||
/obj/spawner/bomb/timer
|
||||
btype = 2
|
||||
|
||||
/obj/spawner/bomb/timer/syndicate
|
||||
btemp = 450
|
||||
|
||||
/obj/spawner/bomb/suicide
|
||||
btype = 3
|
||||
|
||||
/obj/spawner/newbomb
|
||||
// Remember to delete it if you use it for anything else other than uplinks. See the commented line in its New() - Abi
|
||||
// Going in depth: the reason we do not do a Del() in its New()is because then we cannot access its properties.
|
||||
// I might be doing this wrong / not knowing of a Byond function. If I'm doing it wrong, let me know please.
|
||||
name = "bomb"
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
var/btype = 0 // 0=radio, 1=prox, 2=time
|
||||
var/btemp1 = 1500
|
||||
var/btemp2 = 1000 // tank temperatures
|
||||
|
||||
/obj/spawner/newbomb/timer
|
||||
btype = 2
|
||||
|
||||
/obj/spawner/newbomb/timer/syndicate
|
||||
name = "Low-Yield Bomb"
|
||||
btemp1 = 1500
|
||||
btemp2 = 1000
|
||||
|
||||
/obj/spawner/newbomb/proximity
|
||||
btype = 1
|
||||
|
||||
/obj/spawner/newbomb/radio
|
||||
btype = 0
|
||||
|
||||
/obj/spawner/bomb/New()
|
||||
..()
|
||||
|
||||
switch (src.btype)
|
||||
// radio
|
||||
if (0)
|
||||
var/obj/item/assembly/r_i_ptank/R = new /obj/item/assembly/r_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
||||
var/obj/item/device/radio/signaler/p1 = new /obj/item/device/radio/signaler(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
p1.b_stat = 0
|
||||
p2.status = 1
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
|
||||
// proximity
|
||||
if (1)
|
||||
var/obj/item/assembly/m_i_ptank/R = new /obj/item/assembly/m_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
||||
var/obj/item/device/prox_sensor/p1 = new /obj/item/device/prox_sensor(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
|
||||
if(src.active)
|
||||
R.part1.state = 1
|
||||
R.part1.icon_state = text("motion[]", 1)
|
||||
R.c_state(1, src)
|
||||
|
||||
// timer
|
||||
if (2)
|
||||
var/obj/item/assembly/t_i_ptank/R = new /obj/item/assembly/t_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
||||
var/obj/item/device/timer/p1 = new /obj/item/device/timer(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
//bombvest
|
||||
if(3)
|
||||
var/obj/item/clothing/suit/armor/a_i_a_ptank/R = new /obj/item/clothing/suit/armor/a_i_a_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/p4 = new /obj/item/weapon/tank/phoron(R)
|
||||
var/obj/item/device/healthanalyzer/p1 = new /obj/item/device/healthanalyzer(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
var/obj/item/clothing/suit/armor/vest/p3 = new /obj/item/clothing/suit/armor/vest(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
R.part4 = p4
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
p4.master = R
|
||||
R.status = explosive
|
||||
|
||||
p4.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/spawner/newbomb/New()
|
||||
..()
|
||||
|
||||
switch (src.btype)
|
||||
// radio
|
||||
if (0)
|
||||
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/radio/signaler/S = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = S
|
||||
|
||||
S.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
|
||||
S.b_stat = 0
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
|
||||
// proximity
|
||||
if (1)
|
||||
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/prox_sensor/P = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = P
|
||||
|
||||
P.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
|
||||
|
||||
// timer
|
||||
if (2)
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/timer/T = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = T
|
||||
|
||||
T.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
T.time = 30
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
//del(src)
|
||||
@@ -1,71 +0,0 @@
|
||||
//This looks to be the traitor win tracker code.
|
||||
client/proc/add_roundsjoined()
|
||||
if(!makejson)
|
||||
return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `roundsjoined` (`ckey`) VALUES ('[ckey(src.key)]')")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/add_roundssurvived()
|
||||
if(!makejson)
|
||||
return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `roundsurvived` (`ckey`) VALUES ('[ckey(src.key)]')")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/onDeath()
|
||||
if(!makejson)
|
||||
return
|
||||
roundinfo.deaths++
|
||||
if(!ismob(mob))
|
||||
return
|
||||
var/area = get_area(mob)
|
||||
var/attacker
|
||||
var/tod = time2text(world.realtime)
|
||||
var/health
|
||||
var/last
|
||||
if(ishuman(mob.lastattacker))
|
||||
attacker = mob.lastattacker:name
|
||||
else
|
||||
attacker = "None"
|
||||
health = "Oxy:[mob.oxyloss]Brute:[mob.bruteloss]Burn:[mob.fireloss]Toxins:[mob.toxloss]Brain:[mob.brainloss]"
|
||||
if(mob.attack_log.len >= 1)
|
||||
last = mob.attack_log[mob.attack_log.len]
|
||||
else
|
||||
last = "None"
|
||||
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `deathlog` (`ckey`,`location`,`lastattacker`,`ToD`,`health`,`lasthit`) VALUES ('[ckey]',[dbcon.Quote(area)],[dbcon.Quote(attacker)],'[tod]','[health]',[dbcon.Quote(last)])")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/onBought(names)
|
||||
if(!makejson) return
|
||||
if(!names) return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `traitorbuy` (`type`) VALUES ([dbcon.Quote(names)])")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
datum/roundinfo
|
||||
var/core = 0
|
||||
var/deaths = 0
|
||||
var/revies = 0
|
||||
var/starttime = 0
|
||||
var/endtime = 0
|
||||
var/lenght = 0
|
||||
var/mode = 0
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
|
||||
Hey you!
|
||||
You only need to untick maps/tgstation.2.0.9.dmm for this if you download the modified map from:
|
||||
http://tgstation13.googlecode.com/files/tgstation.2.1.0_deptsec.zip
|
||||
|
||||
Everything else can just be ticked on top of the original stuff.
|
||||
*/
|
||||
@@ -1,126 +0,0 @@
|
||||
var/list/sec_departments = list("engineering", "supply", "medical", "science")
|
||||
|
||||
proc/assign_sec_to_department(var/mob/living/carbon/human/H)
|
||||
if(sec_departments.len)
|
||||
var/department = pick(sec_departments)
|
||||
sec_departments -= department
|
||||
var/access = null
|
||||
var/destination = null
|
||||
switch(department)
|
||||
if("supply")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/cargo(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_ears)
|
||||
access = list(access_mailsorting, access_mining)
|
||||
destination = /area/security/checkpoint/supply
|
||||
if("engineering")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/engine(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_ears)
|
||||
access = list(access_construction, access_engine)
|
||||
destination = /area/security/checkpoint/engineering
|
||||
if("medical")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/med(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_ears)
|
||||
access = list(access_medical)
|
||||
destination = /area/security/checkpoint/medical
|
||||
if("science")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/science(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_ears)
|
||||
access = list(access_research)
|
||||
destination = /area/security/checkpoint/science
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
|
||||
|
||||
if(destination)
|
||||
var/teleport = 0
|
||||
if(!ticker || ticker.current_state <= GAME_STATE_SETTING_UP)
|
||||
teleport = 1
|
||||
spawn(15)
|
||||
if(H)
|
||||
if(teleport)
|
||||
var/turf/T
|
||||
var/safety = 0
|
||||
while(safety < 25)
|
||||
T = pick(get_area_turfs(destination))
|
||||
if(!H.Move(T))
|
||||
safety += 1
|
||||
continue
|
||||
else
|
||||
break
|
||||
H << "<b>You have been assigned to [department]!</b>"
|
||||
if(locate(/obj/item/weapon/card/id, H))
|
||||
var/obj/item/weapon/card/id/I = locate(/obj/item/weapon/card/id, H)
|
||||
if(I)
|
||||
I.access |= access
|
||||
|
||||
|
||||
/datum/job/officer
|
||||
title = "Security Officer"
|
||||
flag = OFFICER
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 5
|
||||
spawn_positions = 5
|
||||
supervisors = "the head of security, and the head of your assigned department (if applicable)"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
assign_sec_to_department(H)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
|
||||
implant_loyalty(H)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/New()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/engi
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/supply
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/med
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_med
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/sci
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
|
||||
|
||||
/obj/item/clothing/under/rank/security/cargo/New()
|
||||
var/obj/item/clothing/tie/armband/cargo/A = new /obj/item/clothing/tie/armband/cargo
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/engine/New()
|
||||
var/obj/item/clothing/tie/armband/engine/A = new /obj/item/clothing/tie/armband/engine
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/science/New()
|
||||
var/obj/item/clothing/tie/armband/science/A = new /obj/item/clothing/tie/armband/science
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/med/New()
|
||||
var/obj/item/clothing/tie/armband/medgreen/A = new /obj/item/clothing/tie/armband/medgreen
|
||||
hastie = A
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
|
||||
Hey you!
|
||||
You'll need to untick code/game/jobs/access.dm for this to all work correctly!
|
||||
|
||||
Everything else can just be ticked on top of the original stuff.
|
||||
|
||||
You'll also need to download a modified map from http://tgstation13.googlecode.com/files/tgstation.2.0.9_Softcurity.zip.
|
||||
Make sure to untick the original map!
|
||||
*/
|
||||
@@ -1,522 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/var/const/access_security = 1 // Security equipment
|
||||
/var/const/access_brig = 2 // Brig timers and permabrig
|
||||
/var/const/access_armory = 3
|
||||
/var/const/access_forensics_lockers= 4
|
||||
/var/const/access_medical = 5
|
||||
/var/const/access_morgue = 6
|
||||
/var/const/access_tox = 7
|
||||
/var/const/access_tox_storage = 8
|
||||
/var/const/access_genetics = 9
|
||||
/var/const/access_engine = 10
|
||||
/var/const/access_engine_equip= 11
|
||||
/var/const/access_maint_tunnels = 12
|
||||
/var/const/access_external_airlocks = 13
|
||||
/var/const/access_emergency_storage = 14
|
||||
/var/const/access_change_ids = 15
|
||||
/var/const/access_ai_upload = 16
|
||||
/var/const/access_teleporter = 17
|
||||
/var/const/access_eva = 18
|
||||
/var/const/access_heads = 19
|
||||
/var/const/access_captain = 20
|
||||
/var/const/access_all_personal_lockers = 21
|
||||
/var/const/access_chapel_office = 22
|
||||
/var/const/access_tech_storage = 23
|
||||
/var/const/access_atmospherics = 24
|
||||
/var/const/access_bar = 25
|
||||
/var/const/access_janitor = 26
|
||||
/var/const/access_crematorium = 27
|
||||
/var/const/access_kitchen = 28
|
||||
/var/const/access_robotics = 29
|
||||
/var/const/access_rd = 30
|
||||
/var/const/access_cargo = 31
|
||||
/var/const/access_construction = 32
|
||||
/var/const/access_chemistry = 33
|
||||
/var/const/access_cargo_bot = 34
|
||||
/var/const/access_hydroponics = 35
|
||||
/var/const/access_manufacturing = 36
|
||||
/var/const/access_library = 37
|
||||
/var/const/access_lawyer = 38
|
||||
/var/const/access_virology = 39
|
||||
/var/const/access_cmo = 40
|
||||
/var/const/access_qm = 41
|
||||
/var/const/access_court = 42
|
||||
/var/const/access_clown = 43
|
||||
/var/const/access_mime = 44
|
||||
/var/const/access_surgery = 45
|
||||
/var/const/access_theatre = 46
|
||||
/var/const/access_research = 47
|
||||
/var/const/access_mining = 48
|
||||
/var/const/access_mining_office = 49 //not in use
|
||||
/var/const/access_mailsorting = 50
|
||||
/var/const/access_mint = 51
|
||||
/var/const/access_mint_vault = 52
|
||||
/var/const/access_heads_vault = 53
|
||||
/var/const/access_mining_station = 54
|
||||
/var/const/access_xenobiology = 55
|
||||
/var/const/access_ce = 56
|
||||
/var/const/access_hop = 57
|
||||
/var/const/access_hos = 58
|
||||
/var/const/access_RC_announce = 59 //Request console announcements
|
||||
/var/const/access_keycard_auth = 60 //Used for events which require at least two people to confirm them
|
||||
/var/const/access_tcomsat = 61 // has access to the entire telecomms satellite / machinery
|
||||
/var/const/access_gateway = 62
|
||||
/var/const/access_sec_doors = 63 // Security front doors
|
||||
|
||||
//BEGIN CENTCOM ACCESS
|
||||
/*Should leave plenty of room if we need to add more access levels.
|
||||
/var/const/Mostly for admin fun times.*/
|
||||
/var/const/access_cent_general = 101//General facilities.
|
||||
/var/const/access_cent_thunder = 102//Thunderdome.
|
||||
/var/const/access_cent_specops = 103//Special Ops.
|
||||
/var/const/access_cent_medical = 104//Medical/Research
|
||||
/var/const/access_cent_living = 105//Living quarters.
|
||||
/var/const/access_cent_storage = 106//Generic storage areas.
|
||||
/var/const/access_cent_teleporter = 107//Teleporter.
|
||||
/var/const/access_cent_creed = 108//Creed's office.
|
||||
/var/const/access_cent_captain = 109//Captain's office/ID comp/AI.
|
||||
|
||||
//The Syndicate
|
||||
/var/const/access_syndicate = 150//General Syndicate Access
|
||||
|
||||
//MONEY
|
||||
/var/const/access_crate_cash = 200
|
||||
|
||||
/obj/var/list/req_access = null
|
||||
/obj/var/req_access_txt = "0"
|
||||
/obj/var/list/req_one_access = null
|
||||
/obj/var/req_one_access_txt = "0"
|
||||
|
||||
/obj/New()
|
||||
..()
|
||||
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
if(!req_access)
|
||||
req_access = list()
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_access += n
|
||||
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
if(!req_one_access)
|
||||
req_one_access = list()
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_one_access += n
|
||||
|
||||
|
||||
|
||||
//returns 1 if this mob has sufficient access to use this object
|
||||
/obj/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
if(src.check_access(null))
|
||||
return 1
|
||||
if(istype(M, /mob/living/silicon))
|
||||
//AI can do whatever he wants
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
//if they are holding or wearing a card that has access, that works
|
||||
if(src.check_access(H.get_active_hand()) || src.check_access(H.wear_id))
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/alien/humanoid))
|
||||
var/mob/living/carbon/george = M
|
||||
//they can only hold things :(
|
||||
if(george.get_active_hand() && (istype(george.get_active_hand(), /obj/item/weapon/card/id) || istype(george.get_active_hand(), /obj/item/device/pda)) && src.check_access(george.get_active_hand()))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/proc/GetAccess()
|
||||
return list()
|
||||
|
||||
/obj/item/proc/GetID()
|
||||
return null
|
||||
|
||||
/obj/proc/check_access(obj/item/weapon/card/id/I)
|
||||
|
||||
if (istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
|
||||
if(!src.req_access && !src.req_one_access) //no requirements
|
||||
return 1
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
var/list/L = src.req_access
|
||||
if(!L.len && (!src.req_one_access || !src.req_one_access.len)) //no requirements
|
||||
return 1
|
||||
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in I.access) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/proc/check_access_list(var/list/L)
|
||||
if(!src.req_access && !src.req_one_access) return 1
|
||||
if(!istype(src.req_access, /list)) return 1
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in L) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/proc/get_access(job)
|
||||
switch(job)
|
||||
if("Geneticist")
|
||||
return list(access_medical, access_morgue, access_genetics)
|
||||
if("Station Engineer")
|
||||
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction)
|
||||
if("Assistant")
|
||||
if(config.assistant_maint)
|
||||
return list(access_maint_tunnels)
|
||||
else
|
||||
return list()
|
||||
if("Chaplain")
|
||||
return list(access_morgue, access_chapel_office, access_crematorium)
|
||||
if("Detective")
|
||||
return list(access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
if("Medical Doctor")
|
||||
return list(access_medical, access_morgue, access_surgery)
|
||||
if("Gardener") // -- TLE
|
||||
return list(access_hydroponics, access_morgue) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // //Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT //Given Morgue access because they have a viable means of cloning.
|
||||
if("Librarian") // -- TLE
|
||||
return list(access_library)
|
||||
if("Lawyer") //Muskets 160910
|
||||
return list(access_lawyer, access_court, access_sec_doors)
|
||||
if("Captain")
|
||||
return get_all_accesses()
|
||||
if("Crew Supervisor")
|
||||
return list(access_security, access_sec_doors, access_brig, access_court)
|
||||
if("Correctional Advisor")
|
||||
return list(access_security, access_sec_doors, access_brig, access_armory, access_court)
|
||||
if("Scientist")
|
||||
return list(access_tox, access_tox_storage, access_research, access_xenobiology)
|
||||
if("Safety Administrator")
|
||||
return list(access_medical, access_morgue, access_tox, access_tox_storage, access_chemistry, access_genetics, access_court,
|
||||
access_teleporter, access_heads, access_tech_storage, access_security, access_sec_doors, access_brig, access_atmospherics,
|
||||
access_maint_tunnels, access_bar, access_janitor, access_kitchen, access_robotics, access_armory, access_hydroponics,
|
||||
access_theatre, access_research, access_hos, access_RC_announce, access_forensics_lockers, access_keycard_auth, access_gateway)
|
||||
if("Head of Personnel")
|
||||
return list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access_tox, access_tox_storage, access_chemistry, access_medical, access_genetics, access_engine,
|
||||
access_emergency_storage, access_change_ids, access_ai_upload, access_eva, access_heads,
|
||||
access_all_personal_lockers, access_tech_storage, access_maint_tunnels, access_bar, access_janitor,
|
||||
access_crematorium, access_kitchen, access_robotics, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway)
|
||||
if("Atmospheric Technician")
|
||||
return list(access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction)
|
||||
if("Bartender")
|
||||
return list(access_bar)
|
||||
if("Chemist")
|
||||
return list(access_medical, access_chemistry)
|
||||
if("Janitor")
|
||||
return list(access_janitor, access_maint_tunnels)
|
||||
if("Clown")
|
||||
return list(access_clown, access_theatre)
|
||||
if("Mime")
|
||||
return list(access_mime, access_theatre)
|
||||
if("Chef")
|
||||
return list(access_kitchen, access_morgue)
|
||||
if("Roboticist")
|
||||
return list(access_robotics, access_tech_storage, access_morgue) //As a job that handles so many corpses, it makes sense for them to have morgue access.
|
||||
if("Cargo Technician")
|
||||
return list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting)
|
||||
if("Shaft Miner")
|
||||
return list(access_mining, access_mint, access_mining_station)
|
||||
if("Quartermaster")
|
||||
return list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
|
||||
if("Chief Engineer")
|
||||
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
|
||||
access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
|
||||
access_heads, access_ai_upload, access_construction, access_robotics,
|
||||
access_mint, access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_sec_doors)
|
||||
if("Research Director")
|
||||
return list(access_rd, access_heads, access_tox, access_genetics,
|
||||
access_tox_storage, access_teleporter,
|
||||
access_research, access_robotics, access_xenobiology,
|
||||
access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_sec_doors)
|
||||
if("Virologist")
|
||||
return list(access_medical, access_virology)
|
||||
if("Chief Medical Officer")
|
||||
return list(access_medical, access_morgue, access_genetics, access_heads,
|
||||
access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce,
|
||||
access_keycard_auth, access_sec_doors)
|
||||
else
|
||||
return list()
|
||||
|
||||
/proc/get_centcom_access(job)
|
||||
switch(job)
|
||||
if("VIP Guest")
|
||||
return list(access_cent_general)
|
||||
if("Custodian")
|
||||
return list(access_cent_general, access_cent_living, access_cent_storage)
|
||||
if("Thunderdome Overseer")
|
||||
return list(access_cent_general, access_cent_thunder)
|
||||
if("Intel Officer")
|
||||
return list(access_cent_general, access_cent_living)
|
||||
if("Medical Officer")
|
||||
return list(access_cent_general, access_cent_living, access_cent_medical)
|
||||
if("Death Commando")
|
||||
return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)
|
||||
if("Research Officer")
|
||||
return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_teleporter, access_cent_storage)
|
||||
if("BlackOps Commander")
|
||||
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_living, access_cent_storage, access_cent_creed)
|
||||
if("Supreme Commander")
|
||||
return get_all_centcom_access()
|
||||
|
||||
/proc/get_all_accesses()
|
||||
return list(access_security, access_sec_doors, access_brig, access_armory, access_forensics_lockers, access_court,
|
||||
access_medical, access_genetics, access_morgue, access_rd,
|
||||
access_tox, access_tox_storage, access_chemistry, access_engine, access_engine_equip, access_maint_tunnels,
|
||||
access_external_airlocks, access_emergency_storage, access_change_ids, access_ai_upload,
|
||||
access_teleporter, access_eva, access_heads, access_captain, access_all_personal_lockers,
|
||||
access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen,
|
||||
access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_cargo_bot, access_construction,
|
||||
access_hydroponics, access_library, access_manufacturing, access_lawyer, access_virology, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_theatre, access_research, access_mining, access_mailsorting, access_mint_vault, access_mint,
|
||||
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
|
||||
access_keycard_auth, access_tcomsat, access_gateway)
|
||||
|
||||
/proc/get_all_centcom_access()
|
||||
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_creed, access_cent_captain)
|
||||
|
||||
/proc/get_all_syndicate_access()
|
||||
return list(access_syndicate)
|
||||
|
||||
/proc/get_region_accesses(var/code)
|
||||
switch(code)
|
||||
if(0)
|
||||
return get_all_accesses()
|
||||
if(1) //security
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos)
|
||||
if(2) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo)
|
||||
if(3) //research
|
||||
return list(access_research, access_tox, access_tox_storage, access_xenobiology, access_rd)
|
||||
if(4) //engineering and maintenance
|
||||
return list(access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_construction, access_robotics, access_ce)
|
||||
if(5) //command
|
||||
return list(access_heads, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_all_personal_lockers, access_heads_vault, access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_hop, access_captain)
|
||||
if(6) //station general
|
||||
return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_clown, access_mime)
|
||||
if(7) //supply
|
||||
return list(access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_mining, access_mining_station)
|
||||
|
||||
/proc/get_region_accesses_name(var/code)
|
||||
switch(code)
|
||||
if(0)
|
||||
return "All"
|
||||
if(1) //security
|
||||
return "Security"
|
||||
if(2) //medbay
|
||||
return "Medbay"
|
||||
if(3) //research
|
||||
return "Research"
|
||||
if(4) //engineering and maintenance
|
||||
return "Engineering"
|
||||
if(5) //command
|
||||
return "Command"
|
||||
if(6) //station general
|
||||
return "Station General"
|
||||
if(7) //supply
|
||||
return "Supply"
|
||||
|
||||
|
||||
/proc/get_access_desc(A)
|
||||
switch(A)
|
||||
if(access_cargo)
|
||||
return "Cargo Bay"
|
||||
if(access_cargo_bot)
|
||||
return "Cargo Bot Delivery"
|
||||
if(access_security)
|
||||
return "Security"
|
||||
if(access_brig)
|
||||
return "Holding Cells"
|
||||
if(access_court)
|
||||
return "Courtroom"
|
||||
if(access_forensics_lockers)
|
||||
return "Detective's Office"
|
||||
if(access_medical)
|
||||
return "Medical"
|
||||
if(access_genetics)
|
||||
return "Genetics Lab"
|
||||
if(access_morgue)
|
||||
return "Morgue"
|
||||
if(access_tox)
|
||||
return "Research Lab"
|
||||
if(access_tox_storage)
|
||||
return "Toxins Storage"
|
||||
if(access_chemistry)
|
||||
return "Chemistry Lab"
|
||||
if(access_rd)
|
||||
return "RD Private"
|
||||
if(access_bar)
|
||||
return "Bar"
|
||||
if(access_janitor)
|
||||
return "Custodial Closet"
|
||||
if(access_engine)
|
||||
return "Engineering"
|
||||
if(access_engine_equip)
|
||||
return "APCs"
|
||||
if(access_maint_tunnels)
|
||||
return "Maintenance"
|
||||
if(access_external_airlocks)
|
||||
return "External Airlocks"
|
||||
if(access_emergency_storage)
|
||||
return "Emergency Storage"
|
||||
if(access_change_ids)
|
||||
return "ID Computer"
|
||||
if(access_ai_upload)
|
||||
return "AI Upload"
|
||||
if(access_teleporter)
|
||||
return "Teleporter"
|
||||
if(access_eva)
|
||||
return "EVA"
|
||||
if(access_heads)
|
||||
return "Bridge"
|
||||
if(access_captain)
|
||||
return "Captain Private"
|
||||
if(access_all_personal_lockers)
|
||||
return "Personal Lockers"
|
||||
if(access_chapel_office)
|
||||
return "Chapel Office"
|
||||
if(access_tech_storage)
|
||||
return "Technical Storage"
|
||||
if(access_atmospherics)
|
||||
return "Atmospherics"
|
||||
if(access_crematorium)
|
||||
return "Crematorium"
|
||||
if(access_armory)
|
||||
return "Armory"
|
||||
if(access_construction)
|
||||
return "Construction Areas"
|
||||
if(access_kitchen)
|
||||
return "Kitchen"
|
||||
if(access_hydroponics)
|
||||
return "Hydroponics"
|
||||
if(access_library)
|
||||
return "Library"
|
||||
if(access_lawyer)
|
||||
return "Law Office"
|
||||
if(access_robotics)
|
||||
return "Robotics"
|
||||
if(access_virology)
|
||||
return "Virology"
|
||||
if(access_cmo)
|
||||
return "CMO Private"
|
||||
if(access_qm)
|
||||
return "Quartermaster's Office"
|
||||
if(access_clown)
|
||||
return "HONK! Access"
|
||||
if(access_mime)
|
||||
return "Silent Access"
|
||||
if(access_surgery)
|
||||
return "Surgery"
|
||||
if(access_theatre)
|
||||
return "Theatre"
|
||||
if(access_manufacturing)
|
||||
return "Manufacturing"
|
||||
if(access_research)
|
||||
return "Science"
|
||||
if(access_mining)
|
||||
return "Mining"
|
||||
if(access_mining_office)
|
||||
return "Mining Office"
|
||||
if(access_mailsorting)
|
||||
return "Delivery Office"
|
||||
if(access_mint)
|
||||
return "Mint"
|
||||
if(access_mint_vault)
|
||||
return "Mint Vault"
|
||||
if(access_heads_vault)
|
||||
return "Main Vault"
|
||||
if(access_mining_station)
|
||||
return "Mining Station EVA"
|
||||
if(access_xenobiology)
|
||||
return "Xenobiology Lab"
|
||||
if(access_hop)
|
||||
return "HoP Private"
|
||||
if(access_hos)
|
||||
return "HoS Private"
|
||||
if(access_ce)
|
||||
return "CE Private"
|
||||
if(access_RC_announce)
|
||||
return "RC Announcements"
|
||||
if(access_keycard_auth)
|
||||
return "Keycode Auth. Device"
|
||||
if(access_tcomsat)
|
||||
return "Telecommunications"
|
||||
if(access_gateway)
|
||||
return "Gateway"
|
||||
if(access_sec_doors)
|
||||
return "Brig"
|
||||
|
||||
/proc/get_centcom_access_desc(A)
|
||||
switch(A)
|
||||
if(access_cent_general)
|
||||
return "Code Grey"
|
||||
if(access_cent_thunder)
|
||||
return "Code Yellow"
|
||||
if(access_cent_storage)
|
||||
return "Code Orange"
|
||||
if(access_cent_living)
|
||||
return "Code Green"
|
||||
if(access_cent_medical)
|
||||
return "Code White"
|
||||
if(access_cent_teleporter)
|
||||
return "Code Blue"
|
||||
if(access_cent_specops)
|
||||
return "Code Black"
|
||||
if(access_cent_creed)
|
||||
return "Code Silver"
|
||||
if(access_cent_captain)
|
||||
return "Code Gold"
|
||||
|
||||
/proc/get_all_jobs()
|
||||
return list("Assistant", "Captain", "Head of Personnel", "Bartender", "Chef", "Gardener", "Quartermaster", "Cargo Technician",
|
||||
"Shaft Miner", "Clown", "Mime", "Janitor", "Librarian", "Lawyer", "Chaplain", "Chief Engineer", "Station Engineer",
|
||||
"Atmospheric Technician", "Roboticist", "Chief Medical Officer", "Medical Doctor", "Chemist", "Geneticist", "Virologist",
|
||||
"Research Director", "Scientist", "Head of Security", "Warden", "Detective", "Security Officer")
|
||||
|
||||
/proc/get_all_centcom_jobs()
|
||||
return list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer","BlackOps Commander","Supreme Commander")
|
||||
|
||||
/obj/proc/GetJobName()
|
||||
if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id))
|
||||
return
|
||||
|
||||
var/jobName
|
||||
|
||||
if(istype(src, /obj/item/device/pda))
|
||||
if(src:id)
|
||||
jobName = src:id:assignment
|
||||
if(istype(src, /obj/item/weapon/card/id))
|
||||
jobName = src:assignment
|
||||
|
||||
if(jobName in get_all_jobs())
|
||||
return jobName
|
||||
else
|
||||
return "Unknown"
|
||||
@@ -1,33 +0,0 @@
|
||||
/obj/item/clothing/under/rank/administrator
|
||||
name = "safety administrator's jumpsuit"
|
||||
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Safety Administrator\"."
|
||||
icon_state = "hosblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "hosblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/under/rank/advisor
|
||||
name = "correctional advisor's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the words \"Correctional Advisor\" written on the shoulders."
|
||||
icon_state = "wardenblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "wardenblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/under/rank/supervisor
|
||||
name = "crew supervisor's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
|
||||
icon_state = "officerblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "officerblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/shoes/boots
|
||||
name = "boots"
|
||||
desc = "Nanotrasen-issue hard-toe safety boots."
|
||||
icon_state = "secshoes"
|
||||
item_state = "secshoes"
|
||||
color = "hosred"
|
||||
@@ -1,150 +0,0 @@
|
||||
/datum/job/hos
|
||||
title = "Safety Administrator"
|
||||
flag = HOS
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the captain"
|
||||
selection_color = "#ffdddd"
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/administrator(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/taser(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
|
||||
H.implant_loyalty(src) // Will not do so if config is set to disallow.
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/warden
|
||||
title = "Correctional Advisor"
|
||||
flag = WARDEN
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/advisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
|
||||
H.implant_loyalty(src) // // Will not do so if config is set to disallow.
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/detective
|
||||
title = "Detective"
|
||||
flag = DETECTIVE
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head)
|
||||
var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H)
|
||||
CIG.light("")
|
||||
H.equip_to_slot_or_del(CIG, slot_wear_mask)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/flame/lighter/zippo(H), slot_l_store)
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack)
|
||||
|
||||
H.implant_loyalty(src) // Will not do so if config is set to disallow.
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/officer
|
||||
title = "Crew Supervisor"
|
||||
flag = OFFICER
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 5
|
||||
spawn_positions = 5
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/supervisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_r_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
|
||||
H.implant_loyalty(src) // Will not do so if config is set to disallow.
|
||||
|
||||
return 1
|
||||
|
||||
/datum/job/hop
|
||||
title = "Head of Personnel"
|
||||
flag = HOP
|
||||
department_flag = CIVILIAN
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the captain"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_ears)
|
||||
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack)
|
||||
return 1
|
||||
@@ -1,227 +0,0 @@
|
||||
/obj/structure/closet/secure_closet/captains
|
||||
name = "Captain's Locker"
|
||||
req_access = list(access_captain)
|
||||
icon_state = "capsecure1"
|
||||
icon_closed = "capsecure"
|
||||
icon_locked = "capsecure1"
|
||||
icon_opened = "capsecureopen"
|
||||
icon_broken = "capsecurebroken"
|
||||
icon_off = "capsecureoff"
|
||||
|
||||
New()
|
||||
if(prob(50))
|
||||
new /obj/item/weapon/storage/backpack/captain(src)
|
||||
else
|
||||
new /obj/item/weapon/storage/backpack/satchel_cap(src)
|
||||
new /obj/item/clothing/suit/captunic(src)
|
||||
new /obj/item/clothing/head/helmet/cap(src)
|
||||
new /obj/item/clothing/under/rank/captain(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/weapon/cartridge/captain(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/heads/captain(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
|
||||
new /obj/item/clothing/gloves/captain(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/hop
|
||||
name = "Head of Personnel's Locker"
|
||||
req_access = list(access_hop)
|
||||
icon_state = "hopsecure1"
|
||||
icon_closed = "hopsecure"
|
||||
icon_locked = "hopsecure1"
|
||||
icon_opened = "hopsecureopen"
|
||||
icon_broken = "hopsecurebroken"
|
||||
icon_off = "hopsecureoff"
|
||||
|
||||
New()
|
||||
new /obj/item/clothing/under/rank/head_of_personnel(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/head/helmet(src)
|
||||
new /obj/item/weapon/cartridge/hop(src)
|
||||
new /obj/item/device/radio/headset/heads/hop(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/weapon/storage/id_kit( src )
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/hos
|
||||
name = "Safety Administrator's Locker"
|
||||
req_access = list(access_hos)
|
||||
icon_state = "hossecure1"
|
||||
icon_closed = "hossecure"
|
||||
icon_locked = "hossecure1"
|
||||
icon_opened = "hossecureopen"
|
||||
icon_broken = "hossecurebroken"
|
||||
icon_off = "hossecureoff"
|
||||
|
||||
New()
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/weapon/cartridge/hos(src)
|
||||
new /obj/item/device/radio/headset/heads/hos(src)
|
||||
if (config.use_loyalty_implants) new /obj/item/weapon/storage/lockbox/loyalty(src)
|
||||
new /obj/item/weapon/storage/flashbang_kit(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/taser(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/warden
|
||||
name = "Correctional Advisor's Locker"
|
||||
req_access = list(access_armory)
|
||||
icon_state = "wardensecure1"
|
||||
icon_closed = "wardensecure"
|
||||
icon_locked = "wardensecure1"
|
||||
icon_opened = "wardensecureopen"
|
||||
icon_broken = "wardensecurebroken"
|
||||
icon_off = "wardensecureoff"
|
||||
|
||||
|
||||
New()
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/clothing/under/rank/advisor(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/weapon/storage/flashbang_kit(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/security
|
||||
name = "Crew Supervisor's Locker"
|
||||
req_access = list(access_security)
|
||||
icon_state = "sec1"
|
||||
icon_closed = "sec"
|
||||
icon_locked = "sec1"
|
||||
icon_opened = "secopen"
|
||||
icon_broken = "secbroken"
|
||||
icon_off = "secoff"
|
||||
|
||||
New()
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/detective
|
||||
name = "Detective's Cabinet"
|
||||
req_access = list(access_forensics_lockers)
|
||||
icon_state = "cabinetdetective_locked"
|
||||
icon_closed = "cabinetdetective"
|
||||
icon_locked = "cabinetdetective_locked"
|
||||
icon_opened = "cabinetdetective_open"
|
||||
icon_broken = "cabinetdetective_broken"
|
||||
icon_off = "cabinetdetective_broken"
|
||||
|
||||
New()
|
||||
new /obj/item/clothing/under/det(src)
|
||||
new /obj/item/clothing/suit/armor/det_suit(src)
|
||||
new /obj/item/clothing/suit/det_suit(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/head/det_hat(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/weapon/cartridge/detective(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/secure_closet/detective/update_icon()
|
||||
if(broken)
|
||||
icon_state = icon_broken
|
||||
else
|
||||
if(!opened)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
else
|
||||
icon_state = icon_closed
|
||||
else
|
||||
icon_state = icon_opened
|
||||
|
||||
/obj/structure/closet/secure_closet/injection
|
||||
name = "Lethal Injections"
|
||||
req_access = list(access_hos)
|
||||
|
||||
|
||||
New()
|
||||
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
|
||||
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/brig
|
||||
name = "Brig Locker"
|
||||
req_access = list(access_brig)
|
||||
anchored = 1
|
||||
|
||||
New()
|
||||
new /obj/item/clothing/under/color/orange( src )
|
||||
new /obj/item/clothing/shoes/orange( src )
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/courtroom
|
||||
name = "Courtroom Locker"
|
||||
req_access = list(access_court)
|
||||
|
||||
New()
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/pen (src)
|
||||
new /obj/item/clothing/suit/judgerobe (src)
|
||||
new /obj/item/clothing/head/powdered_wig (src)
|
||||
new /obj/item/weapon/storage/briefcase(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/secure_closet/wall
|
||||
name = "wall locker"
|
||||
req_access = list(access_security)
|
||||
icon_state = "wall-locker1"
|
||||
density = 1
|
||||
icon_closed = "wall-locker"
|
||||
icon_locked = "wall-locker1"
|
||||
icon_opened = "wall-lockeropen"
|
||||
icon_broken = "wall-lockerbroken"
|
||||
icon_off = "wall-lockeroff"
|
||||
|
||||
//too small to put a man in
|
||||
large = 0
|
||||
|
||||
/obj/structure/closet/secure_closet/wall/update_icon()
|
||||
if(broken)
|
||||
icon_state = icon_broken
|
||||
else
|
||||
if(!opened)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
else
|
||||
icon_state = icon_closed
|
||||
else
|
||||
icon_state = icon_opened
|
||||
@@ -1,311 +0,0 @@
|
||||
/obj/structure/closet/wardrobe
|
||||
name = "wardrobe"
|
||||
desc = "It's a storage unit for standard-issue Nanotrasen attire."
|
||||
icon_state = "blue"
|
||||
icon_closed = "blue"
|
||||
|
||||
/obj/structure/closet/wardrobe/New()
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/red
|
||||
name = "security wardrobe"
|
||||
icon_state = "red"
|
||||
icon_closed = "red"
|
||||
|
||||
/obj/structure/closet/wardrobe/red/New()
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/pink
|
||||
name = "pink wardrobe"
|
||||
icon_state = "pink"
|
||||
icon_closed = "pink"
|
||||
|
||||
/obj/structure/closet/wardrobe/pink/New()
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/wardrobe/black
|
||||
name = "black wardrobe"
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/black/New()
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/chaplain_black
|
||||
name = "chapel wardrobe"
|
||||
desc = "It's a storage unit for Nanotrasen-approved religious attire."
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/chaplain_black/New()
|
||||
new /obj/item/clothing/under/rank/chaplain(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/suit/nun(src)
|
||||
new /obj/item/clothing/head/nun_hood(src)
|
||||
new /obj/item/clothing/suit/chaplain_hoodie(src)
|
||||
new /obj/item/clothing/head/chaplain_hood(src)
|
||||
new /obj/item/clothing/suit/holidaypriest(src)
|
||||
new /obj/item/weapon/storage/backpack/cultpack (src)
|
||||
new /obj/item/weapon/storage/fancy/candle_box(src)
|
||||
new /obj/item/weapon/storage/fancy/candle_box(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/green
|
||||
name = "green wardrobe"
|
||||
icon_state = "green"
|
||||
icon_closed = "green"
|
||||
|
||||
/obj/structure/closet/wardrobe/green/New()
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/orange
|
||||
name = "prison wardrobe"
|
||||
desc = "It's a storage unit for Nanotrasen-regulation prisoner attire."
|
||||
icon_state = "orange"
|
||||
icon_closed = "orange"
|
||||
|
||||
/obj/structure/closet/wardrobe/orange/New()
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/yellow
|
||||
name = "yellow wardrobe"
|
||||
icon_state = "wardrobe-y"
|
||||
icon_closed = "wardrobe-y"
|
||||
|
||||
/obj/structure/closet/wardrobe/yellow/New()
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/atmospherics_yellow
|
||||
name = "atmospherics wardrobe"
|
||||
icon_state = "yellow"
|
||||
icon_closed = "yellow"
|
||||
|
||||
/obj/structure/closet/wardrobe/atmospherics_yellow/New()
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/engineering_yellow
|
||||
name = "engineering wardrobe"
|
||||
icon_state = "yellow"
|
||||
icon_closed = "yellow"
|
||||
|
||||
/obj/structure/closet/wardrobe/engineering_yellow/New()
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/white
|
||||
name = "white wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/white/New()
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/pjs
|
||||
name = "Pajama wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/pjs/New()
|
||||
new /obj/item/clothing/under/pj/red(src)
|
||||
new /obj/item/clothing/under/pj/red(src)
|
||||
new /obj/item/clothing/under/pj/blue(src)
|
||||
new /obj/item/clothing/under/pj/blue(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/science_white
|
||||
name = "science wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/science_white/New()
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/robotics_black
|
||||
name = "robotics wardrobe"
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/robotics_black/New()
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/chemistry_white
|
||||
name = "chemistry wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/chemistry_white/New()
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/chemist(src)
|
||||
new /obj/item/clothing/suit/labcoat/chemist(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/genetics_white
|
||||
name = "genetics wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/genetics_white/New()
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/genetics(src)
|
||||
new /obj/item/clothing/suit/labcoat/genetics(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/virology_white
|
||||
name = "virology wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/virology_white/New()
|
||||
new /obj/item/clothing/under/rank/virologist(src)
|
||||
new /obj/item/clothing/under/rank/virologist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/virologist(src)
|
||||
new /obj/item/clothing/suit/labcoat/virologist(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/grey
|
||||
name = "grey wardrobe"
|
||||
icon_state = "grey"
|
||||
icon_closed = "grey"
|
||||
|
||||
/obj/structure/closet/wardrobe/grey/New()
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/mixed
|
||||
name = "mixed wardrobe"
|
||||
icon_state = "mixed"
|
||||
icon_closed = "mixed"
|
||||
|
||||
/obj/structure/closet/wardrobe/mixed/New()
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
@@ -1,385 +0,0 @@
|
||||
//UltraLight system, by Sukasa
|
||||
|
||||
|
||||
#define UL_I_FALLOFF_SQUARE 0
|
||||
#define UL_I_FALLOFF_ROUND 1
|
||||
|
||||
#define UL_I_LIT 0
|
||||
#define UL_I_EXTINGUISHED 1
|
||||
#define UL_I_ONZERO 2
|
||||
#define UL_I_CHANGING 3
|
||||
|
||||
#define ul_LightingEnabled 1
|
||||
//#define ul_LightingResolution 2
|
||||
//Uncomment if you want maybe slightly smoother lighting
|
||||
#define ul_Steps 7
|
||||
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
|
||||
#define ul_Layer 10
|
||||
#define ul_TopLuminosity 12 //Maximum brightness an object can have.
|
||||
|
||||
//#define ul_LightLevelChangedUpdates
|
||||
//Uncomment if you have code that you want triggered when the light level on an atom changes.
|
||||
|
||||
|
||||
#define ul_Clamp(Value) min(max(Value, 0), ul_Steps)
|
||||
#define ul_IsLuminous(A) (A.ul_Red || A.ul_Green || A.ul_Blue)
|
||||
#define ul_Luminosity(A) max(A.ul_Red, A.ul_Green, A.ul_Blue)
|
||||
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
var/ul_LightingResolutionSqrt = sqrt(ul_LightingResolution)
|
||||
#endif
|
||||
var/ul_SuppressLightLevelChanges = 0
|
||||
|
||||
|
||||
var/list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7)
|
||||
|
||||
var/list/ul_IconCache = list()
|
||||
|
||||
|
||||
proc/ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src))
|
||||
for(var/atom/Light in ReApply)
|
||||
if(ul_IsLuminous(Light))
|
||||
Light.ul_Illuminate()
|
||||
return
|
||||
|
||||
atom/var/ul_Red = 0
|
||||
atom/var/ul_Green = 0
|
||||
atom/var/ul_Blue = 0
|
||||
atom/var/turf/ul_LastIlluminated
|
||||
|
||||
atom/var/ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
atom/proc/ul_SetLuminosity(var/Red = 0, var/Green = Red, var/Blue = Red)
|
||||
|
||||
if(ul_Extinguished == UL_I_CHANGING) //Changing state, just supress any changes, to prevent glitches.
|
||||
return
|
||||
|
||||
if(ul_Red == min(Red, ul_TopLuminosity) && ul_Green == min(Green, ul_TopLuminosity) && ul_Blue == min(Blue, ul_TopLuminosity))
|
||||
return //No point doing all that work if it won't have any effect anyways...
|
||||
|
||||
if (ul_Extinguished == UL_I_EXTINGUISHED)
|
||||
ul_Red = min(Red,ul_TopLuminosity)
|
||||
ul_Green = min(Green,ul_TopLuminosity)
|
||||
ul_Blue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
return
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
|
||||
ul_Red = min(Red,ul_TopLuminosity)
|
||||
ul_Green = min(Green,ul_TopLuminosity)
|
||||
ul_Blue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Illuminate()
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_Illuminate()
|
||||
if (ul_Extinguished == UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_CHANGING
|
||||
|
||||
luminosity = ul_Luminosity(src)
|
||||
|
||||
for(var/turf/Affected in view(luminosity, src))
|
||||
var/Falloff = ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = ul_Red - Falloff
|
||||
var/DeltaGreen = ul_Green - Falloff
|
||||
var/DeltaBlue = ul_Blue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(!Affected.MaxRed)
|
||||
Affected.MaxRed = list()
|
||||
Affected.MaxRed += DeltaRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(!Affected.MaxGreen)
|
||||
Affected.MaxGreen = list()
|
||||
Affected.MaxGreen += DeltaGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(!Affected.MaxBlue)
|
||||
Affected.MaxBlue = list()
|
||||
Affected.MaxBlue += DeltaBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
|
||||
ul_LastIlluminated = get_turf(src)
|
||||
ul_Extinguished = UL_I_LIT
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_Extinguish()
|
||||
|
||||
if (ul_Extinguished != UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_CHANGING
|
||||
|
||||
for(var/turf/Affected in view(ul_Luminosity(src), ul_LastIlluminated))
|
||||
|
||||
var/Falloff = ul_LastIlluminated.ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = ul_Red - Falloff
|
||||
var/DeltaGreen = ul_Green - Falloff
|
||||
var/DeltaBlue = ul_Blue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(Affected.MaxRed)
|
||||
var/removed_light_source = Affected.MaxRed.Find(DeltaRed)
|
||||
if(removed_light_source)
|
||||
Affected.MaxRed.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxRed.len)
|
||||
del Affected.MaxRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(Affected.MaxGreen)
|
||||
var/removed_light_source = Affected.MaxGreen.Find(DeltaGreen)
|
||||
if(removed_light_source)
|
||||
Affected.MaxGreen.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxGreen.len)
|
||||
del Affected.MaxGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(Affected.MaxBlue)
|
||||
var/removed_light_source = Affected.MaxBlue.Find(DeltaBlue)
|
||||
if(removed_light_source)
|
||||
Affected.MaxBlue.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxBlue.len)
|
||||
del Affected.MaxBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
|
||||
ul_Extinguished = UL_I_EXTINGUISHED
|
||||
luminosity = 0
|
||||
ul_LastIlluminated = null
|
||||
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
Calculates the correct lighting falloff value (used to calculate what brightness to set the turf to) to use,
|
||||
when called on a luminous atom and passed an atom in the turf to be lit.
|
||||
|
||||
Supports multiple configurations, BS12 uses the circular falloff setting. This setting uses an array lookup
|
||||
to avoid the cost of the square root function.
|
||||
*/
|
||||
atom/proc/ul_FalloffAmount(var/atom/ref)
|
||||
if (ul_FalloffStyle == UL_I_FALLOFF_ROUND)
|
||||
var/delta_x = (ref.x - src.x)
|
||||
var/delta_y = (ref.y - src.y)
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
if (round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt,1) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= round(delta_x*delta_x+delta_y*delta_y*ul_LightingResolutionSqrt,1), i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt, 1) + 1]/ul_LightingResolution
|
||||
|
||||
#else
|
||||
if ((delta_x*delta_x + delta_y*delta_y) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= delta_x*delta_x+delta_y*delta_y, i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[delta_x*delta_x + delta_y*delta_y + 1]
|
||||
|
||||
#endif
|
||||
|
||||
else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE)
|
||||
return get_dist(src, ref)
|
||||
|
||||
return 0
|
||||
|
||||
atom/proc/ul_SetOpacity(var/NewOpacity)
|
||||
if(opacity != NewOpacity)
|
||||
|
||||
var/list/Blanked = ul_BlankLocal()
|
||||
|
||||
opacity = NewOpacity
|
||||
|
||||
ul_UnblankLocal(Blanked)
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_BlankLocal()
|
||||
var/list/Blanked = list( )
|
||||
var/TurfAdjust = isturf(src) ? 1 : 0
|
||||
|
||||
for(var/atom/Affected in view(ul_TopLuminosity, src))
|
||||
if(ul_IsLuminous(Affected) && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= ul_Luminosity(Affected) + TurfAdjust))
|
||||
Affected.ul_Extinguish()
|
||||
Blanked += Affected
|
||||
|
||||
return Blanked
|
||||
|
||||
atom/proc/ul_LightLevelChanged()
|
||||
//Designed for client projects to use. Called on items when the turf they are in has its light level changed
|
||||
return
|
||||
|
||||
atom/New()
|
||||
. = ..()
|
||||
if(ul_IsLuminous(src))
|
||||
spawn(5)
|
||||
ul_Illuminate()
|
||||
|
||||
atom/Del()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
|
||||
atom/movable/Move()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
ul_Illuminate()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
turf/var/list/MaxRed
|
||||
turf/var/list/MaxGreen
|
||||
turf/var/list/MaxBlue
|
||||
|
||||
turf/proc/ul_GetRed()
|
||||
if(MaxRed)
|
||||
return ul_Clamp(max(MaxRed))
|
||||
return 0
|
||||
turf/proc/ul_GetGreen()
|
||||
if(MaxGreen)
|
||||
return ul_Clamp(max(MaxGreen))
|
||||
return 0
|
||||
turf/proc/ul_GetBlue()
|
||||
if(MaxBlue)
|
||||
return ul_Clamp(max(MaxBlue))
|
||||
return 0
|
||||
|
||||
turf/proc/ul_UpdateLight()
|
||||
var/area/CurrentArea = loc
|
||||
|
||||
if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting)
|
||||
return
|
||||
|
||||
var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]"
|
||||
|
||||
if(CurrentArea.tag != LightingTag)
|
||||
var/area/NewArea = locate(LightingTag)
|
||||
|
||||
if(!NewArea)
|
||||
NewArea = new CurrentArea.type()
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
for(var/V in CurrentArea.vars - "contents")
|
||||
if(issaved(CurrentArea.vars[V]))
|
||||
NewArea.vars[V] = CurrentArea.vars[V]
|
||||
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
NewArea.ul_Light(ul_GetRed(), ul_GetGreen(), ul_GetBlue())
|
||||
|
||||
|
||||
NewArea.contents += src
|
||||
|
||||
return
|
||||
|
||||
turf/proc/ul_Recalculate()
|
||||
|
||||
ul_SuppressLightLevelChanges++
|
||||
|
||||
var/list/Lights = ul_BlankLocal()
|
||||
|
||||
ul_UnblankLocal(Lights)
|
||||
|
||||
ul_SuppressLightLevelChanges--
|
||||
|
||||
return
|
||||
|
||||
area/var/ul_Overlay = null
|
||||
area/var/ul_Lighting = 1
|
||||
|
||||
area/var/LightLevelRed = 0
|
||||
area/var/LightLevelGreen = 0
|
||||
area/var/LightLevelBlue = 0
|
||||
area/var/list/LightLevels
|
||||
|
||||
area/proc/ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue)
|
||||
|
||||
if(!src || !src.ul_Lighting)
|
||||
return
|
||||
|
||||
overlays -= ul_Overlay
|
||||
if(LightLevels)
|
||||
if(Red < LightLevels["Red"])
|
||||
Red = LightLevels["Red"]
|
||||
if(Green < LightLevels["Green"])
|
||||
Green = LightLevels["Green"]
|
||||
if(Blue < LightLevels["Blue"])
|
||||
Blue = LightLevels["Blue"]
|
||||
|
||||
LightLevelRed = Red
|
||||
LightLevelGreen = Green
|
||||
LightLevelBlue = Blue
|
||||
|
||||
luminosity = LightLevelRed || LightLevelGreen || LightLevelBlue
|
||||
|
||||
var/ul_CachedOverlay = ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"]
|
||||
if(ul_CachedOverlay)
|
||||
ul_Overlay = ul_CachedOverlay
|
||||
else
|
||||
ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"] = image('icons/effects/ULIcons.dmi', , "[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]", ul_Layer)
|
||||
ul_Overlay = ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"]
|
||||
|
||||
overlays += ul_Overlay
|
||||
|
||||
return
|
||||
|
||||
area/proc/ul_Prep()
|
||||
|
||||
if(!tag)
|
||||
tag = "[type]"
|
||||
if(ul_Lighting)
|
||||
if(!findtext(tag,":UL"))
|
||||
ul_Light()
|
||||
//world.log << tag
|
||||
|
||||
return
|
||||
|
||||
#undef UL_I_FALLOFF_SQUARE
|
||||
#undef UL_I_FALLOFF_ROUND
|
||||
#undef UL_I_LIT
|
||||
#undef UL_I_EXTINGUISHED
|
||||
#undef UL_I_ONZERO
|
||||
#undef ul_LightingEnabled
|
||||
#undef ul_LightingResolution
|
||||
#undef ul_Steps
|
||||
#undef ul_FalloffStyle
|
||||
#undef ul_Layer
|
||||
#undef ul_TopLuminosity
|
||||
#undef ul_Clamp
|
||||
#undef ul_LightLevelChangedUpdates
|
||||
@@ -1,96 +0,0 @@
|
||||
/obj/machinery/coatrack/attack_hand(mob/user as mob)
|
||||
switch(alert("What do you want from the coat rack?",,"Coat","Hat"))
|
||||
if("Coat")
|
||||
if(coat)
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hand(coat)
|
||||
else
|
||||
coat.loc = get_turf(user)
|
||||
coat = null
|
||||
if(!hat)
|
||||
icon_state = "coatrack0"
|
||||
else
|
||||
icon_state = "coatrack1"
|
||||
return
|
||||
else
|
||||
user << "\blue There is no coat to take!"
|
||||
return
|
||||
if("Hat")
|
||||
if(hat)
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hand(hat)
|
||||
else
|
||||
hat.loc = get_turf(user)
|
||||
hat = null
|
||||
if(!coat)
|
||||
icon_state = "coatrack0"
|
||||
else
|
||||
icon_state = "coatrack2"
|
||||
return
|
||||
else
|
||||
user << "\blue There is no hat to take!"
|
||||
return
|
||||
user << "Something went wrong."
|
||||
return
|
||||
|
||||
/obj/machinery/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
var/obj/item/I = user.equipped()
|
||||
if ( istype(I,/obj/item/clothing/head/det_hat) && !hat)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
hat = I
|
||||
if(!coat)
|
||||
icon_state = "coatrack1"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue [user] puts his hat onto the rack."), 2)
|
||||
return
|
||||
if ( istype(I,/obj/item/clothing/suit/storage/det_suit) && !coat)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
coat = I
|
||||
if(!hat)
|
||||
icon_state = "coatrack2"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue [user] puts his coat onto the rack."), 2)
|
||||
return
|
||||
if ( istype(I,/obj/item/clothing/head/det_hat) && hat)
|
||||
user << "There's already a hat on the rack!"
|
||||
return ..()
|
||||
if ( istype(I,/obj/item/clothing/suit/storage/det_suit) && coat)
|
||||
user << "There's already a coat on the rack!"
|
||||
return ..()
|
||||
user << "The coat rack wants none of what you offer."
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if ( istype(mover,/obj/item/clothing/head/det_hat) && !hat)
|
||||
mover.loc = src
|
||||
hat = mover
|
||||
if(!coat)
|
||||
icon_state = "coatrack1"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue The hat lands perfectly atop its hanger!"), 2)
|
||||
return 0
|
||||
if ( istype(mover,/obj/item/clothing/suit/storage/det_suit) && !coat)
|
||||
mover.loc = src
|
||||
coat = mover
|
||||
if(!hat)
|
||||
icon_state = "coatrack2"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue The coat lands perfectly atop its hanger!"), 2)
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
@@ -1,21 +0,0 @@
|
||||
//May expand later, but right now it just repairs lights.
|
||||
/obj/item/device/portalathe
|
||||
name = "portable autolathe"
|
||||
desc = "A device which can repair broken lights instantly. Must be advanced."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "portalathe"
|
||||
|
||||
afterattack(var/atom/target, mob/user as mob)
|
||||
if(!target || !user)
|
||||
return
|
||||
if(!istype(target))
|
||||
return
|
||||
if(!istype(target, /obj/machinery/light))
|
||||
return
|
||||
var/obj/machinery/light/L = target
|
||||
if(L.status > 1) //Burned or broke
|
||||
L.status = 0
|
||||
L.on = 1
|
||||
L.update()
|
||||
user.visible_message("[user] repairs \the [target] on the spot with their [src]!","You repair the lightbulb!","You hear a soft whiiir-pop noise over the sound of flexing glass, followed by the soft hum of an activated [target].")
|
||||
return
|
||||
@@ -1,74 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06
|
||||
|
||||
/obj/item/weapon/stamperaser
|
||||
name = "eraser"
|
||||
desc = "It looks like some kind of eraser."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "zippo"
|
||||
item_state = "zippo"
|
||||
w_class = 1.0
|
||||
m_amt = 80
|
||||
/*
|
||||
/obj/item/device/jammer
|
||||
name = "strange device"
|
||||
desc = "It blinks and has an antenna on it. Weird."
|
||||
icon_state = "t-ray0"
|
||||
var/on = 0
|
||||
w_class = 1
|
||||
var/list/obj/item/device/radio/Old = list()
|
||||
var/list/obj/item/device/radio/Curr = list()
|
||||
var/time_remaining = 5
|
||||
|
||||
/obj/item/device/jammer/New()
|
||||
..()
|
||||
time_remaining = rand(10,20) // ~2-4 BYOND seconds of use.
|
||||
return
|
||||
|
||||
/obj/item/device/jammer/attack_self(mob/user)
|
||||
|
||||
if(time_remaining > 0)
|
||||
on = !on
|
||||
icon_state = "t-ray[on]"
|
||||
|
||||
if(on)
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
on = 0
|
||||
icon_state = "t-ray0"
|
||||
user << "It's fried itself from overuse!"
|
||||
if(Old)
|
||||
for(var/obj/item/device/radio/T in Old)
|
||||
T.scrambleoverride = 0
|
||||
Old = null
|
||||
Curr = null
|
||||
|
||||
|
||||
/obj/item/device/jammer/process()
|
||||
if(!on)
|
||||
processing_objects.Remove(src)
|
||||
return null
|
||||
|
||||
Old = Curr
|
||||
Curr = list()
|
||||
|
||||
for(var/obj/item/device/radio/T in range(3, src.loc) )
|
||||
|
||||
T.scrambleoverride = 1
|
||||
Curr |= T
|
||||
for(var/obj/item/device/radio/V in Old)
|
||||
if(V == T)
|
||||
Old -= V
|
||||
break
|
||||
|
||||
for(var/obj/item/device/radio/T in Old)
|
||||
T.scrambleoverride = 0
|
||||
|
||||
time_remaining--
|
||||
if(time_remaining <= 0)
|
||||
for(var/mob/O in viewers(src))
|
||||
O.show_message("\red You hear a loud pop, like circuits frying.", 1)
|
||||
on = 0
|
||||
icon_state = "t-ray0"
|
||||
|
||||
sleep(2)
|
||||
*/
|
||||
@@ -1,611 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06
|
||||
|
||||
/obj/item/wardrobe
|
||||
name = "\improper Wardrobe"
|
||||
desc = "A standard-issue bag for clothing and equipment. Usually comes sealed, stocked with everything you need for a particular job."
|
||||
icon = 'icons/obj/clothing/suits.dmi'
|
||||
icon_state = "wardrobe_sealed"
|
||||
item_state = "wardrobe"
|
||||
w_class = 4
|
||||
layer = 2.99
|
||||
var/descriptor = "various clothing"
|
||||
var/seal_torn = 0
|
||||
|
||||
attack_self(mob/user)
|
||||
if(!contents.len)
|
||||
user << "It's empty!"
|
||||
else
|
||||
user.visible_message("\blue [user] unwraps the clothing from the [src][seal_torn ? "" : ", tearing the seal"].")
|
||||
seal_torn = 1
|
||||
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = get_turf(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/wardrobe) || istype(I, /obj/item/weapon/evidencebag))
|
||||
return
|
||||
if(contents.len < 20)
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
return
|
||||
user.drop_item()
|
||||
|
||||
if(I)
|
||||
I.loc = src
|
||||
|
||||
update_icon()
|
||||
else
|
||||
user << "\red There's not enough space to fit that!"
|
||||
return
|
||||
|
||||
afterattack(atom/A as obj|turf, mob/user as mob)
|
||||
if(A in user)
|
||||
return
|
||||
if(!istype(A.loc,/turf))
|
||||
user << "It's got to be on the ground to do that!"
|
||||
return
|
||||
var/could_fill = 1
|
||||
for (var/obj/O in locate(A.x,A.y,A.z))
|
||||
if (contents.len < 20)
|
||||
if(istype(O,/obj/item/wardrobe))
|
||||
continue
|
||||
if(O.anchored || O.density || istype(O,/obj/structure))
|
||||
continue
|
||||
contents += O;
|
||||
else
|
||||
could_fill = 0
|
||||
break
|
||||
if(could_fill)
|
||||
user << "\blue You pick up all the items."
|
||||
else
|
||||
user << "\blue You try to pick up all of the items, but run out of space in the bag."
|
||||
user.visible_message("\blue [user] gathers up[could_fill ? " " : " most of "]the pile of items and puts it into [src].")
|
||||
update_icon()
|
||||
|
||||
examine(mob/user)
|
||||
..(user)
|
||||
user << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
|
||||
if(seal_torn && !contents.len)
|
||||
user << "The seal on the bag is broken."
|
||||
else
|
||||
user << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
|
||||
|
||||
update_icon()
|
||||
if(contents.len)
|
||||
icon_state = "wardrobe"
|
||||
else
|
||||
icon_state = "wardrobe_empty"
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
pixel_x = rand(0,4) -2
|
||||
pixel_y = rand(0,4) -2
|
||||
|
||||
/obj/item/wardrobe/assistant
|
||||
name = "\improper Assistant Wardrobe"
|
||||
descriptor = "clothing and basic equipment for an assistant"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
|
||||
/obj/item/wardrobe/chief_engineer
|
||||
name = "\improper Chief Engineer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chief Engineer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/heads/ce(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/head/helmet/hardhat/white(src)
|
||||
new /obj/item/clothing/head/helmet/welding(src)
|
||||
new /obj/item/weapon/storage/belt/utility/full(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/suit/storage/hazardvest(src)
|
||||
new /obj/item/clothing/gloves/yellow(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/heads/ce(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/chief_engineer(src)
|
||||
|
||||
/obj/item/wardrobe/engineer
|
||||
name = "\improper Station Engineer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Station Engineer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/device/t_scanner(src)
|
||||
new /obj/item/clothing/suit/storage/hazardvest(src)
|
||||
new /obj/item/weapon/storage/belt/utility/full(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/head/helmet/hardhat(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/headset_eng(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
|
||||
/obj/item/wardrobe/atmos
|
||||
name = "\improper Atmospheric Technician Wardrobe"
|
||||
descriptor = "clothing and basic equipment for an Atmospheric Technician"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/device/radio/headset/headset_eng(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
|
||||
/obj/item/wardrobe/roboticist
|
||||
name = "\improper Roboticist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Roboticist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/device/radio/headset/headset_rob(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
|
||||
/obj/item/wardrobe/chaplain
|
||||
name = "\improper Chaplain Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chaplain"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/storage/bible(src)
|
||||
new /obj/item/device/pda/chaplain(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/chaplain(src)
|
||||
|
||||
/obj/item/wardrobe/captain
|
||||
name = "\improper Captain Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Captain"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/captain(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/suit/storage/captunic(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/head/caphat(src)
|
||||
new /obj/item/clothing/gloves/captain(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/device/radio/headset/heads/captain(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/captain(src)
|
||||
|
||||
/obj/item/wardrobe/hop
|
||||
name = "\improper Head of Personnel Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Head of Personnel"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/pda/heads/hop(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/gloves/blue(src)
|
||||
new /obj/item/device/radio/headset/heads/hop(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/head_of_personnel(src)
|
||||
|
||||
/obj/item/wardrobe/cmo
|
||||
name = "\improper Chief Medical Officer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chief Medical Officer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/heads/cmo(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/suit/bio_suit/cmo(src)
|
||||
new /obj/item/clothing/head/bio_hood/cmo(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/cmo(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/cmoalt(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/heads/cmo(src)
|
||||
new /obj/item/clothing/under/rank/chief_medical_officer(src)
|
||||
new /obj/item/device/healthanalyzer(src)
|
||||
|
||||
/obj/item/wardrobe/doctor
|
||||
name = "\improper Medical Doctor Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Medical Doctor"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/head/nursehat (src)
|
||||
new /obj/item/weapon/storage/belt/medical(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/device/radio/headset/headset_med(src)
|
||||
new /obj/item/clothing/under/rank/nursesuit (src)
|
||||
new /obj/item/clothing/under/rank/medical(src)
|
||||
new /obj/item/device/healthanalyzer(src)
|
||||
|
||||
/obj/item/wardrobe/geneticist
|
||||
name = "\improper Geneticist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Geneticist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/genetics(src)
|
||||
new /obj/item/device/radio/headset/headset_medsci(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
|
||||
/obj/item/wardrobe/virologist
|
||||
name = "\improper Virologist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Virologist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/virologist(src)
|
||||
new /obj/item/device/radio/headset/headset_med(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/medical(src)
|
||||
|
||||
/obj/item/wardrobe/rd
|
||||
name = "\improper Research Director Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Research Director"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/device/pda/heads/rd(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/weapon/tank/air(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/suit/bio_suit/scientist(src)
|
||||
new /obj/item/clothing/head/bio_hood/scientist(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/device/radio/headset/heads/rd(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/research_director(src)
|
||||
|
||||
/obj/item/wardrobe/scientist
|
||||
name = "\improper Scientist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Scientist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/science(src)
|
||||
new /obj/item/weapon/tank/oxygen(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/science(src)
|
||||
new /obj/item/device/radio/headset/headset_sci(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
|
||||
/obj/item/wardrobe/chemist
|
||||
name = "\improper Chemist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chemist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/radio/headset/headset_medsci(src)
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/device/pda/science(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/chemist(src)
|
||||
|
||||
/obj/item/wardrobe/hos
|
||||
name = "\improper Head of Security Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Head of Security"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/device/pda/heads/hos(src)
|
||||
new /obj/item/clothing/suit/storage/armourrigvest(src)
|
||||
new /obj/item/clothing/suit/armor/hos(src)
|
||||
new /obj/item/clothing/head/helmet/HoS(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/gloves/hos(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/device/radio/headset/heads/hos(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/head_of_security(src)
|
||||
|
||||
/obj/item/wardrobe/warden
|
||||
name = "\improper Warden Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Warden"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/taser(src)
|
||||
new /obj/item/device/pda/security(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/suit/storage/gearharness(src)
|
||||
new /obj/item/clothing/head/helmet/warden(src)
|
||||
new /obj/item/clothing/gloves/red(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/warden(src)
|
||||
new /obj/item/clothing/suit/armor/vest/warden(src)
|
||||
new /obj/item/weapon/pepperspray(src)
|
||||
|
||||
/obj/item/wardrobe/detective
|
||||
name = "\improper Detective Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Detective"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/fcardholder(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/weapon/clipboard/notebook(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/taperoll/police(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
new /obj/item/device/pda/detective(src)
|
||||
new /obj/item/clothing/suit/storage/det_suit/armor(src)
|
||||
new /obj/item/clothing/suit/storage/det_suit(src)
|
||||
new /obj/item/clothing/gloves/detective(src)
|
||||
new /obj/item/clothing/head/det_hat(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/det(src)
|
||||
new /obj/item/weapon/camera_film(src)
|
||||
|
||||
/obj/item/wardrobe/officer
|
||||
name = "\improper Security Officer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Security Officer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/pepperspray(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/taperoll/police(src)
|
||||
new /obj/item/weapon/flashbang(src)
|
||||
new /obj/item/device/pda/security(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/suit/storage/gearharness(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/head/helmet(src)
|
||||
new /obj/item/clothing/head/secsoft(src)
|
||||
new /obj/item/clothing/gloves/red(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/security(src)
|
||||
|
||||
|
||||
|
||||
/obj/item/wardrobe/bartender
|
||||
name = "\improper Bartender Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Bartender"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/bartender(src)
|
||||
|
||||
/obj/item/wardrobe/chef
|
||||
name = "\improper Chef Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chef"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/clothing/suit/storage/chef(src)
|
||||
new /obj/item/clothing/head/chefhat(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/chef(src)
|
||||
|
||||
/obj/item/wardrobe/hydro
|
||||
name = "\improper Botanist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Botanist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/analyzer/plant_analyzer(src)
|
||||
new /obj/item/clothing/suit/storage/apron(src)
|
||||
new /obj/item/clothing/gloves/botanic_leather(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/hydroponics(src)
|
||||
|
||||
/obj/item/wardrobe/qm
|
||||
name = "\improper Quartermaster Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Quartermaster"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/pda/quartermaster(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/device/radio/headset/heads/qm(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/cargo(src)
|
||||
|
||||
/obj/item/wardrobe/cargo_tech
|
||||
name = "\improper Cargo Technician Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Cargo Technician"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/quartermaster(src)
|
||||
new /obj/item/device/radio/headset/headset_cargo(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/cargotech(src)
|
||||
new /obj/item/clothing/gloves/fingerless/black(src)
|
||||
|
||||
/obj/item/wardrobe/mining
|
||||
name = "\improper Shaft Miner Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Shaft Miner"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/fingerless/black(src)
|
||||
|
||||
/obj/item/wardrobe/janitor
|
||||
name = "\improper Janitor Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Janitor"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/janitor(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/janitor(src)
|
||||
new /obj/item/device/portalathe(src)
|
||||
|
||||
/obj/item/wardrobe/librarian
|
||||
name = "\improper Librarian Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Librarian"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/barcodescanner(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/suit_jacket/red(src)
|
||||
|
||||
/obj/item/wardrobe/lawyer
|
||||
name = "\improper Lawyer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Lawyer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/lawyer(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/weapon/storage/briefcase(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
if(prob(50))
|
||||
new /obj/item/clothing/under/lawyer/bluesuit(src)
|
||||
new /obj/item/clothing/suit/storage/lawyer/bluejacket(src)
|
||||
else
|
||||
new /obj/item/clothing/under/lawyer/purpsuit(src)
|
||||
new /obj/item/clothing/suit/storage/lawyer/purpjacket(src)
|
||||
|
||||
|
||||
@@ -1,459 +0,0 @@
|
||||
//this is everything i'm going to be using in my outpost zeta map, and possibly future maps.
|
||||
|
||||
turf/unsimulated/desert
|
||||
name = "desert"
|
||||
icon = 'code/WorkInProgress/Susan/desert.dmi'
|
||||
icon_state = "desert"
|
||||
temperature = 393.15
|
||||
luminosity = 5
|
||||
lighting_lumcount = 8
|
||||
|
||||
turf/unsimulated/desert/New()
|
||||
icon_state = "desert[rand(0,4)]"
|
||||
|
||||
turf/simulated/wall/impassable_rock
|
||||
name = "Mountain Wall"
|
||||
|
||||
//so that you can see the impassable sections in the map editor
|
||||
icon_state = "riveted"
|
||||
New()
|
||||
icon_state = "rock"
|
||||
|
||||
/area/awaymission/labs/researchdivision
|
||||
name = "Research"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/militarydivision
|
||||
name = "Military"
|
||||
icon_state = "away2"
|
||||
|
||||
/area/awaymission/labs/gateway
|
||||
name = "Gateway"
|
||||
icon_state = "away1"
|
||||
|
||||
/area/awaymission/labs/command
|
||||
name = "Command"
|
||||
icon_state = "away"
|
||||
|
||||
/area/awaymission/labs/civilian
|
||||
name = "Civilian"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/cargo
|
||||
name = "Cargo"
|
||||
icon_state = "away2"
|
||||
|
||||
/area/awaymission/labs/medical
|
||||
name = "Medical"
|
||||
icon_state = "away1"
|
||||
|
||||
/area/awaymission/labs/security
|
||||
name = "Security"
|
||||
icon_state = "away"
|
||||
|
||||
/area/awaymission/labs/solars
|
||||
name = "Solars"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/cave
|
||||
name = "Caves"
|
||||
icon_state = "away2"
|
||||
|
||||
//corpses and possibly other decorative items
|
||||
|
||||
/obj/effect/landmark/corpse/alien
|
||||
mutantrace = "lizard"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/cargo
|
||||
name = "Cargo Technician"
|
||||
corpseuniform = /obj/item/clothing/under/rank/cargo
|
||||
corpseradio = /obj/item/device/radio/headset/headset_cargo
|
||||
corpseid = 1
|
||||
corpseidjob = "Cargo Technician"
|
||||
corpseidaccess = "Quartermaster"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/laborer
|
||||
name = "Laborer"
|
||||
corpseuniform = /obj/item/clothing/under/overalls
|
||||
corpseradio = /obj/item/device/radio/headset/headset_eng
|
||||
corpseback = /obj/item/weapon/storage/backpack/industrial
|
||||
corpsebelt = /obj/item/weapon/storage/belt/utility/full
|
||||
corpsehelmet = /obj/item/clothing/head/hardhat
|
||||
corpseid = 1
|
||||
corpseidjob = "Laborer"
|
||||
corpseidaccess = "Engineer"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/testsubject
|
||||
name = "Unfortunate Test Subject"
|
||||
corpseuniform = /obj/item/clothing/under/color/white
|
||||
corpseid = 0
|
||||
|
||||
/obj/effect/landmark/corpse/overseer
|
||||
name = "Overseer"
|
||||
corpseuniform = /obj/item/clothing/under/rank/navyhead_of_security
|
||||
corpsesuit = /obj/item/clothing/suit/armor/hosnavycoat
|
||||
corpseradio = /obj/item/device/radio/headset/heads/captain
|
||||
corpsegloves = /obj/item/clothing/gloves/black/hos
|
||||
corpseshoes = /obj/item/clothing/shoes/swat
|
||||
corpsehelmet = /obj/item/clothing/head/beret/navyhos
|
||||
corpseglasses = /obj/item/clothing/glasses/eyepatch
|
||||
corpseid = 1
|
||||
corpseidjob = "Facility Overseer"
|
||||
corpseidaccess = "Captain"
|
||||
|
||||
/obj/effect/landmark/corpse/officer
|
||||
name = "Security Officer"
|
||||
corpseuniform = /obj/item/clothing/under/rank/navysecurity
|
||||
corpsesuit = /obj/item/clothing/suit/armor/navysecvest
|
||||
corpseradio = /obj/item/device/radio/headset/headset_sec
|
||||
corpseshoes = /obj/item/clothing/shoes/swat
|
||||
corpsehelmet = /obj/item/clothing/head/beret/navysec
|
||||
corpseid = 1
|
||||
corpseidjob = "Security Officer"
|
||||
corpseidaccess = "Security Officer"
|
||||
|
||||
/*
|
||||
* Weeds
|
||||
*/
|
||||
#define NODERANGE 1
|
||||
|
||||
/obj/effect/alien/flesh/weeds
|
||||
name = "Fleshy Growth"
|
||||
desc = "A pulsating grouping of odd, alien tissues. It's almost like it has a heartbeat..."
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
icon_state = "flesh"
|
||||
|
||||
anchored = 1
|
||||
density = 0
|
||||
var/health = 15
|
||||
var/obj/effect/alien/weeds/node/linked_node = null
|
||||
|
||||
/obj/effect/alien/flesh/weeds/node
|
||||
icon_state = "fleshnode"
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
name = "Throbbing Pustule"
|
||||
desc = "A grotquese, oozing, pimple-like growth. You swear you can see something moving around in the bulb..."
|
||||
luminosity = NODERANGE
|
||||
var/node_range = NODERANGE
|
||||
|
||||
/obj/effect/alien/flesh/weeds/node/New()
|
||||
..(src.loc, src)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/New(pos, node)
|
||||
..()
|
||||
linked_node = node
|
||||
if(istype(loc, /turf/space))
|
||||
del(src)
|
||||
return
|
||||
if(icon_state == "flesh")icon_state = pick("flesh", "flesh1", "flesh2")
|
||||
spawn(rand(150, 200))
|
||||
if(src)
|
||||
Life()
|
||||
return
|
||||
|
||||
/obj/effect/alien/flesh/weeds/proc/Life()
|
||||
set background = 1
|
||||
var/turf/U = get_turf(src)
|
||||
/*
|
||||
if (locate(/obj/movable, U))
|
||||
U = locate(/obj/movable, U)
|
||||
if(U.density == 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
Alien plants should do something if theres a lot of poison
|
||||
if(U.poison> 200000)
|
||||
health -= round(U.poison/200000)
|
||||
update()
|
||||
return
|
||||
*/
|
||||
if (istype(U, /turf/space))
|
||||
del(src)
|
||||
return
|
||||
|
||||
direction_loop:
|
||||
for(var/dirn in cardinal)
|
||||
var/turf/T = get_step(src, dirn)
|
||||
|
||||
if (!istype(T) || T.density || locate(/obj/effect/alien/flesh/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space))
|
||||
continue
|
||||
|
||||
if(!linked_node || get_dist(linked_node, src) > linked_node.node_range)
|
||||
return
|
||||
|
||||
// if (locate(/obj/movable, T)) // don't propogate into movables
|
||||
// continue
|
||||
|
||||
for(var/obj/O in T)
|
||||
if(O.density)
|
||||
continue direction_loop
|
||||
|
||||
new /obj/effect/alien/flesh/weeds(T, linked_node)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/effect/alien/flesh/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if(W.attack_verb.len)
|
||||
visible_message("\red <B>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
|
||||
else
|
||||
visible_message("\red <B>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
|
||||
|
||||
var/damage = W.force / 4.0
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
|
||||
if(WT.remove_fuel(0, user))
|
||||
damage = 15
|
||||
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
health -= damage
|
||||
healthcheck()
|
||||
|
||||
/obj/effect/alien/flesh/weeds/proc/healthcheck()
|
||||
if(health <= 0)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
health -= 5
|
||||
healthcheck()
|
||||
|
||||
/*/obj/effect/alien/weeds/burn(fi_amount)
|
||||
if (fi_amount > 18000)
|
||||
spawn( 0 )
|
||||
del(src)
|
||||
return
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
|
||||
#undef NODERANGE
|
||||
|
||||
//clothing, weapons, and other items that can be worn or used in some way
|
||||
|
||||
/obj/item/clothing/under/rank/navywarden
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the word \"Warden\" written on the shoulders."
|
||||
name = "warden's jumpsuit"
|
||||
icon_state = "wardendnavyclothes"
|
||||
item_state = "wardendnavyclothes"
|
||||
item_color = "wardendnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/under/rank/navysecurity
|
||||
name = "security officer's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
|
||||
icon_state = "officerdnavyclothes"
|
||||
item_state = "officerdnavyclothes"
|
||||
item_color = "officerdnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/under/rank/navyhead_of_security
|
||||
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Head of Security\". It has additional armor to protect the wearer."
|
||||
name = "head of security's jumpsuit"
|
||||
icon_state = "hosdnavyclothes"
|
||||
item_state = "hosdnavyclothes"
|
||||
item_color = "hosdnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/suit/armor/hosnavycoat
|
||||
name = "armored coat"
|
||||
desc = "A coat enchanced with a special alloy for some protection and style."
|
||||
icon_state = "hosdnavyjacket"
|
||||
item_state = "armor"
|
||||
armor = list(melee = 65, bullet = 30, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/head/beret/navysec
|
||||
name = "security beret"
|
||||
desc = "A beret with the security insignia emblazoned on it. For officers that are more inclined towards style than safety."
|
||||
icon_state = "officerberet"
|
||||
|
||||
/obj/item/clothing/head/beret/navywarden
|
||||
name = "warden's beret"
|
||||
desc = "A beret with a two-colored security insignia emblazoned on it. For wardens that are more inclined towards style than safety."
|
||||
icon_state = "wardenberet"
|
||||
|
||||
/obj/item/clothing/head/beret/navyhos
|
||||
name = "security head's beret"
|
||||
desc = "A stylish beret bearing a golden insignia that proudly displays the security coat of arms. A commander's must-have."
|
||||
icon_state = "hosberet"
|
||||
|
||||
/obj/item/clothing/suit/armor/navysecvest
|
||||
name = "armored coat"
|
||||
desc = "An armored coat that protects against some damage."
|
||||
icon_state = "officerdnavyjacket"
|
||||
item_state = "armor"
|
||||
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/suit/armor/navywardenvest
|
||||
name = "Warden's jacket"
|
||||
desc = "An armoured jacket with silver rank pips and livery."
|
||||
icon_state = "wardendnavyjacket"
|
||||
item_state = "armor"
|
||||
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
//hostile entities or npcs
|
||||
|
||||
/obj/item/projectile/slimeglob
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "toxin"
|
||||
damage = 20
|
||||
damage_type = BRUTE
|
||||
|
||||
/obj/effect/critter/fleshmonster
|
||||
name = "Fleshy Horror"
|
||||
desc = "A grotesque, shambling fleshy horror... was this once a... a person?"
|
||||
icon = 'icons/mob/mob.dmi'
|
||||
icon_state = "horror"
|
||||
/*
|
||||
health = 120
|
||||
max_health = 120
|
||||
aggressive = 1
|
||||
defensive = 1
|
||||
wanderer = 1
|
||||
opensdoors = 1
|
||||
atkcarbon = 1
|
||||
atksilicon = 1
|
||||
atkcritter = 1
|
||||
atksame = 0
|
||||
atkmech = 1
|
||||
firevuln = 0.5
|
||||
brutevuln = 1
|
||||
seekrange = 25
|
||||
armor = 15
|
||||
melee_damage_lower = 12
|
||||
melee_damage_upper = 17
|
||||
angertext = "shambles"
|
||||
attacktext = "slashes"
|
||||
var/ranged = 0
|
||||
var/rapid = 0
|
||||
proc
|
||||
Shoot(var/target, var/start, var/user, var/bullet = 0)
|
||||
OpenFire(var/thing)//bluh ill rename this later or somethin
|
||||
|
||||
|
||||
Die()
|
||||
if (!src.alive) return
|
||||
src.alive = 0
|
||||
walk_to(src,0)
|
||||
src.visible_message("<b>[src]</b> disintegrates into mush!")
|
||||
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
|
||||
var/turf/Ts = get_turf(src)
|
||||
new /obj/effect/decal/cleanable/blood(Ts)
|
||||
del(src)
|
||||
|
||||
seek_target()
|
||||
src.anchored = 0
|
||||
var/T = null
|
||||
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
|
||||
if (src.target)
|
||||
src.task = "chasing"
|
||||
break
|
||||
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
|
||||
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
|
||||
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
|
||||
if(C.health < 0) continue
|
||||
if(istype(C, /mob/living/carbon/) && src.atkcarbon)
|
||||
if(C:mind)
|
||||
if(C:mind:special_role == "H.I.V.E")
|
||||
continue
|
||||
src.attack = 1
|
||||
if(istype(C, /mob/living/silicon/) && src.atksilicon)
|
||||
if(C:mind)
|
||||
if(C:mind:special_role == "H.I.V.E")
|
||||
continue
|
||||
src.attack = 1
|
||||
if(src.attack)
|
||||
T = C
|
||||
break
|
||||
|
||||
if(!src.attack)
|
||||
for(var/obj/effect/critter/C in view(src.seekrange,src))
|
||||
if(istype(C, /obj/effect/critter) && !src.atkcritter) continue
|
||||
if(C.health <= 0) continue
|
||||
if(istype(C, /obj/effect/critter) && src.atkcritter)
|
||||
if((istype(C, /obj/effect/critter/hivebot) && !src.atksame) || (C == src)) continue
|
||||
T = C
|
||||
break
|
||||
|
||||
for(var/obj/mecha/M in view(src.seekrange,src))
|
||||
if(istype(M, /obj/mecha) && !src.atkmech) continue
|
||||
if(M.health <= 0) continue
|
||||
if(istype(M, /obj/mecha) && src.atkmech) src.attack = 1
|
||||
if(src.attack)
|
||||
T = M
|
||||
break
|
||||
|
||||
if(src.attack)
|
||||
src.target = T
|
||||
src.oldtarget_name = T:name
|
||||
if(src.ranged)
|
||||
OpenFire(T)
|
||||
return
|
||||
src.task = "chasing"
|
||||
return
|
||||
|
||||
|
||||
OpenFire(var/thing)
|
||||
src.target = thing
|
||||
src.oldtarget_name = thing:name
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <b>[src]</b> spits a glob at [src.target]!", 1)
|
||||
|
||||
var/tturf = get_turf(target)
|
||||
if(rapid)
|
||||
spawn(1)
|
||||
Shoot(tturf, src.loc, src)
|
||||
spawn(4)
|
||||
Shoot(tturf, src.loc, src)
|
||||
spawn(6)
|
||||
Shoot(tturf, src.loc, src)
|
||||
else
|
||||
Shoot(tturf, src.loc, src)
|
||||
|
||||
src.attack = 0
|
||||
sleep(12)
|
||||
seek_target()
|
||||
src.task = "thinking"
|
||||
return
|
||||
|
||||
|
||||
Shoot(var/target, var/start, var/user, var/bullet = 0)
|
||||
if(target == start)
|
||||
return
|
||||
|
||||
var/obj/item/projectile/slimeglob/A = new /obj/item/projectile/slimeglob(user:loc)
|
||||
playsound(user, 'sound/weapons/bite.ogg', 100, 1)
|
||||
|
||||
if(!A) return
|
||||
|
||||
if (!istype(target, /turf))
|
||||
del(A)
|
||||
return
|
||||
A.current = target
|
||||
A.yo = target:y - start:y
|
||||
A.xo = target:x - start:x
|
||||
spawn( 0 )
|
||||
A.process()
|
||||
return
|
||||
*/
|
||||
|
||||
obj/effect/critter/fleshmonster/fleshslime
|
||||
name = "Flesh Slime"
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
icon_state = "livingflesh"
|
||||
desc = "A creature that appears to be made out of living tissue strewn together haphazardly. Some kind of liquid bubbles from its maw."
|
||||
//ranged = 1
|
||||
@@ -1,152 +0,0 @@
|
||||
// Contains:
|
||||
// /datum/text_parser/parser/eliza
|
||||
// /datum/text_parser/keyword
|
||||
|
||||
/datum/text_parser/parser/eliza
|
||||
//var/datum/text_parser/reply/replies[] // R(X) 36
|
||||
var/prev_reply = "" // previous reply
|
||||
var/username = ""
|
||||
var/callsign = ""
|
||||
var/yesno_state = ""
|
||||
var/yesno_param = ""
|
||||
|
||||
/datum/text_parser/parser/eliza/new_session()
|
||||
..()
|
||||
for(var/datum/text_parser/keyword/key in keywords)
|
||||
key.eliza = src
|
||||
|
||||
prev_reply = ""
|
||||
username = ""
|
||||
yesno_state = ""
|
||||
yesno_param = ""
|
||||
print("Hi! I'm [callsign], how are you doing? You can talk to me by beginning your statements with \"[callsign],\"")
|
||||
|
||||
/datum/text_parser/parser/eliza/process_line()
|
||||
..()
|
||||
// pad so we can detect initial and final words correctly
|
||||
input_line = " " + src.input_line + " "
|
||||
// remove apostrophes
|
||||
for(var/i = -1, i != 0, i = findtext(input_line, "'"))
|
||||
if(i == -1)
|
||||
continue
|
||||
input_line = copytext(input_line, 1, i) + copytext(input_line, i + 1, 0)
|
||||
|
||||
// did user insult us? (i don't really want cursing in the source code,
|
||||
// so keep it the simple original check from the 70's code :p)
|
||||
if(findtext(input_line, "shut"))
|
||||
// sssh
|
||||
return
|
||||
|
||||
if(input_line == prev_reply)
|
||||
print("Please don't repeat yourself!")
|
||||
|
||||
// find a keyword
|
||||
var/keyphrase = ""
|
||||
var/datum/text_parser/keyword/keyword // the actual keyword
|
||||
var/keypos = 0 // pos of keyword so we can grab extra text after it
|
||||
|
||||
for(var/i = 1, i <= keywords.len, i++)
|
||||
keyword = keywords[i]
|
||||
for(var/j = 1, j <= keyword.phrases.len, j++)
|
||||
keypos = findtext(input_line, " " + keyword.phrases[j])
|
||||
if(keypos != 0)
|
||||
// found it!
|
||||
keyphrase = keyword.phrases[j]
|
||||
break
|
||||
if(keyphrase != "")
|
||||
break
|
||||
|
||||
//world << "keyphrase: " + keyphrase + " " + num2text(keypos)
|
||||
|
||||
var/conjugated = ""
|
||||
// was it not recognized? then make it nokeyfound
|
||||
if(keyphrase == "")
|
||||
keyword = keywords[keywords.len] // nokeyfound
|
||||
else
|
||||
// otherwise, business as usual
|
||||
|
||||
// let's conjugate this mess
|
||||
conjugated = copytext(input_line, 1 + keypos + lentext(keyphrase))
|
||||
|
||||
// go ahead and strip punctuation
|
||||
if(lentext(conjugated) > 0 && copytext(conjugated, lentext(conjugated)) == " ")
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
if(lentext(conjugated) > 0)
|
||||
var/final_punc = copytext(conjugated, lentext(conjugated))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
|
||||
conjugated += " "
|
||||
|
||||
if(keyword.conjugate)
|
||||
// now run through conjugation pairs
|
||||
for(var/i = 1, i <= lentext(conjugated), i++)
|
||||
for(var/x = 1, x <= conjugs.len, x += 2)
|
||||
var/cx = conjugs[x]
|
||||
var/cxa = conjugs[x + 1]
|
||||
if(i + lentext(cx) <= lentext(conjugated) + 1 && cmptext(cx, copytext(conjugated, i, i + lentext(cx))))
|
||||
// world << cx
|
||||
|
||||
conjugated = copytext(conjugated, 1, i) + cxa + copytext(conjugated, i + lentext(cx))
|
||||
i = i + lentext(cx)
|
||||
// don't count right padding
|
||||
if(copytext(cx, lentext(cx)) == " ")
|
||||
i--
|
||||
break
|
||||
else if(i + lentext(cxa) <= lentext(conjugated) + 1 && cmptext(cxa, copytext(conjugated, i, i + lentext(cxa))))
|
||||
// world << cxa
|
||||
|
||||
conjugated = copytext(conjugated, 1, i) + cx + copytext(conjugated, i + lentext(cxa))
|
||||
i = i + lentext(cxa)
|
||||
// don't count right padding
|
||||
if(copytext(cxa, lentext(cxa)) == " ")
|
||||
i--
|
||||
break
|
||||
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
|
||||
//world << "Conj: " + conjugated
|
||||
|
||||
// now actually get a reply
|
||||
var/reply = keyword.process(conjugated)
|
||||
print(reply)
|
||||
|
||||
prev_reply = reply
|
||||
|
||||
/datum/text_parser/keyword
|
||||
var/list/phrases = new()
|
||||
var/list/replies = new()
|
||||
var/datum/text_parser/parser/eliza/eliza
|
||||
var/conjugate = 1
|
||||
|
||||
New(p, r)
|
||||
phrases = p
|
||||
replies = r
|
||||
|
||||
proc/process(object)
|
||||
eliza.yesno_state = ""
|
||||
eliza.yesno_param = ""
|
||||
var/reply = pick(replies)
|
||||
if(copytext(reply, lentext(reply)) == "*")
|
||||
// add object of statement (hopefully not actually mess :p)
|
||||
if(object == "")
|
||||
object = pick(generic_objects)
|
||||
// possibly add name or just ?
|
||||
if(eliza.username != "" && rand(3) == 0)
|
||||
object += ", " + eliza.username
|
||||
return copytext(reply, 1, lentext(reply)) + object + "?"
|
||||
else
|
||||
// get punct
|
||||
var/final_punc = ""
|
||||
if(lentext(reply) > 0)
|
||||
final_punc = copytext(reply, lentext(reply))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
reply = copytext(reply, 1, lentext(reply))
|
||||
else
|
||||
final_punc = ""
|
||||
|
||||
// possibly add name or just ?/./!
|
||||
if(eliza.username != "" && rand(2) == 0)
|
||||
reply += ", " + eliza.username
|
||||
|
||||
return reply + final_punc
|
||||
@@ -1,435 +0,0 @@
|
||||
// Contains:
|
||||
// Implementation-specific data for /datum/text_parser/parser/eliza
|
||||
|
||||
/datum/text_parser/keyword
|
||||
// if we have a * reply, but no object from the user
|
||||
var/list/generic_objects = list(
|
||||
" what", " something", "...")
|
||||
|
||||
var/list/object_leaders = list(
|
||||
" is ", "'s ")
|
||||
|
||||
/datum/text_parser/parser/eliza
|
||||
|
||||
// conjugation data
|
||||
var/list/conjugs = list(
|
||||
" are ", " am ", " were ", " was ", " you ", " me ", " you ", " i " , " your ", " my ",
|
||||
" ive ", " youve ", " Im ", " youre ")
|
||||
|
||||
// keywords / replies
|
||||
var/list/keywords = list(
|
||||
new/datum/text_parser/keyword/tell( // NT-like
|
||||
list("tell"),
|
||||
list(
|
||||
"Told *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("can you"),
|
||||
list(
|
||||
"Dont you believe that I can*",
|
||||
"Perhaps you would like to be able to*",
|
||||
"You want me to be able to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("can i"),
|
||||
list(
|
||||
"Perhaps you don't want to*",
|
||||
"Do you want to be able to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("you are", "youre"),
|
||||
list(
|
||||
"What makes you think I am*",
|
||||
"Does it please you to believe that I am*",
|
||||
"Perhaps you would like to be*",
|
||||
"Do you sometimes wish you were*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i dont"),
|
||||
list(
|
||||
"Don't you really*",
|
||||
"Why don't you*",
|
||||
"Do you wish to be able to*",
|
||||
"Does that trouble you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i feel"),
|
||||
list(
|
||||
"Tell me more about such feelings.",
|
||||
"Do you often feel*",
|
||||
"Do you enjoy feeling*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("why dont you"),
|
||||
list(
|
||||
"Do you really believe I don't*",
|
||||
"Perhaps in good time I will*",
|
||||
"Do you want me to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("why cant i"),
|
||||
list(
|
||||
"Do you think you should be able to*",
|
||||
"Why can't you*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("are you"),
|
||||
list(
|
||||
"Why are you interested in whether or not I am*",
|
||||
"Would you prefer if I were not*",
|
||||
"Perhaps in your fantasies I am*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i cant"),
|
||||
list(
|
||||
"How do you know I can't*",
|
||||
"Have you tried?",
|
||||
"Perhaps you can now*")),
|
||||
new/datum/text_parser/keyword/setparam/username(
|
||||
list("my name", "im called", "am called", "call me"),
|
||||
list(
|
||||
"Your name is *",
|
||||
"You call yourself *",
|
||||
"You're called *")),
|
||||
new/datum/text_parser/keyword/setparam/callsign(
|
||||
list("your name", "call yourself"),
|
||||
list(
|
||||
"My name is *",
|
||||
"I call myself *",
|
||||
"I'm called *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i am", "im"),
|
||||
list(
|
||||
"Did you come to me because you are*",
|
||||
"How long have you been*",
|
||||
"Do you believe it is normal to be*",
|
||||
"Do you enjoy being*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("thanks", "thank you"),
|
||||
list(
|
||||
"You're welcome.",
|
||||
"No problem.",
|
||||
"Thank you!")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("you"),
|
||||
list(
|
||||
"We were discussing you - not me.",
|
||||
"Oh, I*",
|
||||
"You're not really talking about me, are you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i want","i like"),
|
||||
list(
|
||||
"What would it mean if you got*",
|
||||
"Why do you want*",
|
||||
"Suppose you got*",
|
||||
"What if you never got*",
|
||||
"I sometimes also want*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("what", "how", "who", "where", "when", "why"),
|
||||
list(
|
||||
"Why do you ask?",
|
||||
"Does that question interest you?",
|
||||
"What answer would please you the most?",
|
||||
"What do you think?",
|
||||
"Are such questions on your mind often?",
|
||||
"What is it you really want to know?",
|
||||
"Have you asked anyone else?",
|
||||
"Have you asked such questions before?",
|
||||
"What else comes to mind when you ask that?")),
|
||||
new/datum/text_parser/keyword/paramlist/pick( // NT-like
|
||||
list("pick","choose"),
|
||||
list(
|
||||
"I choose... *",
|
||||
"I prefer *",
|
||||
"My favorite is *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("name"),
|
||||
list(
|
||||
"Names don't interest me.",
|
||||
"I don't care about names. Go on.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("cause"),
|
||||
list(
|
||||
"Is that a real reason?",
|
||||
"Don't any other reasons come to mind?",
|
||||
"Does that reason explain anything else?",
|
||||
"What other reason might there be?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("sorry"),
|
||||
list(
|
||||
"Please don't apologize.",
|
||||
"Apologies are not necessary.",
|
||||
"What feelings do you get when you apologize?",
|
||||
"Don't be so defensive!")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("dream"),
|
||||
list(
|
||||
"What does that dream suggest to you?",
|
||||
"Do you dream often?",
|
||||
"What persons are in your dreams?",
|
||||
"Are you disturbed by your dreams?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("hello", "hi", "yo", "hiya"),
|
||||
list(
|
||||
"How do you do... Please state your name and problem.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("go away", "bye"),
|
||||
list(
|
||||
"Good bye. I hope to have another session with you soon.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("maybe", "sometimes", "probably", "mostly", "most of the time"),
|
||||
list(
|
||||
"You don't seem quite certain.",
|
||||
"Why the uncertain tone?",
|
||||
"Can't you be more positive?",
|
||||
"You aren't sure?",
|
||||
"Don't you know?")),
|
||||
new/datum/text_parser/keyword/no(
|
||||
list("no", "nope", "nah"),
|
||||
list(
|
||||
"Are you saying that just to be negative?",
|
||||
"You are being a bit negative.",
|
||||
"Why not?",
|
||||
"Are you sure?",
|
||||
"Why no?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("your"),
|
||||
list(
|
||||
"Why are you concerned about my*",
|
||||
"What about your own*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("always"),
|
||||
list(
|
||||
"Can you think of a specific example?",
|
||||
"When?",
|
||||
"What are you thinking of?",
|
||||
"Really, always?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("think"),
|
||||
list(
|
||||
"Do you really think so?",
|
||||
"But you're not sure you*",
|
||||
"Do you doubt you*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("alike"),
|
||||
list(
|
||||
"In what way?",
|
||||
"What resemblence do you see?",
|
||||
"What does the similarity suggest to you?",
|
||||
"What other connections do you see?",
|
||||
"Count there really be some connection?",
|
||||
"How?",
|
||||
"You seem quite positive.")),
|
||||
new/datum/text_parser/keyword/yes(
|
||||
list("yes", "yep", "yeah", "indeed"),
|
||||
list(
|
||||
"Are you sure?",
|
||||
"I see.",
|
||||
"I understand.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("friend"),
|
||||
list(
|
||||
"Why do you bring up the topic of friends?",
|
||||
"Why do your friends worry you?",
|
||||
"Do your friends pick on you?",
|
||||
"Are you sure you have any friends?",
|
||||
"Do you impose on your friends?",
|
||||
"Perhaps your love for friends worries you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("computer", "bot", "ai"),
|
||||
list(
|
||||
"Do computers worry you?",
|
||||
"Are you talking about me in particular?",
|
||||
"Are you frightened by machines?",
|
||||
"Why do your mention computers?",
|
||||
"What do you think computers have to do with your problem?",
|
||||
"Don't you think computers can help people?",
|
||||
"What is it about machines that worries you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("murder", "death", "kill", "dead", "destroy", "traitor", "synd"),
|
||||
list(
|
||||
"Well, that's rather morbid.",
|
||||
"Do you think that caused a trauma with you?",
|
||||
"Have you ever previously spoken to anybody about this?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("bomb", "explosive", "toxin", "phoron"),
|
||||
list(
|
||||
"Do you worry about bombs often?",
|
||||
"Do you work in science?",
|
||||
"Do you find it odd to worry about bombs on a science research vessel?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("work", "job", "head", "staff", "transen"),
|
||||
list(
|
||||
"Do you like working here?",
|
||||
"What are your feelings on working here?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("nokeyfound"),
|
||||
list(
|
||||
"Say, do you have any psychological problems?",
|
||||
"What does that suggest to you?",
|
||||
"I see.",
|
||||
"I'm not sure I understand you fully.",
|
||||
"Come elucidate on your thoughts.",
|
||||
"Can you elaborate on that?",
|
||||
"That is quite interesting.")))
|
||||
|
||||
/datum/text_parser/keyword/setparam
|
||||
proc/param(object)
|
||||
|
||||
// drop leading parts
|
||||
for(var/leader in object_leaders)
|
||||
var/i = findtext(object, leader)
|
||||
if(i)
|
||||
object = copytext(object, i + lentext(leader))
|
||||
break
|
||||
|
||||
// trim spaces
|
||||
object = trim(object)
|
||||
|
||||
// trim punctuation
|
||||
if(lentext(object) > 0)
|
||||
var/final_punc = copytext(object, lentext(object))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
object = copytext(object, 1, lentext(object))
|
||||
|
||||
return object
|
||||
|
||||
/datum/text_parser/keyword/paramlist
|
||||
proc/param(object)
|
||||
// drop leading parts
|
||||
for(var/leader in object_leaders)
|
||||
var/i = findtext(object, leader)
|
||||
if(i)
|
||||
object = copytext(object, i + lentext(leader))
|
||||
break
|
||||
|
||||
// trim spaces
|
||||
object = trim(object)
|
||||
|
||||
// trim punctuation
|
||||
if(lentext(object) > 0)
|
||||
var/final_punc = copytext(object, lentext(object))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
object = copytext(object, 1, lentext(object))
|
||||
|
||||
return dd_text2list(object, ",")
|
||||
|
||||
/datum/text_parser/keyword/setparam/username
|
||||
process(object)
|
||||
object = param(object)
|
||||
|
||||
// handle name
|
||||
if(eliza.username == "")
|
||||
// new name
|
||||
var/t = ..(object)
|
||||
eliza.yesno_state = "username"
|
||||
eliza.yesno_param = object
|
||||
return t
|
||||
else if(cmptext(eliza.username, object))
|
||||
// but wait!
|
||||
return "You already told me your name was [eliza.username]."
|
||||
else
|
||||
eliza.yesno_state = "username"
|
||||
eliza.yesno_param = object
|
||||
return "But you previously told me your name was [eliza.username]. Are you sure you want to be called [object]?"
|
||||
|
||||
/datum/text_parser/keyword/setparam/callsign
|
||||
process(object)
|
||||
object = param(object)
|
||||
|
||||
// handle name
|
||||
if(eliza.callsign == "")
|
||||
// new name
|
||||
var/t = ..(object)
|
||||
eliza.yesno_state = "callsign"
|
||||
eliza.yesno_param = object
|
||||
return t
|
||||
else if(cmptext(eliza.callsign, object))
|
||||
// but wait!
|
||||
return "You already told me that I should answer to [eliza.callsign]."
|
||||
else
|
||||
eliza.yesno_state = "callsign"
|
||||
eliza.yesno_param = object
|
||||
return "But you previously told me my name was [eliza.callsign]. Are you sure you want me to be called [object]?"
|
||||
|
||||
/datum/text_parser/keyword/paramlist/pick
|
||||
process(object)
|
||||
var/choice = pick(param(object))
|
||||
return ..(choice)
|
||||
|
||||
/datum/text_parser/keyword/tell
|
||||
conjugate = 0
|
||||
|
||||
process(object)
|
||||
// get name & message
|
||||
var/i = findtext(object, ",")
|
||||
var/sl = 1
|
||||
if(!i || lentext(object) < i + sl)
|
||||
return "Tell who that you what?"
|
||||
|
||||
var/name = trim(copytext(object, 1, i))
|
||||
object = trim(copytext(object, i + sl))
|
||||
if(!lentext(name) || !lentext(object))
|
||||
return "Tell who that you what?"
|
||||
|
||||
// find PDA
|
||||
var/obj/item/device/pda/pda
|
||||
for (var/obj/item/device/pda/P in world)
|
||||
if (!P.owner)
|
||||
continue
|
||||
else if (P.toff)
|
||||
continue
|
||||
|
||||
if(!cmptext(name, P.owner))
|
||||
continue
|
||||
|
||||
pda = P
|
||||
|
||||
if(!pda || pda.toff)
|
||||
return "I couldn't find [name]'s PDA."
|
||||
|
||||
// send message
|
||||
if(!istype(eliza.speaker.loc.loc, /obj/item/device/pda))//Looking if we are in a PDA
|
||||
pda.tnote += "<i><b>← From [eliza.callsign]:</b></i><br>[object]<br>"
|
||||
|
||||
if(prob(15) && eliza.speaker) //Give the AI a chance of intercepting the message
|
||||
var/who = eliza.speaker
|
||||
if(prob(50))
|
||||
who = "[eliza.speaker:master] via [eliza.speaker]"
|
||||
for(var/mob/living/silicon/ai/ai in world)
|
||||
ai.show_message("<i>Intercepted message from <b>[who]</b>: [object]</i>")
|
||||
|
||||
if (!pda.silent)
|
||||
playsound(pda.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, pda.loc))
|
||||
O.show_message(text("\icon[pda] *[pda.ttone]*"))
|
||||
|
||||
pda.overlays = null
|
||||
pda.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
else
|
||||
var/list/href_list = list()
|
||||
href_list["src"] = "\ref[eliza.speaker.loc.loc]"
|
||||
href_list["choice"] = "Message"
|
||||
href_list["target"] = "\ref[pda]"
|
||||
href_list["pAI_mess"] = "\"[object]\" \[Via pAI Unit\]"
|
||||
var/obj/item/device/pda/pda_im_in = eliza.speaker.loc.loc
|
||||
pda_im_in.Topic("src=\ref[eliza.speaker.loc.loc];choice=Message;target=\ref[pda];pAI_mess=\"[object] \[Via pAI Unit\]",href_list)
|
||||
return "Told [name], [object]."
|
||||
|
||||
/datum/text_parser/keyword/yes
|
||||
process(object)
|
||||
var/reply
|
||||
switch(eliza.yesno_state)
|
||||
if("username")
|
||||
eliza.username = eliza.yesno_param
|
||||
reply = pick(
|
||||
"[eliza.username] - that's a nice name.",
|
||||
"Hello, [eliza.username]!",
|
||||
"You sound nice.")
|
||||
if("callsign")
|
||||
eliza.callsign = eliza.yesno_param
|
||||
eliza.set_name(eliza.callsign)
|
||||
reply = pick(
|
||||
"Oh, alright...",
|
||||
"[eliza.callsign]... I like that.",
|
||||
"OK!")
|
||||
else
|
||||
return ..(object)
|
||||
eliza.yesno_state = ""
|
||||
eliza.yesno_param = ""
|
||||
return reply
|
||||
|
||||
/datum/text_parser/keyword/no
|
||||
process(object)
|
||||
return ..(object)
|
||||
@@ -1,18 +0,0 @@
|
||||
// Contains:
|
||||
// /datum/text_parser/parser
|
||||
|
||||
/datum/text_parser/parser
|
||||
var/input_line = ""
|
||||
var/mob/speaker
|
||||
|
||||
/datum/text_parser/parser/proc/print(line)
|
||||
speaker.say(line)
|
||||
|
||||
/datum/text_parser/parser/proc/set_name(name)
|
||||
speaker.name = name
|
||||
speaker.real_name = name
|
||||
|
||||
/datum/text_parser/parser/proc/new_session()
|
||||
input_line = ""
|
||||
|
||||
/datum/text_parser/parser/proc/process_line()
|
||||
@@ -1,190 +0,0 @@
|
||||
// Base Class
|
||||
/mob/living/simple_animal/livestock
|
||||
desc = "Tasty!"
|
||||
icon = 'icons/mob/livestock.dmi'
|
||||
emote_see = list("shakes its head", "kicks the ground")
|
||||
speak_chance = 1
|
||||
turns_per_move = 15
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "kicks"
|
||||
var/max_nutrition = 100 // different animals get hungry faster, basically number of 5-second steps from full to starving (60 == 5 minutes)
|
||||
var/nutrition_step // cycle step in nutrition system
|
||||
var/obj/movement_target // eating-ing target
|
||||
|
||||
New()
|
||||
if(!nutrition)
|
||||
nutrition = max_nutrition * 0.33 // at 1/3 nutrition
|
||||
|
||||
reagents = new()
|
||||
reagents.my_atom = src
|
||||
|
||||
Life()
|
||||
..()
|
||||
|
||||
if(stat != DEAD)
|
||||
meat_amount = round(nutrition / 50)
|
||||
|
||||
nutrition_step--
|
||||
if(nutrition_step <= 0)
|
||||
// handle animal digesting
|
||||
if(nutrition > 0)
|
||||
nutrition--
|
||||
else
|
||||
health--
|
||||
nutrition_step = 50 // only tick this every 5 seconds
|
||||
|
||||
// handle animal eating (borrowed from Ian code)
|
||||
|
||||
// not hungry if full
|
||||
if(nutrition >= max_nutrition)
|
||||
return
|
||||
|
||||
if((movement_target) && !(isturf(movement_target.loc)))
|
||||
movement_target = null
|
||||
a_intent = "help"
|
||||
turns_per_move = initial(turns_per_move)
|
||||
if( !movement_target || !(movement_target.loc in oview(src, 3)) )
|
||||
movement_target = null
|
||||
a_intent = "help"
|
||||
turns_per_move = initial(turns_per_move)
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in oview(src,3))
|
||||
if(isturf(S.loc) || ishuman(S.loc))
|
||||
movement_target = S
|
||||
break
|
||||
if(movement_target)
|
||||
stop_automated_movement = 1
|
||||
step_to(src,movement_target,1)
|
||||
sleep(3)
|
||||
step_to(src,movement_target,1)
|
||||
sleep(3)
|
||||
step_to(src,movement_target,1)
|
||||
|
||||
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
|
||||
if (movement_target.loc.x < src.x)
|
||||
set_dir(WEST)
|
||||
else if (movement_target.loc.x > src.x)
|
||||
set_dir(EAST)
|
||||
else if (movement_target.loc.y < src.y)
|
||||
set_dir(SOUTH)
|
||||
else if (movement_target.loc.y > src.y)
|
||||
set_dir(NORTH)
|
||||
else
|
||||
set_dir(SOUTH)
|
||||
|
||||
if(isturf(movement_target.loc))
|
||||
movement_target.attack_animal(src)
|
||||
if(istype(movement_target, /obj/item/weapon/reagent_containers/food/snacks))
|
||||
var/obj/item/I = movement_target
|
||||
I.attack(src, src, "mouth") // eat it, if it's food
|
||||
|
||||
if(a_intent == "hurt") // to make raging critter harm, then disarm, then stop
|
||||
a_intent = "disarm"
|
||||
else if(a_intent == "disarm")
|
||||
a_intent = "help"
|
||||
movement_target = null
|
||||
turns_per_move = initial(turns_per_move)
|
||||
else if(ishuman(movement_target.loc))
|
||||
if(prob(20))
|
||||
emote("stares at the [movement_target] that [movement_target.loc] has with a longing expression.")
|
||||
|
||||
proc/rage_at(mob/living/M)
|
||||
movement_target = M // pretty simple
|
||||
turns_per_move = 1
|
||||
emote("becomes enraged")
|
||||
a_intent = "hurt"
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(nutrition < max_nutrition && istype(O,/obj/item/weapon/reagent_containers/food/snacks))
|
||||
O.attack_animal(src)
|
||||
else
|
||||
..(O, user)
|
||||
|
||||
// Cow
|
||||
/mob/living/simple_animal/livestock/cow
|
||||
name = "\improper Cow"
|
||||
icon_state = "cow"
|
||||
icon_living = "cow"
|
||||
icon_dead = "cow_d"
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/cow
|
||||
meat_amount = 10
|
||||
max_nutrition = 1000
|
||||
speak = list("Moo.","Moooo!","Snort.")
|
||||
speak_emote = list("moos")
|
||||
emote_hear = list("moos", "snorts")
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass))
|
||||
var/datum/reagents/R = O:reagents
|
||||
|
||||
R.add_reagent("milk", 50)
|
||||
nutrition -= 50
|
||||
usr << "\blue You milk the cow."
|
||||
else if(O.force > 0 && O.w_class >= 2)
|
||||
rage_at(user)
|
||||
else
|
||||
..(O, user)
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
..()
|
||||
if(user.a_intent == "hurt")
|
||||
rage_at(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/cow
|
||||
name = "Beef"
|
||||
desc = "It's what's for dinner!"
|
||||
|
||||
// Chicken
|
||||
/mob/living/simple_animal/livestock/chicken
|
||||
name = "\improper Chicken"
|
||||
icon_state = "chick"
|
||||
icon_living = "chick"
|
||||
icon_dead = "chick_d"
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/chicken
|
||||
meat_amount = 3
|
||||
max_nutrition = 200
|
||||
speak = list("Bock bock!","Cl-cluck.","Click.")
|
||||
speak_emote = list("bocks","clucks")
|
||||
emote_hear = list("bocks", "clucks", "squawks")
|
||||
|
||||
/mob/living/simple_animal/livestock/chicken/Life()
|
||||
..()
|
||||
|
||||
// go right before cycle elapses, and if animal isn't starving
|
||||
if(stat != DEAD && nutrition_step == 1 && nutrition > max_nutrition / 2)
|
||||
// lay an egg with probability of 5% in 5 second time period
|
||||
if(prob(33))
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/egg(src.loc) // lay an egg
|
||||
nutrition -= 25
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/chicken
|
||||
name = "Chicken"
|
||||
desc = "Tasty!"
|
||||
|
||||
/obj/structure/closet/critter
|
||||
desc = "\improper Critter crate."
|
||||
name = "Critter Crate"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "critter"
|
||||
density = 1
|
||||
icon_opened = "critteropen"
|
||||
icon_closed = "critter"
|
||||
|
||||
/datum/supply_packs/chicken
|
||||
name = "\improper Chicken crate"
|
||||
contains = list("/mob/living/simple_animal/livestock/chicken",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/grown/corn")
|
||||
cost = 10
|
||||
containertype = "/obj/structure/closet/critter"
|
||||
containername = "Chicken crate"
|
||||
//group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/cow
|
||||
name = "\improper Cow crate"
|
||||
contains = list("/mob/living/simple_animal/livestock/cow",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/grown/corn")
|
||||
cost = 50
|
||||
containertype = "/obj/structure/closet/critter"
|
||||
containername = "Cow crate"
|
||||
//group = "Hydroponics"
|
||||
@@ -1,28 +0,0 @@
|
||||
/datum/paiCandidate/chatbot
|
||||
name = "NT Standard Chatbot"
|
||||
description = "NT Standard Issue pAI Unit 13A"
|
||||
role = "Advisor"
|
||||
comments = "This is an actual AI."
|
||||
ready = 1
|
||||
|
||||
/mob/living/silicon/pai/chatbot
|
||||
var/datum/text_parser/parser/eliza/P = new()
|
||||
|
||||
proc/init()
|
||||
P.speaker = src
|
||||
P.callsign = input("What do you want to call me?", "Chatbot Name", "NT") as text
|
||||
P.set_name(P.callsign)
|
||||
P.new_session()
|
||||
|
||||
proc/hear_talk(mob/M, text)
|
||||
if(stat)
|
||||
return
|
||||
|
||||
var/prefix = P.callsign + ","
|
||||
|
||||
if(lentext(text) <= lentext(prefix))
|
||||
return
|
||||
var/i = lentext(prefix) + 1
|
||||
if(cmptext(copytext(text, 1, i), prefix))
|
||||
P.input_line = html_decode(copytext(text, i))
|
||||
P.process_line()
|
||||
@@ -1,231 +0,0 @@
|
||||
// a frame for generic wall-mounted things, such as fire alarm, status display..
|
||||
// combination of apc_frame and machine_frame
|
||||
/obj/machinery/constructable_frame/wallmount_frame
|
||||
icon = 'icons/obj/stock_parts.dmi'
|
||||
icon_state = "wm_0"
|
||||
var/wall_offset = 24
|
||||
density = 0
|
||||
|
||||
/obj/machinery/constructable_frame/wallmount_frame/New()
|
||||
spawn(1)
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red [name] cannot be placed on this spot."
|
||||
new/obj/item/stack/sheet/metal(get_turf(src), 2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
var/turf/obj_ofs = get_step(locate(2,2,1), dir)
|
||||
pixel_x = (obj_ofs.x - 2) * wall_offset
|
||||
pixel_y = (obj_ofs.y - 2) * wall_offset
|
||||
|
||||
var/turf/T = get_step(usr, dir)
|
||||
if(!istype(T, /turf/simulated/wall))
|
||||
usr << "\red [name] must be placed on a wall."
|
||||
new/obj/item/stack/sheet/metal(get_turf(src), 2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
set_dir(get_dir(T, loc))
|
||||
|
||||
/obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||
if(P.crit_fail)
|
||||
user << "\red This part is faulty, you cannot add this to the machine!"
|
||||
return
|
||||
switch(state)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
if(P:amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You start to add cables to the frame."
|
||||
if(do_after(user, 20))
|
||||
P:amount -= 5
|
||||
if(!P:amount) del(P)
|
||||
user << "\blue You add cables to the frame."
|
||||
state = 2
|
||||
icon_state = "wm_1"
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "\blue You dismantle the frame"
|
||||
new /obj/item/stack/sheet/metal(src.loc, 2)
|
||||
del(src)
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/circuitboard))
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "wallmount")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You add the circuit board to the frame."
|
||||
circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
icon_state = "wm_2"
|
||||
state = 3
|
||||
components = list()
|
||||
req_components = circuit.req_components.Copy()
|
||||
for(var/A in circuit.req_components)
|
||||
req_components[A] = circuit.req_components[A]
|
||||
req_component_names = circuit.req_components.Copy()
|
||||
for(var/A in req_components)
|
||||
var/cp = text2path(A)
|
||||
var/obj/ct = new cp() // have to quickly instantiate it get name
|
||||
req_component_names[A] = ct.name
|
||||
if(circuit.frame_desc)
|
||||
desc = circuit.frame_desc
|
||||
else
|
||||
update_desc()
|
||||
user << desc
|
||||
else
|
||||
user << "\red This frame does not accept circuit boards of this type!"
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cables."
|
||||
state = 1
|
||||
icon_state = "wm_0"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||
A.amount = 5
|
||||
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
state = 2
|
||||
circuit.loc = src.loc
|
||||
circuit = null
|
||||
if(components.len == 0)
|
||||
user << "\blue You remove the circuit board."
|
||||
else
|
||||
user << "\blue You remove the circuit board and other components."
|
||||
for(var/obj/item/weapon/W in components)
|
||||
W.loc = src.loc
|
||||
desc = initial(desc)
|
||||
req_components = null
|
||||
components = null
|
||||
icon_state = "wm_1"
|
||||
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
var/component_check = 1
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
break
|
||||
if(component_check)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||
new_machine.set_dir(dir)
|
||||
if(istype(circuit, /obj/item/weapon/circuitboard/status_display))
|
||||
new_machine.pixel_x = pixel_x * 1.33
|
||||
new_machine.pixel_y = pixel_y * 1.33
|
||||
else
|
||||
new_machine.pixel_x = pixel_x
|
||||
new_machine.pixel_y = pixel_y
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
del(O)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
||||
O.loc = new_machine
|
||||
else
|
||||
O.loc = null
|
||||
new_machine.component_parts += O
|
||||
if(circuit.contain_parts)
|
||||
circuit.loc = new_machine
|
||||
else
|
||||
circuit.loc = null
|
||||
new_machine.RefreshParts()
|
||||
del(src)
|
||||
|
||||
if(istype(P, /obj/item/weapon))
|
||||
for(var/I in req_components)
|
||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CP = P
|
||||
if(CP.amount > 1)
|
||||
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
||||
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
|
||||
CC.amount = camt
|
||||
CC.update_icon()
|
||||
CP.use(camt)
|
||||
components += CC
|
||||
req_components[I] -= camt
|
||||
update_desc()
|
||||
break
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
components += P
|
||||
req_components[I]--
|
||||
update_desc()
|
||||
break
|
||||
user << desc
|
||||
if(P.loc != src && !istype(P, /obj/item/stack/cable_coil))
|
||||
user << "\red You cannot add that component to the machine!"
|
||||
|
||||
/obj/item/weapon/circuitboard/firealarm
|
||||
name = "Circuit board (Fire Alarm)"
|
||||
build_path = "/obj/machinery/firealarm"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Capacitor, and 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/capacitor" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/alarm
|
||||
name = "Circuit board (Atmospheric Alarm)"
|
||||
build_path = "/obj/machinery/alarm"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Console Screen, and 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2)
|
||||
|
||||
/* oh right, not a machine :(
|
||||
/obj/item/weapon/circuitboard/intercom
|
||||
name = "Circuit board (Intercom)"
|
||||
build_path = "/obj/item/device/radio/intercom"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 1 Console Screen, and 2 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2)
|
||||
*/
|
||||
|
||||
/* too complex to set up the dept for an RC in a way intuitive for the user
|
||||
/obj/item/weapon/circuitboard/requests_console
|
||||
name = "Circuit board (Requests Console)"
|
||||
build_path = "/obj/machinery/requests_console"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 radio, 1 Console Screen, and 1 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/device/radio" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1
|
||||
"/obj/item/stack/cable_coil" = 1)
|
||||
*/
|
||||
|
||||
/obj/item/weapon/circuitboard/status_display
|
||||
name = "Circuit board (Status Display)"
|
||||
build_path = "/obj/machinery/status_display"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2,programming=2"
|
||||
frame_desc = "Requires 2 Console Screens, and 1 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2,
|
||||
"/obj/item/stack/cable_coil" = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/light_switch
|
||||
name = "Circuit board (Light Switch)"
|
||||
build_path = "/obj/machinery/light_switch"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 2)
|
||||
@@ -1,176 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06
|
||||
|
||||
/*
|
||||
|
||||
TODO:
|
||||
give money an actual use (QM stuff, vending machines)
|
||||
send money to people (might be worth attaching money to custom database thing for this, instead of being in the ID)
|
||||
log transactions
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/atm
|
||||
name = "\improper NanoTrasen Automatic Teller Machine"
|
||||
desc = "For all your monetary needs!"
|
||||
icon = 'icons/obj/terminals.dmi'
|
||||
icon_state = "atm"
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
var/obj/item/weapon/card/id/card
|
||||
var/obj/item/weapon/spacecash/cashes = list()
|
||||
var/inserted = 0
|
||||
var/accepted = 0
|
||||
var/pincode = 0
|
||||
|
||||
attackby(var/obj/A, var/mob/user)
|
||||
if(istype(A,/obj/item/weapon/spacecash))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += A:worth
|
||||
return
|
||||
if(istype(A,/obj/item/weapon/coin))
|
||||
if(istype(A,/obj/item/weapon/coin/iron))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += 1
|
||||
return
|
||||
if(istype(A,/obj/item/weapon/coin/silver))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += 10
|
||||
return
|
||||
if(istype(A,/obj/item/weapon/coin/gold))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += 50
|
||||
return
|
||||
if(istype(A,/obj/item/weapon/coin/phoron))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += 2
|
||||
return
|
||||
if(istype(A,/obj/item/weapon/coin/diamond))
|
||||
cashes += A
|
||||
user.drop_item()
|
||||
A.loc = src
|
||||
inserted += 300
|
||||
return
|
||||
user << "You insert your [A.name] in ATM"
|
||||
..()
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
if(istype(user, /mob/living/silicon))
|
||||
user << "\red Artificial unit recognized. Artificial units do not currently receive monetary compensation, as per NanoTrasen regulation #1005."
|
||||
return
|
||||
|
||||
if(!(stat && NOPOWER) && ishuman(user))
|
||||
var/dat
|
||||
user.machine = src
|
||||
if(!accepted)
|
||||
if(scan(user))
|
||||
pincode = input(usr,"Enter a pin-code") as num
|
||||
if(card.checkaccess(pincode,usr))
|
||||
accepted = 1
|
||||
// usr << sound('nya.mp3')
|
||||
else
|
||||
dat = null
|
||||
dat += "<h1>NanoTrasen Automatic Teller Machine</h1><br/>"
|
||||
dat += "For all your monetary needs!<br/><br/>"
|
||||
dat += "Welcome, [card.registered_name]. You have [card.money] credits deposited.<br>"
|
||||
dat += "Current inserted item value: [inserted] credits.<br><br>"
|
||||
dat += "Please, select action<br>"
|
||||
dat += "<a href=\"?src=\ref[src]&with=1\">Withdraw Physical Credits</a><br/>"
|
||||
dat += "<a href=\"?src=\ref[src]&eca=1\">Eject Inserted Items</a><br/>"
|
||||
dat += "<a href=\"?src=\ref[src]&ins=1\">Convert Inserted Items to Credits</a><br/>"
|
||||
dat += "<a href=\"?src=\ref[src]&lock=1\">Lock ATM</a><br/>"
|
||||
user << browse(dat,"window=atm")
|
||||
onclose(user,"close")
|
||||
proc
|
||||
withdraw(var/mob/user)
|
||||
if(accepted)
|
||||
var/amount = input("How much would you like to withdraw?", "Amount", 0) in list(1,10,20,50,100,200,500,1000, 0)
|
||||
if(amount == 0)
|
||||
return
|
||||
if(card.money >= amount)
|
||||
card.money -= amount
|
||||
switch(amount)
|
||||
if(1)
|
||||
new /obj/item/weapon/spacecash(loc)
|
||||
if(10)
|
||||
new /obj/item/weapon/spacecash/c10(loc)
|
||||
if(20)
|
||||
new /obj/item/weapon/spacecash/c20(loc)
|
||||
if(50)
|
||||
new /obj/item/weapon/spacecash/c50(loc)
|
||||
if(100)
|
||||
new /obj/item/weapon/spacecash/c100(loc)
|
||||
if(200)
|
||||
new /obj/item/weapon/spacecash/c200(loc)
|
||||
if(500)
|
||||
new /obj/item/weapon/spacecash/c500(loc)
|
||||
if(1000)
|
||||
new /obj/item/weapon/spacecash/c1000(loc)
|
||||
else
|
||||
user << "\red Error: Insufficient funds."
|
||||
return
|
||||
|
||||
scan(var/mob/user)
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.wear_id)
|
||||
if(istype(H.wear_id, /obj/item/weapon/card/id))
|
||||
card = H.wear_id
|
||||
return 1
|
||||
if(istype(H.wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/P = H.wear_id
|
||||
if(istype(P.id,/obj/item/weapon/card/id))
|
||||
card = P.id
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
insert()
|
||||
if(accepted)
|
||||
card.money += inserted
|
||||
inserted = 0
|
||||
|
||||
Topic(href,href_list)
|
||||
if (usr.machine==src && get_dist(src, usr) <= 1 || istype(usr, /mob/living/silicon/ai))
|
||||
if(href_list["eca"])
|
||||
if(accepted)
|
||||
for(var/obj/item/weapon/spacecash/M in cashes)
|
||||
M.loc = loc
|
||||
inserted = 0
|
||||
if(!cashes)
|
||||
cashes = null
|
||||
if(href_list["with"] && card)
|
||||
withdraw(usr)
|
||||
if(href_list["ins"] && card)
|
||||
if(accepted)
|
||||
card.money += inserted
|
||||
inserted = 0
|
||||
if(cashes)
|
||||
cashes = null
|
||||
if(href_list["lock"])
|
||||
card = null
|
||||
accepted = 0
|
||||
usr.machine = null
|
||||
usr << browse(null,"window=atm")
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
usr.machine = null
|
||||
usr << browse(null,"window=atm")
|
||||
|
||||
|
||||
/obj/item/weapon/card/id/proc/checkaccess(p,var/mob/user)
|
||||
if(p == pin)
|
||||
user << "\green Access granted"
|
||||
return 1
|
||||
user << "\red Access denied"
|
||||
return 0
|
||||
@@ -1,117 +0,0 @@
|
||||
//TODO: Flash range does nothing currently
|
||||
//NOTE: This has not yet been updated with the lighting deferal stuff. ~Carn
|
||||
//Needs some work anyway.
|
||||
|
||||
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
|
||||
spawn(0)
|
||||
var/start = world.timeofday
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter) return
|
||||
|
||||
if(adminlog)
|
||||
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[epicenter.x];Y=[epicenter.y];Z=[epicenter.z]'>JMP</a>)")
|
||||
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
||||
|
||||
playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
|
||||
playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) )
|
||||
|
||||
tension_master.explosion()
|
||||
|
||||
if(defer_powernet_rebuild != 2)
|
||||
defer_powernet_rebuild = 1
|
||||
|
||||
if(heavy_impact_range > 1)
|
||||
var/datum/effect/system/explosion/E = new/datum/effect/system/explosion()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
|
||||
var/x = epicenter.x
|
||||
var/y = epicenter.y
|
||||
var/z = epicenter.z
|
||||
|
||||
var/counter = 0
|
||||
|
||||
if(devastation_range > 0)
|
||||
counter += explosion_turf(x,y,z,1)
|
||||
else
|
||||
devastation_range = 0
|
||||
if(heavy_impact_range > 0)
|
||||
counter += explosion_turf(x,y,z,2)
|
||||
else
|
||||
heavy_impact_range = 0
|
||||
if(light_impact_range > 0)
|
||||
counter += explosion_turf(x,y,z,3)
|
||||
else
|
||||
return
|
||||
|
||||
//Diamond 'splosions (looks more round than square version)
|
||||
for(var/i=0, i<devastation_range, i++)
|
||||
for(var/j=0, j<i, j++)
|
||||
counter += explosion_turf((x-i)+j, y+j, z, 1)
|
||||
counter += explosion_turf(x+j, (y+i)-j, z, 1)
|
||||
counter += explosion_turf((x+i)-j, y-j, z, 1)
|
||||
counter += explosion_turf(x-j, (y-i)+j, z, 1)
|
||||
|
||||
for(var/i=devastation_range, i<heavy_impact_range, i++)
|
||||
for(var/j=0, j<i, j++)
|
||||
counter += explosion_turf((x-i)+j, y+j, z, 2)
|
||||
counter += explosion_turf(x+j, (y+i)-j, z, 2)
|
||||
counter += explosion_turf((x+i)-j, y-j, z, 2)
|
||||
counter += explosion_turf(x-j, (y-i)+j, z, 2)
|
||||
|
||||
for(var/i=heavy_impact_range, i<light_impact_range, i++)
|
||||
for(var/j=0, j<i, j++)
|
||||
counter += explosion_turf((x-i)+j, y+j, z, 3)
|
||||
counter += explosion_turf(x+j, (y+i)-j, z, 3)
|
||||
counter += explosion_turf((x+i)-j, y-j, z, 3)
|
||||
counter += explosion_turf(x-j, (y-i)+j, z, 3)
|
||||
|
||||
/* //Square 'splosions
|
||||
for(var/i=0, i<devastation_range, i++)
|
||||
for(var/j=-i, j<i, j++)
|
||||
counter += explosion_turf(x+j, y-i, z, 1)
|
||||
counter += explosion_turf(x-j, y+i, z, 1)
|
||||
counter += explosion_turf(x+i, y+j, z, 1)
|
||||
counter += explosion_turf(x-i, y-j, z, 1)
|
||||
sleep(1)
|
||||
|
||||
for(var/i=devastation_range, i<heavy_impact_range, i++)
|
||||
for(var/j=-i, j<i, j++)
|
||||
counter += explosion_turf(x+j, y-i, z, 2)
|
||||
counter += explosion_turf(x-j, y+i, z, 2)
|
||||
counter += explosion_turf(x+i, y+j, z, 2)
|
||||
counter += explosion_turf(x-i, y-j, z, 2)
|
||||
sleep(1)
|
||||
|
||||
for(var/i=heavy_impact_range, i<light_impact_range, i++)
|
||||
for(var/j=-i, j<i, j++)
|
||||
counter += explosion_turf(x+j, y-i, z, 3)
|
||||
counter += explosion_turf(x-j, y+i, z, 3)
|
||||
counter += explosion_turf(x+i, y+j, z, 3)
|
||||
counter += explosion_turf(x-i, y-j, z, 3)
|
||||
sleep(1)
|
||||
*/
|
||||
|
||||
if(defer_powernet_rebuild != 2)
|
||||
defer_powernet_rebuild = 0
|
||||
|
||||
world.log << "## Explosion([x],[y],[z])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [(world.timeofday-start)/10] seconds. Processed [counter] atoms."
|
||||
return 1
|
||||
|
||||
proc/explosion_turf(var/x,var/y,var/z,var/force)
|
||||
var/counter = 1
|
||||
var/turf/T = locate(x,y,z)
|
||||
if(T)
|
||||
T.ex_act(force)
|
||||
if(T)
|
||||
for(var/atom/movable/AM in T.contents)
|
||||
counter++
|
||||
AM.ex_act(force)
|
||||
|
||||
// sleep(0)
|
||||
return counter
|
||||
|
||||
|
||||
proc/secondaryexplosion(turf/epicenter, range)
|
||||
for(var/turf/tile in range(range, epicenter))
|
||||
tile.ex_act(2)
|
||||
@@ -1,7 +0,0 @@
|
||||
/client/verb/find_atoms_in_null()
|
||||
if(!holder) return
|
||||
var/msg
|
||||
for(var/atom/A)
|
||||
if(A.loc == null)
|
||||
msg += "\ref[A] [A.type] - [A]\n"
|
||||
world.log << msg
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
client/verb/powernets_debug()
|
||||
if(!holder) return
|
||||
var/ref_holder = "\ref[holder]"
|
||||
for(var/i=1,i<=powernets.len,i++)
|
||||
src << "<a href='?[ref_holder];adminplayervars=\ref[powernets[i]]'>[copytext("\ref[powernets[i]]",8,12)]</A>"
|
||||
|
||||
|
||||
client/verb/powernet_overlays()
|
||||
for(var/obj/structure/cable/C in cable_list)
|
||||
C.maptext = "<font color='white'>[copytext("\ref[C.powernet]",8,12)]</font>"
|
||||
for(var/obj/machinery/power/M in machines)
|
||||
M.maptext = "<font color='white'>[copytext("\ref[M.powernet]",8,12)]</font>"
|
||||
*/
|
||||
@@ -1,210 +0,0 @@
|
||||
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
|
||||
|
||||
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)
|
||||
@@ -1,258 +0,0 @@
|
||||
//Nothing spectacular, just a slightly more configurable MC.
|
||||
|
||||
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
|
||||
|
||||
var/global/obj/machinery/last_obj_processed //Used for MC 'proc break' debugging
|
||||
var/global/datum/disease/last_disease_processed //Used for MC 'proc break' debugging
|
||||
var/global/obj/machinery/last_machine_processed //Used for MC 'proc break' debugging
|
||||
|
||||
datum/controller/game_controller
|
||||
var/processing = 0
|
||||
var/breather_ticks = 1 //a somewhat crude attempt to iron over the 'bumps' caused by high-cpu use by letting the MC have a breather for this many ticks after every step
|
||||
var/minimum_ticks = 10 //The minimum length of time between MC ticks
|
||||
|
||||
var/global/air_master_ready = 0
|
||||
var/global/tension_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
|
||||
|
||||
datum/controller/game_controller/New()
|
||||
//There can be only one master_controller. Out with the old and in with the new.
|
||||
if(master_controller)
|
||||
if(master_controller != src)
|
||||
del(master_controller)
|
||||
master_controller = src
|
||||
|
||||
if(!air_master)
|
||||
air_master = new /datum/controller/air_system()
|
||||
air_master.setup()
|
||||
|
||||
if(!job_master)
|
||||
job_master = new /datum/controller/occupations()
|
||||
if(job_master.SetupOccupations())
|
||||
world << "\red \b Job setup complete"
|
||||
job_master.LoadJobs("config/jobs.txt")
|
||||
|
||||
if(!tension_master) tension_master = new /datum/tension()
|
||||
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
|
||||
if(!ticker) ticker = new /datum/controller/gameticker()
|
||||
if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle()
|
||||
if(artifact_spawn) artifact_spawning_turfs = artifact_spawn
|
||||
|
||||
datum/controller/game_controller/proc/setup()
|
||||
world.tick_lag = config.Ticklag
|
||||
|
||||
createRandomZlevel()
|
||||
setup_objects()
|
||||
setupgenetics()
|
||||
setupfactions()
|
||||
|
||||
for(var/i = 0, i < max_secret_rooms, i++)
|
||||
make_mining_asteroid_secret()
|
||||
|
||||
spawn(0)
|
||||
if(ticker)
|
||||
ticker.pregame()
|
||||
|
||||
datum/controller/game_controller/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."
|
||||
sleep(-1)
|
||||
|
||||
|
||||
datum/controller/game_controller/proc/process()
|
||||
set background = 1
|
||||
processing = 1
|
||||
while(1) //far more efficient than recursively calling ourself
|
||||
if(!Failsafe) new /datum/failsafe()
|
||||
|
||||
var/currenttime = world.timeofday
|
||||
last_tick_duration = (currenttime - last_tick_timeofday) / 10
|
||||
last_tick_timeofday = currenttime
|
||||
|
||||
if(processing)
|
||||
var/start_time = world.timeofday
|
||||
controller_iteration++
|
||||
|
||||
air_master_ready = 0
|
||||
tension_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
|
||||
|
||||
spawn(0)
|
||||
air_master.process()
|
||||
air_master_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
tension_master.process()
|
||||
tension_master_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
sun.calc_position()
|
||||
sun_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
for(var/mob/living/M in world) //only living mobs have life processes
|
||||
M.Life()
|
||||
mobs_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
for(var/datum/disease/D in active_diseases)
|
||||
last_disease_processed = D
|
||||
D.process()
|
||||
diseases_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
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(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/object in processing_objects)
|
||||
last_obj_processed = object
|
||||
object.process()
|
||||
objects_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
for(var/datum/pipe_network/network in pipe_networks)
|
||||
network.process()
|
||||
networks_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
for(var/datum/powernet/P in powernets)
|
||||
P.reset()
|
||||
powernets_ready = 1
|
||||
sleep(breather_ticks)
|
||||
|
||||
spawn(0)
|
||||
ticker.process()
|
||||
ticker_ready = 1
|
||||
|
||||
sleep( minimum_ticks - max(world.timeofday-start_time,0) ) //to prevent long delays happening at midnight
|
||||
|
||||
var/IL_check = 0 //Infinite loop check (To report when the master controller breaks.)
|
||||
while(!air_master_ready || !tension_master_ready || !sun_ready || !mobs_ready || !diseases_ready || !machines_ready || !objects_ready || !networks_ready || !powernets_ready || !ticker_ready)
|
||||
IL_check++
|
||||
if(IL_check > 200)
|
||||
var/MC_report = "air_master_ready = [air_master_ready]; tension_master_ready = [tension_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];"
|
||||
var/MC_admin_report = "<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.<br>The master controller reports: [MC_report]</b><br>"
|
||||
if(!diseases_ready)
|
||||
if(last_disease_processed)
|
||||
MC_admin_report += "<b>DISEASE PROCESSING stuck on </b><A HREF='?src=%holder_ref%;adminplayervars=\ref[last_disease_processed]'>[last_disease_processed]</A><br>"
|
||||
else
|
||||
MC_admin_report += "<b>DISEASE PROCESSING stuck on </b>unknown<br>"
|
||||
if(!machines_ready)
|
||||
if(last_machine_processed)
|
||||
MC_admin_report += "<b>MACHINE PROCESSING stuck on </b><A HREF='?src=%holder_ref%;adminplayervars=\ref[last_machine_processed]'>[last_machine_processed]</A><br>"
|
||||
else
|
||||
MC_admin_report += "<b>MACHINE PROCESSING stuck on </b>unknown<br>"
|
||||
if(!objects_ready)
|
||||
if(last_obj_processed)
|
||||
MC_admin_report += "<b>OBJ PROCESSING stuck on </b><A HREF='?src=ADMINHOLDERREF;adminplayervars=\ref[last_obj_processed]'>[last_obj_processed]</A><br>"
|
||||
else
|
||||
MC_admin_report += "<b>OBJ PROCESSING stuck on </b>unknown<br>"
|
||||
MC_admin_report += "<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><br>"
|
||||
message_admins(MC_admin_report)
|
||||
log_admin("PROC BREAKAGE WARNING: infinite_loop_check = [IL_check]; [MC_report];")
|
||||
break
|
||||
sleep(3)
|
||||
else
|
||||
sleep(10)
|
||||
|
||||
|
||||
|
||||
/datum/failsafe // This thing pretty much just keeps poking the master controller
|
||||
var/spinning = 1
|
||||
var/current_iteration = 0
|
||||
var/ticks_per_spin = 200 //poke the MC every 20 seconds
|
||||
var/defcon = 0 //alert level. For every poke that fails this is raised by 1. When it reaches 5 the MC is replaced with a new one. (effectively killing any master_controller.process() and starting a new one)
|
||||
|
||||
/datum/failsafe/New()
|
||||
//There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one)
|
||||
if(Failsafe && (Failsafe != src))
|
||||
del(Failsafe)
|
||||
Failsafe = src
|
||||
|
||||
current_iteration = controller_iteration
|
||||
spawn(0)
|
||||
Failsafe.spin()
|
||||
|
||||
|
||||
/datum/failsafe/proc/spin()
|
||||
set background = 1
|
||||
while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop
|
||||
if(master_controller)
|
||||
if(spinning && master_controller.processing) //only poke if these overrides aren't in effect
|
||||
if(current_iteration == controller_iteration) //master_controller hasn't finished processing in the defined interval
|
||||
switch(defcon)
|
||||
if(0 to 3)
|
||||
defcon++
|
||||
if(4)
|
||||
defcon = 5
|
||||
for(var/client/C)
|
||||
if(C.holder)
|
||||
C << "<font color='red' size='2'><b>Warning. The Master Controller has not fired in the last [4*ticks_per_spin] ticks. Automatic restart in [ticks_per_spin] ticks.</b></font>"
|
||||
if(5)
|
||||
for(var/client/C)
|
||||
if(C.holder)
|
||||
C << "<font color='red' size='2'><b>Warning. The Master Controller has still not fired within the last [5*ticks_per_spin] ticks. Killing and restarting...</b></font>"
|
||||
spawn(0)
|
||||
new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process)
|
||||
master_controller.process() //Start it rolling again
|
||||
defcon = 0
|
||||
else
|
||||
defcon = 0
|
||||
current_iteration = controller_iteration
|
||||
else
|
||||
defcon = 0
|
||||
else
|
||||
new /datum/controller/game_controller() //replace the missing master_controller! This should never happen.
|
||||
sleep(ticks_per_spin)
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/obj/machinery/computer3/aifixer
|
||||
default_prog = /datum/file/program/aifixer
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/ai_holder)
|
||||
icon_state = "frame-rnd"
|
||||
|
||||
|
||||
/datum/file/program/aifixer
|
||||
name = "AI system integrity restorer"
|
||||
desc = "Repairs and revives artificial intelligence cores."
|
||||
image = 'icons/ntos/airestore.png'
|
||||
active_state = "ai-fixer-empty"
|
||||
req_access = list(access_captain, access_robotics, access_heads)
|
||||
|
||||
update_icon()
|
||||
if(!computer || !computer.cradle)
|
||||
overlay.icon_state = "ai-fixer-404"
|
||||
return // what
|
||||
|
||||
if(!computer.cradle.occupant)
|
||||
overlay.icon_state = "ai-fixer-empty"
|
||||
else
|
||||
if (computer.cradle.occupant.health >= 0 && computer.cradle.occupant.stat != 2)
|
||||
overlay.icon_state = "ai-fixer-full"
|
||||
else
|
||||
overlay.icon_state = "ai-fixer-404"
|
||||
computer.update_icon()
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.cradle)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
popup.set_content(aifixer_menu())
|
||||
popup.open()
|
||||
return
|
||||
|
||||
proc/aifixer_menu()
|
||||
var/dat = ""
|
||||
if (computer.cradle.occupant)
|
||||
var/laws
|
||||
dat += "<h3>Stored AI: [computer.cradle.occupant.name]</h3>"
|
||||
dat += "<b>System integrity:</b> [(computer.cradle.occupant.health+100)/2]%<br>"
|
||||
|
||||
if (computer.cradle.occupant.laws.zeroth)
|
||||
laws += "<b>0:</b> [computer.cradle.occupant.laws.zeroth]<BR>"
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= computer.cradle.occupant.laws.inherent.len, index++)
|
||||
var/law = computer.cradle.occupant.laws.inherent[index]
|
||||
if (length(law) > 0)
|
||||
laws += "<b>[number]:</b> [law]<BR>"
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= computer.cradle.occupant.laws.supplied.len, index++)
|
||||
var/law = computer.cradle.occupant.laws.supplied[index]
|
||||
if (length(law) > 0)
|
||||
laws += "<b>[number]:</b> [law]<BR>"
|
||||
number++
|
||||
|
||||
dat += "<b>Laws:</b><br>[laws]<br>"
|
||||
|
||||
if (computer.cradle.occupant.stat == 2)
|
||||
dat += "<span class='bad'>AI non-functional</span>"
|
||||
else
|
||||
dat += "<span class='good'>AI functional</span>"
|
||||
if (!computer.cradle.busy)
|
||||
dat += "<br><br>[topic_link(src,"fix","Begin Reconstruction")]"
|
||||
else
|
||||
dat += "<br><br>Reconstruction in process, please wait.<br>"
|
||||
dat += "<br>[topic_link(src,"close","Close")]"
|
||||
return dat
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.cradle || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("fix" in href_list)
|
||||
var/mob/living/silicon/ai/occupant = computer.cradle.occupant
|
||||
if(!occupant) return
|
||||
|
||||
computer.cradle.busy = 1
|
||||
computer.overlays += image('icons/obj/computer.dmi', "ai-fixer-on")
|
||||
|
||||
var/i = 0
|
||||
while (occupant.health < 100)
|
||||
if(!computer || (computer.stat&~MAINT)) // takes some time, keep checking
|
||||
break
|
||||
|
||||
occupant.adjustOxyLoss(-1)
|
||||
occupant.adjustFireLoss(-1)
|
||||
occupant.adjustToxLoss(-1)
|
||||
occupant.adjustBruteLoss(-1)
|
||||
occupant.updatehealth()
|
||||
if (occupant.health >= 0 && computer.cradle.occupant.stat == 2)
|
||||
occupant.stat = 0
|
||||
occupant.lying = 0
|
||||
dead_mob_list -= occupant
|
||||
living_mob_list += occupant
|
||||
update_icon()
|
||||
|
||||
i++
|
||||
if(i == 5)
|
||||
computer.use_power(50) // repairing an AI is nontrivial. laptop battery may not be enough.
|
||||
computer.power_change() // if the power runs out, set stat
|
||||
i = 0
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
sleep(10)
|
||||
computer.cradle.busy = 0
|
||||
computer.overlays -= image('icons/obj/computer.dmi', "ai-fixer-on")
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
@@ -1,363 +0,0 @@
|
||||
/obj/machinery/computer3/cloning
|
||||
default_prog = /datum/file/program/cloning
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/storage/removable,/obj/item/part/computer/networking/prox)
|
||||
|
||||
/datum/file/program/cloning
|
||||
name = "cloning console"
|
||||
desc = "Connects to cloning machinery through the local network."
|
||||
active_state = "dna_old"
|
||||
|
||||
req_access = list(access_heads) //Only used for record deletion right now.
|
||||
|
||||
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
|
||||
var/obj/machinery/clonepod/pod1 = null //Linked cloning pod.
|
||||
|
||||
var/temp = "Inactive"
|
||||
var/scantemp_ckey
|
||||
var/scantemp = "Ready to Scan"
|
||||
var/menu = 1 //Which menu screen to display
|
||||
var/list/records = list()
|
||||
var/datum/data/record/active_record = null
|
||||
var/loading = 0 // Nice loading text
|
||||
var/has_disk = 0
|
||||
|
||||
proc/updatemodules()
|
||||
if(!computer.net) return
|
||||
|
||||
if(scanner && pod1)
|
||||
if(!computer.net.verify_machine(scanner))
|
||||
scanner = null
|
||||
if(!computer.net.verify_machine(pod1))
|
||||
pod1 = null
|
||||
|
||||
if(!scanner || !pod1)
|
||||
var/list/nearby = computer.net.get_machines()
|
||||
scanner = locate(/obj/machinery/dna_scannernew) in nearby
|
||||
pod1 = locate(/obj/machinery/clonepod) in nearby
|
||||
|
||||
if (pod1)
|
||||
pod1.connected = src // Some variable the pod needs
|
||||
|
||||
proc/ScanningMenu()
|
||||
if (isnull(scanner))
|
||||
return "<font class='bad'>ERROR: No Scanner detected!</font><br>"
|
||||
|
||||
var/dat = "<h3>Scanner Functions</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
|
||||
if (!scanner.occupant)
|
||||
dat += "Scanner Unoccupied"
|
||||
else if(loading)
|
||||
dat += "[scanner.occupant] => Scanning..."
|
||||
else
|
||||
if (scanner.occupant.ckey != scantemp_ckey)
|
||||
scantemp = "Ready to Scan"
|
||||
scantemp_ckey = scanner.occupant.ckey
|
||||
dat += "[scanner.occupant] => [scantemp]"
|
||||
|
||||
dat += "</div>"
|
||||
|
||||
if (scanner.occupant)
|
||||
dat += topic_link(src,"scan","Start Scan") + "<br>"
|
||||
if(scanner.locked)
|
||||
dat += topic_link(src,"lock","Unlock Scanner")
|
||||
else
|
||||
dat += topic_link(src,"lock","Lock Scanner")
|
||||
else
|
||||
dat += fake_link("Start Scan")
|
||||
|
||||
// Footer
|
||||
dat += "<h3>Database Functions</h3>"
|
||||
if (records.len > 0)
|
||||
dat += topic_link(src,"menu=2","View Records ([records.len])") + "<br>"
|
||||
else
|
||||
dat += fake_link("View Records (0)")
|
||||
|
||||
if (has_disk)
|
||||
dat += topic_link(src,"eject_disk","Eject Disk") + "<br>"
|
||||
return dat
|
||||
|
||||
proc/RecordsList()
|
||||
var/dat = "<h3>Current records</h3>"
|
||||
dat += topic_link(src,"menu=1","<< Back") + "<br><br>"
|
||||
for(var/datum/data/record/R in records)
|
||||
dat += "<h4>[R.fields["name"]]</h4>Scan ID [R.fields["id"]] " + topic_link(src,"view_rec=\ref[R]","View Record")
|
||||
return dat
|
||||
|
||||
proc/ShowRecord()
|
||||
var/dat = "<h3>Selected Record</h3>"
|
||||
dat += topic_link(src,"menu=2","<< Back") + "<br><br>"
|
||||
|
||||
if (!active_record)
|
||||
dat += "<font class='bad'>Record not found.</font>"
|
||||
else
|
||||
dat += "<h4>[active_record.fields["name"]]</h4>"
|
||||
dat += "Scan ID [active_record.fields["id"]] [topic_link(src,"clone","Clone")]<br>"
|
||||
|
||||
var/obj/item/weapon/implant/health/H = locate(active_record.fields["imp"])
|
||||
|
||||
if ((H) && (istype(H)))
|
||||
dat += "<b>Health Implant Data:</b><br />[H.sensehealth()]<br><br />"
|
||||
else
|
||||
dat += "<font class='bad'>Unable to locate Health Implant.</font><br /><br />"
|
||||
|
||||
dat += "<b>Unique Identifier:</b><br /><span class='highlight'>[active_record.fields["UI"]]</span><br>"
|
||||
dat += "<b>Structural Enzymes:</b><br /><span class='highlight'>[active_record.fields["SE"]]</span><br>"
|
||||
|
||||
if (has_disk)
|
||||
dat += "<div class='block'>"
|
||||
dat += "<h4>Inserted Disk</h4>"
|
||||
dat += "<b>Contents:</b> "
|
||||
if (computer.floppy.inserted.files.len == 0)
|
||||
dat += "<i>Empty</i>"
|
||||
else
|
||||
for(var/datum/file/data/genome/G in computer.floppy.inserted.files)
|
||||
dat += topic_link(src,"loadfile=\ref[G]","[G.name]") + "<br>"
|
||||
|
||||
dat += "<br /><br /><b>Save to Disk:<b><br />"
|
||||
dat += topic_link(src,"save_disk=ue","Unique Identifier + Unique Enzymes") + "<br />"
|
||||
dat += topic_link(src,"save_disk=ui","Unique Identifier") + "<br />"
|
||||
dat += topic_link(src,"save_disk=se","Structural Enzymes") + "<br />"
|
||||
dat += "</div>"
|
||||
|
||||
dat += "<font size=1>[topic_link(src,"del_rec","Delete Record")]</font>"
|
||||
return dat
|
||||
proc/ConfirmDelete()
|
||||
var/dat = "[temp]<br>"
|
||||
dat += "<h3>Confirm Record Deletion</h3>"
|
||||
|
||||
dat += "<b>[topic_link(src,"del_rec","Scan card to confirm")]</b><br>"
|
||||
dat += "<b>[topic_link(src,"menu=3","Cancel")]</b>"
|
||||
return dat
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
updatemodules()
|
||||
|
||||
var/dat = ""
|
||||
dat += topic_link(src,"refresh","Refresh")
|
||||
dat += "<h3>Cloning Pod Status</h3>"
|
||||
dat += "<div class='statusDisplay'>[temp] </div>"
|
||||
|
||||
has_disk = (computer.floppy && computer.floppy.inserted)
|
||||
if(!active_record && menu > 2)
|
||||
menu = 2
|
||||
|
||||
switch(menu)
|
||||
if(1)
|
||||
dat += ScanningMenu()
|
||||
|
||||
if(2)
|
||||
dat += RecordsList()
|
||||
|
||||
if(3)
|
||||
dat += ShowRecord()
|
||||
|
||||
if(4)
|
||||
dat = ConfirmDelete() // not (+=), this is how it used to be, just putting it in a function
|
||||
|
||||
if(!popup)
|
||||
popup = new(usr, "\ref[computer]", "Cloning System Control")
|
||||
popup.set_title_image(usr.browse_rsc_icon(overlay.icon, overlay.icon_state))
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(loading || !interactable())
|
||||
return
|
||||
|
||||
if (href_list["menu"])
|
||||
menu = text2num(href_list["menu"])
|
||||
else if (("scan" in href_list) && !isnull(scanner))
|
||||
scantemp = ""
|
||||
|
||||
loading = 1
|
||||
computer.updateUsrDialog()
|
||||
|
||||
spawn(20)
|
||||
scan_mob(scanner.occupant)
|
||||
|
||||
loading = 0
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
//No locking an open scanner.
|
||||
else if (("lock" in href_list) && !isnull(scanner))
|
||||
if ((!scanner.locked) && (scanner.occupant))
|
||||
scanner.locked = 1
|
||||
else
|
||||
scanner.locked = 0
|
||||
|
||||
else if ("view_rec" in href_list)
|
||||
active_record = locate(href_list["view_rec"])
|
||||
if(istype(active_record,/datum/data/record))
|
||||
if ( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
|
||||
del(active_record)
|
||||
temp = "<font class='bad'>Record Corrupt</font>"
|
||||
else
|
||||
menu = 3
|
||||
else
|
||||
active_record = null
|
||||
temp = "Record missing."
|
||||
|
||||
else if ("del_rec" in href_list)
|
||||
if ((!active_record) || (menu < 3))
|
||||
return
|
||||
if (menu == 3) //If we are viewing a record, confirm deletion
|
||||
temp = "Delete record?"
|
||||
menu = 4
|
||||
|
||||
else if (menu == 4)
|
||||
var/obj/item/weapon/card/id/C = usr.get_active_hand()
|
||||
if (istype(C)||istype(C, /obj/item/device/pda))
|
||||
if(check_access(C))
|
||||
temp = "[active_record.fields["name"]] => Record deleted."
|
||||
records.Remove(active_record)
|
||||
del(active_record)
|
||||
menu = 2
|
||||
else
|
||||
temp = "<font class='bad'>Access Denied.</font>"
|
||||
|
||||
else if ("eject_disk" in href_list)
|
||||
if(computer.floppy)
|
||||
computer.floppy.eject_disk()
|
||||
|
||||
else if("loadfile" in href_list)
|
||||
|
||||
var/datum/file/data/genome/G = locate(href_list["loadfile"]) in computer.floppy.files
|
||||
if(!istype(G))
|
||||
temp = "<font class='bad'>Load error.</font>"
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
switch(G.type)
|
||||
if(/datum/file/data/genome/UI)
|
||||
active_record.fields["UI"] = G.content
|
||||
if(/datum/file/data/genome/UE)
|
||||
active_record.fields["name"] = G.real_name
|
||||
if(/datum/file/data/genome/SE)
|
||||
active_record.fields["SE"] = G.content
|
||||
if(/datum/file/data/genome/cloning)
|
||||
active_record = G:record
|
||||
else if("savefile" in href_list)
|
||||
if (!active_record || !computer || !computer.floppy)
|
||||
temp = "<font class='bad'>Save error.</font>"
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
var/rval = 0
|
||||
switch(href_list["save_disk"])
|
||||
if("ui")
|
||||
var/datum/file/data/genome/UI/ui = new
|
||||
ui.content = active_record.fields["UI"]
|
||||
ui.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(ui)
|
||||
if("ue")
|
||||
var/datum/file/data/genome/UI/UE/ui = new
|
||||
ui.content = active_record.fields["UI"]
|
||||
ui.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(ui)
|
||||
if("se")
|
||||
var/datum/file/data/genome/SE/se = new
|
||||
se.content = active_record.fields["SE"]
|
||||
se.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(se)
|
||||
if("clone")
|
||||
var/datum/file/data/genome/cloning/c = new
|
||||
c.record = active_record
|
||||
c.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(c)
|
||||
if(!rval)
|
||||
temp = "<font class='bad'>Disk write error.</font>"
|
||||
|
||||
else if ("refresh" in href_list)
|
||||
computer.updateUsrDialog()
|
||||
|
||||
else if ("clone" in href_list)
|
||||
//Look for that player! They better be dead!
|
||||
if(active_record)
|
||||
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
|
||||
if(!pod1)
|
||||
temp = "<font class='bad'>No Clonepod detected.</font>"
|
||||
else if(pod1.occupant)
|
||||
temp = "<font class='bad'>Clonepod is currently occupied.</font>"
|
||||
else if(pod1.mess)
|
||||
temp = "<font class='bad'>Clonepod malfunction.</font>"
|
||||
else if(!config.revival_cloning)
|
||||
temp = "<font class='bad'>Unable to initiate cloning cycle.</font>"
|
||||
else if(pod1.growclone(active_record.fields["ckey"], active_record.fields["name"], active_record.fields["UI"], active_record.fields["SE"], active_record.fields["mind"], active_record.fields["mrace"]))
|
||||
temp = "[active_record.fields["name"]] => <font class='good'>Cloning cycle in progress...</font>"
|
||||
records.Remove(active_record)
|
||||
del(active_record)
|
||||
menu = 1
|
||||
else
|
||||
temp = "[active_record.fields["name"]] => <font class='bad'>Initialisation failure.</font>"
|
||||
|
||||
else
|
||||
temp = "<font class='bad'>Data corruption.</font>"
|
||||
|
||||
computer.add_fingerprint(usr)
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
|
||||
proc/scan_mob(mob/living/carbon/human/subject as mob)
|
||||
if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
|
||||
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
|
||||
return
|
||||
if (!getbrain(subject))
|
||||
scantemp = "<font class='bad'>No signs of intelligence detected.</font>"
|
||||
return
|
||||
if (subject.suiciding == 1)
|
||||
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
|
||||
return
|
||||
if ((!subject.ckey) || (!subject.client))
|
||||
scantemp = "<font class='bad'>Mental interface failure.</font>"
|
||||
return
|
||||
if (NOCLONE in subject.mutations)
|
||||
scantemp = "<font class='bad'>Mental interface failure.</font>"
|
||||
return
|
||||
if (!isnull(find_record(subject.ckey)))
|
||||
scantemp = "<font class='average'>Subject already in database.</font>"
|
||||
return
|
||||
|
||||
subject.dna.check_integrity()
|
||||
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
if(subject.dna)
|
||||
R.fields["mrace"] = subject.dna.mutantrace
|
||||
R.fields["UI"] = subject.dna.uni_identity
|
||||
R.fields["SE"] = subject.dna.struc_enzymes
|
||||
else
|
||||
R.fields["mrace"] = null
|
||||
R.fields["UI"] = null
|
||||
R.fields["SE"] = null
|
||||
R.fields["ckey"] = subject.ckey
|
||||
R.fields["name"] = subject.real_name
|
||||
R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
|
||||
|
||||
|
||||
|
||||
//Add an implant if needed
|
||||
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
|
||||
if (isnull(imp))
|
||||
imp = new /obj/item/weapon/implant/health(subject)
|
||||
imp.implanted = subject
|
||||
R.fields["imp"] = "\ref[imp]"
|
||||
//Update it if needed
|
||||
else
|
||||
R.fields["imp"] = "\ref[imp]"
|
||||
|
||||
if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
|
||||
R.fields["mind"] = "\ref[subject.mind]"
|
||||
|
||||
records += R
|
||||
scantemp = "Subject successfully scanned."
|
||||
|
||||
//Find a specific record by key.
|
||||
proc/find_record(var/find_key)
|
||||
for(var/datum/data/record/R in records)
|
||||
if (R.fields["ckey"] == find_key)
|
||||
return R
|
||||
return null
|
||||
@@ -1,450 +0,0 @@
|
||||
/obj/machinery/computer3/message_monitor
|
||||
default_prog = /datum/file/program/message_mon
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/prox)
|
||||
|
||||
|
||||
//BROKEN AS HELL, DON'T USE UNTIL FIXED
|
||||
|
||||
/datum/file/program/message_mon
|
||||
name = "Message Monitor Console"
|
||||
desc = "Used to Monitor the crew's messages, that are sent via PDA. Can also be used to view Request Console messages."
|
||||
active_state = "comm_logs"
|
||||
var/hack_icon = "comm_logsc"
|
||||
var/normal_icon = "comm_logs"
|
||||
|
||||
//Server linked to.
|
||||
var/obj/machinery/message_server/linkedServer = null
|
||||
//Sparks effect - For emag
|
||||
//var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
|
||||
|
||||
//Messages - Saves me time if I want to change something.
|
||||
var/noserver = "<span class='alert'>ALERT: No server detected.</span>"
|
||||
var/incorrectkey = "<span class='warning'>ALERT: Incorrect decryption key!</span>"
|
||||
var/defaultmsg = "<span class='notice'>Welcome. Please select an option.</span>"
|
||||
var/rebootmsg = "<span class='warning'>%$&(<28>: Critical %$$@ Error // !RestArting! <lOadiNg backUp iNput ouTput> - ?pLeaSe wAit!</span>"
|
||||
|
||||
//Computer properties
|
||||
var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message
|
||||
var/hacking = 0 // Is it being hacked into by the AI/Cyborg
|
||||
var/emag = 0 // When it is emagged.
|
||||
var/message = "<span class='notice'>System bootup complete. Please select an option.</span>" // The message that shows on the main menu.
|
||||
var/auth = 0 // Are they authenticated?
|
||||
var/optioncount = 7
|
||||
|
||||
// Custom Message Properties
|
||||
var/customsender = "System Administrator"
|
||||
var/obj/item/device/pda/customrecepient = null
|
||||
var/customjob = "Admin"
|
||||
var/custommessage = "This is a test, please ignore."
|
||||
|
||||
|
||||
procinitialize()
|
||||
if(!linkedServer)
|
||||
if(message_servers && message_servers.len > 0)
|
||||
linkedServer = message_servers[1]
|
||||
return
|
||||
|
||||
|
||||
update_icon()
|
||||
if(emag || hacking)
|
||||
overlay.icon_state = hack_icon
|
||||
else
|
||||
overlay.icon_state = normal_icon
|
||||
computer.update_icon()
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
//If the computer is being hacked or is emagged, display the reboot message.
|
||||
if(hacking || emag)
|
||||
message = rebootmsg
|
||||
var/dat = "<head><title>Message Monitor Console</title></head><body>"
|
||||
dat += "<center><h2>Message Monitor Console</h2></center><hr>"
|
||||
dat += "<center><h4><font color='blue'[message]</h5></center>"
|
||||
|
||||
if(auth)
|
||||
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>	<font color='green'>\[Authenticated\]</font></a>	/"
|
||||
dat += " Server Power: <A href='?src=\ref[src];active=1'>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</a></h4>"
|
||||
else
|
||||
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>	<font color='red'>\[Unauthenticated\]</font></a>	/"
|
||||
dat += " Server Power: <u>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</u></h4>"
|
||||
|
||||
if(hacking || emag)
|
||||
screen = 2
|
||||
else if(!auth || !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) message = noserver
|
||||
screen = 0
|
||||
|
||||
switch(screen)
|
||||
//Main menu
|
||||
if(0)
|
||||
//	 = TAB
|
||||
var/i = 0
|
||||
dat += "<dd><A href='?src=\ref[src];find=1'>	[++i]. Link To A Server</a></dd>"
|
||||
if(auth)
|
||||
if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
dat += "<dd><A>	ERROR: Server not found!</A><br></dd>"
|
||||
else
|
||||
dat += "<dd><A href='?src=\ref[src];view=1'>	[++i]. View Message Logs </a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];viewr=1'>	[++i]. View Request Console Logs </a></br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clear=1'>	[++i]. Clear Message Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clearr=1'>	[++i]. Clear Request Console Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];pass=1'>	[++i]. Set Custom Key</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];msg=1'>	[++i]. Send Admin Message</a><br></dd>"
|
||||
else
|
||||
for(var/n = ++i; n <= optioncount; n++)
|
||||
dat += "<dd><font color='blue'>	[n]. ---------------</font><br></dd>"
|
||||
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
|
||||
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
|
||||
dat += "<dd><A href='?src=\ref[src];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
|
||||
else
|
||||
dat += "<br>"
|
||||
|
||||
//Bottom message
|
||||
if(!auth)
|
||||
dat += "<br><hr><dd><span class='notice'>Please authenticate with the server in order to show additional options.</span>"
|
||||
else
|
||||
dat += "<br><hr><dd><span class='warning'>Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties.</span>"
|
||||
|
||||
//Message Logs
|
||||
if(1)
|
||||
var/index = 0
|
||||
//var/recipient = "Unspecified" //name of the person
|
||||
//var/sender = "Unspecified" //name of the sender
|
||||
//var/message = "Blank" //transferred message
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
|
||||
dat += "<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sender</th><th width='15%'>Recipient</th><th width='300px' word-wrap: break-word>Message</th></tr>"
|
||||
for(var/datum/data_pda_msg/pda in src.linkedServer.pda_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += "<tr><td width = '5%'><center><A href='?src=\ref[src];delete=\ref[pda]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message]</td></tr>"
|
||||
dat += "</table>"
|
||||
//Hacking screen.
|
||||
if(2)
|
||||
if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
|
||||
dat += "Brute-forcing for server key.<br> It will take 20 seconds for every character that the password has."
|
||||
dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time."
|
||||
else
|
||||
//It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever.
|
||||
dat += {"01000010011100100111010101110100011001010010110<br>
|
||||
10110011001101111011100100110001101101001011011100110011<br>
|
||||
10010000001100110011011110111001000100000011100110110010<br>
|
||||
10111001001110110011001010111001000100000011010110110010<br>
|
||||
10111100100101110001000000100100101110100001000000111011<br>
|
||||
10110100101101100011011000010000001110100011000010110101<br>
|
||||
10110010100100000001100100011000000100000011100110110010<br>
|
||||
10110001101101111011011100110010001110011001000000110011<br>
|
||||
00110111101110010001000000110010101110110011001010111001<br>
|
||||
00111100100100000011000110110100001100001011100100110000<br>
|
||||
10110001101110100011001010111001000100000011101000110100<br>
|
||||
00110000101110100001000000111010001101000011001010010000<br>
|
||||
00111000001100001011100110111001101110111011011110111001<br>
|
||||
00110010000100000011010000110000101110011001011100010000<br>
|
||||
00100100101101110001000000111010001101000011001010010000<br>
|
||||
00110110101100101011000010110111001110100011010010110110<br>
|
||||
10110010100101100001000000111010001101000011010010111001<br>
|
||||
10010000001100011011011110110111001110011011011110110110<br>
|
||||
00110010100100000011000110110000101101110001000000111001<br>
|
||||
00110010101110110011001010110000101101100001000000111100<br>
|
||||
10110111101110101011100100010000001110100011100100111010<br>
|
||||
10110010100100000011010010110111001110100011001010110111<br>
|
||||
00111010001101001011011110110111001110011001000000110100<br>
|
||||
10110011000100000011110010110111101110101001000000110110<br>
|
||||
00110010101110100001000000111001101101111011011010110010<br>
|
||||
10110111101101110011001010010000001100001011000110110001<br>
|
||||
10110010101110011011100110010000001101001011101000010111<br>
|
||||
00010000001001101011000010110101101100101001000000111001<br>
|
||||
10111010101110010011001010010000001101110011011110010000<br>
|
||||
00110100001110101011011010110000101101110011100110010000<br>
|
||||
00110010101101110011101000110010101110010001000000111010<br>
|
||||
00110100001100101001000000111001001101111011011110110110<br>
|
||||
10010000001100100011101010111001001101001011011100110011<br>
|
||||
10010000001110100011010000110000101110100001000000111010<br>
|
||||
001101001011011010110010100101110"}
|
||||
|
||||
//Fake messages
|
||||
if(3)
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];Reset=1'>Reset</a></center><hr>"
|
||||
|
||||
dat += {"<table border='1' width='100%'>
|
||||
<tr><td width='20%'><A href='?src=\ref[src];select=Sender'>Sender</a></td>
|
||||
<td width='20%'><A href='?src=\ref[src];select=RecJob'>Sender's Job</a></td>
|
||||
<td width='20%'><A href='?src=\ref[src];select=Recepient'>Recipient</a></td>
|
||||
<td width='300px' word-wrap: break-word><A href='?src=\ref[src];select=Message'>Message</a></td></tr>"}
|
||||
//Sender - Sender's Job - Recepient - Message
|
||||
//Al Green- Your Dad - Your Mom - WHAT UP!?
|
||||
|
||||
dat += {"<tr><td width='20%'>[customsender]</td>
|
||||
<td width='20%'>[customjob]</td>
|
||||
<td width='20%'>[customrecepient ? customrecepient.owner : "NONE"]</td>
|
||||
<td width='300px'>[custommessage]</td></tr>"}
|
||||
dat += "</table><br><center><A href='?src=\ref[src];select=Send'>Send</a>"
|
||||
|
||||
//Request Console Logs
|
||||
if(4)
|
||||
|
||||
var/index = 0
|
||||
/* data_rc_msg
|
||||
X - 5%
|
||||
var/rec_dpt = "Unspecified" //name of the person - 15%
|
||||
var/send_dpt = "Unspecified" //name of the sender- 15%
|
||||
var/message = "Blank" //transferred message - 300px
|
||||
var/stamp = "Unstamped" - 15%
|
||||
var/id_auth = "Unauthenticated" - 15%
|
||||
var/priority = "Normal" - 10%
|
||||
*/
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
|
||||
dat += {"<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sending Dep.</th><th width='15%'>Receiving Dep.</th>
|
||||
<th width='300px' word-wrap: break-word>Message</th><th width='15%'>Stamp</th><th width='15%'>ID Auth.</th><th width='15%'>Priority.</th></tr>"}
|
||||
for(var/datum/data_rc_msg/rc in src.linkedServer.rc_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += {"<tr><td width = '5%'><center><A href='?src=\ref[src];deleter=\ref[rc]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[rc.send_dpt]</td>
|
||||
<td width='15%'>[rc.rec_dpt]</td><td width='300px'>[rc.message]</td><td width='15%'>[rc.stamp]</td><td width='15%'>[rc.id_auth]</td><td width='15%'>[rc.priority]</td></tr>"}
|
||||
dat += "</table>"
|
||||
|
||||
|
||||
popup.width = 700
|
||||
popup.height = 700
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
proc/BruteForce(mob/usr as mob)
|
||||
if(isnull(linkedServer))
|
||||
usr << "<span class='warning'>Could not complete brute-force: Linked Server Disconnected!</span>"
|
||||
else
|
||||
var/currentKey = src.linkedServer.decryptkey
|
||||
usr << "<span class='warning'>Brute-force completed! The key is '[currentKey]'.</span>"
|
||||
src.hacking = 0
|
||||
src.active_state = normal_icon
|
||||
src.screen = 0 // Return the screen back to normal
|
||||
|
||||
proc/UnmagConsole()
|
||||
src.active_state = normal_icon
|
||||
src.emag = 0
|
||||
|
||||
proc/ResetMessage()
|
||||
customsender = "System Administrator"
|
||||
customrecepient = null
|
||||
custommessage = "This is a test, please ignore."
|
||||
customjob = "Admin"
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("auth" in href_list)
|
||||
if(auth)
|
||||
auth = 0
|
||||
screen = 0
|
||||
else
|
||||
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
|
||||
if(dkey && dkey != "")
|
||||
if(src.linkedServer.decryptkey == dkey)
|
||||
auth = 1
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Turn the server on/off.
|
||||
if ("active" in href_list)
|
||||
if(auth) linkedServer.active = !linkedServer.active
|
||||
//Find a server
|
||||
if ("find" in href_list)
|
||||
if(message_servers && message_servers.len > 1)
|
||||
src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers
|
||||
message = "<span class='alert'>NOTICE: Server selected.</span>"
|
||||
else if(message_servers && message_servers.len > 0)
|
||||
linkedServer = message_servers[1]
|
||||
message = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>"
|
||||
else
|
||||
message = noserver
|
||||
|
||||
//View the logs - KEY REQUIRED
|
||||
if ("view" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 1
|
||||
|
||||
//Clears the logs - KEY REQUIRED
|
||||
if ("clear" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.linkedServer.pda_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Clears the request console logs - KEY REQUIRED
|
||||
if ("clearr" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.linkedServer.rc_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Change the password - KEY REQUIRED
|
||||
if ("pass" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
|
||||
if(dkey && dkey != "")
|
||||
if(src.linkedServer.decryptkey == dkey)
|
||||
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
|
||||
if(length(newkey) <= 3)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too short!</span>"
|
||||
else if(length(newkey) > 16)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too long!</span>"
|
||||
else if(newkey && newkey != "")
|
||||
src.linkedServer.decryptkey = newkey
|
||||
message = "<span class='notice'>NOTICE: Decryption key set.</span>"
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Hack the Console to get the password
|
||||
if ("hack" in href_list)
|
||||
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
|
||||
src.hacking = 1
|
||||
src.screen = 2
|
||||
src.active_state = hack_icon
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
spawn(100*length(src.linkedServer.decryptkey))
|
||||
if(src && src.linkedServer && usr)
|
||||
BruteForce(usr)
|
||||
//Delete the log.
|
||||
if ("delete" in href_list)
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 1)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete"], /datum/data_pda_msg))
|
||||
src.linkedServer.pda_msgs -= locate(href_list["delete"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Delete the request console log.
|
||||
if ("deleter" in href_list)
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 4)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete"], /datum/data_pda_msg))
|
||||
src.linkedServer.rc_msgs -= locate(href_list["deleter"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Create a custom message
|
||||
if ("msg" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 3
|
||||
//Fake messaging selection - KEY REQUIRED
|
||||
if ("select" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
screen = 0
|
||||
else
|
||||
switch(href_list["select"])
|
||||
|
||||
//Reset
|
||||
if("Reset")
|
||||
ResetMessage()
|
||||
|
||||
//Select Your Name
|
||||
if("Sender")
|
||||
customsender = input(usr, "Please enter the sender's name.") as text|null
|
||||
|
||||
//Select Receiver
|
||||
if("Recepient")
|
||||
//Get out list of viable PDAs
|
||||
var/list/obj/item/device/pda/sendPDAs = list()
|
||||
for(var/obj/item/device/pda/P in PDAs)
|
||||
if(!P.owner || P.toff || P.hidden) continue
|
||||
sendPDAs += P
|
||||
if(PDAs && PDAs.len > 0)
|
||||
customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs)
|
||||
else
|
||||
customrecepient = null
|
||||
|
||||
|
||||
//Enter custom job
|
||||
if("RecJob")
|
||||
customjob = input(usr, "Please enter the sender's job.") as text|null
|
||||
|
||||
//Enter message
|
||||
if("Message")
|
||||
custommessage = input(usr, "Please enter your message.") as text|null
|
||||
custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN)
|
||||
|
||||
//Send message
|
||||
if("Send")
|
||||
|
||||
if(isnull(customsender) || customsender == "")
|
||||
customsender = "UNKNOWN"
|
||||
|
||||
if(isnull(customrecepient))
|
||||
message = "<span class='notice'>NOTICE: No recepient selected!</span>"
|
||||
return src.attack_hand(usr)
|
||||
|
||||
if(isnull(custommessage) || custommessage == "")
|
||||
message = "<span class='notice'>NOTICE: No message entered!</span>"
|
||||
return src.attack_hand(usr)
|
||||
|
||||
var/obj/item/device/pda/PDARec = null
|
||||
for (var/obj/item/device/pda/P in PDAs)
|
||||
if (!P.owner || P.toff || P.hidden) continue
|
||||
if(P.owner == customsender)
|
||||
PDARec = P
|
||||
//Sender isn't faking as someone who exists
|
||||
if(isnull(PDARec))
|
||||
src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]")
|
||||
customrecepient.tnote += "<i><b>← From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[src]'>[customsender]</a> ([customjob]):</b></i><br>[custommessage]<br>"
|
||||
if (!customrecepient.silent)
|
||||
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, customrecepient.loc))
|
||||
O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
|
||||
if( customrecepient.loc && ishuman(customrecepient.loc) )
|
||||
var/mob/living/carbon/human/H = customrecepient.loc
|
||||
H << "\icon[customrecepient] <b>Message from [customsender] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
|
||||
log_pda("[usr] (PDA: [customsender]) sent \"[custommessage]\" to [customrecepient.owner]")
|
||||
customrecepient.overlays.Cut()
|
||||
customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
//Sender is faking as someone who exists
|
||||
else
|
||||
src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]")
|
||||
customrecepient.tnote += "<i><b>← From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[PDARec]'>[PDARec.owner]</a> ([customjob]):</b></i><br>[custommessage]<br>"
|
||||
if (!customrecepient.silent)
|
||||
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, customrecepient.loc))
|
||||
O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
|
||||
if( customrecepient.loc && ishuman(customrecepient.loc) )
|
||||
var/mob/living/carbon/human/H = customrecepient.loc
|
||||
H << "\icon[customrecepient] <b>Message from [PDARec.owner] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[customrecepient];choice=Message;skiprefresh=1;target=\ref[PDARec]'>Reply</a>)"
|
||||
log_pda("[usr] (PDA: [PDARec.owner]) sent \"[custommessage]\" to [customrecepient.owner]")
|
||||
customrecepient.overlays.Cut()
|
||||
customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
//Finally..
|
||||
ResetMessage()
|
||||
|
||||
//Request Console Logs - KEY REQUIRED
|
||||
if("viewr" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 4
|
||||
|
||||
//usr << href_list["select"]
|
||||
|
||||
if ("back" in href_list)
|
||||
src.screen = 0
|
||||
interact()
|
||||
@@ -1,242 +0,0 @@
|
||||
//Config stuff
|
||||
#define PRISON_MOVETIME 150 //Time to station is milliseconds.
|
||||
#define PRISON_STATION_AREATYPE "/area/shuttle/prison/station" //Type of the prison shuttle area for station
|
||||
#define PRISON_DOCK_AREATYPE "/area/shuttle/prison/prison" //Type of the prison shuttle area for dock
|
||||
|
||||
var/prison_shuttle_moving_to_station = 0
|
||||
var/prison_shuttle_moving_to_prison = 0
|
||||
var/prison_shuttle_at_station = 0
|
||||
var/prison_shuttle_can_send = 1
|
||||
var/prison_shuttle_time = 0
|
||||
var/prison_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/prison_shuttle
|
||||
name = "Prison Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_security)
|
||||
circuit = "/obj/item/part/board/circuit/prison_shuttle"
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
var/prison_break = 0
|
||||
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/tool/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/part/board/circuit/prison_shuttle/M = new /obj/item/part/board/circuit/prison_shuttle( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.anchored = 1
|
||||
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/trash/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
del(src)
|
||||
else if(istype(I,/obj/item/card/emag) && (!hacked))
|
||||
hacked = 1
|
||||
user << "\blue You disable the lock."
|
||||
else
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(!src.allowed(user) && (!hacked))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
if(prison_break)
|
||||
user << "\red Unable to locate shuttle."
|
||||
return
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
post_signal("prison")
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = src.temp
|
||||
else
|
||||
dat += {"<b>Location:</b> [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called*<BR>\n<BR>":prison_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Send to Dock</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Send to Station</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", name, 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["sendtodock"])
|
||||
if (!prison_can_move())
|
||||
usr << "\red The prison shuttle is unable to leave."
|
||||
return
|
||||
if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
post_signal("prison")
|
||||
usr << "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds."
|
||||
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
src.updateUsrDialog()
|
||||
prison_shuttle_moving_to_prison = 1
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
|
||||
else if (href_list["sendtostation"])
|
||||
if (!prison_can_move())
|
||||
usr << "\red The prison shuttle is unable to leave."
|
||||
return
|
||||
if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
post_signal("prison")
|
||||
usr << "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds."
|
||||
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
src.updateUsrDialog()
|
||||
prison_shuttle_moving_to_station = 1
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
src.temp = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
proc/prison_can_move()
|
||||
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0
|
||||
else return 1
|
||||
|
||||
/*
|
||||
proc/prison_break()
|
||||
switch(prison_break)
|
||||
if (0)
|
||||
if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
prison_shuttle_moving_to_prison = 1
|
||||
prison_shuttle_at_station = prison_shuttle_at_station
|
||||
|
||||
if (!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
prison_break = 1
|
||||
if(1)
|
||||
prison_break = 0
|
||||
*/
|
||||
|
||||
proc/post_signal(var/command)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311)
|
||||
if(!frequency) return
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
frequency.post_signal(src, status_signal)
|
||||
return
|
||||
|
||||
|
||||
proc/prison_process()
|
||||
while(prison_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = prison_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
prison_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
|
||||
prison_shuttle_timeleft = (ticksleft / 10)
|
||||
sleep(5)
|
||||
prison_shuttle_moving_to_station = 0
|
||||
prison_shuttle_moving_to_prison = 0
|
||||
|
||||
switch(prison_shuttle_at_station)
|
||||
|
||||
if(0)
|
||||
prison_shuttle_at_station = 1
|
||||
if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
if (!prison_can_move())
|
||||
usr << "\red The prison shuttle is unable to leave."
|
||||
return
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/prison/prison)
|
||||
var/area/end_location = locate(/area/shuttle/prison/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)
|
||||
|
||||
if(1)
|
||||
prison_shuttle_at_station = 0
|
||||
if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
if (!prison_can_move())
|
||||
usr << "\red The prison shuttle is unable to leave."
|
||||
return
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/prison/station)
|
||||
var/area/end_location = locate(/area/shuttle/prison/prison)
|
||||
|
||||
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)
|
||||
return
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
This may not migrate to C3. It's basically a machine in the guise of a computer;
|
||||
there is nothing interactive about it.
|
||||
*/
|
||||
|
||||
/obj/machinery/computer3/shuttle
|
||||
name = "Shuttle"
|
||||
desc = "For shuttle control."
|
||||
icon_state = "shuttle"
|
||||
var/auth_need = 3.0
|
||||
var/list/authorized = list( )
|
||||
|
||||
|
||||
attackby(var/obj/item/card/W as obj, var/mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if ((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
|
||||
if (istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (istype(W, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = W
|
||||
W = pda.id
|
||||
if (!W:access) //no access
|
||||
user << "The access level of [W:registered_name]\'s card is not high enough. "
|
||||
return
|
||||
|
||||
var/list/cardaccess = W:access
|
||||
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
|
||||
user << "The access level of [W:registered_name]\'s card is not high enough. "
|
||||
return
|
||||
|
||||
if(!(access_heads in W:access)) //doesn't have this access
|
||||
user << "The access level of [W:registered_name]\'s card is not high enough. "
|
||||
return 0
|
||||
|
||||
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
|
||||
if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
|
||||
return 0
|
||||
switch(choice)
|
||||
if("Authorize")
|
||||
src.authorized -= W:registered_name
|
||||
src.authorized += W:registered_name
|
||||
if (src.auth_need - src.authorized.len > 0)
|
||||
message_admins("[key_name_admin(user)] has authorized early shuttle launch")
|
||||
log_game("[user.ckey] has authorized early shuttle launch")
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
else
|
||||
message_admins("[key_name_admin(user)] has launched the shuttle")
|
||||
log_game("[user.ckey] has launched the shuttle early")
|
||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||
emergency_shuttle.online = 1
|
||||
emergency_shuttle.settimeleft(10)
|
||||
//src.authorized = null
|
||||
del(src.authorized)
|
||||
src.authorized = list( )
|
||||
|
||||
if("Repeal")
|
||||
src.authorized -= W:registered_name
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
|
||||
if("Abort")
|
||||
world << "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>"
|
||||
src.authorized.len = 0
|
||||
src.authorized = list( )
|
||||
|
||||
else if (istype(W, /obj/item/card/emag) && !emagged)
|
||||
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
|
||||
|
||||
if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W)
|
||||
switch(choice)
|
||||
if("Launch")
|
||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||
emergency_shuttle.settimeleft( 10 )
|
||||
emagged = 1
|
||||
if("Cancel")
|
||||
return
|
||||
return
|
||||
@@ -1,246 +0,0 @@
|
||||
//Config stuff
|
||||
#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
|
||||
#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
|
||||
|
||||
var/specops_shuttle_moving_to_station = 0
|
||||
var/specops_shuttle_moving_to_centcom = 0
|
||||
var/specops_shuttle_at_station = 0
|
||||
var/specops_shuttle_can_send = 1
|
||||
var/specops_shuttle_time = 0
|
||||
var/specops_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle
|
||||
name = "Spec. Ops. Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_cent_specops)
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
|
||||
/proc/specops_process()
|
||||
var/area/centcom/control/cent_com = locate()//To find announcer. This area should exist for this proc to work.
|
||||
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
|
||||
var/mob/living/silicon/decoy/announcer = locate() in cent_com//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.say(message)
|
||||
message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
|
||||
announcer.say(message)
|
||||
|
||||
while(specops_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = specops_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
specops_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
specops_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
|
||||
if(rounded_time_left==0)
|
||||
message = "ALERT: TAKEOFF"
|
||||
announcer.say(message)
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
specops_shuttle_moving_to_station = 0
|
||||
specops_shuttle_moving_to_centcom = 0
|
||||
|
||||
specops_shuttle_at_station = 1
|
||||
if (specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\red The Special Operations shuttle is unable to leave."
|
||||
return
|
||||
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
special_ops.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/specops/centcom)
|
||||
var/area/end_location = locate(/area/shuttle/specops/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/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived to [station_name]. Commence operation!"
|
||||
|
||||
/proc/specops_can_move()
|
||||
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0
|
||||
else return 1
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals."
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
if (sent_strike_team == 0)
|
||||
usr << "\red The strike team has not yet deployed."
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if (temp)
|
||||
dat = temp
|
||||
else
|
||||
dat += {"
|
||||
<b>Location:</b> [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*<BR>\n<BR>":specops_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["sendtodock"])
|
||||
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
usr << "\blue Central Command will not allow the Special Operations shuttle to return."
|
||||
return
|
||||
|
||||
else if (href_list["sendtostation"])
|
||||
if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\red The Special Operations shuttle is unable to leave."
|
||||
return
|
||||
|
||||
usr << "\blue The Special Operations shuttle will arrive on [station_name] in [(SPECOPS_MOVETIME/10)] seconds."
|
||||
|
||||
temp += "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
var/area/centcom/specops/special_ops = locate()
|
||||
if(special_ops)
|
||||
special_ops.readyalert()//Trigger alarm for the spec ops area.
|
||||
specops_shuttle_moving_to_station = 1
|
||||
|
||||
specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
|
||||
spawn(0)
|
||||
specops_process()
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
temp = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -1,97 +0,0 @@
|
||||
/obj/machinery/computer3/station_alert
|
||||
default_prog = /datum/file/program/station_alert
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "frame-eng"
|
||||
|
||||
|
||||
/datum/file/program/station_alert
|
||||
name = "Station Alert Console"
|
||||
desc = "Used to access the station's automated alert system."
|
||||
active_state = "alert:0"
|
||||
var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())
|
||||
|
||||
interact(mob/user)
|
||||
usr.set_machine(src)
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += "<A HREF='?src=\ref[user];mach_close=alerts'>Close</A><br><br>"
|
||||
for (var/cat in src.alarms)
|
||||
dat += text("<B>[]</B><BR>\n", cat)
|
||||
var/list/L = src.alarms[cat]
|
||||
if (L.len)
|
||||
for (var/alarm in L)
|
||||
var/list/alm = L[alarm]
|
||||
var/area/A = alm[1]
|
||||
var/list/sources = alm[3]
|
||||
dat += "<NOBR>"
|
||||
dat += "• "
|
||||
dat += "[A.name]"
|
||||
if (sources.len > 1)
|
||||
dat += text(" - [] sources", sources.len)
|
||||
dat += "</NOBR><BR>\n"
|
||||
else
|
||||
dat += "-- All Systems Nominal<BR>\n"
|
||||
dat += "<BR>\n"
|
||||
//user << browse(dat, "window=alerts")
|
||||
//onclose(user, "alerts")
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
var/list/L = src.alarms[class]
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(alarmsource in sources))
|
||||
sources += alarmsource
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if (O && istype(O, /list))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
return 1
|
||||
|
||||
|
||||
proc/cancelAlarm(var/class, area/A as area, obj/origin)
|
||||
var/list/L = src.alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
return !cleared
|
||||
|
||||
|
||||
|
||||
process()
|
||||
var/active_alarms = 0
|
||||
for (var/cat in src.alarms)
|
||||
var/list/L = src.alarms[cat]
|
||||
if(L.len) active_alarms = 1
|
||||
if(active_alarms)
|
||||
active_state = "alert:2"
|
||||
else
|
||||
active_state = "alert:0"
|
||||
..()
|
||||
return
|
||||
@@ -1,103 +0,0 @@
|
||||
#define SYNDICATE_SHUTTLE_MOVE_TIME 240
|
||||
#define SYNDICATE_SHUTTLE_COOLDOWN 200
|
||||
|
||||
/obj/machinery/computer3/syndicate_station
|
||||
name = "syndicate shuttle terminal"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "syndishuttle"
|
||||
req_access = list(access_syndicate)
|
||||
var/area/curr_location
|
||||
var/moving = 0
|
||||
var/lastMove = 0
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/New()
|
||||
curr_location= locate(/area/syndicate_station/start)
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/proc/syndicate_move_to(area/destination as area)
|
||||
if(moving) return
|
||||
if(lastMove + SYNDICATE_SHUTTLE_COOLDOWN > world.time) return
|
||||
var/area/dest_location = locate(destination)
|
||||
if(curr_location == dest_location) return
|
||||
|
||||
moving = 1
|
||||
lastMove = world.time
|
||||
|
||||
if(curr_location.z != dest_location.z)
|
||||
var/area/transit_location = locate(/area/syndicate_station/transit)
|
||||
curr_location.move_contents_to(transit_location)
|
||||
curr_location = transit_location
|
||||
sleep(SYNDICATE_SHUTTLE_MOVE_TIME)
|
||||
|
||||
curr_location.move_contents_to(dest_location)
|
||||
curr_location = dest_location
|
||||
moving = 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_ai(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_hand(mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied"
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = {"Location: [curr_location]<br>
|
||||
Ready to move[max(lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time, 0) ? " in [max(round((lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time) * 0.1), 0)] seconds" : ": now"]<br>
|
||||
<a href='?src=\ref[src];syndicate=1'>Syndicate Space</a><br>
|
||||
<a href='?src=\ref[src];station_nw=1'>North West of SS13</a> |
|
||||
<a href='?src=\ref[src];station_n=1'>North of SS13</a> |
|
||||
<a href='?src=\ref[src];station_ne=1'>North East of SS13</a><br>
|
||||
<a href='?src=\ref[src];station_sw=1'>South West of SS13</a> |
|
||||
<a href='?src=\ref[src];station_s=1'>South of SS13</a> |
|
||||
<a href='?src=\ref[src];station_se=1'>South East of SS13</a><br>
|
||||
<a href='?src=\ref[src];mining=1'>North East of the Mining Asteroid</a><br>
|
||||
<a href='?src=\ref[user];mach_close=computer'>Close</a>"}
|
||||
|
||||
user << browse(dat, "window=computer;size=575x450")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/Topic(href, href_list)
|
||||
if(!isliving(usr)) return
|
||||
var/mob/living/user = usr
|
||||
|
||||
if(in_range(src, user) || istype(user, /mob/living/silicon))
|
||||
user.set_machine(src)
|
||||
|
||||
if(href_list["syndicate"])
|
||||
syndicate_move_to(/area/syndicate_station/start)
|
||||
else if(href_list["station_nw"])
|
||||
syndicate_move_to(/area/syndicate_station/northwest)
|
||||
else if(href_list["station_n"])
|
||||
syndicate_move_to(/area/syndicate_station/north)
|
||||
else if(href_list["station_ne"])
|
||||
syndicate_move_to(/area/syndicate_station/northeast)
|
||||
else if(href_list["station_sw"])
|
||||
syndicate_move_to(/area/syndicate_station/southwest)
|
||||
else if(href_list["station_s"])
|
||||
syndicate_move_to(/area/syndicate_station/south)
|
||||
else if(href_list["station_se"])
|
||||
syndicate_move_to(/area/syndicate_station/southeast)
|
||||
// else if(href_list["commssat"])
|
||||
// syndicate_move_to(/area/syndicate_station/commssat)
|
||||
else if(href_list["mining"])
|
||||
syndicate_move_to(/area/syndicate_station/mining)
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("[Proj] ricochets off [src]!") //let's not let them fuck themselves in the rear
|
||||
@@ -1,259 +0,0 @@
|
||||
//Config stuff
|
||||
#define SYNDICATE_ELITE_MOVETIME 600 //Time to station is deciseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station
|
||||
#define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock
|
||||
|
||||
var/syndicate_elite_shuttle_moving_to_station = 0
|
||||
var/syndicate_elite_shuttle_moving_to_mothership = 0
|
||||
var/syndicate_elite_shuttle_at_station = 0
|
||||
var/syndicate_elite_shuttle_can_send = 1
|
||||
var/syndicate_elite_shuttle_time = 0
|
||||
var/syndicate_elite_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle
|
||||
name = "Elite Syndicate Squad Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "syndishuttle"
|
||||
req_access = list(access_cent_specops)
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
|
||||
/proc/syndicate_elite_process()
|
||||
var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work.
|
||||
var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located?
|
||||
var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.say(message)
|
||||
// message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
|
||||
// announcer.say(message)
|
||||
|
||||
while(syndicate_elite_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = syndicate_elite_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
syndicate_elite_shuttle_time = world.timeofday // midnight rollover
|
||||
syndicate_elite_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
|
||||
if(rounded_time_left==0)
|
||||
message = "ALERT: TAKEOFF"
|
||||
announcer.say(message)
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
syndicate_elite_shuttle_moving_to_station = 0
|
||||
syndicate_elite_shuttle_moving_to_mothership = 0
|
||||
|
||||
syndicate_elite_shuttle_at_station = 1
|
||||
if (syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
if (!syndicate_elite_can_move())
|
||||
usr << "\red The Syndicate Elite shuttle is unable to leave."
|
||||
return
|
||||
|
||||
sleep(600)
|
||||
/*
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in elite_squad)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in elite_squad)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in elite_squad)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
*/
|
||||
elite_squad.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
/*
|
||||
var/obj/explosionmarker = locate("Syndicate Breach Area")
|
||||
if(explosionmarker)
|
||||
var/turf/simulated/T = explosionmarker.loc
|
||||
if(T)
|
||||
explosion(T,4,6,8,10,0)
|
||||
|
||||
sleep(40)
|
||||
// proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
|
||||
|
||||
*/
|
||||
var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership)
|
||||
var/area/end_location = locate(/area/shuttle/syndicate_elite/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/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived to [station_name]. Commence operation!"
|
||||
|
||||
/proc/syndicate_elite_can_move()
|
||||
if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0
|
||||
else return 1
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals."
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
// if (sent_syndicate_strike_team == 0)
|
||||
// usr << "\red The strike team has not yet deployed."
|
||||
// return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if (temp)
|
||||
dat = temp
|
||||
else
|
||||
dat = {"<b>Location:</b> [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*<BR>\n<BR>":syndicate_elite_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["sendtodock"])
|
||||
if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
usr << "\blue The Syndicate will not allow the Elite Squad shuttle to return."
|
||||
return
|
||||
|
||||
else if (href_list["sendtostation"])
|
||||
if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\red The Syndicate Elite shuttle is unable to leave."
|
||||
return
|
||||
|
||||
usr << "\blue The Syndicate Elite shuttle will arrive on [station_name] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds."
|
||||
|
||||
temp = "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
var/area/syndicate_mothership/elite_squad/elite_squad = locate()
|
||||
if(elite_squad)
|
||||
elite_squad.readyalert()//Trigger alarm for the spec ops area.
|
||||
syndicate_elite_shuttle_moving_to_station = 1
|
||||
|
||||
syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME
|
||||
spawn(0)
|
||||
syndicate_elite_process()
|
||||
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
temp = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
/obj/machinery/computer3/testing
|
||||
spawn_files = list(/datum/file/program/aifixer,/datum/file/program/arcade,/datum/file/program/atmos_alert,
|
||||
/datum/file/program/security,/datum/file/program/card_comp,
|
||||
/datum/file/program/borg_control,/datum/file/program/holodeck, /datum/file/program/communications,
|
||||
/datum/file/program/crew,/datum/file/program/op_monitor, /datum/file/program/powermon,
|
||||
|
||||
/datum/file/camnet_key,/datum/file/camnet_key/mining,/datum/file/camnet_key/entertainment,/datum/file/camnet_key/research,
|
||||
/datum/file/camnet_key/bombrange,/datum/file/camnet_key/xeno,/datum/file/camnet_key/singulo,/datum/file/camnet_key/prison)
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/storage/removable,/obj/item/part/computer/ai_holder,
|
||||
/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras,
|
||||
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
|
||||
New(var/L,var/built=0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
..(L,built)
|
||||
|
||||
/obj/machinery/computer3/laptop/testing
|
||||
spawn_files = list(/datum/file/program/aifixer,/datum/file/program/arcade,/datum/file/program/atmos_alert,
|
||||
/datum/file/program/security,/datum/file/program/card_comp,
|
||||
/datum/file/program/borg_control,/datum/file/program/holodeck, /datum/file/program/communications,
|
||||
/datum/file/program/crew,/datum/file/program/op_monitor, /datum/file/program/powermon,
|
||||
|
||||
/datum/file/camnet_key,/datum/file/camnet_key/mining,/datum/file/camnet_key/entertainment,/datum/file/camnet_key/research,
|
||||
/datum/file/camnet_key/bombrange,/datum/file/camnet_key/xeno,/datum/file/camnet_key/singulo,/datum/file/camnet_key/prison)
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/storage/removable,/obj/item/part/computer/ai_holder,
|
||||
/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras,
|
||||
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
|
||||
New(var/L,var/built=0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell/super(src)
|
||||
..(L,built)
|
||||
|
||||
/obj/machinery/computer3/wall_comp/testing
|
||||
spawn_files = list(/datum/file/program/aifixer,/datum/file/program/arcade,/datum/file/program/atmos_alert,
|
||||
/datum/file/program/security,/datum/file/program/card_comp,
|
||||
/datum/file/program/borg_control,/datum/file/program/holodeck, /datum/file/program/communications,
|
||||
/datum/file/program/crew,/datum/file/program/op_monitor, /datum/file/program/powermon,
|
||||
|
||||
/datum/file/camnet_key,/datum/file/camnet_key/mining,/datum/file/camnet_key/entertainment,/datum/file/camnet_key/research,
|
||||
/datum/file/camnet_key/bombrange,/datum/file/camnet_key/xeno,/datum/file/camnet_key/singulo,/datum/file/camnet_key/prison)
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/storage/removable,/obj/item/part/computer/ai_holder,
|
||||
/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras,
|
||||
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
|
||||
New(var/L,var/built=0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
..(L,built)
|
||||
|
||||
/obj/machinery/computer3/server/testing
|
||||
spawn_files = list(/datum/file/program/aifixer,/datum/file/program/arcade,/datum/file/program/atmos_alert,
|
||||
/datum/file/program/security,/datum/file/program/card_comp,
|
||||
/datum/file/program/borg_control,/datum/file/program/holodeck, /datum/file/program/communications,
|
||||
/datum/file/program/crew,/datum/file/program/op_monitor, /datum/file/program/powermon,
|
||||
|
||||
/datum/file/camnet_key,/datum/file/camnet_key/mining,/datum/file/camnet_key/entertainment,/datum/file/camnet_key/research,
|
||||
/datum/file/camnet_key/bombrange,/datum/file/camnet_key/xeno,/datum/file/camnet_key/singulo,/datum/file/camnet_key/prison)
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/storage/removable,/obj/item/part/computer/ai_holder,
|
||||
/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras,
|
||||
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
|
||||
New(var/L,var/built=0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
..(L,built)
|
||||
|
||||
/obj/machinery/computer3/server/rack/testing
|
||||
spawn_files = list(/datum/file/program/aifixer,/datum/file/program/arcade,/datum/file/program/atmos_alert,
|
||||
/datum/file/program/security,/datum/file/program/card_comp,
|
||||
/datum/file/program/borg_control,/datum/file/program/holodeck, /datum/file/program/communications,
|
||||
/datum/file/program/crew,/datum/file/program/op_monitor, /datum/file/program/powermon,
|
||||
|
||||
/datum/file/camnet_key,/datum/file/camnet_key/mining,/datum/file/camnet_key/entertainment,/datum/file/camnet_key/research,
|
||||
/datum/file/camnet_key/bombrange,/datum/file/camnet_key/xeno,/datum/file/camnet_key/singulo,/datum/file/camnet_key/prison)
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/storage/removable,/obj/item/part/computer/ai_holder,
|
||||
/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras,
|
||||
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
|
||||
New(var/L,var/built=0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
..(L,built)
|
||||
|
||||
/obj/item/weapon/storage/box/testing_disks
|
||||
New()
|
||||
..()
|
||||
for(var/typekey in typesof(/obj/item/weapon/disk/file) - /obj/item/weapon/disk/file)
|
||||
new typekey(src)
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
Computer3 law changes:
|
||||
|
||||
* Laws are a file type
|
||||
* Connecting to the AI requires a network connection
|
||||
* Connecting to a borg requires a radio or network.
|
||||
|
||||
*/
|
||||
|
||||
/datum/file/ai_law
|
||||
var/list/hacklaws = null
|
||||
var/zerolaw = null
|
||||
var/list/corelaws = null
|
||||
var/list/auxlaws = null
|
||||
|
||||
var/configurable = 0
|
||||
|
||||
// override this when you need to be able to alter the parameters of the lawset
|
||||
proc/configure()
|
||||
return
|
||||
|
||||
execute(var/datum/file/program/source)
|
||||
if(istype(usr,/mob/living/silicon))
|
||||
return
|
||||
if(istype(source,/datum/file/program/ntos))
|
||||
if(configurable)
|
||||
configure()
|
||||
return
|
||||
if(istype(source,/datum/file/program/upload/ai))
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
Note that as with existing ai upload, this is not an interactive program.
|
||||
That means that the work is done in execute() rather than interact()
|
||||
*/
|
||||
|
||||
/datum/file/program/upload/ai
|
||||
execute(var/datum/file/program/source)
|
||||
if(!interactable() || istype(usr,/mob/living/silicon))
|
||||
return 0
|
||||
if(!computer.net)
|
||||
usr << "An indecipherable set of code flicks across the screen. Nothing else happens."
|
||||
return
|
||||
var/list/results = computer.net.get_machines
|
||||
@@ -1,254 +0,0 @@
|
||||
// emergency response teams
|
||||
// work in progress
|
||||
|
||||
var/const/members_possible = 5
|
||||
var/const/members_required = 1 // We need at least *one* person ;_;
|
||||
var/global/admin_emergency_team = 0 // Used for admin-spawned response teams
|
||||
// 'sent_response_team' for automagic response teams
|
||||
|
||||
/client/proc/response_team()
|
||||
set name = "Dispatch Emergency Response Team"
|
||||
set category = "Special Verbs"
|
||||
set desc = "Send an emergency response team to the station"
|
||||
|
||||
if(!holder)
|
||||
usr << "\red Only administrators may use this command."
|
||||
return
|
||||
if(!ticker)
|
||||
usr << "\red The game hasn't started yet!"
|
||||
return
|
||||
if(ticker.current_state == GAME_STATE_PREGAME)
|
||||
usr << "\red The round hasn't started yet!"
|
||||
return
|
||||
if(admin_emergency_team || send_emergency_team)
|
||||
usr << "\red Central Command has already dispatched an emergency response team!"
|
||||
return
|
||||
if(alert("Do you want to dispatch an Emergency Response Team?",,"Yes","No") != "Yes")
|
||||
return
|
||||
if(get_security_level() != "red") // Allow admins to reconsider if the alert level isn't Red
|
||||
switch(alert("The station has not entered code red recently. Do you still want to dispatch a response team?",,"Yes","No"))
|
||||
if("No")
|
||||
return
|
||||
|
||||
var/situation = null
|
||||
while(!situation)
|
||||
situation = copytext(sanitize(input(src, "Please specify the mission the emergency response team will undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
|
||||
if(!situation)
|
||||
if(alert("You haven't specified a mission. Exit the setup process?",,"No","Yes")=="Yes")
|
||||
return
|
||||
|
||||
if(admin_emergency_team || send_emergency_team)
|
||||
usr << "\red Looks like somebody beat you to it!"
|
||||
return
|
||||
|
||||
admin_emergency_team = 1
|
||||
message_admins("[key_name_admin(usr)] is dispatching an Emergency Response Team.", 1)
|
||||
log_admin("[key_name(usr)] used Dispatch Response Team.")
|
||||
|
||||
var/member_number = members_possible
|
||||
var/leader_selected = 0
|
||||
|
||||
// Shamelessly stolen nuke code
|
||||
var/nuke_code
|
||||
var/temp_code
|
||||
for(var/obj/machinery/nuclearbomb/N in machines)
|
||||
temp_code = text2num(N.r_code)
|
||||
if(temp_code)
|
||||
nuke_code = N.r_code
|
||||
break
|
||||
|
||||
/* var/list/candidates = list() // ghosts who can be picked
|
||||
var/list/members = list() // ghosts who have been picked
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!G.client.holder && !G.client.is_afk())
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
for(var/i=members_possible,(i>0&&candidates.len), i--)
|
||||
var/candidate = input("Choose characters to spawn as response team members. This will go on until there are no more ghosts to pick from or until all slots are full.", "Active Players") as null|anything in candidates */
|
||||
|
||||
// I tried doing this differently. Ghosts get a pop-up box similar to pAIs and one-click-antag
|
||||
// Biggest diff here is in how the candidates list is updated
|
||||
alert(usr, "Active ghosts will be given a chance to choose whether or not they want to be considered for the emergency reponse team. This will take about 30 seconds.") // There's probably a better way to do this, with a fancy count-down timer or something
|
||||
|
||||
var/list/candidates = list()
|
||||
var/list/members = list()
|
||||
var/time_passed = world.time
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!jobban_isbanned(G, "Syndicate") && !jobban_isbanned(G, "Emergency Response Team") && !jobban_isbanned(G, "Security Officer"))
|
||||
spawn(0)
|
||||
switch(alert(G, "Do you want to be considered for the Emergency Response Team? Please answer in 30 seconds!",,"Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)
|
||||
return
|
||||
candidates += G.key
|
||||
if("No")
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
sleep(300)
|
||||
|
||||
if(candidates.len < members_required)
|
||||
message_admins("Not enough people signed up for [key_name_admin(usr)]'s response team! Aborting.")
|
||||
log_admin("Response Team aborted: Not Enough Signups.")
|
||||
admin_emergency_team = 0
|
||||
return
|
||||
|
||||
for(var/i=members_possible,(i>0&&candidates.len), i--) // The rest of the choosing process is just an input with a list of candidates on it
|
||||
var/chosen = input("Time's up! Choose characters to spawn as reponse team members. This will go on until there are no more ghosts to pick from or until all slots are full.", "Considered Players") as null|anything in candidates
|
||||
candidates -= chosen
|
||||
members += chosen
|
||||
|
||||
command_alert("Sensors indicate that [station_name()] has entered Code Red and is in need of assistance. We will prepare and dispatch an emergency response team to deal with the situation.", "NMV Icarus Command")
|
||||
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Response Team")
|
||||
leader_selected = member_number == 1?1:0 // The last person selected will be the leader
|
||||
|
||||
var/mob/living/carbon/human/new_member = spawn_response_team(L, leader_selected)
|
||||
|
||||
new_member.age = !leader_selected ? rand(23,35) : rand(35,45)
|
||||
|
||||
if(members.len)
|
||||
new_member.key = pick(members)
|
||||
members -= new_member.key
|
||||
|
||||
if(!new_member.key) // It works ok? sort of
|
||||
del(new_member)
|
||||
break
|
||||
|
||||
spawn(0)
|
||||
|
||||
switch(alert(new_member, "You are an Emergency Response Team member! Are you a boy or a girl?",,"Male","Female"))
|
||||
if("Male")
|
||||
new_member.gender = MALE
|
||||
if("Female")
|
||||
new_member.gender = FEMALE
|
||||
|
||||
var/new_name = input(new_member, "...Erm, what was your name again?", "Choose your name") as text
|
||||
|
||||
if(!new_name)
|
||||
new_member.real_name = "Agent [pick("Red","Yellow","Orange","Silver","Gold", "Pink", "Purple", "Rainbow")]" // Choose a "random" agent name
|
||||
new_member.name = usr.real_name
|
||||
new_member.mind.name = usr.real_name
|
||||
|
||||
else
|
||||
new_member.real_name = new_name
|
||||
new_member.name = new_name
|
||||
new_member.mind.name = new_name
|
||||
|
||||
// -- CHANGE APPEARANCE --
|
||||
var/new_tone = input(new_member, "Please select your new skin tone: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as num
|
||||
|
||||
if(new_tone)
|
||||
new_member.s_tone = max(min(round(text2num(new_tone)), 220), 1)
|
||||
new_member.s_tone = -new_member.s_tone + 35
|
||||
|
||||
var/new_hair = input(new_member, "Please select your new hair color.","Character Generation") as color
|
||||
|
||||
if(new_hair)
|
||||
new_member.r_hair = hex2num(copytext(new_hair, 2, 4))
|
||||
new_member.g_hair = hex2num(copytext(new_hair, 4, 6))
|
||||
new_member.b_hair = hex2num(copytext(new_hair, 6, 8))
|
||||
|
||||
var/new_facial = input(new_member, "Please select your new facial hair color.","Character Generation") as color
|
||||
|
||||
if(new_facial)
|
||||
new_member.r_facial = hex2num(copytext(new_facial, 2, 4))
|
||||
new_member.g_facial = hex2num(copytext(new_facial, 4, 6))
|
||||
new_member.b_facial = hex2num(copytext(new_facial, 6, 8))
|
||||
|
||||
var/new_eyes = input(new_member, "Please select eye color.", "Character Generation") as color
|
||||
|
||||
if(new_eyes)
|
||||
new_member.r_eyes = hex2num(copytext(new_eyes, 2, 4))
|
||||
new_member.g_eyes = hex2num(copytext(new_eyes, 4, 6))
|
||||
new_member.b_eyes = hex2num(copytext(new_eyes, 6, 8))
|
||||
|
||||
var/new_hstyle = input(new_member, "Please select your new hair style!", "Grooming") as null|anything in hair_styles_list
|
||||
|
||||
if(new_hstyle)
|
||||
new_member.h_style = new_hstyle
|
||||
|
||||
var/new_fstyle = input(new_member, "Please select your new facial hair style!", "Grooming") as null|anything in facial_hair_styles_list
|
||||
|
||||
if(new_fstyle)
|
||||
new_member.f_style = new_fstyle
|
||||
|
||||
// -- END --
|
||||
|
||||
new_member.dna.ready_dna(new_member)
|
||||
new_member.update_body(1)
|
||||
new_member.update_hair(1)
|
||||
|
||||
new_member.mind_initialize()
|
||||
|
||||
new_member.mind.assigned_role = "Emergency Response Team"
|
||||
new_member.mind.special_role = "Emergency Response Team"
|
||||
ticker.mode.traitors |= new_member.mind // ERTs will show up at the end of the round on the "traitor" list
|
||||
|
||||
// Join message
|
||||
new_member << "\blue You are the <b>Emergency Response Team[!leader_selected?"!</b>":" Leader!</b>"] \nAs a response team [!leader_selected?"member":"<b>leader</b>"] you answer directly to [!leader_selected?"your team leader.":"Central Command."] \nYou have been deployed by NanoTrasen Central Command in Tau Ceti to resolve a Code Red alert aboard [station_name()], and have been provided with the following instructions and information regarding your mission: \red [situation]"
|
||||
new_member.mind.store_memory("<b>Mission Parameters:</b> \red [situation].")
|
||||
|
||||
// Leader join message
|
||||
if(leader_selected)
|
||||
new_member << "\red The Nuclear Authentication Code is: <b> [nuke_code]</b>. You are instructed not to detonate the nuclear device aboard [station_name()] unless <u>absolutely necessary</u>."
|
||||
new_member.mind.store_memory("<b>Nuclear Authentication Code:</b> \red [nuke_code]")
|
||||
|
||||
new_member.equip_response_team(leader_selected) // Start equipping them
|
||||
|
||||
member_number--
|
||||
return 1
|
||||
|
||||
// Mob creation
|
||||
/client/proc/spawn_response_team(obj/spawn_location, leader_selected = 0)
|
||||
var/mob/living/carbon/human/new_member = new(spawn_location.loc)
|
||||
|
||||
return new_member
|
||||
|
||||
// Equip mob
|
||||
/mob/living/carbon/human/proc/equip_response_team(leader_selected = 0)
|
||||
|
||||
// Headset
|
||||
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert(src), slot_ears)
|
||||
|
||||
// Uniform
|
||||
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
|
||||
equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes)
|
||||
equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(src), slot_belt)
|
||||
|
||||
// Glasses
|
||||
equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(src), slot_glasses)
|
||||
|
||||
// Backpack
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
|
||||
|
||||
// Put stuff into their backpacks
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(src), slot_in_backpack)
|
||||
// equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) // Regular medkit
|
||||
|
||||
// Loyalty implants
|
||||
implant_loyalty(src)
|
||||
|
||||
// ID cards
|
||||
var/obj/item/weapon/card/id/E = new(src)
|
||||
E.name = "[real_name]'s ID Card (Emergency Response Team)"
|
||||
E.icon_state = "centcom"
|
||||
E.access = get_all_accesses() // ERTs can go everywhere on the station
|
||||
if(leader_selected)
|
||||
E.name = "[real_name]'s ID Card (Emergency Response Team Leader)"
|
||||
E.access += get_all_centcom_access()
|
||||
E.assignment = "Emergency Response Team Leader"
|
||||
else
|
||||
E.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)
|
||||
E.assignment = "Emergency Response Team"
|
||||
E.registered_name = real_name
|
||||
equip_to_slot_or_del(E, slot_wear_id)
|
||||
|
||||
update_icons()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
#define METEOR_TEMPERATURE
|
||||
|
||||
/var/const/meteor_wave_delay = 625 //minimum wait between waves in tenths of seconds
|
||||
//set to at least 100 unless you want evarr ruining every round
|
||||
|
||||
/var/const/meteors_in_wave = 20
|
||||
/var/const/meteors_in_small_wave = 10
|
||||
|
||||
/proc/meteor_wave(var/number = meteors_in_wave)
|
||||
if(!ticker || wavesecret)
|
||||
return
|
||||
|
||||
var/startx
|
||||
var/starty
|
||||
var/endx
|
||||
var/endy
|
||||
var/turf/pickedstart
|
||||
var/turf/pickedgoal
|
||||
switch(pick(1,2,3,4))
|
||||
if(1) //NORTH
|
||||
starty = world.maxy-3
|
||||
startx = rand(1, world.maxx-1)
|
||||
endy = 1
|
||||
endx = rand(1, world.maxx-1)
|
||||
if(2) //EAST
|
||||
starty = rand(1,world.maxy-1)
|
||||
startx = world.maxx-3
|
||||
endy = rand(1, world.maxy-1)
|
||||
endx = 1
|
||||
if(3) //SOUTH
|
||||
starty = 3
|
||||
startx = rand(1, world.maxx-1)
|
||||
endy = world.maxy-1
|
||||
endx = rand(1, world.maxx-1)
|
||||
if(4) //WEST
|
||||
starty = rand(1, world.maxy-1)
|
||||
startx = 3
|
||||
endy = rand(1,world.maxy-1)
|
||||
endx = world.maxx-1
|
||||
pickedstart = locate(startx, starty, 1)
|
||||
pickedgoal = locate(endx, endy, 1)
|
||||
wavesecret = 1
|
||||
for(var/i = 0 to number)
|
||||
spawn(rand(10,100))
|
||||
spawn_meteor(pickedstart, pickedgoal)
|
||||
spawn(meteor_wave_delay)
|
||||
wavesecret = 0
|
||||
|
||||
/proc/spawn_meteors(var/turf/pickedstart, var/turf/pickedgoal, var/number = meteors_in_small_wave)
|
||||
for(var/i = 0; i < number; i++)
|
||||
spawn(0)
|
||||
spawn_meteor(pickedstart, pickedgoal)
|
||||
|
||||
/proc/spawn_meteor(var/turf/pickedstart, var/turf/pickedgoal)
|
||||
|
||||
var/route = rand(1,5)
|
||||
var/turf/tempgoal = pickedgoal
|
||||
for(var/i, i < route, i++)
|
||||
tempgoal = get_step(tempgoal,rand(1,8))
|
||||
|
||||
var/obj/effect/meteor/M
|
||||
switch(rand(1, 100))
|
||||
if(1 to 15)
|
||||
M = new /obj/effect/meteor/big(pickedstart)
|
||||
if(16 to 75)
|
||||
M = new /obj/effect/meteor( pickedstart )
|
||||
if(76 to 100)
|
||||
M = new /obj/effect/meteor/small( pickedstart )
|
||||
|
||||
M.dest = tempgoal
|
||||
|
||||
do
|
||||
sleep(1)
|
||||
walk_towards(M, M.dest, 1)
|
||||
while (!istype(M.loc, /turf/space) || pickedstart.loc.name != "Space" ) //FUUUCK, should never happen.
|
||||
|
||||
return
|
||||
|
||||
/obj/effect/meteor
|
||||
name = "meteor"
|
||||
icon = 'icons/obj/meteor.dmi'
|
||||
icon_state = "flaming"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/hits = 1
|
||||
var/dest
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
/obj/effect/meteor/small
|
||||
name = "small meteor"
|
||||
icon_state = "smallf"
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
|
||||
/obj/effect/meteor/Move()
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
T.hotspot_expose(METEOR_TEMPERATURE, 1000)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/effect/meteor/Bump(atom/A)
|
||||
spawn(0)
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai)) //bad idea to shake an ai's view
|
||||
shake_camera(M, 3, 1)
|
||||
if (A)
|
||||
A.meteorhit(src)
|
||||
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
if (--src.hits <= 0)
|
||||
if(prob(15))// && !istype(A, /obj/structure/grille))
|
||||
explosion(get_turf(src), 4, 5, 6, 7, 0)
|
||||
playsound(get_turf(src), "explosion", 50, 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/meteor/ex_act(severity)
|
||||
spawn(0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/effect/meteor/big
|
||||
name = "big meteor"
|
||||
hits = 5
|
||||
|
||||
ex_act(severity)
|
||||
return
|
||||
|
||||
Bump(atom/A)
|
||||
spawn(0)
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai)) //bad idea to shake an ai's view
|
||||
shake_camera(M, 3, 1)
|
||||
if (A)
|
||||
if(isobj(A))
|
||||
del(A)
|
||||
else
|
||||
A.meteorhit(src)
|
||||
src.hits--
|
||||
return
|
||||
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
if (--src.hits <= 0)
|
||||
if(prob(15) && !istype(A, /obj/structure/grille))
|
||||
explosion(get_turf(src), 1, 2, 3, 4, 0)
|
||||
playsound(get_turf(src), "explosion", 50, 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/pickaxe))
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
@@ -1,13 +0,0 @@
|
||||
/*------
|
||||
SPELL IMPLANTS
|
||||
+ Most diverse effects
|
||||
- Limited charges, failure rate
|
||||
|
||||
CYBERNETIC IMPLANTS
|
||||
+ Easiest to make
|
||||
- Require power
|
||||
|
||||
GRAFTS (includes basic human bodyparts)
|
||||
+ Permanent effects
|
||||
- Horrible side effects
|
||||
*/
|
||||
@@ -1,700 +0,0 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/organstructure //used obj for the "contents" var
|
||||
name = "organs"
|
||||
|
||||
var/species = "mob" //for speaking in unknown languages purposes
|
||||
|
||||
var/obj/effect/organ/limb/arms/arms = null
|
||||
var/obj/effect/organ/limb/legs/legs = null
|
||||
var/obj/effect/organ/torso/torso = null
|
||||
var/obj/effect/organ/head/head = null
|
||||
|
||||
|
||||
proc/GetSpeciesName()
|
||||
var/list/speciesPresent = list()
|
||||
|
||||
for(var/obj/effect/organ/organ in src) //only external organs count, since it's judging by the appearance
|
||||
if(speciesPresent[organ.species])
|
||||
speciesPresent[organ.species]++
|
||||
else
|
||||
speciesPresent[organ.species] = 1 //not sure, but I think it's not initialised before that, so can't ++
|
||||
|
||||
var/list/dominantSpecies = list()
|
||||
|
||||
for(var/speciesName in speciesPresent)
|
||||
if(!dominantSpecies.len)
|
||||
dominantSpecies += speciesName
|
||||
else
|
||||
if(speciesPresent[dominantSpecies[1]] == speciesPresent[speciesName])
|
||||
dominantSpecies += speciesName
|
||||
else if(speciesPresent[dominantSpecies[1]] < speciesPresent[speciesName])
|
||||
dominantSpecies = list(speciesName)
|
||||
|
||||
if(!dominantSpecies.len)
|
||||
species = "mob"
|
||||
else
|
||||
species = pick(dominantSpecies)
|
||||
|
||||
return species
|
||||
|
||||
proc/RecalculateStructure()
|
||||
var/list/organs = GetAllContents()
|
||||
|
||||
arms = locate(/obj/effect/organ/limb/arms) in organs
|
||||
legs = locate(/obj/effect/organ/limb/legs) in organs
|
||||
torso = locate(/obj/effect/organ/torso) in organs
|
||||
head = locate(/obj/effect/organ/head) in organs
|
||||
|
||||
GetSpeciesName()
|
||||
|
||||
return
|
||||
|
||||
proc/ProcessOrgans()
|
||||
set background = 1
|
||||
|
||||
var/list/organs = GetAllContents()
|
||||
for(var/obj/effect/organ/organ in organs)
|
||||
organ.ProcessOrgan()
|
||||
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
RecalculateStructure()
|
||||
|
||||
/obj/effect/organstructure/human
|
||||
name = "human organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/human(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organstructure/alien
|
||||
name = "alien organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/alien(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ
|
||||
name = "organ"
|
||||
|
||||
//All types
|
||||
var/organType = 0 //CYBER and SPELL go here
|
||||
var/species = "mob"
|
||||
var/obj/effect/organstructure/rootOrganStructure = null
|
||||
|
||||
New(location)
|
||||
..()
|
||||
|
||||
rootOrganStructure = FindRootStructure()
|
||||
|
||||
proc/FindRootStructure()
|
||||
if(istype(loc,/obj/effect/organ))
|
||||
var/obj/effect/organ/parent = loc
|
||||
return parent.FindRootStructure()
|
||||
else if(istype(loc,/obj/effect/organstructure))
|
||||
return loc
|
||||
return null
|
||||
|
||||
proc/ProcessOrgan()
|
||||
return
|
||||
|
||||
/obj/effect/organ/torso
|
||||
name = "torso"
|
||||
var/maxHealth = 50 //right now, the mob's (only humans for now) health depends only on it. Will be fixed later
|
||||
|
||||
/obj/effect/organ/torso/human
|
||||
name = "human torso"
|
||||
species = "human"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/human(src)
|
||||
new /obj/effect/organ/limb/legs/human(src)
|
||||
new /obj/effect/organ/head/human(src)
|
||||
/obj/effect/organ/torso/alien
|
||||
name = "alien torso"
|
||||
species = "alien"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/alien(src)
|
||||
new /obj/effect/organ/limb/legs/alien(src)
|
||||
new /obj/effect/organ/head/alien(src)
|
||||
|
||||
|
||||
/obj/effect/organ/limb
|
||||
name = "limb"
|
||||
|
||||
/obj/effect/organ/limb/arms
|
||||
name = "arms"
|
||||
|
||||
var/minDamage = 5 //punching damage
|
||||
var/maxDamage = 5
|
||||
|
||||
/obj/effect/organ/limb/arms/alien
|
||||
name = "alien arms"
|
||||
species = "alien"
|
||||
minDamage = 5
|
||||
maxDamage = 15
|
||||
|
||||
|
||||
/obj/effect/organ/limb/arms/human
|
||||
name = "human arms"
|
||||
species = "human"
|
||||
minDamage = 1
|
||||
maxDamage = 9
|
||||
|
||||
/obj/effect/organ/limb/legs
|
||||
name = "legs"
|
||||
|
||||
/obj/effect/organ/limb/legs/human
|
||||
name = "human legs"
|
||||
species = "human"
|
||||
|
||||
/obj/effect/organ/limb/legs/alien
|
||||
name = "alien legs"
|
||||
species = "alien"
|
||||
|
||||
|
||||
/obj/effect/organ/head
|
||||
name = "head"
|
||||
|
||||
/obj/effect/organ/head/human
|
||||
name = "human head"
|
||||
species = "human"
|
||||
|
||||
/obj/effect/organ/head/alien
|
||||
name = "alien head"
|
||||
species = "alien"
|
||||
|
||||
/obj/effect/organ/limb/arms/alien
|
||||
name = "alien arms"
|
||||
species = "alien"
|
||||
minDamage = 5
|
||||
maxDamage = 15
|
||||
|
||||
/obj/effect/organ/limb/legs/alien
|
||||
name = "alien legs"
|
||||
species = "alien"
|
||||
|
||||
/obj/effect/organ/head/alien
|
||||
name = "alien head"
|
||||
species = "alien"
|
||||
|
||||
// ++++STUB ORGAN STRUCTURE. THIS IS THE DEFAULT STRUCTURE. USED TO PREVENT EXCEPTIONS++++
|
||||
/obj/effect/organstructure/stub
|
||||
name = "stub organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/stub(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/stub
|
||||
name = "stub torso"
|
||||
species = "stub"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/stub(src)
|
||||
new /obj/effect/organ/limb/legs/stub(src)
|
||||
new /obj/effect/organ/head/stub(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/stub
|
||||
name = "stub arms"
|
||||
species = "stub"
|
||||
|
||||
/obj/effect/organ/limb/legs/stub
|
||||
name = "stub legs"
|
||||
species = "stub"
|
||||
|
||||
/obj/effect/organ/head/stub
|
||||
name = "stub head"
|
||||
species = "stub"
|
||||
|
||||
// ++++STUB ORGAN STRUCTURE. END++++
|
||||
|
||||
|
||||
// ++++MONKEY++++
|
||||
|
||||
/obj/effect/organstructure/monkey
|
||||
name = "monkey organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/monkey(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/monkey
|
||||
name = "monkey torso"
|
||||
species = "monkey"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/monkey(src)
|
||||
new /obj/effect/organ/limb/legs/monkey(src)
|
||||
new /obj/effect/organ/head/monkey(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/monkey
|
||||
name = "monkey arms"
|
||||
species = "monkey"
|
||||
|
||||
/obj/effect/organ/limb/legs/monkey
|
||||
name = "monkey legs"
|
||||
species = "monkey"
|
||||
|
||||
/obj/effect/organ/head/monkey
|
||||
name = "monkey head"
|
||||
species = "monkey"
|
||||
|
||||
|
||||
// +++++CYBORG+++++
|
||||
/obj/effect/organstructure/cyborg
|
||||
name = "cyborg organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/cyborg(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/cyborg
|
||||
name = "cyborg torso"
|
||||
species = "cyborg"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/cyborg(src)
|
||||
new /obj/effect/organ/limb/legs/cyborg(src)
|
||||
new /obj/effect/organ/head/cyborg(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/cyborg
|
||||
name = "cyborg arms"
|
||||
species = "cyborg"
|
||||
|
||||
/obj/effect/organ/limb/legs/cyborg
|
||||
name = "cyborg legs"
|
||||
species = "cyborg"
|
||||
|
||||
/obj/effect/organ/head/cyborg
|
||||
name = "cyborg head"
|
||||
species = "cyborg"
|
||||
|
||||
// +++++AI++++++
|
||||
/obj/effect/organstructure/AI
|
||||
name = "AI organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/AI(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/AI
|
||||
name = "AI torso"
|
||||
species = "AI"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/AI(src)
|
||||
new /obj/effect/organ/limb/legs/AI(src)
|
||||
new /obj/effect/organ/head/AI(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/AI
|
||||
name = "AI arms"
|
||||
species = "AI"
|
||||
|
||||
/obj/effect/organ/limb/legs/AI
|
||||
name = "AI legs"
|
||||
species = "AI"
|
||||
|
||||
/obj/effect/organ/head/AI
|
||||
name = "AI head"
|
||||
species = "AI"
|
||||
|
||||
/* New organ structure template
|
||||
|
||||
|
||||
/obj/effect/organstructure/template
|
||||
name = "template organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/template(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/template
|
||||
name = "template torso"
|
||||
species = "template"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/template(src)
|
||||
new /obj/effect/organ/limb/legs/template(src)
|
||||
new /obj/effect/organ/head/template(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/template
|
||||
name = "template arms"
|
||||
species = "template"
|
||||
|
||||
/obj/effect/organ/limb/legs/template
|
||||
name = "template legs"
|
||||
species = "template"
|
||||
|
||||
/obj/effect/organ/head/template
|
||||
name = "template head"
|
||||
species = "template"
|
||||
|
||||
=======
|
||||
/obj/effect/organstructure //used obj for the "contents" var
|
||||
name = "organs"
|
||||
|
||||
var/species = "mob" //for speaking in unknown languages purposes
|
||||
|
||||
var/obj/effect/organ/limb/arms/arms = null
|
||||
var/obj/effect/organ/limb/legs/legs = null
|
||||
var/obj/effect/organ/torso/torso = null
|
||||
var/obj/effect/organ/head/head = null
|
||||
|
||||
|
||||
proc/GetSpeciesName()
|
||||
var/list/speciesPresent = list()
|
||||
|
||||
for(var/obj/effect/organ/organ in src) //only external organs count, since it's judging by the appearance
|
||||
if(speciesPresent[organ.species])
|
||||
speciesPresent[organ.species]++
|
||||
else
|
||||
speciesPresent[organ.species] = 1 //not sure, but I think it's not initialised before that, so can't ++
|
||||
|
||||
var/list/dominantSpecies = list()
|
||||
|
||||
for(var/speciesName in speciesPresent)
|
||||
if(!dominantSpecies.len)
|
||||
dominantSpecies += speciesName
|
||||
else
|
||||
if(speciesPresent[dominantSpecies[1]] == speciesPresent[speciesName])
|
||||
dominantSpecies += speciesName
|
||||
else if(speciesPresent[dominantSpecies[1]] < speciesPresent[speciesName])
|
||||
dominantSpecies = list(speciesName)
|
||||
|
||||
if(!dominantSpecies.len)
|
||||
species = "mob"
|
||||
else
|
||||
species = pick(dominantSpecies)
|
||||
|
||||
return species
|
||||
|
||||
proc/RecalculateStructure()
|
||||
var/list/organs = GetAllContents()
|
||||
|
||||
arms = locate(/obj/effect/organ/limb/arms) in organs
|
||||
legs = locate(/obj/effect/organ/limb/legs) in organs
|
||||
torso = locate(/obj/effect/organ/torso) in organs
|
||||
head = locate(/obj/effect/organ/head) in organs
|
||||
|
||||
GetSpeciesName()
|
||||
|
||||
return
|
||||
|
||||
proc/ProcessOrgans()
|
||||
set background = 1
|
||||
|
||||
var/list/organs = GetAllContents()
|
||||
for(var/obj/effect/organ/organ in organs)
|
||||
organ.ProcessOrgan()
|
||||
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
RecalculateStructure()
|
||||
|
||||
/obj/effect/organstructure/human
|
||||
name = "human organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/human(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organstructure/alien
|
||||
name = "alien organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/alien(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ
|
||||
name = "organ"
|
||||
|
||||
//All types
|
||||
var/organType = 0 //CYBER and SPELL go here
|
||||
var/species = "mob"
|
||||
var/obj/effect/organstructure/rootOrganStructure = null
|
||||
|
||||
New(location)
|
||||
..()
|
||||
|
||||
rootOrganStructure = FindRootStructure()
|
||||
|
||||
proc/FindRootStructure()
|
||||
if(istype(loc,/obj/effect/organ))
|
||||
var/obj/effect/organ/parent = loc
|
||||
return parent.FindRootStructure()
|
||||
else if(istype(loc,/obj/effect/organstructure))
|
||||
return loc
|
||||
return null
|
||||
|
||||
proc/ProcessOrgan()
|
||||
return
|
||||
|
||||
/obj/effect/organ/torso
|
||||
name = "torso"
|
||||
var/maxHealth = 50 //right now, the mob's (only humans for now) health depends only on it. Will be fixed later
|
||||
|
||||
/obj/effect/organ/torso/human
|
||||
name = "human torso"
|
||||
species = "human"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/human(src)
|
||||
new /obj/effect/organ/limb/legs/human(src)
|
||||
new /obj/effect/organ/head/human(src)
|
||||
/obj/effect/organ/torso/alien
|
||||
name = "alien torso"
|
||||
species = "alien"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/alien(src)
|
||||
new /obj/effect/organ/limb/legs/alien(src)
|
||||
new /obj/effect/organ/head/alien(src)
|
||||
|
||||
|
||||
/obj/effect/organ/limb
|
||||
name = "limb"
|
||||
|
||||
/obj/effect/organ/limb/arms
|
||||
name = "arms"
|
||||
|
||||
var/minDamage = 5 //punching damage
|
||||
var/maxDamage = 5
|
||||
|
||||
/obj/effect/organ/limb/arms/alien
|
||||
name = "alien arms"
|
||||
species = "alien"
|
||||
minDamage = 5
|
||||
maxDamage = 15
|
||||
|
||||
|
||||
/obj/effect/organ/limb/arms/human
|
||||
name = "human arms"
|
||||
species = "human"
|
||||
minDamage = 1
|
||||
maxDamage = 9
|
||||
|
||||
/obj/effect/organ/limb/legs
|
||||
name = "legs"
|
||||
|
||||
/obj/effect/organ/limb/legs/human
|
||||
name = "human legs"
|
||||
species = "human"
|
||||
|
||||
/obj/effect/organ/limb/legs/alien
|
||||
name = "alien legs"
|
||||
species = "alien"
|
||||
|
||||
|
||||
/obj/effect/organ/head
|
||||
name = "head"
|
||||
|
||||
/obj/effect/organ/head/human
|
||||
name = "human head"
|
||||
species = "human"
|
||||
|
||||
/obj/effect/organ/head/alien
|
||||
name = "alien head"
|
||||
species = "alien"
|
||||
|
||||
/obj/effect/organ/limb/arms/alien
|
||||
name = "alien arms"
|
||||
species = "alien"
|
||||
minDamage = 5
|
||||
maxDamage = 15
|
||||
|
||||
/obj/effect/organ/limb/legs/alien
|
||||
name = "alien legs"
|
||||
species = "alien"
|
||||
|
||||
/obj/effect/organ/head/alien
|
||||
name = "alien head"
|
||||
species = "alien"
|
||||
|
||||
// ++++STUB ORGAN STRUCTURE. THIS IS THE DEFAULT STRUCTURE. USED TO PREVENT EXCEPTIONS++++
|
||||
/obj/effect/organstructure/stub
|
||||
name = "stub organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/stub(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/stub
|
||||
name = "stub torso"
|
||||
species = "stub"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/stub(src)
|
||||
new /obj/effect/organ/limb/legs/stub(src)
|
||||
new /obj/effect/organ/head/stub(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/stub
|
||||
name = "stub arms"
|
||||
species = "stub"
|
||||
|
||||
/obj/effect/organ/limb/legs/stub
|
||||
name = "stub legs"
|
||||
species = "stub"
|
||||
|
||||
/obj/effect/organ/head/stub
|
||||
name = "stub head"
|
||||
species = "stub"
|
||||
|
||||
// ++++STUB ORGAN STRUCTURE. END++++
|
||||
|
||||
|
||||
// ++++MONKEY++++
|
||||
|
||||
/obj/effect/organstructure/monkey
|
||||
name = "monkey organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/monkey(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/monkey
|
||||
name = "monkey torso"
|
||||
species = "monkey"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/monkey(src)
|
||||
new /obj/effect/organ/limb/legs/monkey(src)
|
||||
new /obj/effect/organ/head/monkey(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/monkey
|
||||
name = "monkey arms"
|
||||
species = "monkey"
|
||||
|
||||
/obj/effect/organ/limb/legs/monkey
|
||||
name = "monkey legs"
|
||||
species = "monkey"
|
||||
|
||||
/obj/effect/organ/head/monkey
|
||||
name = "monkey head"
|
||||
species = "monkey"
|
||||
|
||||
|
||||
// +++++CYBORG+++++
|
||||
/obj/effect/organstructure/cyborg
|
||||
name = "cyborg organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/cyborg(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/cyborg
|
||||
name = "cyborg torso"
|
||||
species = "cyborg"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/cyborg(src)
|
||||
new /obj/effect/organ/limb/legs/cyborg(src)
|
||||
new /obj/effect/organ/head/cyborg(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/cyborg
|
||||
name = "cyborg arms"
|
||||
species = "cyborg"
|
||||
|
||||
/obj/effect/organ/limb/legs/cyborg
|
||||
name = "cyborg legs"
|
||||
species = "cyborg"
|
||||
|
||||
/obj/effect/organ/head/cyborg
|
||||
name = "cyborg head"
|
||||
species = "cyborg"
|
||||
|
||||
// +++++AI++++++
|
||||
/obj/effect/organstructure/AI
|
||||
name = "AI organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/AI(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/AI
|
||||
name = "AI torso"
|
||||
species = "AI"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/AI(src)
|
||||
new /obj/effect/organ/limb/legs/AI(src)
|
||||
new /obj/effect/organ/head/AI(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/AI
|
||||
name = "AI arms"
|
||||
species = "AI"
|
||||
|
||||
/obj/effect/organ/limb/legs/AI
|
||||
name = "AI legs"
|
||||
species = "AI"
|
||||
|
||||
/obj/effect/organ/head/AI
|
||||
name = "AI head"
|
||||
species = "AI"
|
||||
|
||||
/* New organ structure template
|
||||
|
||||
|
||||
/obj/effect/organstructure/template
|
||||
name = "template organs"
|
||||
|
||||
New()
|
||||
new /obj/effect/organ/torso/template(src)
|
||||
..()
|
||||
|
||||
/obj/effect/organ/torso/template
|
||||
name = "template torso"
|
||||
species = "template"
|
||||
maxHealth = 100
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/effect/organ/limb/arms/template(src)
|
||||
new /obj/effect/organ/limb/legs/template(src)
|
||||
new /obj/effect/organ/head/template(src)
|
||||
|
||||
/obj/effect/organ/limb/arms/template
|
||||
name = "template arms"
|
||||
species = "template"
|
||||
|
||||
/obj/effect/organ/limb/legs/template
|
||||
name = "template legs"
|
||||
species = "template"
|
||||
|
||||
/obj/effect/organ/head/template
|
||||
name = "template head"
|
||||
species = "template"
|
||||
|
||||
>>>>>>> remotes/git-svn
|
||||
*/
|
||||
Reference in New Issue
Block a user