Initial Commit

This commit is contained in:
skull132
2014-03-11 09:03:52 +02:00
commit a8d9450c7e
3486 changed files with 415920 additions and 0 deletions
@@ -0,0 +1,573 @@
//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)
+107
View File
@@ -0,0 +1,107 @@
/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)
@@ -0,0 +1,156 @@
//------------------------------------------------------------
//
// 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()
+224
View File
@@ -0,0 +1,224 @@
#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
@@ -0,0 +1,137 @@
/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
+38
View File
@@ -0,0 +1,38 @@
/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
+23
View File
@@ -0,0 +1,23 @@
/obj/item/changestone
name = "An uncut ruby"
desc = "The ruby shines and catches the light, despite being uncut"
icon = 'icons/obj/artifacts.dmi'
icon_state = "changerock"
obj/item/changestone/attack_hand(var/mob/user as mob)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(!H.gloves)
if (H.gender == FEMALE)
H.gender = MALE
else
H.gender = FEMALE
H.dna.ready_dna(H)
H.update_body()
..()
@@ -0,0 +1,59 @@
//simplified copy of /obj/structure/falsewall
/obj/effect/landmark/falsewall_spawner
name = "falsewall spawner"
/obj/structure/temple_falsewall
name = "wall"
anchored = 1
icon = 'icons/turf/walls.dmi'
icon_state = "plasma0"
opacity = 1
var/closed_wall_dir = 0
var/opening = 0
var/mineral = "plasma"
var/is_metal = 0
/obj/structure/temple_falsewall/New()
..()
spawn(10)
if(prob(95))
desc = pick("Something seems slightly off about it.","")
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
for(var/turf/unsimulated/wall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
junction |= get_dir(src,W)
closed_wall_dir = junction
density = 1
icon_state = "[mineral][closed_wall_dir]"
/obj/structure/temple_falsewall/attack_hand(mob/user as mob)
if(opening)
return
if(density)
opening = 1
if(is_metal)
icon_state = "metalfwall_open"
flick("metalfwall_opening", src)
else
icon_state = "[mineral]fwall_open"
flick("[mineral]fwall_opening", src)
sleep(15)
src.density = 0
SetOpacity(0)
opening = 0
else
opening = 1
icon_state = "[mineral][closed_wall_dir]"
if(is_metal)
flick("metalfwall_closing", src)
else
flick("[mineral]fwall_closing", src)
density = 1
sleep(15)
SetOpacity(1)
opening = 0
@@ -0,0 +1,345 @@
//some testin stuff
#define PATH_SPREAD_CHANCE_START 90
#define PATH_SPREAD_CHANCE_LOSS_UPPER 80
#define PATH_SPREAD_CHANCE_LOSS_LOWER 50
#define RIVER_SPREAD_CHANCE_START 100
#define RIVER_SPREAD_CHANCE_LOSS_UPPER 65
#define RIVER_SPREAD_CHANCE_LOSS_LOWER 50
#define RANDOM_UPPER_X 100
#define RANDOM_UPPER_Y 100
#define RANDOM_LOWER_X 18
#define RANDOM_LOWER_Y 18
/area/jungle
name = "jungle"
icon = 'code/workinprogress/cael_aislinn/jungle/jungle.dmi'
icon_state = "area"
lighting_use_dynamic = 0
luminosity = 1
//randomly spawns, will create paths around the map
/obj/effect/landmark/path_waypoint
name = "path waypoint"
icon_state = "x2"
var/connected = 0
/obj/effect/landmark/temple
name = "temple entrance"
icon_state = "x2"
var/obj/structure/ladder/my_ladder
New()
//pick a random temple to link to
var/list/waypoints = list()
for(var/obj/effect/landmark/temple/destination/T in landmarks_list)
waypoints.Add(T)
if(!T)
return
else continue
var/obj/effect/landmark/temple/destination/dest_temple = pick(waypoints)
dest_temple.init()
//connect this landmark to the other
my_ladder = new /obj/structure/ladder(src.loc)
my_ladder.id = dest_temple.my_ladder.id
dest_temple.my_ladder.up = my_ladder
//delete the landmarks now that we're finished
del(dest_temple)
del(src)
/obj/effect/landmark/temple/destination/New()
//nothing
/obj/effect/landmark/temple/destination/proc/init()
my_ladder = new /obj/structure/ladder(src.loc)
my_ladder.id = rand(999)
my_ladder.height = -1
//loop over the walls in the temple and make them a random pre-chosen mineral (null is a stand in for plasma, which the walls already are)
//treat plasma slightly differently because it's the default wall type
var/mineral = pick("uranium","sandstone","gold","iron","silver","diamond","clown","plasma")
//world << "init [mineral]"
var/area/my_area = get_area(src)
var/list/temple_turfs = get_area_turfs(my_area.type)
for(var/turf/simulated/floor/T in temple_turfs)
for(var/obj/effect/landmark/falsewall_spawner/F in T.contents)
var/obj/structure/temple_falsewall/fwall = new(F.loc)
fwall.mineral = mineral
if(mineral == "iron")
fwall.is_metal = 1
del(F)
for(var/obj/effect/landmark/door_spawner/D in T.contents)
var/spawn_type
if(mineral == "iron")
spawn_type = text2path("/obj/machinery/door/airlock/vault")
else
spawn_type = text2path("/obj/machinery/door/airlock/[mineral]")
new spawn_type(D.loc)
del(D)
for(var/turf/unsimulated/wall/T in temple_turfs)
if(mineral != "plasma")
T.icon_state = replacetext(T.icon_state, "plasma", mineral)
/*for(var/obj/effect/landmark/falsewall_spawner/F in T.contents)
//world << "falsewall_spawner found in wall"
var/obj/structure/temple_falsewall/fwall = new(F.loc)
fwall.mineral = mineral
del(F)
for(var/obj/effect/landmark/door_spawner/D in T.contents)
//world << "door_spawner found in wall"
T = new /turf/unsimulated/floor(T.loc)
T.icon_state = "dark"
var/spawn_type = text2path("/obj/machinery/door/airlock/[door_mineral]")
new spawn_type(T)
del(D)*/
//a shuttle has crashed somewhere on the map, it should have a power cell to let the adventurers get home
/area/jungle/crash_ship_source
icon_state = "crash"
/area/jungle/crash_ship_clean
icon_state = "crash"
/area/jungle/crash_ship_one
icon_state = "crash"
/area/jungle/crash_ship_two
icon_state = "crash"
/area/jungle/crash_ship_three
icon_state = "crash"
/area/jungle/crash_ship_four
icon_state = "crash"
//randomly spawns, will create rivers around the map
//uses the same logic as jungle paths
/obj/effect/landmark/river_waypoint
name = "river source waypoint"
var/connected = 0
/obj/machinery/jungle_controller
name = "jungle controller"
desc = "a mysterious and ancient piece of machinery"
var/list/animal_spawners = list()
/obj/machinery/jungle_controller/initialize()
world << "\red \b Setting up jungle, this may take a bleeding eternity..."
//crash dat shuttle
var/area/start_location = locate(/area/jungle/crash_ship_source)
var/area/clean_location = locate(/area/jungle/crash_ship_clean)
var/list/ship_locations = list(/area/jungle/crash_ship_one, /area/jungle/crash_ship_two, /area/jungle/crash_ship_three, /area/jungle/crash_ship_four)
var/area/end_location = locate( pick(ship_locations) )
ship_locations -= end_location.type
start_location.move_contents_to(end_location)
for(var/area_type in ship_locations)
var/area/cur_location = locate(area_type)
clean_location.copy_turfs_to(cur_location)
//drop some random river nodes
var/list/river_nodes = list()
var/max = rand(1,3)
var/num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!istype(J))
continue
if(!J.bushes_spawn)
continue
river_nodes.Add(new /obj/effect/landmark/river_waypoint(J))
num_spawned++
//make some randomly pathing rivers
for(var/obj/effect/landmark/river_waypoint/W in landmarks_list)
if (W.z != src.z || W.connected)
continue
W.connected = 1
var/turf/cur_turf = new /turf/unsimulated/jungle/water(get_turf(W))
var/turf/target_turf = get_turf(pick(river_nodes))
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20))
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
var/skip = 0
if(!istype(cur_turf, /turf/unsimulated/jungle) || istype(cur_turf, /turf/unsimulated/jungle/rock))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
if(!skip)
var/turf/unsimulated/jungle/water/water_turf = new(cur_turf)
water_turf.Spread(75, rand(65, 25))
var/list/path_nodes = list()
//place some ladders leading down to pre-generated temples
max = rand(2,5)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/landmark/temple(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//put a native tribe somewhere
num_spawned = 0
while(num_spawned < 1)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/jungle_tribe_spawn(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//place some random path waypoints to confuse players
max = rand(1,3)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//get any path nodes placed on the map
for(var/obj/effect/landmark/path_waypoint/W in landmarks_list)
if (W.z == src.z)
path_nodes.Add(W)
//make random, connecting paths
for(var/obj/effect/landmark/path_waypoint/W in path_nodes)
if (W.connected)
continue
W.connected = 1
var/turf/cur_turf = get_turf(W)
path_nodes.Remove(W)
var/turf/target_turf = get_turf(pick(path_nodes))
path_nodes.Add(W)
//
cur_turf = new /turf/unsimulated/jungle/path(cur_turf)
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20) || get_dist(cur_turf, target_turf) < 5)
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20) && get_dist(cur_turf, target_turf) > 5)
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
//move a step forward
cur_turf = get_step(cur_turf, cur_dir)
//if we're not a jungle turf, get back to what we were doing
if(!istype(cur_turf, /turf/unsimulated/jungle/))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
var/turf/unsimulated/jungle/J = cur_turf
if(istype(J, /turf/unsimulated/jungle/impenetrable) || istype(J, /turf/unsimulated/jungle/water/deep))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
if(!istype(J, /turf/unsimulated/jungle/water))
J = new /turf/unsimulated/jungle/path(cur_turf)
J.Spread(PATH_SPREAD_CHANCE_START, rand(PATH_SPREAD_CHANCE_LOSS_UPPER, PATH_SPREAD_CHANCE_LOSS_LOWER))
//create monkey spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/monkey(J))
num_spawned++
//create panther spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/panther(J))
num_spawned++
//create snake spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/snake(J))
num_spawned++
//create parrot spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/parrot(J))
num_spawned++
#undef PATH_SPREAD_CHANCE_START
#undef PATH_SPREAD_CHANCE_LOSS_UPPER
#undef PATH_SPREAD_CHANCE_LOSS_LOWER
#undef RIVER_SPREAD_CHANCE_START
#undef RIVER_SPREAD_CHANCE_LOSS_UPPER
#undef RIVER_SPREAD_CHANCE_LOSS_LOWER
#undef RANDOM_UPPER_X
#undef RANDOM_UPPER_Y
#undef RANDOM_LOWER_X
#undef RANDOM_LOWER_Y
Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

@@ -0,0 +1,158 @@
//spawns one of the specified animal type
/obj/effect/landmark/animal_spawner
icon_state = "x3"
var/spawn_type
var/mob/living/spawned_animal
invisibility = 101
/obj/effect/landmark/animal_spawner/New()
if(!spawn_type)
var/new_type = pick(typesof(/obj/effect/landmark/animal_spawner) - /obj/effect/landmark/animal_spawner)
new new_type(get_turf(src))
del(src)
processing_objects.Add(src)
spawned_animal = new spawn_type(get_turf(src))
/obj/effect/landmark/animal_spawner/process()
//if any of our animals are killed, spawn new ones
if(!spawned_animal || spawned_animal.stat == DEAD)
spawned_animal = new spawn_type(src)
//after a random timeout, and in a random position (6-30 seconds)
spawn(rand(1200,2400))
spawned_animal.loc = locate(src.x + rand(-12,12), src.y + rand(-12,12), src.z)
/obj/effect/landmark/animal_spawner/Del()
processing_objects.Remove(src)
/obj/effect/landmark/animal_spawner/panther
name = "panther spawner"
spawn_type = /mob/living/simple_animal/hostile/panther
/obj/effect/landmark/animal_spawner/parrot
name = "parrot spawner"
spawn_type = /mob/living/simple_animal/parrot
/obj/effect/landmark/animal_spawner/monkey
name = "monkey spawner"
spawn_type = /mob/living/carbon/monkey
/obj/effect/landmark/animal_spawner/snake
name = "snake spawner"
spawn_type = /mob/living/simple_animal/hostile/snake
//*********//
// Panther //
//*********//
/mob/living/simple_animal/hostile/panther
name = "panther"
desc = "A long sleek, black cat with sharp teeth and claws."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "panther"
icon_living = "panther"
icon_dead = "panther_dead"
icon_gib = "panther_dead"
speak_chance = 0
turns_per_move = 3
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
stop_automated_movement_when_pulled = 0
maxHealth = 50
health = 50
harm_intent_damage = 8
melee_damage_lower = 15
melee_damage_upper = 15
attacktext = "slashes"
attack_sound = 'sound/weapons/bite.ogg'
layer = 3.1 //so they can stay hidde under the /obj/structure/bush
var/stalk_tick_delay = 3
/mob/living/simple_animal/hostile/panther/ListTargets()
var/list/targets = list()
for(var/mob/living/carbon/human/H in view(src, 10))
targets += H
return targets
/mob/living/simple_animal/hostile/panther/FindTarget()
. = ..()
if(.)
emote("nashes at [.]")
/mob/living/simple_animal/hostile/panther/AttackingTarget()
. =..()
var/mob/living/L = .
if(istype(L))
if(prob(15))
L.Weaken(3)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
/mob/living/simple_animal/hostile/panther/AttackTarget()
..()
if(stance == HOSTILE_STANCE_ATTACKING && get_dist(src, target_mob))
stalk_tick_delay -= 1
if(stalk_tick_delay <= 0)
src.loc = get_step_towards(src, target_mob)
stalk_tick_delay = 3
//*******//
// Snake //
//*******//
/mob/living/simple_animal/hostile/snake
name = "snake"
desc = "A sinuously coiled, venomous looking reptile."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "snake"
icon_living = "snake"
icon_dead = "snake_dead"
icon_gib = "snake_dead"
speak_chance = 0
turns_per_move = 1
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
stop_automated_movement_when_pulled = 0
maxHealth = 25
health = 25
harm_intent_damage = 2
melee_damage_lower = 3
melee_damage_upper = 10
attacktext = "bites"
attack_sound = 'sound/weapons/bite.ogg'
layer = 3.1 //so they can stay hidde under the /obj/structure/bush
var/stalk_tick_delay = 3
/mob/living/simple_animal/hostile/snake/ListTargets()
var/list/targets = list()
for(var/mob/living/carbon/human/H in view(src, 10))
targets += H
return targets
/mob/living/simple_animal/hostile/snake/FindTarget()
. = ..()
if(.)
emote("hisses wickedly")
/mob/living/simple_animal/hostile/snake/AttackingTarget()
. =..()
var/mob/living/L = .
if(istype(L))
L.apply_damage(rand(3,12), TOX)
/mob/living/simple_animal/hostile/snake/AttackTarget()
..()
if(stance == HOSTILE_STANCE_ATTACKING && get_dist(src, target_mob))
stalk_tick_delay -= 1
if(stalk_tick_delay <= 0)
src.loc = get_step_towards(src, target_mob)
stalk_tick_delay = 3
@@ -0,0 +1,120 @@
//*********************//
// Generic undergrowth //
//*********************//
/obj/structure/bush
name = "foliage"
desc = "Pretty thick scrub, it'll take something sharp and a lot of determination to clear away."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "bush1"
density = 1
anchored = 1
layer = 3.2
var/indestructable = 0
var/stump = 0
/obj/structure/bush/New()
if(prob(20))
opacity = 1
/obj/structure/bush/Bumped(M as mob)
if (istype(M, /mob/living/simple_animal))
var/mob/living/simple_animal/A = M
A.loc = get_turf(src)
else if (istype(M, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/A = M
A.loc = get_turf(src)
/obj/structure/bush/attackby(var/obj/I as obj, var/mob/user as mob)
//hatchets can clear away undergrowth
if(istype(I, /obj/item/weapon/hatchet) && !stump)
if(indestructable)
//this bush marks the edge of the map, you can't destroy it
user << "\red You flail away at the undergrowth, but it's too thick here."
else
user.visible_message("\red <b>[user] begins clearing away [src].</b>","\red <b>You begin clearing away [src].</b>")
spawn(rand(15,30))
if(get_dist(user,src) < 2)
user << "\blue You clear away [src]."
var/obj/item/stack/sheet/wood/W = new(src.loc)
W.amount = rand(3,15)
if(prob(50))
icon_state = "stump[rand(1,2)]"
name = "cleared foliage"
desc = "There used to be dense undergrowth here."
density = 0
stump = 1
pixel_x = rand(-6,6)
pixel_y = rand(-6,6)
else
del(src)
else
return ..()
//*******************************//
// Strange, fruit-bearing plants //
//*******************************//
var/list/fruit_icon_states = list("badrecipe","kudzupod","reishi","lime","grapes","boiledrorocore","chocolateegg")
var/list/reagent_effects = list("toxin","anti_toxin","stoxin","space_drugs","mindbreaker","zombiepowder","impedrezene")
var/jungle_plants_init = 0
/proc/init_jungle_plants()
jungle_plants_init = 1
fruit_icon_states = shuffle(fruit_icon_states)
reagent_effects = shuffle(reagent_effects)
/obj/item/weapon/reagent_containers/food/snacks/grown/jungle_fruit
seed = ""
name = "jungle fruit"
desc = "It smells weird and looks off."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "orange"
potency = 1
/obj/structure/jungle_plant
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "plant1"
desc = "Looks like some of that fruit might be edible."
var/fruits_left = 3
var/fruit_type = -1
var/icon/fruit_overlay
var/plant_strength = 1
var/fruit_r
var/fruit_g
var/fruit_b
/obj/structure/jungle_plant/New()
if(!jungle_plants_init)
init_jungle_plants()
fruit_type = rand(1,7)
icon_state = "plant[fruit_type]"
fruits_left = rand(1,5)
fruit_overlay = icon('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"fruit[fruits_left]")
fruit_r = 255 - fruit_type * 36
fruit_g = rand(1,255)
fruit_b = fruit_type * 36
fruit_overlay.Blend(rgb(fruit_r, fruit_g, fruit_b), ICON_ADD)
overlays += fruit_overlay
plant_strength = rand(20,200)
/obj/structure/jungle_plant/attack_hand(var/mob/user as mob)
if(fruits_left > 0)
fruits_left--
user << "\blue You pick a fruit off [src]."
var/obj/item/weapon/reagent_containers/food/snacks/grown/jungle_fruit/J = new (src.loc)
J.potency = plant_strength
J.icon_state = fruit_icon_states[fruit_type]
J.reagents.add_reagent(reagent_effects[fruit_type], 1+round((plant_strength / 20), 1))
J.bitesize = 1+round(J.reagents.total_volume / 2, 1)
J.attack_hand(user)
overlays -= fruit_overlay
fruit_overlay = icon('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"fruit[fruits_left]")
fruit_overlay.Blend(rgb(fruit_r, fruit_g, fruit_b), ICON_ADD)
overlays += fruit_overlay
else
user << "\red There are no fruit left on [src]."
@@ -0,0 +1,401 @@
//randomly generated temples, indiana jones style (minus the cultists, probably)
/area/jungle/temple_one
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple1"
/area/jungle/temple_two
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple2"
/area/jungle/temple_three
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple3"
/area/jungle/temple_four
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple4"
/area/jungle/temple_five
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple5"
/area/jungle/temple_six
name = "temple"
lighting_use_dynamic = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "temple6"
/obj/effect/landmark/door_spawner
name = "door spawner"
//******//
// Loot //
//******//
/obj/effect/landmark/glowshroom_spawn
icon_state = "x3"
invisibility = 101
New()
if(prob(10))
new /obj/effect/glowshroom(src.loc)
del(src)
/obj/effect/landmark/loot_spawn
name = "loot spawner"
icon_state = "grabbed1"
var/low_probability = 0
New()
switch(pick( \
low_probability * 1000;"nothing", \
200 - low_probability * 175;"treasure", \
25 + low_probability * 75;"remains", \
25 + low_probability * 75;"plants", \
5; "blob", \
50 + low_probability * 50;"clothes", \
"glasses", \
100 - low_probability * 50;"weapons", \
100 - low_probability * 50;"spacesuit", \
"health", \
25 + low_probability * 75;"snacks", \
25;"alien", \
"lights", \
25 - low_probability * 25;"engineering", \
25 - low_probability * 25;"coffin", \
25;"mimic", \
25;"viscerator", \
))
if("treasure")
var/obj/structure/closet/crate/C = new(src.loc)
if(prob(33))
//coins
var/amount = rand(2,6)
var/list/possible_spawns = list()
for(var/coin_type in typesof(/obj/item/weapon/coin))
possible_spawns += coin_type
//no icon_state for mythril coins
possible_spawns -= /obj/item/weapon/coin/mythril
var/coin_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
new coin_type(C)
else if(prob(50))
//bars
var/amount = rand(2,6)
var/quantity = rand(10,50)
var/list/possible_spawns = list()
for(var/bar_type in typesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral - /obj/item/stack/sheet/mineral/enruranium)
possible_spawns += bar_type
var/bar_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
var/obj/item/stack/sheet/mineral/M = new bar_type(C)
M.amount = quantity
else
//credits
var/amount = rand(2,6)
var/list/possible_spawns = list()
for(var/cash_type in typesof(/obj/item/stack/sheet/mineral))
possible_spawns += cash_type
var/cash_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
new cash_type(C)
if("remains")
if(prob(50))
new /obj/effect/decal/remains/human(src.loc)
else
new /obj/effect/decal/remains/xeno(src.loc)
if("plants")
if(prob(25))
new /obj/effect/glowshroom(src.loc)
else if(prob(33))
new /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap(src.loc)
else if(prob(50))
new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris(src.loc)
if("blob")
new /obj/effect/blob/core(src.loc)
if("clothes")
var/obj/structure/closet/C = new(src.loc)
C.icon_state = "blue"
C.icon_closed = "blue"
if(prob(33))
new /obj/item/clothing/under/rainbow(C)
new /obj/item/clothing/shoes/rainbow(C)
new /obj/item/clothing/head/soft/rainbow(C)
new /obj/item/clothing/gloves/rainbow(C)
else if(prob(50))
new /obj/item/clothing/under/psyche(C)
else
new /obj/item/clothing/under/syndicate/combat(C)
new /obj/item/clothing/shoes/swat(C)
new /obj/item/clothing/gloves/swat(C)
new /obj/item/clothing/mask/balaclava(C)
if("glasses")
var/obj/structure/closet/C = new(src.loc)
var/new_type = pick(
/obj/item/clothing/glasses/material, \
/obj/item/clothing/glasses/thermal, \
/obj/item/clothing/glasses/meson, \
/obj/item/clothing/glasses/night, \
/obj/item/clothing/glasses/hud/health, \
/obj/item/clothing/glasses/hud/health \
)
new new_type(C)
if("weapons")
var/obj/structure/closet/crate/secure/weapon/C = new(src.loc)
var/new_type = pick(
200; /obj/item/weapon/hatchet, \
/obj/item/weapon/gun/projectile/pistol, \
/obj/item/weapon/gun/projectile/deagle, \
/obj/item/weapon/gun/projectile/russian, \
)
new new_type(C)
if("spacesuit")
var/obj/structure/closet/syndicate/C = new(src.loc)
if(prob(25))
new /obj/item/clothing/suit/space/syndicate/black(C)
new /obj/item/clothing/head/helmet/space/syndicate/black(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else if(prob(33))
new /obj/item/clothing/suit/space/syndicate/blue(C)
new /obj/item/clothing/head/helmet/space/syndicate/blue(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else if(prob(50))
new /obj/item/clothing/suit/space/syndicate/green(C)
new /obj/item/clothing/head/helmet/space/syndicate/green(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else
new /obj/item/clothing/suit/space/syndicate/orange(C)
new /obj/item/clothing/head/helmet/space/syndicate/orange(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
if("health")
//hopefully won't be necessary, but there were an awful lot of traps to get through...
var/obj/structure/closet/crate/medical/C = new(src.loc)
if(prob(50))
new /obj/item/weapon/storage/firstaid/regular(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/fire(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/o2(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/toxin(C)
if("snacks")
//you're come so far, you must be in need of refreshment
var/obj/structure/closet/crate/freezer/C = new(src.loc)
var/num = rand(2,6)
var/new_type = pick(
/obj/item/weapon/reagent_containers/food/drinks/cans/beer, \
/obj/item/weapon/reagent_containers/food/drinks/tea, \
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen, \
/obj/item/weapon/reagent_containers/food/snacks/candiedapple, \
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar, \
/obj/item/weapon/reagent_containers/food/snacks/cookie, \
/obj/item/weapon/reagent_containers/food/snacks/faggot, \
/obj/item/weapon/reagent_containers/food/snacks/plump_pie, \
)
for(var/i=0,i<num,i++)
new new_type(C)
if("alien")
//ancient aliens
var/obj/structure/closet/acloset/C = new(src.loc)
if(prob(33))
//facehuggers
var/num = rand(1,3)
for(var/i=0,i<num,i++)
new /obj/item/clothing/mask/facehugger(C)
/*else if(prob(50))
//something else very much alive and angry
var/spawn_type = pick(/mob/living/simple_animal/hostile/alien, /mob/living/simple_animal/hostile/alien/drone, /mob/living/simple_animal/hostile/alien/sentinel)
new spawn_type(C)*/
//33% chance of nothing
if("lights")
//flares, candles, matches
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
var/num = rand(2,6)
for(var/i=0,i<num,i++)
var/spawn_type = pick(/obj/item/device/flashlight/flare, /obj/item/trash/candle, /obj/item/candle/, /obj/item/weapon/storage/box/matches)
new spawn_type(C)
if("engineering")
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
//chance to have any combination of up to two electrical/mechanical toolboxes and one cell
if(prob(33))
new /obj/item/weapon/storage/toolbox/electrical(C)
else if(prob(50))
new /obj/item/weapon/storage/toolbox/mechanical(C)
if(prob(33))
new /obj/item/weapon/storage/toolbox/mechanical(C)
else if(prob(50))
new /obj/item/weapon/storage/toolbox/electrical(C)
if(prob(25))
new /obj/item/weapon/cell(C)
if("coffin")
new /obj/structure/closet/coffin(src.loc)
if(prob(33))
new /obj/effect/decal/remains/human(src)
else if(prob(50))
new /obj/effect/decal/remains/xeno(src)
/*if("mimic")
//a guardian of the tomb!
new /mob/living/simple_animal/hostile/mimic/crate(src.loc)*/
if("viscerator")
//more tomb guardians!
var/num = rand(1,3)
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
for(var/i=0,i<num,i++)
new /mob/living/simple_animal/hostile/viscerator(C)
del(src)
/obj/effect/landmark/loot_spawn/low
name = "low prob loot spawner"
icon_state = "grabbed"
low_probability = 1
//********//
// Traps! //
//********//
/obj/effect/step_trigger/trap
name = "trap"
icon = 'code/workinprogress/cael_aislinn/jungle/jungle.dmi'
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "trap"
var/trap_type
New()
trap_type = pick(50;"thrower","sawburst","poison_dart","flame_burst",10;"plasma_gas",5;"n2_gas")
if( (trap_type == "plasma_gas" || trap_type == "n2_gas") && prob(10))
new /obj/effect/glowshroom(src.loc)
//hint that this tile is dangerous
if(prob(90))
var/turf/T = get_turf(src)
T.desc = pick("There is a faint sheen of moisture over the top.","It looks a little unstable.","Something doesn't seem right.")
/obj/effect/step_trigger/trap/Trigger(var/atom/A)
var/mob/living/M = A
if(!istype(M))
return
switch(trap_type)
if("sawburst")
M << "\red <b>A sawblade shoots out of the ground and strikes you!</b>"
M.apply_damage(rand(5,10), BRUTE)
var/atom/myloc = src.loc
var/image/flicker = image('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"sawblade")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del(flicker)
//flick("sawblade",src)
if("poison_dart")
M << "\red <b>You feel something small and sharp strike you!</b>"
M.apply_damage(rand(5,10), TOX)
var/atom/myloc = src.loc
var/image/flicker = image('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"dart[rand(1,3)]")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del(flicker)
//flick("dart[rand(1,3)]",src)
if("flame_burst")
M << "\red <b>A jet of fire comes out of nowhere!</b>"
M.apply_damage(rand(5,10), BURN)
var/atom/myloc = src.loc
var/image/flicker = image('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"flameburst")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del flicker
//flick("flameburst",src)
if("plasma_gas")
//spawn a bunch of plasma
if("n2_gas")
//spawn a bunch of sleeping gas
if("thrower")
//edited version of obj/effect/step_trigger/thrower
var/throw_dir = pick(1,2,4,8)
M.visible_message("\red <b>The floor under [M] suddenly tips upward!</b>","\red <b>The floor tips upward under you!</b>")
var/atom/myloc = src.loc
var/image/flicker = image('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"throw[throw_dir]")
myloc.overlays += flicker
var/turf/my_turf = get_turf(loc)
if(!my_turf.density)
my_turf.density = 1
spawn(8)
my_turf.density = 0
spawn(8)
myloc.overlays -= flicker
del(flicker)
var/dist = rand(1,5)
var/curtiles = 0
while(M)
if(curtiles >= dist)
break
if(M.z != src.z)
break
curtiles++
sleep(1)
var/predir = M.dir
step(M, throw_dir)
M.dir = predir
//gives turf a different description, to try and trick players
/obj/effect/step_trigger/trap/fake
icon_state = "faketrap"
name = "fake trap"
New()
if(prob(10))
new /obj/effect/glowshroom(src.loc)
if(prob(90))
var/turf/T = get_turf(src)
T.desc = pick("It looks a little dustier than the surrounding tiles.","It is somewhat ornate.","It looks a little darker than the surrounding tiles.")
del(src)
//50% chance of being a trap
/obj/effect/step_trigger/trap/fifty
icon_state = "trap"
name = "fifty fifty trap"
icon_state = "fiftytrap"
New()
if(prob(50))
..()
else
if(prob(10))
new /obj/effect/glowshroom(src.loc)
del(src)
@@ -0,0 +1,91 @@
/obj/item/projectile/jungle_spear
damage = 10
damage_type = TOX
icon_state = "bullet"
/obj/effect/jungle_tribe_spawn
name = "campfire"
desc = "Looks cosy, in an alien sort of way."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "campfire"
anchored = 1
var/list/tribesmen = list()
var/list/enemy_players = list()
var/tribe_type = 1
/obj/effect/jungle_tribe_spawn/New()
processing_objects.Add(src)
tribe_type = rand(1,5)
var/num_tribesmen = rand(3,6)
for(var/i=0,i<num_tribesmen,i++)
var/mob/living/simple_animal/hostile/tribesman/T = new(src.loc)
T.my_type = tribe_type
T.x += rand(-6,6)
T.y += rand(-6,6)
tribesmen += T
/obj/effect/jungle_tribe_spawn/Del()
processing_objects.Remove(src)
/obj/effect/jungle_tribe_spawn/process()
set background = 1
for(var/mob/living/simple_animal/hostile/tribesman/T in tribesmen)
if(T.stat == DEAD)
tribesmen.Remove(T)
spawn(rand(50,300))
var/mob/living/simple_animal/hostile/tribesman/B = new(src.loc)
B.my_type = tribe_type
B.x += rand(-4,4)
B.y += rand(-4,4)
tribesmen += B
/mob/living/simple_animal/hostile/tribesman
name = "tribesman"
desc = "A noble savage, doesn't seem to know what to make of you."
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "native1"
icon_living = "native1"
icon_dead = "native1_dead"
speak_chance = 25
speak = list("Rong a'hu dong'a sik?","Ahi set mep'a teth.","Ohen nek'ti ep esi.")
speak_emote = list("chatters")
emote_hear = list("chatters to themselves","chatters away at something","whistles")
emote_see = list("bends down to examine something")
melee_damage_lower = 5
melee_damage_upper = 15
turns_per_move = 1
stop_automated_movement_when_pulled = 0
var/my_type = 1
/mob/living/simple_animal/hostile/tribesman/New()
if(prob(33))
ranged = 1
spawn(8)
icon_state = "native[my_type]"
icon_living = "native[my_type]"
icon_dead = "native[my_type]_dead"
/mob/living/simple_animal/hostile/tribesman/ListTargets()
var/list/targets = list()
for(var/mob/living/simple_animal/hostile/H in view(src, 10))
if(istype(H, /mob/living/simple_animal/hostile/tribesman))
continue
targets += H
return targets
/mob/living/simple_animal/hostile/tribesman/FindTarget()
. = ..()
if(.)
emote("waves a spear at [.]")
/mob/living/simple_animal/hostile/tribesman/OpenFire(target_mob)
visible_message("\red <b>[src]</b> throws a spear at [target_mob]!", 1)
flick(src, "native[my_type]_act")
var/tturf = get_turf(target_mob)
Shoot(tturf, src.loc, src)
@@ -0,0 +1,178 @@
/turf/unsimulated/jungle
var/bushes_spawn = 1
var/plants_spawn = 1
name = "wet grass"
desc = "Thick, long wet grass"
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "grass1"
var/icon_spawn_state = "grass1"
luminosity = 3
New()
icon_state = icon_spawn_state
if(plants_spawn && prob(40))
if(prob(90))
var/image/I
if(prob(35))
I = image('code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi',"plant[rand(1,7)]")
else
if(prob(30))
I = image('icons/obj/flora/ausflora.dmi',"reedbush_[rand(1,4)]")
else if(prob(33))
I = image('icons/obj/flora/ausflora.dmi',"leafybush_[rand(1,3)]")
else if(prob(50))
I = image('icons/obj/flora/ausflora.dmi',"fernybush_[rand(1,3)]")
else
I = image('icons/obj/flora/ausflora.dmi',"stalkybush_[rand(1,3)]")
I.pixel_x = rand(-6,6)
I.pixel_y = rand(-6,6)
overlays += I
else
var/obj/structure/jungle_plant/J = new(src)
J.pixel_x = rand(-6,6)
J.pixel_y = rand(-6,6)
if(bushes_spawn && prob(90))
new /obj/structure/bush(src)
/turf/unsimulated/jungle/clear
bushes_spawn = 0
plants_spawn = 0
icon_state = "grass_clear"
icon_spawn_state = "grass3"
/turf/unsimulated/jungle/path
bushes_spawn = 0
name = "wet grass"
desc = "thick, long wet grass"
icon = 'code/WorkInProgress/Cael_Aislinn/Jungle/jungle.dmi'
icon_state = "grass_path"
icon_spawn_state = "grass2"
New()
..()
for(var/obj/structure/bush/B in src)
del B
/turf/unsimulated/jungle/proc/Spread(var/probability, var/prob_loss = 50)
if(probability <= 0)
return
//world << "\blue Spread([probability])"
for(var/turf/unsimulated/jungle/J in orange(1, src))
if(!J.bushes_spawn)
continue
var/turf/unsimulated/jungle/P = null
if(J.type == src.type)
P = J
else
P = new src.type(J)
if(P && prob(probability))
P.Spread(probability - prob_loss)
/turf/unsimulated/jungle/impenetrable
bushes_spawn = 0
icon_state = "grass_impenetrable"
icon_spawn_state = "grass1"
New()
..()
var/obj/structure/bush/B = new(src)
B.indestructable = 1
//copy paste from asteroid mineral turfs
/turf/unsimulated/jungle/rock
bushes_spawn = 0
plants_spawn = 0
density = 1
name = "rock wall"
icon = 'icons/turf/walls.dmi'
icon_state = "rock"
icon_spawn_state = "rock"
/turf/unsimulated/jungle/rock/New()
spawn(1)
var/turf/T
if(!istype(get_step(src, NORTH), /turf/unsimulated/jungle/rock) && !istype(get_step(src, NORTH), /turf/unsimulated/wall))
T = get_step(src, NORTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_s")
if(!istype(get_step(src, SOUTH), /turf/unsimulated/jungle/rock) && !istype(get_step(src, SOUTH), /turf/unsimulated/wall))
T = get_step(src, SOUTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_n", layer=6)
if(!istype(get_step(src, EAST), /turf/unsimulated/jungle/rock) && !istype(get_step(src, EAST), /turf/unsimulated/wall))
T = get_step(src, EAST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=6)
if(!istype(get_step(src, WEST), /turf/unsimulated/jungle/rock) && !istype(get_step(src, WEST), /turf/unsimulated/wall))
T = get_step(src, WEST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
/turf/unsimulated/jungle/water
bushes_spawn = 0
name = "murky water"
desc = "thick, murky water"
icon = 'icons/misc/beach.dmi'
icon_state = "water"
icon_spawn_state = "water"
/turf/unsimulated/jungle/water/New()
..()
for(var/obj/structure/bush/B in src)
del(B)
/turf/unsimulated/jungle/water/Entered(atom/movable/O)
..()
if(istype(O, /mob/living/))
var/mob/living/M = O
//slip in the murky water if we try to run through it
if(prob(10 + (M.m_intent == "run" ? 40 : 0)))
M << pick("\blue You slip on something slimy.","\blue You fall over into the murk.")
M.Stun(2)
M.Weaken(1)
//piranhas - 25% chance to be an omnipresent risk, although they do practically no damage
if(prob(25))
M << "\blue You feel something slithering around your legs."
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
/turf/unsimulated/jungle/water/deep
plants_spawn = 0
density = 1
icon_state = "water2"
icon_spawn_state = "water2"
/turf/unsimulated/jungle/temple_wall
name = "temple wall"
desc = ""
density = 1
icon = 'icons/turf/walls.dmi'
icon_state = "plasma0"
var/mineral = "plasma"
@@ -0,0 +1,122 @@
//put this here because i needed specific functionality, and i wanted to avoid the hassle of getting it onto svn
/area/proc/copy_turfs_to(var/area/A , var/platingRequired = 0 )
//Takes: Area. Optional: If it should copy to areas that don't have plating
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
// Movement based on lower left corner. Tiles that do not fit
// into the new area will not be moved.
if(!A || !src) return 0
var/list/turfs_src = get_area_turfs(src.type)
var/list/turfs_trg = get_area_turfs(A.type)
var/src_min_x = 0
var/src_min_y = 0
for (var/turf/T in turfs_src)
if(T.x < src_min_x || !src_min_x) src_min_x = T.x
if(T.y < src_min_y || !src_min_y) src_min_y = T.y
var/trg_min_x = 0
var/trg_min_y = 0
for (var/turf/T in turfs_trg)
if(T.x < trg_min_x || !trg_min_x) trg_min_x = T.x
if(T.y < trg_min_y || !trg_min_y) trg_min_y = T.y
var/list/refined_src = new/list()
for(var/turf/T in turfs_src)
refined_src += T
refined_src[T] = new/datum/coords
var/datum/coords/C = refined_src[T]
C.x_pos = (T.x - src_min_x)
C.y_pos = (T.y - src_min_y)
var/list/refined_trg = new/list()
for(var/turf/T in turfs_trg)
refined_trg += T
refined_trg[T] = new/datum/coords
var/datum/coords/C = refined_trg[T]
C.x_pos = (T.x - trg_min_x)
C.y_pos = (T.y - trg_min_y)
var/list/toupdate = new/list()
var/copiedobjs = list()
moving:
for (var/turf/T in refined_src)
var/datum/coords/C_src = refined_src[T]
for (var/turf/B in refined_trg)
var/datum/coords/C_trg = refined_trg[B]
if(C_src.x_pos == C_trg.x_pos && C_src.y_pos == C_trg.y_pos)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
if(platingRequired)
if(istype(B, /turf/space))
continue moving
var/turf/X = new T.type(B)
X.dir = old_dir1
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
var/list/mobs = new/list()
var/list/newmobs = new/list()
for(var/mob/M in T)
if(!istype(M,/mob) || istype(M, /mob/aiEye)) continue // If we need to check for more mobs, I'll add a variable
mobs += M
for(var/mob/M in mobs)
newmobs += DuplicateObject(M , 1)
for(var/mob/M in newmobs)
M.loc = X
for(var/V in T.vars)
if(!(V in list("type","loc","locs","vars", "parent", "parent_type","verbs","ckey","key","x","y","z","contents", "luminosity")))
X.vars[V] = T.vars[V]
// var/area/AR = X.loc
// if(AR.lighting_use_dynamic)
// X.opacity = !X.opacity
// X.sd_SetOpacity(!X.opacity) //TODO: rewrite this code so it's not messed by lighting ~Carn
toupdate += X
refined_src -= T
refined_trg -= B
continue moving
/*var/list/doors = new/list()
if(toupdate.len)
for(var/turf/simulated/T1 in toupdate)
for(var/obj/machinery/door/D2 in T1)
doors += D2
if(T1.parent)
air_master.groups_to_rebuild += T1.parent
else
air_master.tiles_to_update += T1
for(var/obj/O in doors)
O:update_nearby_tiles(1)*/
return copiedobjs
@@ -0,0 +1,78 @@
//reactor areas
/area/engine
icon_state = "engine"
fore
name = "\improper Fore"
construction_storage
name = "\improper Construction storage"
atmos_storage
name = "\improper Atmos storage"
icon_state = "engine_storage"
control
name = "\improper Control"
icon_state = "engine_control"
electrical_storage
name = "\improper Electrical storage"
engine_monitoring
name = "\improper Electrical storage"
icon_state = "engine_monitoring"
reactor_core
name = "\improper Reactor Core"
//icon_state = "engine_core"
reactor_gas
name = "Reactor Gas Storage"
//icon_state = "engine_atmos"
aux_control
name = "Reactor Auxiliary Control"
//icon_state = "engine_aux"
turbine_control
name = "Turbine Control"
//icon_state = "engine_turbine"
reactor_airlock
name = "\improper Reactor Primary Entrance"
//icon_state = "engine_airlock"
reactor_fuel_storage
name = "Reactor Fuel Storage"
//icon_state = "engine_fuel"
reactor_fuel_ports
name = "\improper Reactor Fuel Ports"
//icon_state = "engine_port"
generators
name = "\improper Generator Room"
//icon_state = "engine_generators"
port_gyro_bay
name = "\improper Port Gyrotron Bay"
//icon_state = "engine_starboardgyro"
starboard_gyro_bay
name = "\improper Starboard Gyrotron Bay"
//icon_state = "engine_portgyro"
storage
name = "\improper Engineering Storage"
icon_state = "engine_storage"
storage_hard
name = "\improper Engineering Hard Storage"
icon_state = "engine_storage"
hallway
name = "\improper Engineering storage"
icon_state = "engine_hallway"
@@ -0,0 +1,120 @@
//////////////////////////////////////
// RUST Core Control computer
/obj/item/weapon/circuitboard/rust_core_control
name = "Circuit board (RUST core controller)"
build_path = "/obj/machinery/computer/rust_core_control"
origin_tech = "programming=4;engineering=4"
datum/design/rust_core_control
name = "Circuit Design (RUST core controller)"
desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine."
id = "rust_core_control"
req_tech = list("programming" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20)
build_path = "/obj/item/weapon/circuitboard/rust_core_control"
//////////////////////////////////////
// RUST Fuel Control computer
/obj/item/weapon/circuitboard/rust_fuel_control
name = "Circuit board (RUST fuel controller)"
build_path = "/obj/machinery/computer/rust_fuel_control"
origin_tech = "programming=4;engineering=4"
datum/design/rust_fuel_control
name = "Circuit Design (RUST fuel controller)"
desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine."
id = "rust_fuel_control"
req_tech = list("programming" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20)
build_path = "/obj/item/weapon/circuitboard/rust_fuel_control"
//////////////////////////////////////
// RUST Fuel Port board
/obj/item/weapon/module/rust_fuel_port
name = "Internal circuitry (RUST fuel port)"
icon_state = "card_mod"
origin_tech = "engineering=4;materials=5"
datum/design/rust_fuel_port
name = "Internal circuitry (RUST fuel port)"
desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine."
id = "rust_fuel_port"
req_tech = list("engineering" = 4, "materials" = 5)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$uranium" = 3000)
build_path = "/obj/item/weapon/module/rust_fuel_port"
//////////////////////////////////////
// RUST Fuel Compressor board
/obj/item/weapon/module/rust_fuel_compressor
name = "Internal circuitry (RUST fuel compressor)"
icon_state = "card_mod"
origin_tech = "materials=6;plasmatech=4"
datum/design/rust_fuel_compressor
name = "Circuit Design (RUST fuel compressor)"
desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine."
id = "rust_fuel_compressor"
req_tech = list("materials" = 6, "plasmatech" = 4)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000)
build_path = "/obj/item/weapon/module/rust_fuel_compressor"
//////////////////////////////////////
// RUST Tokamak Core board
/obj/item/weapon/circuitboard/rust_core
name = "Internal circuitry (RUST tokamak core)"
build_path = "/obj/machinery/power/rust_core"
board_type = "machine"
origin_tech = "bluespace=3;plasmatech=4;magnets=5;powerstorage=6"
frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/micro_laser/ultra" = 1,
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 5)
datum/design/rust_core
name = "Internal circuitry (RUST tokamak core)"
desc = "The circuit board that for a RUST-pattern tokamak fusion core."
id = "pacman"
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, powerstorage = 6)
build_type = IMPRINTER
reliability_base = 79
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000)
build_path = "/obj/item/weapon/circuitboard/rust_core"
//////////////////////////////////////
// RUST Fuel Injector board
/obj/item/weapon/circuitboard/rust_injector
name = "Internal circuitry (RUST fuel injector)"
build_path = "/obj/machinery/power/rust_fuel_injector"
board_type = "machine"
origin_tech = "powerstorage=3;engineering=4;plasmatech=4;materials=6"
frame_desc = "Requires 2 Pico Manipulators, 1 Phasic Scanning Module, 1 Super Matter Bin, 1 Console Screen and 5 Pieces of Cable."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/scanning_module/phasic" = 1,
"/obj/item/weapon/stock_parts/matter_bin/super" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 5)
datum/design/rust_injector
name = "Internal circuitry (RUST tokamak core)"
desc = "The circuit board that for a RUST-pattern particle accelerator."
id = "pacman"
req_tech = list(powerstorage = 3, engineering = 4, plasmatech = 4, materials = 6)
build_type = IMPRINTER
reliability_base = 79
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$uranium" = 2000)
build_path = "/obj/item/weapon/circuitboard/rust_core"
@@ -0,0 +1,143 @@
/obj/machinery/computer/rust_core_control
name = "RUST Core Control"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "core_control"
var/list/connected_devices = list()
var/id_tag = "allan remember to update this before you leave"
var/scan_range = 25
//currently viewed
var/obj/machinery/power/rust_core/cur_viewed_device
/obj/machinery/computer/rust_core_control/process()
if(stat & (BROKEN|NOPOWER))
return
/obj/machinery/computer/rust_core_control/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/computer/rust_core_control/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
/obj/machinery/computer/rust_core_control/interact(mob/user)
if(stat & BROKEN)
user.unset_machine()
user << browse(null, "window=core_control")
return
if (!istype(user, /mob/living/silicon) && (get_dist(src, user) > 1 ))
user.unset_machine()
user << browse(null, "window=core_control")
return
var/dat = ""
if(stat & NOPOWER)
dat += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<B>Reactor Core Primary Monitor</B><BR>"
if(cur_viewed_device && cur_viewed_device.stat & (BROKEN|NOPOWER))
cur_viewed_device = null
if(cur_viewed_device && !cur_viewed_device.remote_access_enabled)
cur_viewed_device = null
if(cur_viewed_device)
dat += "<b>Device tag:</b> [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]<br>"
dat += "<font color=blue>Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].</font><br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];toggle_active=1'>\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]</a><br>"
dat += "<b>Device [cur_viewed_device.anchored ? "secured" : "unsecured"].</b><br>"
dat += "<hr>"
dat += "<b>Field encumbrance:</b> [cur_viewed_device.owned_field ? 0 : "NA"]<br>"
dat += "<b>Field strength:</b> [cur_viewed_device.field_strength] Wm^3<br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1000'>\[----\]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-100'>\[--- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-10'>\[-- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1'>\[- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1'>\[+ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=10'>\[++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=100'>\[+++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1000'>\[++++\]</a><br>"
dat += "<b>Field frequency:</b> [cur_viewed_device.field_frequency] MHz<br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1000'>\[----\]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-100'>\[--- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-10'>\[-- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1'>\[- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1'>\[+ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=10'>\[++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=100'>\[+++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1000'>\[++++\]</a><br>"
var/power_stat = "Good"
if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage)
power_stat = "Insufficient"
else if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage * 2)
power_stat = "Check"
dat += "<b>Power status:</b> [power_stat]<br>"
else
dat += "<a href='?src=\ref[src];scan=1'>\[Refresh device list\]</a><br><br>"
if(connected_devices.len)
dat += "<table width='100%' border=1>"
dat += "<tr>"
dat += "<td><b>Device tag</b></td>"
dat += "<td></td>"
dat += "</tr>"
for(var/obj/machinery/power/rust_core/C in connected_devices)
if(!check_core_status(C))
connected_devices.Remove(C)
continue
dat += "<tr>"
dat += "<td>[C.id_tag]</td>"
dat += "<td><a href='?src=\ref[src];manage_individual=\ref[C]'>\[Manage\]</a></td>"
dat += "</tr>"
dat += "</table>"
else
dat += "No devices connected.<br>"
dat += "<hr>"
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> "
dat += "<a href='?src=\ref[src];close=1'>Close</a>"
user << browse(dat, "window=core_control;size=500x400")
onclose(user, "core_control")
user.set_machine(src)
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
..()
if( href_list["goto_scanlist"] )
cur_viewed_device = null
if( href_list["manage_individual"] )
cur_viewed_device = locate(href_list["manage_individual"])
if( href_list["scan"] )
connected_devices = list()
for(var/obj/machinery/power/rust_core/C in range(scan_range, src))
if(check_core_status(C))
connected_devices.Add(C)
if( href_list["startup"] )
if(cur_viewed_device)
cur_viewed_device.Startup()
if( href_list["shutdown"] )
if(cur_viewed_device)
cur_viewed_device.Shutdown()
if( href_list["close"] )
usr << browse(null, "window=core_control")
usr.unset_machine()
updateDialog()
/obj/machinery/computer/rust_core_control/proc/check_core_status(var/obj/machinery/power/rust_core/C)
if(!C)
return 0
if(C.stat & (BROKEN|NOPOWER) || !C.remote_access_enabled || !C.id_tag)
if(connected_devices.Find(C))
connected_devices.Remove(C)
return 0
return 1
@@ -0,0 +1,438 @@
//the em field is where the fun happens
/*
Deuterium-deuterium fusion : 40 x 10^7 K
Deuterium-tritium fusion: 4.5 x 10^7 K
*/
//#DEFINE MAX_STORED_ENERGY (held_plasma.toxins * held_plasma.toxins * SPECIFIC_HEAT_TOXIN)
/obj/effect/rust_em_field
name = "EM Field"
desc = "A coruscating, barely visible field of energy. It is shaped like a slightly flattened torus."
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "emfield_s1"
//
var/major_radius = 0 //longer radius in meters = field_strength * 0.21875, max = 8.75
var/minor_radius = 0 //shorter radius in meters = field_strength * 0.2125, max = 8.625
var/size = 1 //diameter in tiles
var/volume_covered = 0 //atmospheric volume covered
//
var/obj/machinery/power/rust_core/owned_core
var/list/dormant_reactant_quantities = new
//luminosity = 1
layer = 3.1
//
var/energy = 0
var/mega_energy = 0
var/radiation = 0
var/frequency = 1
var/field_strength = 0.01 //in teslas, max is 50T
var/obj/machinery/rust/rad_source/radiator
var/datum/gas_mixture/held_plasma = new
var/particle_catchers[13]
var/emp_overload = 0
/obj/effect/rust_em_field/New()
..()
//create radiator
for(var/obj/machinery/rust/rad_source/rad in range(0))
radiator = rad
if(!radiator)
radiator = new()
//make sure there's a field generator
for(var/obj/machinery/power/rust_core/core in loc)
owned_core = core
if(!owned_core)
del(src)
//create the gimmicky things to handle field collisions
var/obj/effect/rust_particle_catcher/catcher
//
catcher = new (locate(src.x,src.y,src.z))
catcher.parent = src
catcher.SetSize(1)
particle_catchers.Add(catcher)
//
catcher = new (locate(src.x-1,src.y,src.z))
catcher.parent = src
catcher.SetSize(3)
particle_catchers.Add(catcher)
catcher = new (locate(src.x+1,src.y,src.z))
catcher.parent = src
catcher.SetSize(3)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y+1,src.z))
catcher.parent = src
catcher.SetSize(3)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y-1,src.z))
catcher.parent = src
catcher.SetSize(3)
particle_catchers.Add(catcher)
//
catcher = new (locate(src.x-2,src.y,src.z))
catcher.parent = src
catcher.SetSize(5)
particle_catchers.Add(catcher)
catcher = new (locate(src.x+2,src.y,src.z))
catcher.parent = src
catcher.SetSize(5)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y+2,src.z))
catcher.parent = src
catcher.SetSize(5)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y-2,src.z))
catcher.parent = src
catcher.SetSize(5)
particle_catchers.Add(catcher)
//
catcher = new (locate(src.x-3,src.y,src.z))
catcher.parent = src
catcher.SetSize(7)
particle_catchers.Add(catcher)
catcher = new (locate(src.x+3,src.y,src.z))
catcher.parent = src
catcher.SetSize(7)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y+3,src.z))
catcher.parent = src
catcher.SetSize(7)
particle_catchers.Add(catcher)
catcher = new (locate(src.x,src.y-3,src.z))
catcher.parent = src
catcher.SetSize(7)
particle_catchers.Add(catcher)
//init values
major_radius = field_strength * 0.21875// max = 8.75
minor_radius = field_strength * 0.2125// max = 8.625
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000
processing_objects.Add(src)
/obj/effect/rust_em_field/process()
//make sure the field generator is still intact
if(!owned_core)
del(src)
//handle radiation
if(!radiator)
radiator = new /obj/machinery/rust/rad_source()
radiator.mega_energy += radiation
radiator.source_alive++
radiation = 0
//update values
var/transfer_ratio = field_strength / 50 //higher field strength will result in faster plasma aggregation
major_radius = field_strength * 0.21875// max = 8.75m
minor_radius = field_strength * 0.2125// max = 8.625m
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio //one tile = 2.5m*2.5m*2.5m
//add plasma from the surrounding environment
var/datum/gas_mixture/environment = loc.return_air()
//hack in some stuff to remove plasma from the air because SCIENCE
//the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field
//at minimum strength, 0.25% of the field volume is pulled in per update (?)
//have a max of 1000 moles suspended
if(held_plasma.toxins < transfer_ratio * 1000)
var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION)
//world << "\blue moles_covered: [moles_covered]"
//
var/datum/gas_mixture/gas_covered = environment.remove(moles_covered)
var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture()
//
plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio)
//world << "\blue[plasma_captured.toxins] moles of plasma captured"
plasma_captured.temperature = gas_covered.temperature
plasma_captured.update_values()
//
gas_covered.toxins -= plasma_captured.toxins
gas_covered.update_values()
//
held_plasma.merge(plasma_captured)
//
environment.merge(gas_covered)
//let the particles inside the field react
React()
//forcibly radiate any excess energy
/*var/energy_max = transfer_ratio * 100000
if(mega_energy > energy_max)
var/energy_lost = rand( 1.5 * (mega_energy - energy_max), 2.5 * (mega_energy - energy_max) )
mega_energy -= energy_lost
radiation += energy_lost*/
//change held plasma temp according to energy levels
//SPECIFIC_HEAT_TOXIN
if(mega_energy > 0 && held_plasma.toxins)
var/heat_capacity = held_plasma.heat_capacity()//200 * number of plasma moles
if(heat_capacity > 0.0003) //formerly MINIMUM_HEAT_CAPACITY
held_plasma.temperature = (heat_capacity + mega_energy * 35000)/heat_capacity
//if there is too much plasma in the field, lose some
/*if( held_plasma.toxins > (MOLES_CELLSTANDARD * 7) * (50 / field_strength) )
LosePlasma()*/
if(held_plasma.toxins > 1)
//lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually)
var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength))
//world << "lost [loss_ratio*100]% of held plasma"
//
var/datum/gas_mixture/plasma_lost = new
plasma_lost.temperature = held_plasma.temperature
//
plasma_lost.toxins = held_plasma.toxins * loss_ratio
//plasma_lost.update_values()
held_plasma.toxins -= held_plasma.toxins * loss_ratio
//held_plasma.update_values()
//
environment.merge(plasma_lost)
radiation += loss_ratio * mega_energy * 0.1
mega_energy -= loss_ratio * mega_energy * 0.1
else
held_plasma.toxins = 0
//held_plasma.update_values()
//handle some reactants formatting
for(var/reactant in dormant_reactant_quantities)
var/amount = dormant_reactant_quantities[reactant]
if(amount < 1)
dormant_reactant_quantities.Remove(reactant)
else if(amount >= 1000000)
var/radiate = rand(3 * amount / 4, amount / 4)
dormant_reactant_quantities[reactant] -= radiate
radiation += radiate
return 1
/obj/effect/rust_em_field/proc/ChangeFieldStrength(var/new_strength)
var/calc_size = 1
emp_overload = 0
if(new_strength <= 50)
calc_size = 1
else if(new_strength <= 200)
calc_size = 3
else if(new_strength <= 500)
calc_size = 5
else
calc_size = 7
if(new_strength > 900)
emp_overload = 1
//
field_strength = new_strength
change_size(calc_size)
/obj/effect/rust_em_field/proc/ChangeFieldFrequency(var/new_frequency)
frequency = new_frequency
/obj/effect/rust_em_field/proc/AddEnergy(var/a_energy, var/a_mega_energy, var/a_frequency)
var/energy_loss_ratio = 0
if(a_frequency != src.frequency)
energy_loss_ratio = 1 / abs(a_frequency - src.frequency)
energy += a_energy - a_energy * energy_loss_ratio
mega_energy += a_mega_energy - a_mega_energy * energy_loss_ratio
while(energy > 100000)
energy -= 100000
mega_energy += 0.1
/obj/effect/rust_em_field/proc/AddParticles(var/name, var/quantity = 1)
if(name in dormant_reactant_quantities)
dormant_reactant_quantities[name] += quantity
else if(name != "proton" && name != "electron" && name != "neutron")
dormant_reactant_quantities.Add(name)
dormant_reactant_quantities[name] = quantity
/obj/effect/rust_em_field/proc/RadiateAll(var/ratio_lost = 1)
for(var/particle in dormant_reactant_quantities)
radiation += dormant_reactant_quantities[particle]
dormant_reactant_quantities.Remove(particle)
radiation += mega_energy
mega_energy = 0
//lose all held plasma back into the air
var/datum/gas_mixture/environment = loc.return_air()
environment.merge(held_plasma)
/obj/effect/rust_em_field/proc/change_size(var/newsize = 1)
//
var/changed = 0
switch(newsize)
if(1)
size = 1
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "emfield_s1"
pixel_x = 0
pixel_y = 0
//
changed = 1
if(3)
size = 3
icon = 'icons/effects/96x96.dmi'
icon_state = "emfield_s3"
pixel_x = -32
pixel_y = -32
//
changed = 3
if(5)
size = 5
icon = 'icons/effects/160x160.dmi'
icon_state = "emfield_s5"
pixel_x = -64
pixel_y = -64
//
changed = 5
if(7)
size = 7
icon = 'icons/effects/224x224.dmi'
icon_state = "emfield_s7"
pixel_x = -96
pixel_y = -96
//
changed = 7
for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers)
catcher.UpdateSize()
return changed
//the !!fun!! part
/obj/effect/rust_em_field/proc/React()
//loop through the reactants in random order
var/list/reactants_reacting_pool = dormant_reactant_quantities.Copy()
/*
for(var/reagent in dormant_reactant_quantities)
world << " before: [reagent]: [dormant_reactant_quantities[reagent]]"
*/
//cant have any reactions if there aren't any reactants present
if(reactants_reacting_pool.len)
//determine a random amount to actually react this cycle, and remove it from the standard pool
//this is a hack, and quite nonrealistic :(
for(var/reactant in reactants_reacting_pool)
reactants_reacting_pool[reactant] = rand(0,reactants_reacting_pool[reactant])
dormant_reactant_quantities[reactant] -= reactants_reacting_pool[reactant]
if(!reactants_reacting_pool[reactant])
reactants_reacting_pool -= reactant
//loop through all the reacting reagents, picking out random reactions for them
var/list/produced_reactants = new/list
var/list/primary_reactant_pool = reactants_reacting_pool.Copy()
while(primary_reactant_pool.len)
//pick one of the unprocessed reacting reagents randomly
var/cur_primary_reactant = pick(primary_reactant_pool)
primary_reactant_pool.Remove(cur_primary_reactant)
//world << "\blue primary reactant chosen: [cur_primary_reactant]"
//grab all the possible reactants to have a reaction with
var/list/possible_secondary_reactants = reactants_reacting_pool.Copy()
//if there is only one of a particular reactant, then it can not react with itself so remove it
possible_secondary_reactants[cur_primary_reactant] -= 1
if(possible_secondary_reactants[cur_primary_reactant] < 1)
possible_secondary_reactants.Remove(cur_primary_reactant)
//loop through and work out all the possible reactions
var/list/possible_reactions = new/list
for(var/cur_secondary_reactant in possible_secondary_reactants)
if(possible_secondary_reactants[cur_secondary_reactant] < 1)
continue
var/datum/fusion_reaction/cur_reaction = get_fusion_reaction(cur_primary_reactant, cur_secondary_reactant)
if(cur_reaction)
//world << "\blue secondary reactant: [cur_secondary_reactant], [reaction_products.len]"
possible_reactions.Add(cur_reaction)
//if there are no possible reactions here, abandon this primary reactant and move on
if(!possible_reactions.len)
//world << "\blue no reactions"
continue
//split up the reacting atoms between the possible reactions
while(possible_reactions.len)
//pick a random substance to react with
var/datum/fusion_reaction/cur_reaction = pick(possible_reactions)
possible_reactions.Remove(cur_reaction)
//set the randmax to be the lower of the two involved reactants
var/max_num_reactants = reactants_reacting_pool[cur_reaction.primary_reactant] > reactants_reacting_pool[cur_reaction.secondary_reactant] ? \
reactants_reacting_pool[cur_reaction.secondary_reactant] : reactants_reacting_pool[cur_reaction.primary_reactant]
if(max_num_reactants < 1)
continue
//make sure we have enough energy
if(mega_energy < max_num_reactants * cur_reaction.energy_consumption)
max_num_reactants = round(mega_energy / cur_reaction.energy_consumption)
if(max_num_reactants < 1)
continue
//randomly determined amount to react
var/amount_reacting = rand(1, max_num_reactants)
//removing the reacting substances from the list of substances that are primed to react this cycle
//if there aren't enough of that substance (there should be) then modify the reactant amounts accordingly
if( reactants_reacting_pool[cur_reaction.primary_reactant] - amount_reacting >= 0 )
reactants_reacting_pool[cur_reaction.primary_reactant] -= amount_reacting
else
amount_reacting = reactants_reacting_pool[cur_reaction.primary_reactant]
reactants_reacting_pool[cur_reaction.primary_reactant] = 0
//same again for secondary reactant
if( reactants_reacting_pool[cur_reaction.secondary_reactant] - amount_reacting >= 0 )
reactants_reacting_pool[cur_reaction.secondary_reactant] -= amount_reacting
else
reactants_reacting_pool[cur_reaction.primary_reactant] += amount_reacting - reactants_reacting_pool[cur_reaction.primary_reactant]
amount_reacting = reactants_reacting_pool[cur_reaction.secondary_reactant]
reactants_reacting_pool[cur_reaction.secondary_reactant] = 0
//remove the consumed energy
mega_energy -= max_num_reactants * cur_reaction.energy_consumption
//add any produced energy
mega_energy += max_num_reactants * cur_reaction.energy_production
//add any produced radiation
radiation += max_num_reactants * cur_reaction.radiation
//create the reaction products
for(var/reactant in cur_reaction.products)
var/success = 0
for(var/check_reactant in produced_reactants)
if(check_reactant == reactant)
produced_reactants[reactant] += cur_reaction.products[reactant] * amount_reacting
success = 1
break
if(!success)
produced_reactants[reactant] = cur_reaction.products[reactant] * amount_reacting
//this reaction is done, and can't be repeated this sub-cycle
possible_reactions.Remove(cur_reaction.secondary_reactant)
//
/*if(new_radiation)
if(!radiating)
radiating = 1
PeriodicRadiate()*/
//loop through the newly produced reactants and add them to the pool
//var/list/neutronic_radiation = new
//var/list/protonic_radiation = new
for(var/reactant in produced_reactants)
AddParticles(reactant, produced_reactants[reactant])
//world << "produced: [reactant], [dormant_reactant_quantities[reactant]]"
//check whether there are reactants left, and add them back to the pool
for(var/reactant in reactants_reacting_pool)
AddParticles(reactant, reactants_reacting_pool[reactant])
//world << "retained: [reactant], [reactants_reacting_pool[reactant]]"
/obj/effect/rust_em_field/Del()
//radiate everything in one giant burst
for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers)
del (catcher)
RadiateAll()
processing_objects.Remove(src)
..()
@@ -0,0 +1,287 @@
//the core [tokamaka generator] big funky solenoid, it generates an EM field
/*
when the core is turned on, it generates [creates] an electromagnetic field
the em field attracts plasma, and suspends it in a controlled torus (doughnut) shape, oscillating around the core
the field strength is directly controllable by the user
field strength = sqrt(energy used by the field generator)
the size of the EM field = field strength / k
(k is an arbitrary constant to make the calculated size into tilewidths)
1 tilewidth = below 5T
3 tilewidth = between 5T and 12T
5 tilewidth = between 10T and 25T
7 tilewidth = between 20T and 50T
(can't go higher than 40T)
energy is added by a gyrotron, and lost when plasma escapes
energy transferred from the gyrotron beams is reduced by how different the frequencies are (closer frequencies = more energy transferred)
frequency = field strength * (stored energy / stored moles of plasma) * x
(where x is an arbitrary constant to make the frequency something realistic)
the gyrotron beams' frequency and energy are hardcapped low enough that they won't heat the plasma much
energy is generated in considerable amounts by fusion reactions from injected particles
fusion reactions only occur when the existing energy is above a certain level, and it's near the max operating level of the gyrotron. higher energy reactions only occur at higher energy levels
a small amount of energy constantly bleeds off in the form of radiation
the field is constantly pulling in plasma from the surrounding [local] atmosphere
at random intervals, the field releases a random percentage of stored plasma in addition to a percentage of energy as intense radiation
the amount of plasma is a percentage of the field strength, increased by frequency
*/
/*
- VALUES -
max volume of plasma storeable by the field = the total volume of a number of tiles equal to the (field tilewidth)^2
*/
#define MAX_FIELD_FREQ 1000
#define MIN_FIELD_FREQ 1
#define MAX_FIELD_STR 1000
#define MIN_FIELD_STR 1
/obj/machinery/power/rust_core
name = "RUST Tokamak core"
desc = "Enormous solenoid for generating extremely high power electromagnetic fields"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "core0"
density = 1
var/obj/effect/rust_em_field/owned_field
var/field_strength = 1//0.01
var/field_frequency = 1
var/id_tag = "allan, don't forget to set the ID of this one too"
req_access = list(access_engine)
//
use_power = 1
idle_power_usage = 50
active_power_usage = 500 //multiplied by field strength
var/cached_power_avail = 0
directwired = 1
anchored = 0
var/state = 0
var/locked = 1
var/remote_access_enabled = 1
/obj/machinery/power/rust_core/process()
if(stat & BROKEN || !powernet)
Shutdown()
cached_power_avail = avail()
//luminosity = round(owned_field.field_strength/10)
//luminosity = max(luminosity,1)
/obj/machinery/power/rust_core/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(owned_field)
user << "Turn off [src] first."
return
switch(state)
if(0)
state = 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] secures [src.name] to the floor.", \
"You secure the external reinforcing bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
if(1)
state = 0
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
"You undo the external reinforcing bolts.", \
"You hear a ratchet")
src.anchored = 0
if(2)
user << "\red The [src.name] needs to be unwelded from the floor."
return
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(owned_field)
user << "Turn off the [src] first."
return
switch(state)
if(0)
user << "\red The [src.name] needs to be wrenched to the floor."
if(1)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
"You start to weld the [src] to the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 2
user << "You weld the [src] to the floor."
connect_to_network()
src.directwired = 1
else
user << "\red You need more welding fuel to complete this task."
if(2)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
"You start to cut the [src] free from the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 1
user << "You cut the [src] free from the floor."
disconnect_from_network()
src.directwired = 0
else
user << "\red You need more welding fuel to complete this task."
return
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(emagged)
user << "\red The lock seems to be broken"
return
if(src.allowed(user))
if(owned_field)
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
else
src.locked = 0 //just in case it somehow gets locked
user << "\red The controls can only be locked when the [src] is online"
else
user << "\red Access denied."
return
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
locked = 0
emagged = 1
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
return
..()
return
/obj/machinery/power/rust_core/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/power/rust_core/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
/obj/machinery/power/rust_core/interact(mob/user)
if(stat & BROKEN)
user.unset_machine()
user << browse(null, "window=core_gen")
return
if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
user.unset_machine()
user << browse(null, "window=core_gen")
return
var/dat = ""
if(stat & NOPOWER || locked || state != 2)
dat += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
dat += "<b>Device ID tag: </b> [id_tag ? id_tag : "UNSET"] <a href='?src=\ref[src];new_id_tag=1'>\[Modify\]</a><br>"
dat += "<a href='?src=\ref[src];toggle_active=1'>\[[owned_field ? "Deactivate" : "Activate"]\]</a><br>"
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]</a><br>"
dat += "<hr>"
dat += "<b>Field strength:</b> [field_strength]Wm^3<br>"
dat += "<a href='?src=\ref[src];str=-1000'>\[----\]</a> \
<a href='?src=\ref[src];str=-100'>\[--- \]</a> \
<a href='?src=\ref[src];str=-10'>\[-- \]</a> \
<a href='?src=\ref[src];str=-1'>\[- \]</a> \
<a href='?src=\ref[src];str=1'>\[+ \]</a> \
<a href='?src=\ref[src];str=10'>\[++ \]</a> \
<a href='?src=\ref[src];str=100'>\[+++ \]</a> \
<a href='?src=\ref[src];str=1000'>\[++++\]</a><br>"
dat += "<b>Field frequency:</b> [field_frequency]MHz<br>"
dat += "<a href='?src=\ref[src];freq=-1000'>\[----\]</a> \
<a href='?src=\ref[src];freq=-100'>\[--- \]</a> \
<a href='?src=\ref[src];freq=-10'>\[-- \]</a> \
<a href='?src=\ref[src];freq=-1'>\[- \]</a> \
<a href='?src=\ref[src];freq=1'>\[+ \]</a> \
<a href='?src=\ref[src];freq=10'>\[++ \]</a> \
<a href='?src=\ref[src];freq=100'>\[+++ \]</a> \
<a href='?src=\ref[src];freq=1000'>\[++++\]</a><br>"
var/font_colour = "green"
if(cached_power_avail < active_power_usage)
font_colour = "red"
else if(cached_power_avail < active_power_usage * 2)
font_colour = "orange"
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
user << browse(dat, "window=core_gen;size=500x300")
onclose(user, "core_gen")
user.set_machine(src)
/obj/machinery/power/rust_core/Topic(href, href_list)
if(href_list["str"])
var/dif = text2num(href_list["str"])
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
active_power_usage = 5 * field_strength //change to 500 later
if(owned_field)
owned_field.ChangeFieldStrength(field_strength)
if(href_list["freq"])
var/dif = text2num(href_list["freq"])
field_frequency = min(max(field_frequency + dif, MIN_FIELD_FREQ), MAX_FIELD_FREQ)
if(owned_field)
owned_field.ChangeFieldFrequency(field_frequency)
if(href_list["toggle_active"])
if(!Startup())
Shutdown()
if( href_list["toggle_remote"] )
remote_access_enabled = !remote_access_enabled
if(href_list["new_id_tag"])
if(usr)
id_tag = input("Enter a new ID tag", "Tokamak core ID tag", id_tag) as text|null
if(href_list["close"])
usr << browse(null, "window=core_gen")
usr.unset_machine()
if(href_list["extern_update"])
var/obj/machinery/computer/rust_core_control/C = locate(href_list["extern_update"])
if(C)
C.updateDialog()
src.updateDialog()
/obj/machinery/power/rust_core/proc/Startup()
if(owned_field)
return
owned_field = new(src.loc)
owned_field.ChangeFieldStrength(field_strength)
owned_field.ChangeFieldFrequency(field_frequency)
icon_state = "core1"
luminosity = 1
use_power = 2
return 1
/obj/machinery/power/rust_core/proc/Shutdown()
//todo: safety checks for field status
if(owned_field)
icon_state = "core0"
del(owned_field)
luminosity = 0
use_power = 1
/obj/machinery/power/rust_core/proc/AddParticles(var/name, var/quantity = 1)
if(owned_field)
owned_field.AddParticles(name, quantity)
return 1
return 0
/obj/machinery/power/rust_core/bullet_act(var/obj/item/projectile/Proj)
if(owned_field)
return owned_field.bullet_act(Proj)
return 0
@@ -0,0 +1,17 @@
/obj/item/weapon/fuel_assembly
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "fuel_assembly"
name = "Fuel Rod Assembly"
var/list/rod_quantities
var/percent_depleted = 1
layer = 3.1
//
New()
rod_quantities = new/list
//these can be abstracted away for now
/*
/obj/item/weapon/fuel_rod
/obj/item/weapon/control_rod
*/
@@ -0,0 +1,102 @@
/obj/machinery/rust_fuel_assembly_port
name = "Fuel Assembly Port"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "port2"
density = 0
var/obj/item/weapon/fuel_assembly/cur_assembly
var/busy = 0
anchored = 1
var/opened = 1 //0=closed, 1=opened
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
/obj/machinery/rust_fuel_assembly_port/attackby(var/obj/item/I, var/mob/user)
if(istype(I,/obj/item/weapon/fuel_assembly) && !opened)
if(cur_assembly)
user << "\red There is already a fuel rod assembly in there!"
else
cur_assembly = I
user.drop_item()
I.loc = src
icon_state = "port1"
user << "\blue You insert [I] into [src]. Touch the panel again to insert [I] into the injector."
/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER) || opened)
return
if(cur_assembly)
if(try_insert_assembly())
user << "\blue \icon[src] [src] inserts it's fuel rod assembly into an injector."
else
if(eject_assembly())
user << "\red \icon[src] [src] ejects it's fuel assembly. Check the fuel injector status."
else if(try_draw_assembly())
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
else if(try_draw_assembly())
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
else
user << "\red \icon[src] [src] was unable to draw a fuel rod assembly from an injector."
/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly()
var/success = 0
if(cur_assembly)
var/turf/check_turf = get_step(get_turf(src), src.dir)
check_turf = get_step(check_turf, src.dir)
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
if(I.stat & (BROKEN|NOPOWER))
break
if(I.cur_assembly)
break
if(I.state != 2)
break
I.cur_assembly = cur_assembly
cur_assembly.loc = I
cur_assembly = null
icon_state = "port0"
success = 1
return success
/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly()
if(cur_assembly)
cur_assembly.loc = src.loc//get_step(get_turf(src), src.dir)
cur_assembly = null
icon_state = "port0"
return 1
/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly()
var/success = 0
if(!cur_assembly)
var/turf/check_turf = get_step(get_turf(src), src.dir)
check_turf = get_step(check_turf, src.dir)
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
if(I.stat & (BROKEN|NOPOWER))
break
if(!I.cur_assembly)
break
if(I.injecting)
break
if(I.state != 2)
break
cur_assembly = I.cur_assembly
cur_assembly.loc = src
I.cur_assembly = null
icon_state = "port1"
success = 1
break
return success
/obj/machinery/rust_fuel_assembly_port/verb/eject_assembly_verb()
set name = "Eject assembly from port"
set category = "Object"
set src in oview(1)
eject_assembly()
@@ -0,0 +1,133 @@
//frame assembly
/obj/item/rust_fuel_assembly_port_frame
name = "Fuel Assembly Port frame"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "port2"
w_class = 4
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
del(src)
return
..()
/obj/item/rust_fuel_assembly_port_frame/proc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
return
var/ndir = get_dir(usr,on_wall)
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
usr << "\red Port cannot be placed on this spot."
return
if (A.requires_power == 0 || A.name == "Space")
usr << "\red Port cannot be placed in this area."
return
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
del(src)
//construction steps
/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0)
..()
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
dir = ndir
else
has_electronics = 3
opened = 0
icon_state = "port0"
//20% easier to read than apc code
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
/obj/machinery/rust_fuel_assembly_port/attackby(obj/item/W, mob/user)
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
return src.attack_hand(user)
if (istype(W, /obj/item/weapon/crowbar))
if(opened)
if(has_electronics & 1)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
if(do_after(user, 50))
user.visible_message(\
"\red [user.name] has removed the circuitboard from [src.name]!",\
"\blue You remove the circuitboard.")
has_electronics = 0
new /obj/item/weapon/module/rust_fuel_port(loc)
has_electronics &= ~1
else
opened = 0
icon_state = "port0"
user << "\blue You close the maintenance cover."
else
if(cur_assembly)
user << "\red You cannot open the cover while there is a fuel assembly inside."
else
opened = 1
user << "\blue You open the maintenance cover."
icon_state = "port2"
return
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
var/obj/item/weapon/cable_coil/C = W
if(C.amount < 10)
user << "\red You need more wires."
return
user << "You start adding cables to the frame..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && C.amount >= 10)
C.use(10)
user.visible_message(\
"\red [user.name] has added cables to the port frame!",\
"You add cables to the port frame.")
has_electronics &= 2
return
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
user << "You begin to cut the cables..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 50))
new /obj/item/weapon/cable_coil(loc,10)
user.visible_message(\
"\red [user.name] cut the cabling inside the port.",\
"You cut the cabling inside the port.")
has_electronics &= ~2
return
else if (istype(W, /obj/item/weapon/module/rust_fuel_port) && opened && !(has_electronics & 1))
user << "You trying to insert the port control board into the frame..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10))
has_electronics &= 1
user << "You place the port control board inside the frame."
del(W)
return
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
var/obj/item/weapon/weldingtool/WT = W
if (WT.get_fuel() < 3)
user << "\blue You need more welding fuel to complete this task."
return
user << "You start welding the port frame..."
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(do_after(user, 50))
if(!src || !WT.remove_fuel(3, user)) return
new /obj/item/rust_fuel_assembly_port_frame(loc)
user.visible_message(\
"\red [src] has been cut away from the wall by [user.name].",\
"You detached the port frame.",\
"\red You hear welding.")
del(src)
return
..()
@@ -0,0 +1,116 @@
var/const/max_assembly_amount = 300
/obj/machinery/rust_fuel_compressor
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "fuel_compressor1"
name = "Fuel Compressor"
var/list/new_assembly_quantities = list("Deuterium" = 150,"Tritium" = 150,"Rodinium-6" = 0,"Stravium-7" = 0, "Pergium" = 0, "Dilithium" = 0)
var/compressed_matter = 0
anchored = 1
layer = 2.9
var/opened = 1 //0=closed, 1=opened
var/locked = 0
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
/obj/machinery/rust_fuel_compressor/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/rust_fuel_compressor/attack_hand(mob/user)
add_fingerprint(user)
/*if(stat & (BROKEN|NOPOWER))
return*/
interact(user)
/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/rcd_ammo))
compressed_matter += 10
del(W)
return
..()
/obj/machinery/rust_fuel_compressor/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=fuelcomp")
return
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
if(locked)
t += "Swipe your ID to unlock this console."
else
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a><br>"
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
t += "<hr>"
t += "- New fuel assembly constituents:- <br>"
for(var/reagent in new_assembly_quantities)
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];change_reagent=[reagent]'>Modify</A>\]<br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=fuelcomp;size=500x300")
user.set_machine(src)
//var/locked
//var/coverlocked
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=fuelcomp")
usr.machine = null
if( href_list["eject_matter"] )
var/ejected = 0
while(compressed_matter > 10)
new /obj/item/weapon/rcd_ammo(get_step(get_turf(src), src.dir))
compressed_matter -= 10
ejected = 1
if(ejected)
usr << "\blue \icon[src] [src] ejects some compressed matter units."
else
usr << "\red \icon[src] there are no more compressed matter units in [src]."
if( href_list["activate"] )
//world << "\blue New fuel rod assembly"
var/obj/item/weapon/fuel_assembly/F = new(src)
var/fail = 0
var/old_matter = compressed_matter
for(var/reagent in new_assembly_quantities)
var/req_matter = round(new_assembly_quantities[reagent] / 30)
//world << "[reagent] matter: [req_matter]/[compressed_matter]"
if(req_matter <= compressed_matter)
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
compressed_matter -= req_matter
if(compressed_matter < 1)
compressed_matter = 0
else
/*world << "bad reagent: [reagent], [req_matter > compressed_matter ? "req_matter > compressed_matter"\
: (req_matter < compressed_matter ? "req_matter < compressed_matter" : "req_matter == compressed_matter")]"*/
fail = 1
break
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
if(fail)
del(F)
compressed_matter = old_matter
usr << "\red \icon[src] [src] flashes red: \'Out of matter.\'"
else
F.loc = src.loc//get_step(get_turf(src), src.dir)
F.percent_depleted = 0
if(compressed_matter < 0.034)
compressed_matter = 0
if( href_list["change_reagent"] )
var/cur_reagent = href_list["change_reagent"]
var/avail_rods = 300
for(var/rod in new_assembly_quantities)
avail_rods -= new_assembly_quantities[rod]
avail_rods += new_assembly_quantities[cur_reagent]
avail_rods = max(avail_rods, 0)
var/new_amount = min(input("Enter new [cur_reagent] rod amount (max [avail_rods])", "Fuel Assembly Rod Composition ([cur_reagent])") as num, avail_rods)
new_assembly_quantities[cur_reagent] = new_amount
updateDialog()
@@ -0,0 +1,160 @@
//frame assembly
/obj/item/rust_fuel_compressor_frame
name = "Fuel Compressor frame"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "fuel_compressor0"
w_class = 4
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
del(src)
return
..()
/obj/item/rust_fuel_compressor_frame/proc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
return
var/ndir = get_dir(usr,on_wall)
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
usr << "\red Compressor cannot be placed on this spot."
return
if (A.requires_power == 0 || A.name == "Space")
usr << "\red Compressor cannot be placed in this area."
return
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
del(src)
//construction steps
/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0)
..()
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
dir = ndir
else
has_electronics = 3
opened = 0
locked = 0
icon_state = "fuel_compressor1"
//20% easier to read than apc code
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user)
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
return src.attack_hand(user)
if (istype(W, /obj/item/weapon/crowbar))
if(opened)
if(has_electronics & 1)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
if(do_after(user, 50))
user.visible_message(\
"\red [user.name] has removed the circuitboard from [src.name]!",\
"\blue You remove the circuitboard board.")
has_electronics = 0
new /obj/item/weapon/module/rust_fuel_compressor(loc)
has_electronics &= ~1
else
opened = 0
icon_state = "fuel_compressor0"
user << "\blue You close the maintenance cover."
else
if(compressed_matter > 0)
user << "\red You cannot open the cover while there is compressed matter inside."
else
opened = 1
user << "\blue You open the maintenance cover."
icon_state = "fuel_compressor1"
return
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
if(opened)
user << "You must close the cover to swipe an ID card."
else
if(src.allowed(usr))
locked = !locked
user << "You [ locked ? "lock" : "unlock"] the compressor interface."
update_icon()
else
user << "\red Access denied."
return
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
if(opened)
user << "You must close the cover to swipe an ID card."
else
flick("apc-spark", src)
if (do_after(user,6))
if(prob(50))
emagged = 1
locked = 0
user << "You emag the port interface."
else
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
return
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
var/obj/item/weapon/cable_coil/C = W
if(C.amount < 10)
user << "\red You need more wires."
return
user << "You start adding cables to the compressor frame..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && C.amount >= 10)
C.use(10)
user.visible_message(\
"\red [user.name] has added cables to the compressor frame!",\
"You add cables to the port frame.")
has_electronics &= 2
return
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
user << "You begin to cut the cables..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 50))
new /obj/item/weapon/cable_coil(loc,10)
user.visible_message(\
"\red [user.name] cut the cabling inside the compressor.",\
"You cut the cabling inside the port.")
has_electronics &= ~2
return
else if (istype(W, /obj/item/weapon/module/rust_fuel_compressor) && opened && !(has_electronics & 1))
user << "You trying to insert the circuitboard into the frame..."
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10))
has_electronics &= 1
user << "You place the circuitboard inside the frame."
del(W)
return
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
var/obj/item/weapon/weldingtool/WT = W
if (WT.get_fuel() < 3)
user << "\blue You need more welding fuel to complete this task."
return
user << "You start welding the compressor frame..."
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(do_after(user, 50))
if(!src || !WT.remove_fuel(3, user)) return
new /obj/item/rust_fuel_assembly_port_frame(loc)
user.visible_message(\
"\red [src] has been cut away from the wall by [user.name].",\
"You detached the compressor frame.",\
"\red You hear welding.")
del(src)
return
..()
@@ -0,0 +1,192 @@
/obj/machinery/computer/rust_fuel_control
name = "RUST Fuel Injection Control"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "fuel"
var/list/connected_injectors = list()
var/list/active_stages = list()
var/list/proceeding_stages = list()
var/list/stage_times = list()
//var/list/stage_status
var/announce_fueldepletion = 0
var/announce_stageprogression = 0
var/scan_range = 25
var/ticks_this_stage = 0
/*/obj/machinery/computer/rust_fuel_control/New()
..()
//these are the only three stages we can accept
//we have another console for SCRAM
fuel_injectors = new/list
stage_status = new/list
fuel_injectors.Add("One")
fuel_injectors["One"] = new/list
stage_status.Add("One")
stage_status["One"] = 0
fuel_injectors.Add("Two")
fuel_injectors["Two"] = new/list
stage_status.Add("Two")
stage_status["Two"] = 0
fuel_injectors.Add("Three")
fuel_injectors["Three"] = new/list
stage_status.Add("Three")
stage_status["Three"] = 0
fuel_injectors.Add("SCRAM")
fuel_injectors["SCRAM"] = new/list
stage_status.Add("SCRAM")
stage_status["SCRAM"] = 0
spawn(0)
for(var/obj/machinery/power/rust_fuel_injector/Injector in world)
if(Injector.stage in fuel_injectors)
var/list/targetlist = fuel_injectors[Injector.stage]
targetlist.Add(Injector)*/
/obj/machinery/computer/rust_fuel_control/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/computer/rust_fuel_control/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
/obj/machinery/computer/rust_fuel_control/interact(mob/user)
if(stat & (BROKEN|NOPOWER))
user.unset_machine()
user << browse(null, "window=fuel_control")
return
if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
user.unset_machine()
user << browse(null, "window=fuel_control")
return
var/dat = "<B>Reactor Core Fuel Control</B><BR>"
/*dat += "<b>Fuel depletion announcement:</b> "
dat += "[announce_fueldepletion == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_fueldepletion=0'>\[Disable\]</a>"] "
dat += "[announce_fueldepletion == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_fueldepletion=1'>\[Announce\]</a>"] "
dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_fueldepletion=2'>\[Broadcast\]</a>"]<br>"
dat += "<b>Stage progression announcement:</b> "
dat += "[announce_stageprogression == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_stageprogression=0'>\[Disable\]</a>"] "
dat += "[announce_stageprogression == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_stageprogression=1'>\[Announce\]</a>"] "
dat += "[announce_stageprogression == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_stageprogression=2'>\[Broadcast\]</a>"]<br>"*/
dat += "<hr>"
dat += "<b>Detected devices</b> <a href='?src=\ref[src];scan=1'>\[Refresh list\]</a>"
dat += "<table border=1 width='100%'>"
dat += "<tr>"
dat += "<td><b>ID</b></td>"
dat += "<td><b>Assembly</b></td>"
dat += "<td><b>Consumption</b></td>"
dat += "<td><b>Depletion</b></td>"
dat += "<td><b>Duration</b></td>"
dat += "<td><b>Next stage</b></td>"
dat += "<td></td>"
dat += "<td></td>"
dat += "</tr>"
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
dat += "<tr>"
dat += "<td>[I.id_tag]</td>"
if(I.cur_assembly)
dat += "<td><a href='?src=\ref[I];toggle_injecting=1;update_extern=\ref[src]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
else
dat += "<td>None</td>"
dat += "<td>[I.fuel_usage * 100]%</td>"
if(I.cur_assembly)
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
else
dat += "<td>NA</td>"
if(stage_times.Find(I.id_tag))
dat += "<td>[ticks_this_stage]/[stage_times[I.id_tag]]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Modify</td>"
else
dat += "<td>[ticks_this_stage]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Set</td>"
if(proceeding_stages.Find(I.id_tag))
dat += "<td><a href='?src=\ref[src];set_next_stage=[I.id_tag]'>[proceeding_stages[I.id_tag]]</a></td>"
else
dat += "<td>None <a href='?src=\ref[src];set_next_stage=[I.id_tag]'>\[modify\]</a></td>"
dat += "<td><a href='?src=\ref[src];toggle_stage=[I.id_tag]'>\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]</a></td>"
dat += "</tr>"
dat += "</table>"
dat += "<hr>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(dat, "window=fuel_control;size=800x400")
user.set_machine(src)
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
..()
if( href_list["scan"] )
connected_injectors = list()
for(var/obj/machinery/power/rust_fuel_injector/I in range(scan_range, src))
if(check_injector_status(I))
connected_injectors.Add(I)
if( href_list["toggle_stage"] )
var/cur_stage = href_list["toggle_stage"]
if(active_stages.Find(cur_stage))
active_stages.Remove(cur_stage)
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
if(I.id_tag == cur_stage && check_injector_status(I))
I.StopInjecting()
else
active_stages.Add(cur_stage)
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
if(I.id_tag == cur_stage && check_injector_status(I))
I.BeginInjecting()
if( href_list["cooldown"] )
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
if(check_injector_status(I))
I.StopInjecting()
active_stages = list()
if( href_list["warmup"] )
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
if(check_injector_status(I))
I.BeginInjecting()
if(!active_stages.Find(I.id_tag))
active_stages.Add(I.id_tag)
if( href_list["stage_time"] )
var/cur_stage = href_list["stage_time"]
var/new_duration = input("Enter new stage duration in seconds", "Stage duration") as num
if(new_duration)
stage_times[cur_stage] = new_duration
else if(stage_times.Find(cur_stage))
stage_times.Remove(cur_stage)
if( href_list["announce_fueldepletion"] )
announce_fueldepletion = text2num(href_list["announce_fueldepletion"])
if( href_list["announce_stageprogression"] )
announce_stageprogression = text2num(href_list["announce_stageprogression"])
if( href_list["close"] )
usr << browse(null, "window=fuel_control")
usr.unset_machine()
if( href_list["set_next_stage"] )
var/cur_stage = href_list["set_next_stage"]
if(!proceeding_stages.Find(cur_stage))
proceeding_stages.Add(cur_stage)
var/next_stage = input("Enter next stage ID", "Automated stage procession") as text|null
if(next_stage)
proceeding_stages[cur_stage] = next_stage
else
proceeding_stages.Remove(cur_stage)
updateDialog()
/obj/machinery/computer/rust_fuel_control/proc/check_injector_status(var/obj/machinery/power/rust_fuel_injector/I)
if(!I)
return 0
if(I.stat & (BROKEN|NOPOWER) || !I.remote_access_enabled || !I.id_tag)
if(connected_injectors.Find(I))
connected_injectors.Remove(I)
return 0
return 1
@@ -0,0 +1,308 @@
/obj/machinery/power/rust_fuel_injector
name = "Fuel Injector"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "injector0"
density = 1
anchored = 0
var/state = 0
var/locked = 0
req_access = list(access_engine)
var/obj/item/weapon/fuel_assembly/cur_assembly
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
var/id_tag = "One"
var/injecting = 0
var/trying_to_swap_fuel = 0
use_power = 1
idle_power_usage = 10
active_power_usage = 500
directwired = 0
var/remote_access_enabled = 1
var/cached_power_avail = 0
var/emergency_insert_ready = 0
/obj/machinery/power/rust_fuel_injector/process()
if(injecting)
if(stat & (BROKEN|NOPOWER))
StopInjecting()
else
Inject()
cached_power_avail = avail()
/obj/machinery/power/rust_fuel_injector/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(injecting)
user << "Turn off the [src] first."
return
switch(state)
if(0)
state = 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] secures [src.name] to the floor.", \
"You secure the external reinforcing bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
if(1)
state = 0
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
"You undo the external reinforcing bolts.", \
"You hear a ratchet")
src.anchored = 0
if(2)
user << "\red The [src.name] needs to be unwelded from the floor."
return
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(injecting)
user << "Turn off the [src] first."
return
switch(state)
if(0)
user << "\red The [src.name] needs to be wrenched to the floor."
if(1)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
"You start to weld the [src] to the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 2
user << "You weld the [src] to the floor."
connect_to_network()
//src.directwired = 1
else
user << "\red You need more welding fuel to complete this task."
if(2)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
"You start to cut the [src] free from the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 1
user << "You cut the [src] free from the floor."
disconnect_from_network()
//src.directwired = 0
else
user << "\red You need more welding fuel to complete this task."
return
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(emagged)
user << "\red The lock seems to be broken"
return
if(src.allowed(user))
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
else
user << "\red Access denied."
return
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
locked = 0
emagged = 1
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
return
if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly)
if(emergency_insert_ready)
cur_assembly = W
user.drop_item()
W.loc = src
emergency_insert_ready = 0
return
..()
return
/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/power/rust_fuel_injector/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
/obj/machinery/power/rust_fuel_injector/interact(mob/user)
if(stat & BROKEN)
user.unset_machine()
user << browse(null, "window=fuel_injector")
return
if(get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=fuel_injector")
return
var/dat = ""
if (stat & NOPOWER || locked || state != 2)
dat += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<B>Reactor Core Fuel Injector</B><hr>"
dat += "<b>Device ID tag:</b> [id_tag] <a href='?src=\ref[src];modify_tag=1'>\[Modify\]</a><br>"
dat += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Enable\]</a>"]<br>"
dat += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
dat += "<b>Fuel assembly port:</b> "
dat += "<a href='?src=\ref[src];fuel_assembly=1'>\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\]</a> "
if(cur_assembly)
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[Emergency eject\]</a><br>"
else
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]</a><br>"
var/font_colour = "green"
if(cached_power_avail < active_power_usage)
font_colour = "red"
else if(cached_power_avail < active_power_usage * 2)
font_colour = "orange"
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]</a><br>"
dat += "<hr>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(dat, "window=fuel_injector;size=500x300")
onclose(user, "fuel_injector")
user.set_machine(src)
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
..()
if( href_list["modify_tag"] )
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
if( href_list["fuel_assembly"] )
attempt_fuel_swap()
if( href_list["emergency_fuel_assembly"] )
if(cur_assembly)
cur_assembly.loc = src.loc
cur_assembly = null
//irradiate!
else
emergency_insert_ready = !emergency_insert_ready
if( href_list["toggle_injecting"] )
if(injecting)
StopInjecting()
else
BeginInjecting()
if( href_list["toggle_remote"] )
remote_access_enabled = !remote_access_enabled
if( href_list["fuel_usage"] )
var/new_usage = text2num(input("Enter new fuel usage (0.01% - 100%)", "Modifying fuel usage", fuel_usage * 100))
if(!new_usage)
usr << "\red That's not a valid number."
return
new_usage = max(new_usage, 0.01)
new_usage = min(new_usage, 100)
fuel_usage = new_usage / 100
active_power_usage = 500 + 1000 * fuel_usage
if( href_list["update_extern"] )
var/obj/machinery/computer/rust_fuel_control/C = locate(href_list["update_extern"])
if(C)
C.updateDialog()
if( href_list["close"] )
usr << browse(null, "window=fuel_injector")
usr.unset_machine()
updateDialog()
/obj/machinery/power/rust_fuel_injector/proc/BeginInjecting()
if(!injecting && cur_assembly)
icon_state = "injector1"
injecting = 1
use_power = 1
/obj/machinery/power/rust_fuel_injector/proc/StopInjecting()
if(injecting)
injecting = 0
icon_state = "injector0"
use_power = 0
/obj/machinery/power/rust_fuel_injector/proc/Inject()
if(!injecting)
return
if(cur_assembly)
var/amount_left = 0
for(var/reagent in cur_assembly.rod_quantities)
//world << "checking [reagent]"
if(cur_assembly.rod_quantities[reagent] > 0)
//world << " rods left: [cur_assembly.rod_quantities[reagent]]"
var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage
var/numparticles = round(amount * 1000)
if(numparticles < 1)
numparticles = 1
//world << " amount: [amount]"
//world << " numparticles: [numparticles]"
//
var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir)
A.particle_type = reagent
A.additional_particles = numparticles - 1
//A.target = target_field
//
cur_assembly.rod_quantities[reagent] -= amount
amount_left += cur_assembly.rod_quantities[reagent]
cur_assembly.percent_depleted = amount_left / 300
flick("injector-emitting",src)
else
StopInjecting()
/obj/machinery/power/rust_fuel_injector/proc/attempt_fuel_swap()
var/rev_dir = reverse_direction(dir)
var/turf/mid = get_step(src, rev_dir)
var/success = 0
for(var/obj/machinery/rust_fuel_assembly_port/check_port in get_step(mid, rev_dir))
if(cur_assembly)
if(!check_port.cur_assembly)
check_port.cur_assembly = cur_assembly
cur_assembly.loc = check_port
cur_assembly = null
check_port.icon_state = "port1"
success = 1
else
if(check_port.cur_assembly)
cur_assembly = check_port.cur_assembly
cur_assembly.loc = src
check_port.cur_assembly = null
check_port.icon_state = "port0"
success = 1
break
if(success)
src.visible_message("\blue \icon[src] a green light flashes on [src].")
updateDialog()
else
src.visible_message("\red \icon[src] a red light flashes on [src].")
/obj/machinery/power/rust_fuel_injector/verb/rotate_clock()
set category = "Object"
set name = "Rotate Generator (Clockwise)"
set src in view(1)
if (usr.stat || usr.restrained() || anchored)
return
src.dir = turn(src.dir, 90)
/obj/machinery/power/rust_fuel_injector/verb/rotate_anticlock()
set category = "Object"
set name = "Rotate Generator (Counterclockwise)"
set src in view(1)
if (usr.stat || usr.restrained() || anchored)
return
src.dir = turn(src.dir, -90)
@@ -0,0 +1,160 @@
datum/fusion_reaction
var/primary_reactant = ""
var/secondary_reactant = ""
var/energy_consumption = 0
var/energy_production = 0
var/radiation = 0
var/list/products = list()
/datum/controller/game_controller/var/list/fusion_reactions
proc/get_fusion_reaction(var/primary_reactant, var/secondary_reactant)
if(!master_controller.fusion_reactions)
populate_fusion_reactions()
if(master_controller.fusion_reactions.Find(primary_reactant))
var/list/secondary_reactions = master_controller.fusion_reactions[primary_reactant]
if(secondary_reactions.Find(secondary_reactant))
return master_controller.fusion_reactions[primary_reactant][secondary_reactant]
proc/populate_fusion_reactions()
if(!master_controller.fusion_reactions)
master_controller.fusion_reactions = list()
for(var/cur_reaction_type in typesof(/datum/fusion_reaction) - /datum/fusion_reaction)
var/datum/fusion_reaction/cur_reaction = new cur_reaction_type()
if(!master_controller.fusion_reactions[cur_reaction.primary_reactant])
master_controller.fusion_reactions[cur_reaction.primary_reactant] = list()
master_controller.fusion_reactions[cur_reaction.primary_reactant][cur_reaction.secondary_reactant] = cur_reaction
if(!master_controller.fusion_reactions[cur_reaction.secondary_reactant])
master_controller.fusion_reactions[cur_reaction.secondary_reactant] = list()
master_controller.fusion_reactions[cur_reaction.secondary_reactant][cur_reaction.primary_reactant] = cur_reaction
//Fake elements and fake reactions, but its nicer gameplay-wise
//Deuterium
//Tritium
//Uridium-3
//Obdurium
//Solonium
//Rodinium-6
//Dilithium
//Trilithium
//Pergium
//Stravium-7
//Primary Production Reactions
datum/fusion_reaction/tritium_deuterium
primary_reactant = "Tritium"
secondary_reactant = "Deuterium"
energy_consumption = 1
energy_production = 5
radiation = 0
//Secondary Production Reactions
datum/fusion_reaction/deuterium_deuterium
primary_reactant = "Deuterium"
secondary_reactant = "Deuterium"
energy_consumption = 1
energy_production = 4
radiation = 1
products = list("Obdurium" = 2)
datum/fusion_reaction/tritium_tritium
primary_reactant = "Tritium"
secondary_reactant = "Tritium"
energy_consumption = 1
energy_production = 4
radiation = 1
products = list("Solonium" = 2)
//Cleanup Reactions
datum/fusion_reaction/rodinium6_obdurium
primary_reactant = "Rodinium-6"
secondary_reactant = "Obdurium"
energy_consumption = 1
energy_production = 2
radiation = 2
datum/fusion_reaction/rodinium6_solonium
primary_reactant = "Rodinium-6"
secondary_reactant = "Solonium"
energy_consumption = 1
energy_production = 2
radiation = 2
//Breeder Reactions
datum/fusion_reaction/dilithium_obdurium
primary_reactant = "Dilithium"
secondary_reactant = "Obdurium"
energy_consumption = 1
energy_production = 1
radiation = 3
products = list("Deuterium" = 1, "Dilithium" = 1)
datum/fusion_reaction/dilithium_solonium
primary_reactant = "Dilithium"
secondary_reactant = "Solonium"
energy_consumption = 1
energy_production = 1
radiation = 3
products = list("Tritium" = 1, "Dilithium" = 1)
//Breeder Inhibitor Reactions
datum/fusion_reaction/stravium7_dilithium
primary_reactant = "Stravium-7"
secondary_reactant = "Dilithium"
energy_consumption = 2
energy_production = 1
radiation = 4
//Enhanced Breeder Reactions
datum/fusion_reaction/trilithium_obdurium
primary_reactant = "Trilithium"
secondary_reactant = "Obdurium"
energy_consumption = 1
energy_production = 2
radiation = 5
products = list("Dilithium" = 1, "Trilithium" = 1, "Deuterium" = 1)
datum/fusion_reaction/trilithium_solonium
primary_reactant = "Trilithium"
secondary_reactant = "Solonium"
energy_consumption = 1
energy_production = 2
radiation = 5
products = list("Dilithium" = 1, "Trilithium" = 1, "Tritium" = 1)
//Control Reactions
datum/fusion_reaction/pergium_deuterium
primary_reactant = "Pergium"
secondary_reactant = "Deuterium"
energy_consumption = 5
energy_production = 0
radiation = 5
datum/fusion_reaction/pergium_tritium
primary_reactant = "Pergium"
secondary_reactant = "Tritium"
energy_consumption = 5
energy_production = 0
radiation = 5
datum/fusion_reaction/pergium_obdurium
primary_reactant = "Pergium"
secondary_reactant = "Obdurium"
energy_consumption = 5
energy_production = 0
radiation = 5
datum/fusion_reaction/pergium_solonium
primary_reactant = "Pergium"
secondary_reactant = "Solonium"
energy_consumption = 5
energy_production = 0
radiation = 5
@@ -0,0 +1,188 @@
//high frequency photon (laser beam)
/obj/item/projectile/beam/ehf_beam
/obj/machinery/rust/gyrotron
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "emitter-off"
name = "Gyrotron"
anchored = 1
density = 0
layer = 4
var/frequency = 1
var/emitting = 0
var/rate = 10
var/mega_energy = 0.001
var/on = 1
var/remoteenabled = 1
//
req_access = list(access_engine)
//
use_power = 1
idle_power_usage = 10
active_power_usage = 300
New()
..()
//pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=gyro_monitor")
usr.machine = null
return
if( href_list["modifypower"] )
var/new_val = text2num(input("Enter new emission power level (0.001 - 0.01)", "Modifying power level (MeV)", mega_energy))
if(!new_val)
usr << "\red That's not a valid number."
return
new_val = min(new_val,0.01)
new_val = max(new_val,0.001)
mega_energy = new_val
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["modifyrate"] )
var/new_val = text2num(input("Enter new emission rate (1 - 10)", "Modifying emission rate (sec)", rate))
if(!new_val)
usr << "\red That's not a valid number."
return
new_val = min(new_val,1)
new_val = max(new_val,10)
rate = new_val
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["modifyfreq"] )
var/new_val = text2num(input("Enter new emission frequency (1 - 50000)", "Modifying emission frequency (GHz)", frequency))
if(!new_val)
usr << "\red That's not a valid number."
return
new_val = min(new_val,1)
new_val = max(new_val,50000)
frequency = new_val
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["activate"] )
emitting = 1
spawn(rate)
Emit()
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["deactivate"] )
emitting = 0
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["enableremote"] )
remoteenabled = 1
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
if( href_list["disableremote"] )
remoteenabled = 0
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
comp.updateDialog()
return
/*
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
else if(src.dir == 2)//Down
A.yo = -20
A.xo = 0
else if(src.dir == 4)//Right
A.yo = 0
A.xo = 20
else if(src.dir == 8)//Left
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.fired()
*/
proc/Emit()
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
A.frequency = frequency
A.damage = mega_energy * 500
//
A.icon_state = "emitter"
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
use_power(100 * mega_energy + 500)
/*if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()*/
A.dir = src.dir
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
else if(src.dir == 2)//Down
A.yo = -20
A.xo = 0
else if(src.dir == 4)//Right
A.yo = 0
A.xo = 20
else if(src.dir == 8)//Left
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.process()
//
flick("emitter-active",src)
if(emitting)
spawn(rate)
Emit()
proc/UpdateIcon()
if(on)
icon_state = "emitter-on"
else
icon_state = "emitter-off"
/obj/machinery/rust/gyrotron/control_panel
icon_state = "control_panel"
name = "Control panel"
var/obj/machinery/rust/gyrotron/owned_gyrotron
New()
..()
pixel_x = -pixel_x
pixel_y = -pixel_y
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=gyro_monitor")
return
var/t = "<B>Free electron MASER (Gyrotron) Control Panel</B><BR>"
if(owned_gyrotron && owned_gyrotron.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(owned_gyrotron.emitting)
t += "Emitting</font> <a href='?src=\ref[owned_gyrotron];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "Not emitting</font> <a href='?src=\ref[owned_gyrotron];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [owned_gyrotron.rate] <a href='?src=\ref[owned_gyrotron];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [owned_gyrotron.frequency] <a href='?src=\ref[owned_gyrotron];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [owned_gyrotron.mega_energy] <a href='?src=\ref[owned_gyrotron];modifypower=1'>\[Modify\]</a><br>"
else
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyro_monitor;size=500x800")
user.machine = src
@@ -0,0 +1,88 @@
/obj/machinery/computer/rust_gyrotron_controller
name = "Gyrotron Remote Controller"
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
icon_state = "engine"
var/updating = 1
New()
..()
Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=gyrotron_controller")
usr.machine = null
return
if( href_list["target"] )
var/obj/machinery/rust/gyrotron/gyro = locate(href_list["target"])
gyro.Topic(href, href_list)
return
process()
..()
if(updating)
src.updateDialog()
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=gyrotron_controller")
return
var/t = "<B>Gyrotron Remote Control Console</B><BR>"
t += "<hr>"
for(var/obj/machinery/rust/gyrotron/gyro in world)
if(gyro.remoteenabled && gyro.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(gyro.emitting)
t += "Emitting</font> <a href='?src=\ref[gyro];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "Not emitting</font> <a href='?src=\ref[gyro];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [gyro.rate] <a href='?src=\ref[gyro];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [gyro.frequency] <a href='?src=\ref[gyro];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [gyro.mega_energy] <a href='?src=\ref[gyro];modifypower=1'>\[Modify\]</a><br>"
else
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
t += "<hr>"
/*
var/t = "<B>Reactor Core Fuel Control</B><BR>"
t += "Current fuel injection stage: [active_stage]<br>"
if(active_stage == "Cooling")
//t += "<a href='?src=\ref[src];restart=1;'>Restart injection cycle</a><br>"
t += "----<br>"
else
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
t += "Fuel depletion announcement: "
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
t += "Stage progression announcement: "
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
t += "<hr>"
t += "<table border=1><tr>"
t += "<td><b>Injector Status</b></td>"
t += "<td><b>Injection interval (sec)</b></td>"
t += "<td><b>Assembly consumption per injection</b></td>"
t += "<td><b>Fuel Assembly Port</b></td>"
t += "<td><b>Assembly depletion percentage</b></td>"
t += "</tr>"
for(var/stage in fuel_injectors)
var/list/cur_stage = fuel_injectors[stage]
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> <font color=blue>[stage]</font> [active_stage == stage ? "<font color=green> (Currently active)</font>" : "<a href='?src=\ref[src];beginstage=[stage]'>Activate</a>"]</td></tr>"
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
t += "<tr>"
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
t += "</tr>"
t += "</table>"
*/
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyrotron_controller;size=500x400")
user.machine = src
@@ -0,0 +1,74 @@
/obj/machinery/rust/rad_source
var/mega_energy = 0
var/time_alive = 0
var/source_alive = 2
New()
..()
process()
..()
//fade away over time
if(source_alive > 0)
time_alive++
source_alive--
else
time_alive -= 0.1
if(time_alive < 0)
del(src)
//radiate mobs nearby here
//
/*
/obj/machinery/rust
proc/RadiateParticle(var/energy, var/ionizing, var/dir = 0)
if(!dir)
RadiateParticleRand(energy, ionizing)
var/obj/effect/accelerated_particle/particle = new
particle.dir = dir
particle.ionizing = ionizing
if(energy)
particle.energy = energy
//particle.invisibility = 2
//
return particle
proc/RadiateParticleRand(var/energy, var/ionizing)
var/turf/target
var/particle_range = 3 * round(energy) + rand(3,20)
if(energy > 1)
//for penetrating radiation
for(var/mob/M in range(particle_range))
var/dist_ratio = particle_range / get_dist(M, src)
//particles are more likely to hit a person if the person is closer
// 1/8 = 12.5% (closest)
// 1/360 = 0.27% (furthest)
// variation of 12.2%
if( rand() < (0.25 + dist_ratio * 12.5) )
target = get_turf(M)
break
if(!target)
target = pick(range(particle_range))
else
//for slower, non-penetrating radiation
for(var/mob/M in view(particle_range))
var/dist_ratio = particle_range / get_dist(M, src)
if( rand() < (0.25 + dist_ratio * 12.5) )
target = get_turf(M)
break
if(!target)
target = pick(view(particle_range))
var/obj/effect/accelerated_particle/particle = new
particle.target = target
particle.ionizing = ionizing
if(energy)
particle.energy = energy
//particle.invisibility = 2
//
return particle
*/
/obj/machinery/computer/rust_radiation_monitor
name = "Radiation Monitor"
icon_state = "power"
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

@@ -0,0 +1,53 @@
//gimmicky hack to collect particles and direct them into the field
/obj/effect/rust_particle_catcher
icon = 'icons/effects/effects.dmi'
density = 0
anchored = 1
layer = 4
var/obj/effect/rust_em_field/parent
var/mysize = 0
invisibility = 101
/*/obj/effect/rust_particle_catcher/New()
for(var/obj/machinery/rust/em_field/field in range(6))
parent = field
if(!parent)
del(src)*/
/obj/effect/rust_particle_catcher/process()
if(!parent)
del(src)
/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize)
name = "collector [newsize]"
mysize = newsize
UpdateSize()
/obj/effect/rust_particle_catcher/proc/AddParticles(var/name, var/quantity = 1)
if(parent && parent.size >= mysize)
parent.AddParticles(name, quantity)
return 1
return 0
/obj/effect/rust_particle_catcher/proc/UpdateSize()
if(parent.size >= mysize)
density = 1
//invisibility = 0
name = "collector [mysize] ON"
else
density = 0
//invisibility = 101
name = "collector [mysize] OFF"
/obj/effect/rust_particle_catcher/bullet_act(var/obj/item/projectile/Proj)
if(Proj.flag != "bullet" && parent)
parent.AddEnergy(Proj.damage * 20, 0, 1)
update_icon()
return 0
/obj/effect/rust_particle_catcher/Bumped(atom/AM)
if(ismob(AM) && density && prob(10))
AM << "\red A powerful force pushes you back."
..()
@@ -0,0 +1,78 @@
////////////////////////////////////////
// External Shield Generator
/obj/item/weapon/circuitboard/shield_gen_ex
name = "Circuit board (Experimental hull shield generator)"
board_type = "machine"
build_path = "/obj/machinery/shield_gen/external"
origin_tech = "bluespace=4;plasmatech=3"
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 5)
datum/design/shield_gen_ex
name = "Circuit Design (Experimental hull shield generator)"
desc = "Allows for the construction of circuit boards used to build an experimental hull shield generator."
id = "shield_gen"
req_tech = list("bluespace" = 4, "plasmatech" = 3)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
build_path = "/obj/machinery/shield_gen/external"
////////////////////////////////////////
// Shield Generator
/obj/item/weapon/circuitboard/shield_gen
name = "Circuit board (Experimental shield generator)"
board_type = "machine"
build_path = "/obj/machinery/shield_gen/external"
origin_tech = "bluespace=4;plasmatech=3"
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 5)
datum/design/shield_gen
name = "Circuit Design (Experimental shield generator)"
desc = "Allows for the construction of circuit boards used to build an experimental shield generator."
id = "shield_gen"
req_tech = list("bluespace" = 4, "plasmatech" = 3)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
build_path = "/obj/machinery/shield_gen/external"
////////////////////////////////////////
// Shield Capacitor
/obj/item/weapon/circuitboard/shield_cap
name = "Circuit board (Experimental shield capacitor)"
board_type = "machine"
build_path = "/obj/machinery/shield_capacitor"
origin_tech = "magnets=3;powerstorage=4"
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Filter, 5 Pieces of cable, 1 Subspace Treatment disk, 1 Subspace Analyzer and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
"/obj/item/weapon/stock_parts/subspace/treatment" = 1,
"/obj/item/weapon/stock_parts/subspace/analyzer" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 5)
datum/design/shield_cap
name = "Circuit Design (Experimental shield capacitor)"
desc = "Allows for the construction of circuit boards used to build an experimental shielding capacitor."
id = "shield_cap"
req_tech = list("magnets" = 3, "powerstorage" = 4)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$silver" = 10000)
build_path = "/obj/machinery/shield_gen/external"
@@ -0,0 +1,55 @@
//---------- actual energy field
/obj/effect/energy_field
name = "energy field"
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
icon = 'code/WorkInProgress/Cael_Aislinn/ShieldGen/shielding.dmi'
icon_state = "shieldsparkles"
anchored = 1
layer = 4.1 //just above mobs
density = 0
invisibility = 101
var/strength = 0
/obj/effect/energy_field/ex_act(var/severity)
Stress(0.5 + severity)
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
Stress(Proj.damage / 10)
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
if(M)
walk(M,0)
Stress(2)
/obj/effect/energy_field/proc/Stress(var/severity)
strength -= severity
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
if(strength < 1)
invisibility = 101
density = 0
else if(strength >= 1)
invisibility = 0
density = 1
/obj/effect/energy_field/proc/Strengthen(var/severity)
strength += severity
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
if(strength >= 1)
invisibility = 0
density = 1
else if(strength < 1)
invisibility = 101
density = 0
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
//Purpose: Determines if the object (or airflow) can pass this atom.
//Called by: Movement, airflow.
//Inputs: The moving atom (optional), target turf, "height" and air group
//Outputs: Boolean if can pass.
//return (!density || !height || air_group)
return !density
@@ -0,0 +1,171 @@
//---------- shield capacitor
//pulls energy out of a power net and charges an adjacent generator
/obj/machinery/shield_capacitor
name = "shield capacitor"
desc = "Machine that charges a shield generator."
icon = 'code/WorkInProgress/Cael_Aislinn/ShieldGen/shielding.dmi'
icon_state = "capacitor"
var/active = 1
density = 1
anchored = 1
var/stored_charge = 0
var/time_since_fail = 100
var/max_charge = 1000000
var/max_charge_rate = 100000
var/min_charge_rate = 0
var/locked = 0
//
use_power = 1 //0 use nothing
//1 use idle power
//2 use active power
idle_power_usage = 10
active_power_usage = 100
var/charge_rate = 100
/obj/machinery/shield_capacitor/New()
spawn(10)
for(var/obj/machinery/shield_gen/possible_gen in range(1, src))
if(get_dir(src, possible_gen) == src.dir)
possible_gen.owned_capacitor = src
break
..()
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
if(access_captain in C.access || access_security in C.access || access_engine in C.access)
src.locked = !src.locked
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
updateDialog()
else
user << "\red Access denied."
else if(istype(W, /obj/item/weapon/card/emag))
if(prob(75))
src.locked = !src.locked
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
updateDialog()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
else if(istype(W, /obj/item/weapon/wrench))
src.anchored = !src.anchored
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
spawn(0)
for(var/obj/machinery/shield_gen/gen in range(1, src))
if(get_dir(src, gen) == src.dir)
if(!src.anchored && gen.owned_capacitor == src)
gen.owned_capacitor = null
break
else if(src.anchored && !gen.owned_capacitor)
gen.owned_capacitor = src
break
gen.updateDialog()
updateDialog()
else
..()
/obj/machinery/shield_capacitor/attack_paw(user as mob)
return src.attack_hand(user)
/obj/machinery/shield_capacitor/attack_ai(user as mob)
return src.attack_hand(user)
/obj/machinery/shield_capacitor/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN))
return
interact(user)
/obj/machinery/shield_capacitor/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=shield_capacitor")
return
var/t = "<B>Shield Capacitor Control Console</B><br><br>"
if(locked)
t += "<i>Swipe your ID card to begin.</i>"
else
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
t += "Charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
t += "Charge rate: \
<a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> \
<a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> \
<a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec \
<a href='?src=\ref[src];charge_rate=100'>\[+\]</a> \
<a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> \
<a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src]'>Refresh</A> "
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=shield_capacitor;size=500x800")
user.set_machine(src)
/obj/machinery/shield_capacitor/process()
//
if(active)
use_power = 2
if(stored_charge + charge_rate > max_charge)
active_power_usage = max_charge - stored_charge
else
active_power_usage = charge_rate
stored_charge += active_power_usage
else
use_power = 1
time_since_fail++
if(stored_charge < active_power_usage * 1.5)
time_since_fail = 0
/obj/machinery/shield_capacitor/Topic(href, href_list[])
..()
if( href_list["close"] )
usr << browse(null, "window=shield_capacitor")
usr.unset_machine()
return
if( href_list["toggle"] )
active = !active
if(active)
use_power = 2
else
use_power = 1
if( href_list["charge_rate"] )
charge_rate += text2num(href_list["charge_rate"])
if(charge_rate > max_charge_rate)
charge_rate = max_charge_rate
else if(charge_rate < min_charge_rate)
charge_rate = min_charge_rate
//
updateDialog()
/obj/machinery/shield_capacitor/power_change()
if(stat & BROKEN)
icon_state = "broke"
else
if( powered() )
if (src.active)
icon_state = "capacitor"
else
icon_state = "capacitor"
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "capacitor"
stat |= NOPOWER
/obj/machinery/shield_capacitor/verb/rotate()
set name = "Rotate capacitor clockwise"
set category = "Object"
set src in oview(1)
if (src.anchored)
usr << "It is fastened to the floor!"
return
src.dir = turn(src.dir, 270)
return
@@ -0,0 +1,283 @@
//renwicks: fictional unit to describe shield strength
//a small meteor hit will deduct 1 renwick of strength from that shield tile
//light explosion range will do 1 renwick's damage
//medium explosion range will do 2 renwick's damage
//heavy explosion range will do 3 renwick's damage
//explosion damage is cumulative. if a tile is in range of light, medium and heavy damage, it will take a hit from all three
/obj/machinery/shield_gen
name = "shield generator"
desc = "Machine that generates an impenetrable field of energy when activated."
icon = 'code/WorkInProgress/Cael_Aislinn/ShieldGen/shielding.dmi'
icon_state = "generator0"
var/active = 0
var/field_radius = 3
var/list/field
density = 1
anchored = 1
var/locked = 0
var/average_field_strength = 0
var/strengthen_rate = 0.2
var/max_strengthen_rate = 0.2
var/powered = 0
var/check_powered = 1
var/obj/machinery/shield_capacitor/owned_capacitor
var/max_field_strength = 10
var/time_since_fail = 100
var/energy_conversion_rate = 0.01 //how many renwicks per watt?
//
use_power = 1 //0 use nothing
//1 use idle power
//2 use active power
idle_power_usage = 20
active_power_usage = 100
/obj/machinery/shield_gen/New()
spawn(10)
for(var/obj/machinery/shield_capacitor/possible_cap in range(1, src))
if(get_dir(possible_cap, src) == possible_cap.dir)
owned_capacitor = possible_cap
break
field = new/list()
..()
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
if(access_captain in C.access || access_security in C.access || access_engine in C.access)
src.locked = !src.locked
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
updateDialog()
else
user << "\red Access denied."
else if(istype(W, /obj/item/weapon/card/emag))
if(prob(75))
src.locked = !src.locked
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
updateDialog()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
else if(istype(W, /obj/item/weapon/wrench))
src.anchored = !src.anchored
src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].")
spawn(0)
for(var/obj/machinery/shield_gen/gen in range(1, src))
if(get_dir(src, gen) == src.dir)
if(!src.anchored && gen.owned_capacitor == src)
gen.owned_capacitor = null
break
else if(src.anchored && !gen.owned_capacitor)
gen.owned_capacitor = src
break
gen.updateDialog()
updateDialog()
else
..()
/obj/machinery/shield_gen/attack_paw(user as mob)
return src.attack_hand(user)
/obj/machinery/shield_gen/attack_ai(user as mob)
return src.attack_hand(user)
/obj/machinery/shield_gen/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN))
return
interact(user)
/obj/machinery/shield_gen/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=shield_generator")
return
var/t = "<B>Shield Generator Control Console</B><BR><br>"
if(locked)
t += "<i>Swipe your ID card to begin.</i>"
else
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
t += "Coverage radius (restart required): \
<a href='?src=\ref[src];change_radius=-5'>--</a> \
<a href='?src=\ref[src];change_radius=-1'>-</a> \
[field_radius * 2]m \
<a href='?src=\ref[src];change_radius=1'>+</a> \
<a href='?src=\ref[src];change_radius=5'>++</a><br>"
t += "Overall field strength: [average_field_strength] Renwicks ([max_field_strength ? 100 * average_field_strength / max_field_strength : "NA"]%)<br>"
t += "Charge rate: <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> \
<a href='?src=\ref[src];strengthen_rate=-0.01'>-</a> \
[strengthen_rate] Renwicks/sec \
<a href='?src=\ref[src];strengthen_rate=0.01'>+</a> \
<a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
t += "Upkeep energy: [field.len * average_field_strength / energy_conversion_rate] Watts/sec<br>"
t += "Additional energy required to charge: [field.len * strengthen_rate / energy_conversion_rate] Watts/sec<br>"
t += "Maximum field strength: \
<a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> \
<a href='?src=\ref[src];max_field_strength=-10'>--</a> \
<a href='?src=\ref[src];max_field_strength=-1'>-</a> \
[max_field_strength] Renwicks \
<a href='?src=\ref[src];max_field_strength=1'>+</a> \
<a href='?src=\ref[src];max_field_strength=10'>++</a> \
<a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src]'>Refresh</A> "
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=shield_generator;size=500x800")
user.set_machine(src)
/obj/machinery/shield_gen/process()
if(active && field.len)
var/stored_renwicks = 0
var/target_field_strength = min(strengthen_rate + max(average_field_strength, 0), max_field_strength)
if(owned_capacitor)
var/required_energy = field.len * target_field_strength / energy_conversion_rate
var/assumed_charge = min(owned_capacitor.stored_charge, required_energy)
stored_renwicks = assumed_charge * energy_conversion_rate
owned_capacitor.stored_charge -= assumed_charge
time_since_fail++
average_field_strength = 0
target_field_strength = stored_renwicks / field.len
for(var/obj/effect/energy_field/E in field)
if(stored_renwicks)
var/strength_change = target_field_strength - E.strength
if(strength_change > stored_renwicks)
strength_change = stored_renwicks
if(E.strength < 0)
E.strength = 0
else
E.Strengthen(strength_change)
stored_renwicks -= strength_change
average_field_strength += E.strength
else
E.Strengthen(-E.strength)
average_field_strength /= field.len
if(average_field_strength < 0)
time_since_fail = 0
else
average_field_strength = 0
/obj/machinery/shield_gen/Topic(href, href_list[])
..()
if( href_list["close"] )
usr << browse(null, "window=shield_generator")
usr.unset_machine()
return
else if( href_list["toggle"] )
toggle()
else if( href_list["change_radius"] )
field_radius += text2num(href_list["change_radius"])
if(field_radius > 200)
field_radius = 200
else if(field_radius < 0)
field_radius = 0
else if( href_list["strengthen_rate"] )
strengthen_rate += text2num(href_list["strengthen_rate"])
if(strengthen_rate > 1)
strengthen_rate = 1
else if(strengthen_rate < 0)
strengthen_rate = 0
else if( href_list["max_field_strength"] )
max_field_strength += text2num(href_list["max_field_strength"])
if(max_field_strength > 1000)
max_field_strength = 1000
else if(max_field_strength < 0)
max_field_strength = 0
//
updateDialog()
/obj/machinery/shield_gen/power_change()
if(stat & BROKEN)
icon_state = "broke"
else
if( powered() )
if (src.active)
icon_state = "generator1"
else
icon_state = "generator0"
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "generator0"
stat |= NOPOWER
if (src.active)
toggle()
/obj/machinery/shield_gen/ex_act(var/severity)
if(active)
toggle()
return ..()
/*
/obj/machinery/shield_gen/proc/check_powered()
check_powered = 1
if(!anchored)
powered = 0
return 0
var/turf/T = src.loc
var/obj/structure/cable/C = T.get_cable_node()
var/net
if (C)
net = C.netnum // find the powernet of the connected cable
if(!net)
powered = 0
return 0
var/datum/powernet/PN = powernets[net] // find the powernet. Magic code, voodoo code.
if(!PN)
powered = 0
return 0
var/surplus = max(PN.avail-PN.load, 0)
var/shieldload = min(rand(50,200), surplus)
if(shieldload==0 && !storedpower) // no cable or no power, and no power stored
powered = 0
return 0
else
powered = 1
if(PN)
storedpower += shieldload
PN.newload += shieldload //uses powernet power.
*/
/obj/machinery/shield_gen/proc/toggle()
active = !active
power_change()
if(active)
var/list/covered_turfs = get_shielded_turfs()
var/turf/T = get_turf(src)
if(T in covered_turfs)
covered_turfs.Remove(T)
for(var/turf/O in covered_turfs)
var/obj/effect/energy_field/E = new(O)
field.Add(E)
del covered_turfs
for(var/mob/M in view(5,src))
M << "\icon[src] You hear heavy droning start up."
else
for(var/obj/effect/energy_field/D in field)
field.Remove(D)
del D
for(var/mob/M in view(5,src))
M << "\icon[src] You hear heavy droning fade out."
//grab the border tiles in a circle around this machine
/obj/machinery/shield_gen/proc/get_shielded_turfs()
var/list/out = list()
for(var/turf/T in range(field_radius, src))
if(get_dist(src,T) == field_radius)
out.Add(T)
return out
@@ -0,0 +1,42 @@
//---------- external shield generator
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
/obj/machinery/shield_gen/external/New()
..()
/obj/machinery/shield_gen/external/get_shielded_turfs()
var
list
open = list(get_turf(src))
closed = list()
while(open.len)
for(var/turf/T in open)
for(var/turf/O in orange(1, T))
if(get_dist(O,src) > field_radius)
continue
var/add_this_turf = 0
if(istype(O,/turf/space))
for(var/turf/simulated/G in orange(1, O))
add_this_turf = 1
break
//uncomment this for structures (but not lattices) to be surrounded by shield as well
/*if(!add_this_turf)
for(var/obj/structure/S in orange(1, O))
if(!istype(S, /obj/structure/lattice))
add_this_turf = 1
break
if(add_this_turf)
for(var/obj/structure/S in O)
if(!istype(S, /obj/structure/lattice))
add_this_turf = 0
break*/
if(add_this_turf && !(O in open) && !(O in closed))
open += O
open -= T
closed += T
return closed
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,132 @@
//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.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.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
*/
@@ -0,0 +1,122 @@
//The laser control computer
//Used to control the lasers
/obj/machinery/computer/lasercon
name = "Laser control computer"
var/list/lasers = new/list
icon_state = "atmos"
var/id
//var/advanced = 0
/obj/machinery/computer/lasercon
New()
spawn(1)
for(var/obj/machinery/zero_point_emitter/las in world)
if(las.id == src.id)
lasers += las
process()
..()
updateDialog()
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=laser_control")
return
var/t = "<TT><B>Laser status monitor</B><HR>"
for(var/obj/machinery/zero_point_emitter/laser in lasers)
t += "Zero Point Laser<br>"
t += "Power level: <A href = '?src=\ref[laser];input=-0.005'>-</A> <A href = '?src=\ref[laser];input=-0.001'>-</A> <A href = '?src=\ref[laser];input=-0.0005'>-</A> <A href = '?src=\ref[laser];input=-0.0001'>-</A> [laser.energy]MeV <A href = '?src=\ref[laser];input=0.0001'>+</A> <A href = '?src=\ref[laser];input=0.0005'>+</A> <A href = '?src=\ref[laser];input=0.001'>+</A> <A href = '?src=\ref[laser];input=0.005'>+</A><BR>"
t += "Frequency: <A href = '?src=\ref[laser];freq=-10000'>-</A> <A href = '?src=\ref[laser];freq=-1000'>-</A> [laser.freq] <A href = '?src=\ref[laser];freq=1000'>+</A> <A href = '?src=\ref[laser];freq=10000'>+</A><BR>"
t += "Output: [laser.active ? "<B>Online</B> <A href = '?src=\ref[laser];online=1'>Offline</A>" : "<A href = '?src=\ref[laser];online=1'>Online</A> <B>Offline</B> "]<BR>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=laser_control;size=500x800")
user.machine = src
/*
/obj/machinery/computer/lasercon/proc/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=powcomp")
return
user.machine = src
var/t = "<TT><B>Laser status monitor</B><HR>"
var/obj/machinery/engine/laser/laser = src.laser[1]
if(!laser)
t += "\red No laser found"
else
t += "Power level: <A href = '?src=\ref[src];input=-4'>-</A> <A href = '?src=\ref[src];input=-3'>-</A> <A href = '?src=\ref[src];input=-2'>-</A> <A href = '?src=\ref[src];input=-1'>-</A> [add_lspace(laser.power,5)] <A href = '?src=\ref[src];input=1'>+</A> <A href = '?src=\ref[src];input=2'>+</A> <A href = '?src=\ref[src];input=3'>+</A> <A href = '?src=\ref[src];input=4'>+</A><BR>"
if(advanced)
t += "Frequency: <A href = '?src=\ref[src];freq=-10000'>-</A> <A href = '?src=\ref[src];freq=-1000'>-</A> [add_lspace(laser.freq,5)] <A href = '?src=\ref[src];freq=1000'>+</A> <A href = '?src=\ref[src];freq=10000'>+</A><BR>"
t += "Output: [laser.on ? "<B>Online</B> <A href = '?src=\ref[src];online=1'>Offline</A>" : "<A href = '?src=\ref[src];online=1'>Online</A> <B>Offline</B> "]<BR>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A></TT>"
user << browse(t, "window=lascomp;size=420x700")
onclose(user, "lascomp")
*/
/obj/machinery/computer/lasercon/Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=laser_control")
usr.machine = null
return
else if( href_list["input"] )
var/i = text2num(href_list["input"])
var/d = i
for(var/obj/machinery/zero_point_emitter/laser in lasers)
var/new_power = laser.energy + d
new_power = max(new_power,0.0001) //lowest possible value
new_power = min(new_power,0.01) //highest possible value
laser.energy = new_power
//
src.updateDialog()
else if( href_list["online"] )
var/obj/machinery/zero_point_emitter/laser = href_list["online"]
laser.active = !laser.active
src.updateDialog()
else if( href_list["freq"] )
var/amt = text2num(href_list["freq"])
for(var/obj/machinery/zero_point_emitter/laser in lasers)
var/new_freq = laser.frequency + amt
new_freq = max(new_freq,1) //lowest possible value
new_freq = min(new_freq,20000) //highest possible value
laser.frequency = new_freq
//
src.updateDialog()
/*
/obj/machinery/computer/lasercon/process()
if(!(stat & (NOPOWER|BROKEN)) )
use_power(250)
//src.updateDialog()
*/
/*
/obj/machinery/computer/lasercon/power_change()
if(stat & BROKEN)
icon_state = "broken"
else
if( powered() )
icon_state = initial(icon_state)
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
stat |= NOPOWER
*/
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,236 @@
//new supermatter lasers
/obj/machinery/zero_point_emitter
name = "Zero-point laser"
desc = "A super-powerful laser"
icon = 'icons/obj/engine.dmi'
icon_state = "laser"
anchored = 0
density = 1
req_access = list(access_research)
use_power = 1
idle_power_usage = 10
active_power_usage = 300
var/active = 0
var/fire_delay = 100
var/last_shot = 0
var/shot_number = 0
var/state = 0
var/locked = 0
var/energy = 0.0001
var/frequency = 1
var/freq = 50000
var/id
/obj/machinery/zero_point_emitter/verb/rotate()
set name = "Rotate"
set category = "Object"
set src in oview(1)
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 90)
return 1
/obj/machinery/zero_point_emitter/New()
..()
return
/obj/machinery/zero_point_emitter/update_icon()
if (active && !(stat & (NOPOWER|BROKEN)))
icon_state = "laser"//"emitter_+a"
else
icon_state = "laser"//"emitter"
/obj/machinery/zero_point_emitter/attack_hand(mob/user as mob)
src.add_fingerprint(user)
if(state == 2)
if(!src.locked)
if(src.active==1)
src.active = 0
user << "You turn off the [src]."
src.use_power = 1
else
src.active = 1
user << "You turn on the [src]."
src.shot_number = 0
src.fire_delay = 100
src.use_power = 2
update_icon()
else
user << "\red The controls are locked!"
else
user << "\red The [src] needs to be firmly secured to the floor first."
return 1
/obj/machinery/zero_point_emitter/emp_act(var/severity)//Emitters are hardened but still might have issues
use_power(1000)
/* if((severity == 1)&&prob(1)&&prob(1))
if(src.active)
src.active = 0
src.use_power = 1 */
return 1
/obj/machinery/zero_point_emitter/process()
if(stat & (NOPOWER|BROKEN))
return
if(src.state != 2)
src.active = 0
return
if(((src.last_shot + src.fire_delay) <= world.time) && (src.active == 1))
src.last_shot = world.time
if(src.shot_number < 3)
src.fire_delay = 2
src.shot_number ++
else
src.fire_delay = rand(20,100)
src.shot_number = 0
use_power(1000)
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
switch(dir)
if(NORTH)
A.yo = 20
A.xo = 0
if(EAST)
A.yo = 0
A.xo = 20
if(WEST)
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.process() //TODO: Carn: check this out
/obj/machinery/zero_point_emitter/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(active)
user << "Turn off the [src] first."
return
switch(state)
if(0)
state = 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] secures [src.name] to the floor.", \
"You secure the external reinforcing bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
if(1)
state = 0
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
"You undo the external reinforcing bolts.", \
"You hear a ratchet")
src.anchored = 0
if(2)
user << "\red The [src.name] needs to be unwelded from the floor."
return
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(active)
user << "Turn off the [src] first."
return
switch(state)
if(0)
user << "\red The [src.name] needs to be wrenched to the floor."
if(1)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
"You start to weld the [src] to the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 2
user << "You weld the [src] to the floor."
else
user << "\red You need more welding fuel to complete this task."
if(2)
if (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
"You start to cut the [src] free from the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 1
user << "You cut the [src] free from the floor."
else
user << "\red You need more welding fuel to complete this task."
return
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(emagged)
user << "\red The lock seems to be broken"
return
if(src.allowed(user))
if(active)
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
else
src.locked = 0 //just in case it somehow gets locked
user << "\red The controls can only be locked when the [src] is online"
else
user << "\red Access denied."
return
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
locked = 0
emagged = 1
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
return
..()
return
/obj/machinery/zero_point_emitter/power_change()
..()
update_icon()
return
/obj/machinery/zero_point_emitter/Topic(href, href_list)
..()
if( href_list["input"] )
var/i = text2num(href_list["input"])
var/d = i
var/new_power = energy + d
new_power = max(new_power,0.0001) //lowest possible value
new_power = min(new_power,0.01) //highest possible value
energy = new_power
//
for(var/obj/machinery/computer/lasercon/comp in world)
if(comp.id == src.id)
comp.updateDialog()
else if( href_list["online"] )
active = !active
//
for(var/obj/machinery/computer/lasercon/comp in world)
if(comp.id == src.id)
comp.updateDialog()
else if( href_list["freq"] )
var/amt = text2num(href_list["freq"])
var/new_freq = frequency + amt
new_freq = max(new_freq,1) //lowest possible value
new_freq = min(new_freq,20000) //highest possible value
frequency = new_freq
//
for(var/obj/machinery/computer/lasercon/comp in world)
if(comp.id == src.id)
comp.updateDialog()
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

@@ -0,0 +1,261 @@
#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
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.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -0,0 +1,263 @@
//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
target.grabbed_by += G
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.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.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.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

+135
View File
@@ -0,0 +1,135 @@
/obj/item/ashtray
icon = 'icons/ashtray.dmi'
var/
max_butts = 0
empty_desc = ""
icon_empty = ""
icon_half = ""
icon_full = ""
icon_broken = ""
/obj/item/ashtray/New()
..()
src.pixel_y = rand(-5, 5)
src.pixel_x = rand(-6, 6)
return
/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (health < 1)
return
if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match))
if (contents.len >= max_butts)
user << "This ashtray is full."
return
user.u_equip(W)
W.loc = src
if (istype(W,/obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/cig = W
if (cig.lit == 1)
src.visible_message("[user] crushes [cig] in [src], putting it out.")
processing_objects.Remove(cig)
var/obj/item/butt = new cig.type_butt(src)
cig.transfer_fingerprints_to(butt)
del(cig)
else if (cig.lit == 0)
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
src.visible_message("[user] places [W] in [src].")
user.update_inv_l_hand()
user.update_inv_r_hand()
add_fingerprint(user)
if (contents.len == max_butts)
icon_state = icon_full
desc = empty_desc + " It's stuffed full."
else if (contents.len > max_butts/2)
icon_state = icon_half
desc = empty_desc + " It's half-filled."
else
health = max(0,health - W.force)
user << "You hit [src] with [W]."
if (health < 1)
die()
return
/obj/item/ashtray/throw_impact(atom/hit_atom)
if (health > 0)
health = max(0,health - 3)
if (health < 1)
die()
return
if (contents.len)
src.visible_message("\red [src] slams into [hit_atom] spilling its contents!")
for (var/obj/item/clothing/mask/cigarette/O in contents)
O.loc = src.loc
icon_state = icon_empty
return ..()
/obj/item/ashtray/proc/die()
src.visible_message("\red [src] shatters spilling its contents!")
for (var/obj/item/clothing/mask/cigarette/O in contents)
O.loc = src.loc
icon_state = icon_broken
/obj/item/ashtray/plastic
name = "plastic ashtray"
desc = "Cheap plastic ashtray."
icon_state = "ashtray_bl"
icon_empty = "ashtray_bl"
icon_half = "ashtray_half_bl"
icon_full = "ashtray_full_bl"
icon_broken = "ashtray_bork_bl"
max_butts = 14
health = 24.0
g_amt = 30
m_amt = 30
empty_desc = "Cheap plastic ashtray."
throwforce = 3.0
die()
..()
name = "pieces of plastic"
desc = "Pieces of plastic with ash on them."
return
/obj/item/ashtray/bronze
name = "bronze ashtray"
desc = "Massive bronze ashtray."
icon_state = "ashtray_br"
icon_empty = "ashtray_br"
icon_half = "ashtray_half_br"
icon_full = "ashtray_full_br"
icon_broken = "ashtray_bork_br"
max_butts = 10
health = 72.0
m_amt = 80
empty_desc = "Massive bronze ashtray."
throwforce = 10.0
die()
..()
name = "pieces of bronze"
desc = "Pieces of bronze with ash on them."
return
/obj/item/ashtray/glass
name = "glass ashtray"
desc = "Glass ashtray. Looks fragile."
icon_state = "ashtray_gl"
icon_empty = "ashtray_gl"
icon_half = "ashtray_half_gl"
icon_full = "ashtray_full_gl"
icon_broken = "ashtray_bork_gl"
max_butts = 12
health = 12.0
g_amt = 60
empty_desc = "Glass ashtray. Looks fragile."
throwforce = 6.0
die()
..()
name = "shards of glass"
desc = "Shards of glass with ash on them."
playsound(src, "shatter", 30, 1)
return
+186
View File
@@ -0,0 +1,186 @@
/////////////////////////////////////////////
//Guest pass ////////////////////////////////
/////////////////////////////////////////////
/obj/item/weapon/card/id/guest
name = "guest pass"
desc = "Allows temporary access to station areas."
icon_state = "guest"
var/temp_access = list() //to prevent agent cards stealing access as permanent
var/expiration_time = 0
var/reason = "NOT SPECIFIED"
/obj/item/weapon/card/id/guest/GetAccess()
if (world.time > expiration_time)
return access
else
return temp_access
/obj/item/weapon/card/id/guest/examine()
..()
if (world.time < expiration_time)
usr << "\blue This pass expires at [worldtime2text(expiration_time)]."
else
usr << "\red It expired at [worldtime2text(expiration_time)]."
/obj/item/weapon/card/id/guest/read()
if (world.time > expiration_time)
usr << "This pass expired at [worldtime2text(expiration_time)]."
else
usr << "This pass expires at [worldtime2text(expiration_time)]."
usr << "It grants access to following areas:"
for (var/A in temp_access)
usr << "[get_access_desc(A)]."
usr << "Issuing reason: [reason]."
return
/////////////////////////////////////////////
//Guest pass terminal////////////////////////
/////////////////////////////////////////////
/obj/machinery/computer/guestpass
name = "guest pass terminal"
icon_state = "guest"
density = 0
var/obj/item/weapon/card/id/giver
var/list/accesses = list()
var/giv_name = "NOT SPECIFIED"
var/reason = "NOT SPECIFIED"
var/duration = 0
var/list/internal_log = list()
var/mode = 0 // 0 - making pass, 1 - viewing logs
/obj/machinery/computer/guestpass/New()
..()
uid = "[rand(100,999)]-G[rand(10,99)]"
/obj/machinery/computer/guestpass/attackby(obj/O, mob/user)
if(istype(O, /obj/item/weapon/card/id))
user.drop_item()
O.loc = src
giver = O
updateUsrDialog()
/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer/guestpass/attack_paw(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer/guestpass/attack_hand(var/mob/user as mob)
if(..())
return
user.set_machine(src)
var/dat
if (mode == 1) //Logs
dat += "<h3>Activity log</h3><br>"
for (var/entry in internal_log)
dat += "[entry]<br><hr>"
dat += "<a href='?src=\ref[src];action=print'>Print</a><br>"
dat += "<a href='?src=\ref[src];mode=0'>Back</a><br>"
else
dat += "<h3>Guest pass terminal #[uid]</h3><br>"
dat += "<a href='?src=\ref[src];mode=1'>View activity log</a><br><br>"
dat += "Issuing ID: <a href='?src=\ref[src];action=id'>[giver]</a><br>"
dat += "Issued to: <a href='?src=\ref[src];choice=giv_name'>[giv_name]</a><br>"
dat += "Reason: <a href='?src=\ref[src];choice=reason'>[reason]</a><br>"
dat += "Duration (minutes): <a href='?src=\ref[src];choice=duration'>[duration] m</a><br>"
dat += "Access to areas:<br>"
if (giver && giver.access)
for (var/A in giver.access)
var/area = get_access_desc(A)
if (A in accesses)
area = "<b>[area]</b>"
dat += "<a href='?src=\ref[src];choice=access;access=[A]'>[area]</a><br>"
dat += "<br><a href='?src=\ref[src];action=issue'>Issue pass</a><br>"
user << browse(dat, "window=guestpass;size=400x520")
onclose(user, "guestpass")
/obj/machinery/computer/guestpass/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
if (href_list["mode"])
mode = text2num(href_list["mode"])
if (href_list["choice"])
switch(href_list["choice"])
if ("giv_name")
var/nam = input("Person pass is issued to", "Name", name)
if (nam)
giv_name = nam
if ("reason")
var/reas = input("Reason why pass is issued", "Reason", reason)
reason = reas
if ("duration")
var/dur = input("Duration (in minutes) during which pass is valid.", "Duration") as num
if (dur > 0 && dur < 30)
duration = dur
else
usr << "\red Invalid duration."
if ("access")
var/A = text2num(href_list["access"])
if (A in accesses)
accesses.Remove(A)
else
accesses.Add(A)
if (href_list["action"])
switch(href_list["action"])
if ("id")
if (giver)
if(ishuman(usr))
giver.loc = usr.loc
if(!usr.get_active_hand())
usr.put_in_hands(giver)
giver = null
else
giver.loc = src.loc
giver = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
giver = I
updateUsrDialog()
if ("print")
var/dat = "<h3>Activity log of guest pass terminal #[uid]</h3><br>"
for (var/entry in internal_log)
dat += "[entry]<br><hr>"
//usr << "Printing the log, standby..."
//sleep(50)
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper( loc )
P.name = "activity log"
P.info = dat
if ("issue")
if (giver)
var/number = add_zero("[rand(0,9999)]", 4)
var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: "
for (var/i=1 to accesses.len)
var/A = accesses[i]
if (A)
var/area = get_access_desc(A)
entry += "[i > 1 ? ", [area]" : "[area]"]"
entry += ". Expires at [worldtime2text(world.time + duration*10*60)]."
internal_log.Add(entry)
var/obj/item/weapon/card/id/guest/pass = new(src.loc)
pass.temp_access = accesses.Copy()
pass.registered_name = giv_name
pass.expiration_time = world.time + duration*10*60
pass.reason = reason
pass.name = "guest pass #[number]"
else
usr << "\red Cannot issue pass without issuing ID."
updateUsrDialog()
return
@@ -0,0 +1,149 @@
// MEDICAL SIDE EFFECT BASE
// ========================
/datum/medical_effect
var/name = "None"
var/strength = 0
var/start = 0
var/list/triggers
var/list/cures
var/cure_message
/datum/medical_effect/proc/manifest(mob/living/carbon/human/H)
for(var/R in cures)
if(H.reagents.has_reagent(R))
return 0
for(var/R in triggers)
if(H.reagents.get_reagent_amount(R) >= triggers[R])
return 1
return 0
/datum/medical_effect/proc/on_life(mob/living/carbon/human/H, strength)
return
/datum/medical_effect/proc/cure(mob/living/carbon/human/H)
for(var/R in cures)
if(H.reagents.has_reagent(R))
if (cure_message)
H <<"\blue [cure_message]"
return 1
return 0
// MOB HELPERS
// ===========
/mob/living/carbon/human/var/list/datum/medical_effect/side_effects = list()
/mob/proc/add_side_effect(name, strength = 0)
/mob/living/carbon/human/add_side_effect(name, strength = 0)
for(var/datum/medical_effect/M in src.side_effects)
if(M.name == name)
M.strength = max(M.strength, 10)
M.start = life_tick
return
var/T = side_effects[name]
if (!T)
return
var/datum/medical_effect/M = new T
if(M.name == name)
M.strength = strength
M.start = life_tick
side_effects += M
/mob/living/carbon/human/proc/handle_medical_side_effects()
//Going to handle those things only every few ticks.
if(life_tick % 15 != 0)
return 0
var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect
for(var/T in L)
var/datum/medical_effect/M = new T
if (M.manifest(src))
src.add_side_effect(M.name)
// One full cycle(in terms of strength) every 10 minutes
for (var/datum/medical_effect/M in side_effects)
if (!M) continue
var/strength_percent = sin((life_tick - M.start) / 2)
// Only do anything if the effect is currently strong enough
if(strength_percent >= 0.4)
if (M.cure(src) || M.strength > 50)
side_effects -= M
M = null
else
if(life_tick % 45 == 0)
M.on_life(src, strength_percent*M.strength)
// Effect slowly growing stronger
M.strength+=0.08
// HEADACHE
// ========
/datum/medical_effect/headache
name = "Headache"
triggers = list("cryoxadone" = 10, "bicaridine" = 15, "tricordrazine" = 15)
cures = list("alkysine", "tramadol", "paracetamol", "oxycodone")
cure_message = "Your head stops throbbing..."
/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a light pain in your head.",0)
if(11 to 30)
H.custom_pain("You feel a throbbing pain in your head!",1)
if(31 to INFINITY)
H.custom_pain("You feel an excrutiating pain in your head!",1)
// BAD STOMACH
// ===========
/datum/medical_effect/bad_stomach
name = "Bad Stomach"
triggers = list("kelotane" = 30, "dermaline" = 15)
cures = list("anti_toxin")
cure_message = "Your stomach feels a little better now..."
/datum/medical_effect/bad_stomach/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a bit light around the stomach.",0)
if(11 to 30)
H.custom_pain("Your stomach hurts.",0)
if(31 to INFINITY)
H.custom_pain("You feel sick.",1)
// CRAMPS
// ======
/datum/medical_effect/cramps
name = "Cramps"
triggers = list("anti_toxin" = 30, "tramadol" = 15)
cures = list("inaprovaline")
cure_message = "The cramps let up..."
/datum/medical_effect/cramps/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("The muscles in your body hurt a little.",0)
if(11 to 30)
H.custom_pain("The muscles in your body cramp up painfully.",0)
if(31 to INFINITY)
H.emote("me",1,"flinches as all the muscles in their body cramp up.")
H.custom_pain("There's pain all over your body.",1)
// ITCH
// ====
/datum/medical_effect/itch
name = "Itch"
triggers = list("space_drugs" = 10)
cures = list("inaprovaline")
cure_message = "The itching stops..."
/datum/medical_effect/itch/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a slight itch.",0)
if(11 to 30)
H.custom_pain("You want to scratch your itch badly.",0)
if(31 to INFINITY)
H.emote("me",1,"shivers slightly.")
H.custom_pain("This itch makes it really hard to concentrate.",1)
+590
View File
@@ -0,0 +1,590 @@
/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
@@ -0,0 +1,248 @@
/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
grabbed_by += G
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
grabbed_by += G
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
@@ -0,0 +1,12 @@
/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)
@@ -0,0 +1,318 @@
/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.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.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.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.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.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.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.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.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.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.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.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.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
+516
View File
@@ -0,0 +1,516 @@
/mob/living/carbon/amorph
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/oxygen_alert = 0
var/toxins_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.toxins_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
+6
View File
@@ -0,0 +1,6 @@
/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]\"";
+596
View File
@@ -0,0 +1,596 @@
//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/host = src.host
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)
+12
View File
@@ -0,0 +1,12 @@
/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)
+360
View File
@@ -0,0 +1,360 @@
/obj/item/weapon/circuitboard/atmoscontrol
name = "\improper Central Atmospherics Computer Circuitboard"
build_path = /obj/machinery/computer/atmoscontrol
/obj/machinery/computer/atmoscontrol
name = "\improper Central Atmospherics Computer"
icon = 'icons/obj/computer.dmi'
icon_state = "computer_generic"
density = 1
anchored = 1.0
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
var/obj/machinery/alarm/current
var/overridden = 0 //not set yet, can't think of a good way to do it
req_access = list(access_ce)
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
return interact(user)
/obj/machinery/computer/atmoscontrol/attack_paw(var/mob/user as mob)
return interact(user)
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
if(..())
return
return interact(user)
/obj/machinery/computer/atmoscontrol/interact(mob/user)
user.set_machine(src)
if(allowed(user))
overridden = 1
else if(!emagged)
overridden = 0
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
if(current)
dat += specific()
else
for(var/obj/machinery/alarm/alarm in machines)
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
switch(max(alarm.danger_level, alarm.alarm_area.atmosalm))
if (0)
dat += "<font color=green>"
if (1)
dat += "<font color=blue>"
if (2)
dat += "<font color=red>"
dat += "[alarm]</font></a><br/>"
user << browse(dat, "window=atmoscontrol")
/obj/machinery/computer/atmoscontrol/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
user.visible_message("\red \The [user] swipes \a [I] through \the [src], causing the screen to flash!",\
"\red You swipe your [I] through \the [src], the screen flashing as you gain full control.",\
"You hear the swipe of a card through a reader, and an electronic warble.")
emagged = 1
overridden = 1
return
return ..()
/obj/machinery/computer/atmoscontrol/proc/specific()
if(!current)
return ""
var/dat = "<h3>[current.name]</h3><hr>"
dat += current.return_status()
if(current.remote_control || overridden)
dat += "<hr>[return_controls()]"
return dat
//a bunch of this is copied from atmos alarms
/obj/machinery/computer/atmoscontrol/Topic(href, href_list)
if(..())
return
if(href_list["reset"])
current = null
if(href_list["alarm"])
current = locate(href_list["alarm"])
if(href_list["command"])
var/device_id = href_list["id_tag"]
switch(href_list["command"])
if(
"power",
"adjust_external_pressure",
"checks",
"co2_scrub",
"tox_scrub",
"n2o_scrub",
"panic_siphon",
"scrubbing"
)
current.send_signal(device_id, list (href_list["command"] = text2num(href_list["val"])))
spawn(3)
src.updateUsrDialog()
//if("adjust_threshold") //was a good idea but required very wide window
if("set_threshold")
var/env = href_list["env"]
var/threshold = text2num(href_list["var"])
var/list/selected = current.TLV[env]
var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound")
var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as num|null
if (isnull(newval) || ..() || (current.locked && issilicon(usr)))
return
if (newval<0)
selected[threshold] = -1.0
else if (env=="temperature" && newval>5000)
selected[threshold] = 5000
else if (env=="pressure" && newval>50*ONE_ATMOSPHERE)
selected[threshold] = 50*ONE_ATMOSPHERE
else if (env!="temperature" && env!="pressure" && newval>200)
selected[threshold] = 200
else
newval = round(newval,0.01)
selected[threshold] = newval
if(threshold == 1)
if(selected[1] > selected[2])
selected[2] = selected[1]
if(selected[1] > selected[3])
selected[3] = selected[1]
if(selected[1] > selected[4])
selected[4] = selected[1]
if(threshold == 2)
if(selected[1] > selected[2])
selected[1] = selected[2]
if(selected[2] > selected[3])
selected[3] = selected[2]
if(selected[2] > selected[4])
selected[4] = selected[2]
if(threshold == 3)
if(selected[1] > selected[3])
selected[1] = selected[3]
if(selected[2] > selected[3])
selected[2] = selected[3]
if(selected[3] > selected[4])
selected[4] = selected[3]
if(threshold == 4)
if(selected[1] > selected[4])
selected[1] = selected[4]
if(selected[2] > selected[4])
selected[2] = selected[4]
if(selected[3] > selected[4])
selected[3] = selected[4]
//Sets the temperature the built-in heater/cooler tries to maintain.
if(env == "temperature")
if(current.target_temperature < selected[2])
current.target_temperature = selected[2]
if(current.target_temperature > selected[3])
current.target_temperature = selected[3]
spawn(1)
updateUsrDialog()
return
if(href_list["screen"])
current.screen = text2num(href_list["screen"])
spawn(1)
src.updateUsrDialog()
return
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
current.air_doors_close(1)
if("1")
current.air_doors_open(1)
if(href_list["atmos_alarm"])
if (current.alarm_area.atmosalert(2))
current.apply_danger_level(2)
spawn(1)
src.updateUsrDialog()
current.update_icon()
return
if(href_list["atmos_reset"])
if (current.alarm_area.atmosalert(0))
current.apply_danger_level(0)
spawn(1)
src.updateUsrDialog()
current.update_icon()
return
if(href_list["mode"])
current.mode = text2num(href_list["mode"])
current.apply_mode()
spawn(5)
src.updateUsrDialog()
return
updateUsrDialog()
//copypasta from alarm code, changed to work with this without derping hard
//---START COPYPASTA----
/obj/machinery/computer/atmoscontrol/proc/return_controls()
var/output = ""//"<B>[alarm_zone] Air [name]</B><HR>"
switch(current.screen)
if (AALARM_SCREEN_MAIN)
if(current.alarm_area.atmosalm)
output += {"<a href='?src=\ref[src];alarm=\ref[current];atmos_reset=1'>Reset - Atmospheric Alarm</a><hr>"}
else
output += {"<a href='?src=\ref[src];alarm=\ref[current];atmos_alarm=1'>Activate - Atmospheric Alarm</a><hr>"}
output += {"
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_SCRUB]'>Scrubbers Control</a><br>
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_VENT]'>Vents Control</a><br>
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MODE]'>Set environmental mode</a><br>
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_SENSORS]'>Sensor Control</a><br>
<HR>
"}
if (current.mode==AALARM_MODE_PANIC)
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_SCRUBBING]'>turn syphoning off</A>"
else
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];alarm=\ref[current];atmos_unlock=[current.alarm_area.air_doors_activated]'>[current.alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
if (AALARM_SCREEN_VENT)
var/sensor_data = ""
if(current.alarm_area.air_vent_names.len)
for(var/id_tag in current.alarm_area.air_vent_names)
var/long_name = current.alarm_area.air_vent_names[id_tag]
var/list/data = current.alarm_area.air_vent_info[id_tag]
var/state = ""
if(!data)
state = "<font color='red'> can not be found!</font>"
data = list("external" = 0) //for "0" instead of empty string
else if (data["timestamp"]+AALARM_REPORT_TIMEOUT < world.time)
state = "<font color='red'> not responding!</font>"
sensor_data += {"
<B>[long_name]</B>[state]<BR>
<B>Operating:</B>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=power;val=[!data["power"]]'>[data["power"]?"on":"off"]</A>
<BR>
<B>Pressure checks:</B>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=checks;val=[data["checks"]^1]' [(data["checks"]&1)?"style='font-weight:bold;'":""]>external</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=checks;val=[data["checks"]^2]' [(data["checks"]&2)?"style='font-weight:bold;'":""]>internal</A>
<BR>
<B>External pressure bound:</B>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=-1000'>-</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=-100'>-</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=-10'>-</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=-1'>-</A>
[data["external"]]
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=+1'>+</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=+10'>+</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=+100'>+</A>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=adjust_external_pressure;val=+1000'>+</A>
<BR>
"}
if (data["direction"] == "siphon")
sensor_data += {"
<B>Direction:</B>
siphoning
<BR>
"}
sensor_data += {"<HR>"}
else
sensor_data = "No vents connected.<BR>"
output = {"<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>[sensor_data]"}
if (AALARM_SCREEN_SCRUB)
var/sensor_data = ""
if(current.alarm_area.air_scrub_names.len)
for(var/id_tag in current.alarm_area.air_scrub_names)
var/long_name = current.alarm_area.air_scrub_names[id_tag]
var/list/data = current.alarm_area.air_scrub_info[id_tag]
var/state = ""
if(!data)
state = "<font color='red'> can not be found!</font>"
data = list("external" = 0) //for "0" instead of empty string
else if (data["timestamp"]+AALARM_REPORT_TIMEOUT < world.time)
state = "<font color='red'> not responding!</font>"
sensor_data += {"
<B>[long_name]</B>[state]<BR>
<B>Operating:</B>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=power;val=[!data["power"]]'>[data["power"]?"on":"off"]</A><BR>
<B>Type:</B>
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=scrubbing;val=[!data["scrubbing"]]'>[data["scrubbing"]?"scrubbing":"syphoning"]</A><BR>
"}
if(data["scrubbing"])
sensor_data += {"
<B>Filtering:</B>
Carbon Dioxide
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=co2_scrub;val=[!data["filter_co2"]]'>[data["filter_co2"]?"on":"off"]</A>;
Toxins
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=tox_scrub;val=[!data["filter_toxins"]]'>[data["filter_toxins"]?"on":"off"]</A>;
Nitrous Oxide
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=n2o_scrub;val=[!data["filter_n2o"]]'>[data["filter_n2o"]?"on":"off"]</A>
<BR>
"}
sensor_data += {"
<B>Panic syphon:</B> [data["panic"]?"<font color='red'><B>PANIC SYPHON ACTIVATED</B></font>":""]
<A href='?src=\ref[src];alarm=\ref[current];id_tag=[id_tag];command=panic_siphon;val=[!data["panic"]]'><font color='[(data["panic"]?"blue'>Dea":"red'>A")]ctivate</font></A><BR>
<HR>
"}
else
sensor_data = "No scrubbers connected.<BR>"
output = {"<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>[sensor_data]"}
if (AALARM_SCREEN_MODE)
output += {"
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
<b>Air machinery mode for the area:</b><ul>"}
var/list/modes = list(AALARM_MODE_SCRUBBING = "Filtering - Scrubs out contaminants",\
AALARM_MODE_REPLACEMENT = "<font color='blue'>Replace Air - Siphons out air while replacing</font>",\
AALARM_MODE_PANIC = "<font color='red'>Panic - Siphons air out of the room</font>",\
AALARM_MODE_CYCLE = "<font color='red'>Cycle - Siphons air before replacing</font>",\
AALARM_MODE_FILL = "<font color='green'>Fill - Shuts off scrubbers and opens vents</font>",\
AALARM_MODE_OFF = "<font color='blue'>Off - Shuts off vents and scrubbers</font>",)
for (var/m=1,m<=modes.len,m++)
if (current.mode==m)
output += {"<li><A href='?src=\ref[src];alarm=\ref[current];mode=[m]'><b>[modes[m]]</b></A> (selected)</li>"}
else
output += {"<li><A href='?src=\ref[src];alarm=\ref[current];mode=[m]'>[modes[m]]</A></li>"}
output += "</ul>"
if (AALARM_SCREEN_SENSORS)
output += {"
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
<b>Alarm thresholds:</b><br>
Partial pressure for gases
<style>/* some CSS woodoo here. Does not work perfect in ie6 but who cares? */
table td { border-left: 1px solid black; border-top: 1px solid black;}
table tr:first-child th { border-left: 1px solid black;}
table th:first-child { border-top: 1px solid black; font-weight: normal;}
table tr:first-child th:first-child { border: none;}
.dl0 { color: green; }
.dl1 { color: orange; }
.dl2 { color: red; font-weght: bold;}
</style>
<table cellspacing=0>
<TR><th></th><th class=dl2>min2</th><th class=dl1>min1</th><th class=dl1>max1</th><th class=dl2>max2</th></TR>
"}
var/list/gases = list(
"oxygen" = "O<sub>2</sub>",
"carbon dioxide" = "CO<sub>2</sub>",
"plasma" = "Toxin",
"other" = "Other",
)
var/list/tlv
for (var/g in gases)
output += "<TR><th>[gases[g]]</th>"
tlv = current.TLV[g]
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[i]'>[tlv[i] >= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["pressure"]
output += "<TR><th>Pressure</th>"
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["temperature"]
output += "<TR><th>Temperature</th>"
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
output += "</table>"
return output
//---END COPYPASTA----
+84
View File
@@ -0,0 +1,84 @@
//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()
+65
View File
@@ -0,0 +1,65 @@
/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
@@ -0,0 +1,53 @@
/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
+467
View File
@@ -0,0 +1,467 @@
/*
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 = FPRINT | TABLEPASS | 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
@@ -0,0 +1,145 @@
// 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()
@@ -0,0 +1,23 @@
/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
@@ -0,0 +1,208 @@
/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/plasma/p3 = new /obj/item/weapon/tank/plasma(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/plasma/p3 = new /obj/item/weapon/tank/plasma(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/plasma/p3 = new /obj/item/weapon/tank/plasma(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/plasma/p4 = new /obj/item/weapon/tank/plasma(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/plasma/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/plasma/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/plasma/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)
+167
View File
@@ -0,0 +1,167 @@
//Define all tape types in policetape.dm
/obj/item/taperoll
name = "tape roll"
icon = 'icons/policetape.dmi'
icon_state = "rollstart"
flags = FPRINT
w_class = 1.0
var/turf/start
var/turf/end
var/tape_type = /obj/item/tape
var/icon_base
/obj/item/tape
name = "tape"
icon = 'icons/policetape.dmi'
anchored = 1
density = 1
var/icon_base
/obj/item/taperoll/police
name = "police tape"
desc = "A roll of police tape used to block off crime scenes from the public."
icon_state = "police_start"
tape_type = /obj/item/tape/police
icon_base = "police"
/obj/item/tape/police
name = "police tape"
desc = "A length of police tape. Do not cross."
req_access = list(access_security)
icon_base = "police"
/obj/item/taperoll/engineering
name = "engineering tape"
desc = "A roll of engineering tape used to block off working areas from the public."
icon_state = "engineering_start"
tape_type = /obj/item/tape/engineering
icon_base = "engineering"
/obj/item/tape/engineering
name = "engineering tape"
desc = "A length of engineering tape. Better not cross it."
req_one_access = list(access_engine,access_atmospherics)
icon_base = "engineering"
/obj/item/taperoll/attack_self(mob/user as mob)
if(icon_state == "[icon_base]_start")
start = get_turf(src)
usr << "\blue You place the first end of the [src]."
icon_state = "[icon_base]_stop"
else
icon_state = "[icon_base]_start"
end = get_turf(src)
if(start.y != end.y && start.x != end.x || start.z != end.z)
usr << "\blue [src] can only be laid horizontally or vertically."
return
var/turf/cur = start
var/dir
if (start.x == end.x)
var/d = end.y-start.y
if(d) d = d/abs(d)
end = get_turf(locate(end.x,end.y+d,end.z))
dir = "v"
else
var/d = end.x-start.x
if(d) d = d/abs(d)
end = get_turf(locate(end.x+d,end.y,end.z))
dir = "h"
var/can_place = 1
while (cur!=end && can_place)
if(cur.density == 1)
can_place = 0
else if (istype(cur, /turf/space))
can_place = 0
else
for(var/obj/O in cur)
if(!istype(O, /obj/item/tape) && O.density)
can_place = 0
break
cur = get_step_towards(cur,end)
if (!can_place)
usr << "\blue You can't run \the [src] through that!"
return
cur = start
var/tapetest = 0
while (cur!=end)
for(var/obj/item/tape/Ptest in cur)
if(Ptest.icon_state == "[Ptest.icon_base]_[dir]")
tapetest = 1
if(tapetest != 1)
var/obj/item/tape/P = new tape_type(cur)
P.icon_state = "[P.icon_base]_[dir]"
cur = get_step_towards(cur,end)
//is_blocked_turf(var/turf/T)
usr << "\blue You finish placing the [src]." //Git Test
/obj/item/taperoll/afterattack(var/atom/A, mob/user as mob)
if (istype(A, /obj/machinery/door/airlock))
var/turf/T = get_turf(A)
var/obj/item/tape/P = new tape_type(T.x,T.y,T.z)
P.loc = locate(T.x,T.y,T.z)
P.icon_state = "[src.icon_base]_door"
P.layer = 3.2
user << "\blue You finish placing the [src]."
/obj/item/tape/Bumped(M as mob)
if(src.allowed(M))
var/turf/T = get_turf(src)
M:loc = T
/obj/item/tape/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(!density) return 1
if(air_group || (height==0)) return 1
if ((mover.flags & 2 || istype(mover, /obj/effect/meteor) || mover.throwing == 1) )
return 1
else
return 0
/obj/item/tape/attackby(obj/item/weapon/W as obj, mob/user as mob)
breaktape(W, user)
/obj/item/tape/attack_hand(mob/user as mob)
if (user.a_intent == "help" && src.allowed(user))
user.show_viewers("\blue [user] lifts [src], allowing passage.")
src.density = 0
spawn(200)
src.density = 1
else
breaktape(null, user)
/obj/item/tape/attack_paw(mob/user as mob)
breaktape(/obj/item/weapon/wirecutters,user)
/obj/item/tape/proc/breaktape(obj/item/weapon/W as obj, mob/user as mob)
if(user.a_intent == "help" && ((!is_sharp(W) && src.allowed(user))))
user << "You can't break the [src] with that!"
return
user.show_viewers("\blue [user] breaks the [src]!")
var/dir[2]
var/icon_dir = src.icon_state
if(icon_dir == "[src.icon_base]_h")
dir[1] = EAST
dir[2] = WEST
if(icon_dir == "[src.icon_base]_v")
dir[1] = NORTH
dir[2] = SOUTH
for(var/i=1;i<3;i++)
var/N = 0
var/turf/cur = get_step(src,dir[i])
while(N != 1)
N = 1
for (var/obj/item/tape/P in cur)
if(P.icon_state == icon_dir)
N = 0
del(P)
cur = get_step(cur,dir[i])
del(src)
return
+71
View File
@@ -0,0 +1,71 @@
//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
@@ -0,0 +1,8 @@
/*
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.
*/
@@ -0,0 +1,126 @@
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)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
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
@@ -0,0 +1,10 @@
/*
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!
*/
@@ -0,0 +1,522 @@
//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("Botanist") // -- 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", "Botanist", "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"
@@ -0,0 +1,33 @@
/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 = FPRINT | TABLEPASS | 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 = FPRINT | TABLEPASS | 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 = FPRINT | TABLEPASS | ONESIZEFITSALL
/obj/item/clothing/shoes/boots
name = "boots"
desc = "Nanotrasen-issue hard-toe safety boots."
icon_state = "secshoes"
item_state = "secshoes"
color = "hosred"
@@ -0,0 +1,152 @@
/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)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
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)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
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/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)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
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)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
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
@@ -0,0 +1,235 @@
/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()
sleep(2)
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()
sleep(2)
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()
sleep(2)
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)
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()
sleep(2)
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()
sleep(2)
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()
sleep(2)
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()
sleep(2)
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()
sleep(2)
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
@@ -0,0 +1,311 @@
/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/toxins_white
name = "toxins wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/toxins_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
@@ -0,0 +1,385 @@
//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
@@ -0,0 +1,32 @@
// MOVED HERE FROM ULTRALIGHT WHICH IS PROBABLY A BAD THING
#define UL_I_FALLOFF_SQUARE 0
#define UL_I_FALLOFF_ROUND 1
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
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)
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
@@ -0,0 +1,96 @@
/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
@@ -0,0 +1,43 @@
// Reference: http://www.teuse.net/personal/harrington/hh_bible.htm
// http://www.trmn.org/portal/images/uniforms/rmn/rmn_officer_srv_dress_lrg.png
/obj/item/clothing/head/beret/centcom/officer
name = "officers beret"
desc = "A black beret adorned with the shield—a silver kite shield with an engraved sword—of the NanoTrasen security forces, announcing to the world that the wearer is a defender of NanoTrasen."
icon_state = "centcomofficerberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/beret/centcom/captain
name = "captains beret"
desc = "A white beret adorned with the shield—a cobalt kite shield with an engraved sword—of the NanoTrasen security forces, worn only by those captaining a vessel of the NanoTrasen Navy."
icon_state = "centcomcaptain"
flags = FPRINT | TABLEPASS
/obj/item/clothing/shoes/centcom
name = "dress shoes"
desc = "They appear impeccably polished."
icon_state = "laceups"
/obj/item/clothing/under/rank/centcom/representative
desc = "Gold trim on space-black cloth, this uniform displays the rank of \"Ensign\" and bears \"N.C.V. Fearless CV-286\" on the left shounder."
name = "\improper NanoTrasen Navy Uniform"
icon_state = "officer"
item_state = "g_suit"
item_color = "officer"
displays_id = 0
/obj/item/clothing/under/rank/centcom/officer
desc = "Gold trim on space-black cloth, this uniform displays the rank of \"Lieutenant Commander\" and bears \"N.C.V. Fearless CV-286\" on the left shounder."
name = "\improper NanoTrasen Officers Uniform"
icon_state = "officer"
item_state = "g_suit"
item_color = "officer"
displays_id = 0
/obj/item/clothing/under/rank/centcom/captain
desc = "Gold trim on space-black cloth, this uniform displays the rank of \"Captain\" and bears \"N.C.V. Fearless CV-286\" on the left shounder."
name = "\improper NanoTrasen Captains Uniform"
icon_state = "centcom"
item_state = "dg_suit"
item_color = "centcom"
displays_id = 0
@@ -0,0 +1,21 @@
//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
@@ -0,0 +1,76 @@
//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."
flags = FPRINT | TABLEPASS
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
flags = FPRINT|TABLEPASS
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)
*/
+614
View File
@@ -0,0 +1,614 @@
//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()
set src in view()
..()
if(src in usr)
usr << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
if(seal_torn && !contents.len)
usr << "The seal on the bag is broken."
else
usr << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
return
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/toxins(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/toxins(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)
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@@ -0,0 +1,467 @@
//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/temperature_expose(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)
flags = FPRINT | TABLEPASS
/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)
flags = FPRINT | TABLEPASS
/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)
flags = FPRINT | TABLEPASS
/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"
flags = FPRINT | TABLEPASS
/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"
flags = FPRINT | TABLEPASS
/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"
flags = FPRINT | TABLEPASS
/obj/item/clothing/suit/armor/navysecvest
name = "armored coat"
desc = "An armored coat that protects against some damage."
icon_state = "officerdnavyjacket"
item_state = "armor"
flags = FPRINT | TABLEPASS
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"
flags = FPRINT | TABLEPASS
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
+152
View File
@@ -0,0 +1,152 @@
// 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
+435
View File
@@ -0,0 +1,435 @@
// 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", "plasma"),
list(
"Do you worry about bombs often?",
"Do you work in toxins?",
"Do you find it odd to worry about bombs on a toxins 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>&larr; 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)
+18
View File
@@ -0,0 +1,18 @@
// 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()
+190
View File
@@ -0,0 +1,190 @@
// 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)
dir = WEST
else if (movement_target.loc.x > src.x)
dir = EAST
else if (movement_target.loc.y < src.y)
dir = SOUTH
else if (movement_target.loc.y > src.y)
dir = NORTH
else
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"
+703
View File
@@ -0,0 +1,703 @@
// internal pipe, don't actually place or use these
obj/machinery/atmospherics/pipe/mains_component
var/obj/machinery/atmospherics/mains_pipe/parent_pipe
var/list/obj/machinery/atmospherics/pipe/mains_component/nodes = new()
New(loc)
..(loc)
parent_pipe = loc
check_pressure(pressure)
var/datum/gas_mixture/environment = loc.loc.return_air()
var/pressure_difference = pressure - environment.return_pressure()
if(pressure_difference > parent_pipe.maximum_pressure)
mains_burst()
else if(pressure_difference > parent_pipe.fatigue_pressure)
//TODO: leak to turf, doing pfshhhhh
if(prob(5))
mains_burst()
else return 1
pipeline_expansion()
return nodes
disconnect(obj/machinery/atmospherics/reference)
if(nodes.Find(reference))
nodes.Remove(reference)
proc/mains_burst()
parent_pipe.burst()
obj/machinery/atmospherics/mains_pipe
icon = 'icons/obj/atmospherics/mainspipe.dmi'
layer = 2.4 //under wires with their 2.5
var/volume = 0
var/force = 20
var/alert_pressure = 80*ONE_ATMOSPHERE
var/initialize_mains_directions = 0
var/list/obj/machinery/atmospherics/mains_pipe/nodes = new()
var/obj/machinery/atmospherics/pipe/mains_component/supply
var/obj/machinery/atmospherics/pipe/mains_component/scrubbers
var/obj/machinery/atmospherics/pipe/mains_component/aux
var/minimum_temperature_difference = 300
var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No
var/maximum_pressure = 70*ONE_ATMOSPHERE
var/fatigue_pressure = 55*ONE_ATMOSPHERE
alert_pressure = 55*ONE_ATMOSPHERE
New()
..()
supply = new(src)
supply.volume = volume
supply.nodes.len = nodes.len
scrubbers = new(src)
scrubbers.volume = volume
scrubbers.nodes.len = nodes.len
aux = new(src)
aux.volume = volume
aux.nodes.len = nodes.len
hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
proc/burst()
..()
for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents)
burst()
proc/check_pressure(pressure)
var/datum/gas_mixture/environment = loc.return_air()
var/pressure_difference = pressure - environment.return_pressure()
if(pressure_difference > maximum_pressure)
burst()
else if(pressure_difference > fatigue_pressure)
//TODO: leak to turf, doing pfshhhhh
if(prob(5))
burst()
else return 1
disconnect()
..()
for(var/obj/machinery/atmospherics/pipe/mains_component/node in nodes)
node.disconnect()
Del()
disconnect()
..()
initialize()
for(var/i = 1 to nodes.len)
var/obj/machinery/atmospherics/mains_pipe/node = nodes[i]
if(node)
supply.nodes[i] = node.supply
scrubbers.nodes[i] = node.scrubbers
aux.nodes[i] = node.aux
obj/machinery/atmospherics/mains_pipe/simple
name = "mains pipe"
desc = "A one meter section of 3-line mains pipe"
dir = SOUTH
initialize_mains_directions = SOUTH|NORTH
New()
nodes.len = 2
..()
switch(dir)
if(SOUTH || NORTH)
initialize_mains_directions = SOUTH|NORTH
if(EAST || WEST)
initialize_mains_directions = EAST|WEST
if(NORTHEAST)
initialize_mains_directions = NORTH|EAST
if(NORTHWEST)
initialize_mains_directions = NORTH|WEST
if(SOUTHEAST)
initialize_mains_directions = SOUTH|EAST
if(SOUTHWEST)
initialize_mains_directions = SOUTH|WEST
proc/normalize_dir()
if(dir==3)
dir = 1
else if(dir==12)
dir = 4
update_icon()
if(nodes[1] && nodes[2])
icon_state = "intact[invisibility ? "-f" : "" ]"
//var/node1_direction = get_dir(src, node1)
//var/node2_direction = get_dir(src, node2)
//dir = node1_direction|node2_direction
else
if(!nodes[1]&&!nodes[2])
del(src) //TODO: silent deleting looks weird
var/have_node1 = nodes[1]?1:0
var/have_node2 = nodes[2]?1:0
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
initialize()
normalize_dir()
var/node1_dir
var/node2_dir
for(var/direction in cardinal)
if(direction&initialize_mains_directions)
if (!node1_dir)
node1_dir = direction
else if (!node2_dir)
node2_dir = direction
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[2] = target
break
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
hidden
level = 1
icon_state = "intact-f"
visible
level = 2
icon_state = "intact"
obj/machinery/atmospherics/mains_pipe/manifold
name = "manifold pipe"
desc = "A manifold composed of mains pipes"
dir = SOUTH
initialize_mains_directions = EAST|NORTH|WEST
volume = 105
New()
nodes.len = 3
..()
initialize_mains_directions = (NORTH|SOUTH|EAST|WEST) & ~dir
initialize()
var/connect_directions = initialize_mains_directions
for(var/direction in cardinal)
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
connect_directions &= ~direction
break
if (nodes[1])
break
for(var/direction in cardinal)
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[2] = target
connect_directions &= ~direction
break
if (nodes[2])
break
for(var/direction in cardinal)
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[3] = target
connect_directions &= ~direction
break
if (nodes[3])
break
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
update_icon()
icon_state = "manifold[invisibility ? "-f" : "" ]"
hidden
level = 1
icon_state = "manifold-f"
visible
level = 2
icon_state = "manifold"
obj/machinery/atmospherics/mains_pipe/manifold4w
name = "manifold pipe"
desc = "A manifold composed of mains pipes"
dir = SOUTH
initialize_mains_directions = EAST|NORTH|WEST|SOUTH
volume = 105
New()
nodes.len = 4
..()
initialize()
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,NORTH))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,SOUTH))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[2] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,EAST))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[3] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,WEST))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[3] = target
break
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
update_icon()
icon_state = "manifold4w[invisibility ? "-f" : "" ]"
hidden
level = 1
icon_state = "manifold4w-f"
visible
level = 2
icon_state = "manifold4w"
obj/machinery/atmospherics/mains_pipe/split
name = "mains splitter"
desc = "A splitter for connecting to a single pipe off a mains."
var/obj/machinery/atmospherics/pipe/mains_component/split_node
var/obj/machinery/atmospherics/node3
var/icon_type
New()
nodes.len = 2
..()
initialize_mains_directions = turn(dir, 90) | turn(dir, -90)
initialize_directions = dir // actually have a normal connection too
initialize()
var/node1_dir
var/node2_dir
var/node3_dir
node1_dir = turn(dir, 90)
node2_dir = turn(dir, -90)
node3_dir = dir
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[2] = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
if(target.initialize_directions & get_dir(target,src))
node3 = target
break
..() // initialize internal pipes
// bind them
spawn(5)
if(node3 && split_node)
var/datum/pipe_network/N1 = node3.return_network(src)
var/datum/pipe_network/N2 = split_node.return_network(split_node)
if(N1 && N2)
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
update_icon()
icon_state = "split-[icon_type][invisibility ? "-f" : "" ]"
return_network(A)
return split_node.return_network(A)
supply
icon_type = "supply"
New()
..()
split_node = supply
hidden
level = 1
icon_state = "split-supply-f"
visible
level = 2
icon_state = "split-supply"
scrubbers
icon_type = "scrubbers"
New()
..()
split_node = scrubbers
hidden
level = 1
icon_state = "split-scrubbers-f"
visible
level = 2
icon_state = "split-scrubbers"
aux
icon_type = "aux"
New()
..()
split_node = aux
hidden
level = 1
icon_state = "split-aux-f"
visible
level = 2
icon_state = "split-aux"
obj/machinery/atmospherics/mains_pipe/split3
name = "triple mains splitter"
desc = "A splitter for connecting to the 3 pipes on a mainline."
var/obj/machinery/atmospherics/supply_node
var/obj/machinery/atmospherics/scrubbers_node
var/obj/machinery/atmospherics/aux_node
New()
nodes.len = 1
..()
initialize_mains_directions = dir
initialize_directions = cardinal & ~dir // actually have a normal connection too
initialize()
var/node1_dir
var/supply_node_dir
var/scrubbers_node_dir
var/aux_node_dir
node1_dir = dir
aux_node_dir = turn(dir, 180)
if(dir & (NORTH|SOUTH))
supply_node_dir = EAST
scrubbers_node_dir = WEST
else
supply_node_dir = SOUTH
scrubbers_node_dir = NORTH
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src, node1_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,supply_node_dir))
if(target.initialize_directions & get_dir(target,src))
supply_node = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,scrubbers_node_dir))
if(target.initialize_directions & get_dir(target,src))
scrubbers_node = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,aux_node_dir))
if(target.initialize_directions & get_dir(target,src))
aux_node = target
break
..() // initialize internal pipes
// bind them
spawn(5)
if(supply_node)
var/datum/pipe_network/N1 = supply_node.return_network(src)
var/datum/pipe_network/N2 = supply.return_network(supply)
if(N1 && N2)
N1.merge(N2)
if(scrubbers_node)
var/datum/pipe_network/N1 = scrubbers_node.return_network(src)
var/datum/pipe_network/N2 = scrubbers.return_network(scrubbers)
if(N1 && N2)
N1.merge(N2)
if(aux_node)
var/datum/pipe_network/N1 = aux_node.return_network(src)
var/datum/pipe_network/N2 = aux.return_network(aux)
if(N1 && N2)
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
update_icon()
icon_state = "split-t[invisibility ? "-f" : "" ]"
return_network(obj/machinery/atmospherics/reference)
var/obj/machinery/atmospherics/A
A = supply_node.return_network(reference)
if(!A)
A = scrubbers_node.return_network(reference)
if(!A)
A = aux_node.return_network(reference)
return A
hidden
level = 1
icon_state = "split-t-f"
visible
level = 2
icon_state = "split-t"
obj/machinery/atmospherics/mains_pipe/cap
name = "pipe cap"
desc = "A cap for the end of a mains pipe"
dir = SOUTH
initialize_directions = SOUTH
volume = 35
New()
nodes.len = 1
..()
initialize_mains_directions = dir
update_icon()
icon_state = "cap[invisibility ? "-f" : ""]"
initialize()
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
..()
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
update_icon()
hidden
level = 1
icon_state = "cap-f"
visible
level = 2
icon_state = "cap"
obj/machinery/atmospherics/mains_pipe/valve
icon_state = "mvalve0"
name = "mains shutoff valve"
desc = "A mains pipe valve"
var/open = 1
dir = SOUTH
initialize_mains_directions = SOUTH|NORTH
New()
nodes.len = 2
..()
initialize_mains_directions = dir | turn(dir, 180)
update_icon(animation)
var/turf/simulated/floor = loc
var/hide = istype(floor) ? floor.intact : 0
level = 1
for(var/obj/machinery/atmospherics/mains_pipe/node in nodes)
if(node.level == 2)
hide = 0
level = 2
break
if(animation)
flick("[hide?"h":""]mvalve[src.open][!src.open]",src)
else
icon_state = "[hide?"h":""]mvalve[open]"
initialize()
normalize_dir()
var/node1_dir
var/node2_dir
for(var/direction in cardinal)
if(direction&initialize_mains_directions)
if (!node1_dir)
node1_dir = direction
else if (!node2_dir)
node2_dir = direction
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[1] = target
break
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
if(target.initialize_mains_directions & get_dir(target,src))
nodes[2] = target
break
if(open)
..() // initialize internal pipes
update_icon()
proc/normalize_dir()
if(dir==3)
dir = 1
else if(dir==12)
dir = 4
proc/open()
if(open) return 0
open = 1
update_icon()
initialize()
return 1
proc/close()
if(!open) return 0
open = 0
update_icon()
for(var/obj/machinery/atmospherics/pipe/mains_component/node in src)
for(var/obj/machinery/atmospherics/pipe/mains_component/o in node.nodes)
o.disconnect(node)
o.build_network()
return 1
attack_ai(mob/user as mob)
return
attack_paw(mob/user as mob)
return attack_hand(user)
attack_hand(mob/user as mob)
src.add_fingerprint(usr)
update_icon(1)
sleep(10)
if (open)
close()
else
open()
digital // can be controlled by AI
name = "digital mains valve"
desc = "A digitally controlled valve."
icon_state = "dvalve0"
attack_ai(mob/user as mob)
return src.attack_hand(user)
attack_hand(mob/user as mob)
if(!src.allowed(user))
user << "\red Access denied."
return
..()
//Radio remote control
proc
set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
var/frequency = 0
var/id = null
var/datum/radio_frequency/radio_connection
initialize()
..()
if(frequency)
set_frequency(frequency)
update_icon(animation)
var/turf/simulated/floor = loc
var/hide = istype(floor) ? floor.intact : 0
level = 1
for(var/obj/machinery/atmospherics/mains_pipe/node in nodes)
if(node.level == 2)
hide = 0
level = 2
break
if(animation)
flick("[hide?"h":""]dvalve[src.open][!src.open]",src)
else
icon_state = "[hide?"h":""]dvalve[open]"
receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id))
return 0
switch(signal.data["command"])
if("valve_open")
if(!open)
open()
if("valve_close")
if(open)
close()
if("valve_toggle")
if(open)
close()
else
open()
+28
View File
@@ -0,0 +1,28 @@
/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()
@@ -0,0 +1,231 @@
// 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
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/weapon/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/weapon/cable_coil/A = new /obj/item/weapon/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.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/weapon/cable_coil))
var/obj/item/weapon/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/weapon/cable_coil/CC = new /obj/item/weapon/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/weapon/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/weapon/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/weapon/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/weapon/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/weapon/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/weapon/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/weapon/cable_coil" = 2)
@@ -0,0 +1,51 @@
/obj/item/weapon/weldpack
name = "Welding kit"
desc = "A heavy-duty, portable welding fluid carrier."
slot_flags = SLOT_BACK
icon = 'icons/obj/storage.dmi'
icon_state = "welderpack"
w_class = 4.0
var/max_fuel = 350
/obj/item/weapon/weldpack/New()
var/datum/reagents/R = new/datum/reagents(max_fuel) //Lotsa refills
reagents = R
R.my_atom = src
R.add_reagent("fuel", max_fuel)
/obj/item/weapon/weldpack/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/T = W
if(T.welding & prob(50))
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
log_game("[key_name(user)] triggered a fueltank explosion.")
user << "\red That was stupid of you."
explosion(get_turf(src),-1,0,2)
if(src)
del(src)
return
else
if(T.welding)
user << "\red That was close!"
src.reagents.trans_to(W, T.max_fuel)
user << "\blue Welder refilled!"
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
user << "\blue The tank scoffs at your insolence. It only provides services to welders."
return
/obj/item/weapon/weldpack/afterattack(obj/O as obj, mob/user as mob)
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.reagents.total_volume < max_fuel)
O.reagents.trans_to(src, max_fuel)
user << "\blue You crack the cap off the top of the pack and fill it back up again from the tank."
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
else if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.reagents.total_volume == max_fuel)
user << "\blue The pack is already full!"
return
/obj/item/weapon/weldpack/examine()
set src in usr
usr << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume)
..()
return
+265
View File
@@ -0,0 +1,265 @@
#define NITROGEN_RETARDATION_FACTOR 4 //Higher == N2 slows reaction more
#define THERMAL_RELEASE_MODIFIER 10 //Higher == less heat released during reaction
#define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction
#define OXYGEN_RELEASE_MODIFIER 750 //Higher == less oxygen released at high temperature/power
#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power
//These would be what you would get at point blank, decreases with distance
#define DETONATION_RADS 200
#define DETONATION_HALLUCINATION 600
#define WARNING_DELAY 60 //45 seconds between warnings.
/obj/machinery/power/supermatter
name = "Supermatter"
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
icon = 'icons/obj/engine.dmi'
icon_state = "darkmatter"
density = 1
anchored = 0
var/gasefficency = 0.25
var/base_icon_state = "darkmatter"
var/damage = 0
var/damage_archived = 0
var/safe_alert = "Crystaline hyperstructure returning to safe operating levels."
var/warning_point = 100
var/warning_alert = "Danger! Crystal hyperstructure instability!"
var/emergency_point = 700
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
var/explosion_point = 1000
var/emergency_issued = 0
var/explosion_power = 8
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
var/power = 0
//Temporary values so that we can optimize this
//How much the bullets damage should be multiplied by when it is added to the internal variables
var/config_bullet_energy = 2
//How much of the power is left after processing is finished?
// var/config_power_reduction_per_tick = 0.5
//How much hallucination should it produce per unit of power?
var/config_hallucination_power = 0.1
var/obj/item/device/radio/radio
shard //Small subtype, less efficient and more sensitive, but less boom.
name = "Supermatter Shard"
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. \red You get headaches just from looking at it."
icon_state = "darkmatter_shard"
base_icon_state = "darkmatter_shard"
warning_point = 50
emergency_point = 500
explosion_point = 900
gasefficency = 0.125
explosion_power = 3 //3,6,9,12? Or is that too small?
/obj/machinery/power/supermatter/New()
. = ..()
radio = new (src)
/obj/machinery/power/supermatter/Del()
del radio
. = ..()
/obj/machinery/power/supermatter/proc/explode()
explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1)
del src
return
/obj/machinery/power/supermatter/process()
var/turf/L = loc
if(isnull(L)) // We have a null turf...something is wrong, stop processing this entity.
return PROCESS_KILL
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
if(damage > emergency_point)
radio.autosay(emergency_alert, "Supermatter Monitor")
lastwarning = world.timeofday
else if(damage >= damage_archived) // The damage is still going up
radio.autosay(warning_alert, "Supermatter Monitor")
lastwarning = world.timeofday - 150
else // Phew, we're safe
radio.autosay(safe_alert, "Supermatter Monitor")
lastwarning = world.timeofday
if(damage > explosion_point)
for(var/mob/living/mob in living_mob_list)
if(istype(mob, /mob/living/carbon/human))
//Hilariously enough, running into a closet should make you get hit the hardest.
mob:hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) )
mob.apply_effect(rads, IRRADIATE)
explode()
//Ok, get the air from the turf
var/datum/gas_mixture/env = L.return_air()
//Remove gas from surrounding area
var/datum/gas_mixture/removed = env.remove(gasefficency * env.total_moles)
if(!removed || !removed.total_moles)
damage += max((power-1600)/10, 0)
power = min(power, 1600)
return 1
if (!removed)
return 1
damage_archived = damage
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
var/oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
var/temp_factor = 100
if(oxygen > 0.8)
// with a perfect gas mix, make the power less based on heat
icon_state = "[base_icon_state]_glow"
else
// in normal mode, base the produced energy around the heat
temp_factor = 60
icon_state = base_icon_state
power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload
//We've generated power, now let's transfer it to the collectors for storing/usage
transfer_energy()
var/device_energy = power * REACTION_POWER_MODIFIER
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
//Since the core is effectively "cold"
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER)
removed.temperature = max(0, min(removed.temperature, 2500))
//Calculate how much gas to release
removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
removed.update_values()
env.merge(removed)
for(var/mob/living/carbon/human/l in view(src, round(power ** 0.25))) // you have to be seeing the core to get hallucinations
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) )
l.apply_effect(rads, IRRADIATE)
power -= (power/500)**3
return 1
/obj/machinery/power/supermatter/bullet_act(var/obj/item/projectile/Proj)
if(Proj.flag != "bullet")
power += Proj.damage * config_bullet_energy
else
damage += Proj.damage * config_bullet_energy
return 0
/obj/machinery/power/supermatter/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/machinery/power/supermatter/attack_robot(mob/user as mob)
if(Adjacent(user))
return attack_hand(user)
else
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
return
/obj/machinery/power/supermatter/attack_ai(mob/user as mob)
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
/obj/machinery/power/supermatter/attack_hand(mob/user as mob)
user.visible_message("<span class=\"warning\">\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
"<span class=\"danger\">You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
Consume(user)
/obj/machinery/power/supermatter/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
R.receive_pulse(power)
return
/obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
user.visible_message("<span class=\"warning\">\The [user] touches \a [W] to \the [src] as a silence fills the room...</span>",\
"<span class=\"danger\">You touch \the [W] to \the [src] when everything suddenly goes silent.\"</span>\n<span class=\"notice\">\The [W] flashes into dust as you flinch away from \the [src].</span>",\
"<span class=\"warning\">Everything suddenly goes silent.</span>")
user.drop_from_inventory(W)
Consume(W)
user.apply_effect(150, IRRADIATE)
/obj/machinery/power/supermatter/Bumped(atom/AM as mob|obj)
if(istype(AM, /mob/living))
AM.visible_message("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
else
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
Consume(AM)
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
if(istype(user))
user.dust()
power += 200
else
del user
power += 200
//Some poor sod got eaten, go ahead and irradiate people nearby.
for(var/mob/living/l in range(10))
if(l in view())
l.show_message("<span class=\"warning\">As \the [src] slowly stops resonating, you find your skin covered in new radiation burns.</span>", 1,\
"<span class=\"warning\">The unearthly ringing subsides and you notice you have new radiation burns.</span>", 2)
else
l.show_message("<span class=\"warning\">You hear an uneartly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
var/rads = 500 * sqrt( 1 / (get_dist(l, src) + 1) )
l.apply_effect(rads, IRRADIATE)
+176
View File
@@ -0,0 +1,176 @@
//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/plasma))
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

Some files were not shown because too many files have changed in this diff Show More