mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-23 04:36:18 +01:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,310 @@
|
||||
//All credit for this goes to Uristqwerty.
|
||||
|
||||
/turf
|
||||
var/image/obscured
|
||||
var/image/dim
|
||||
|
||||
/turf/proc/visibilityChanged()
|
||||
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 = 0
|
||||
var/updating = 0
|
||||
|
||||
/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()
|
||||
|
||||
/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
|
||||
|
||||
/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 = 6
|
||||
for(var/turf/t in view(7, c))
|
||||
if(t in turfs)
|
||||
newDimTurfs += t
|
||||
|
||||
for(var/turf/t in view(6, c))
|
||||
if(t in turfs)
|
||||
newVisibleTurfs += t
|
||||
|
||||
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
|
||||
|
||||
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
||||
if(c.status)
|
||||
cameras += c
|
||||
|
||||
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
|
||||
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
|
||||
turfs += t
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 6
|
||||
for(var/turf/t in view(7, c))
|
||||
if(t in turfs)
|
||||
dimTurfs += t
|
||||
|
||||
for(var/turf/t in view(6, c))
|
||||
if(t in turfs)
|
||||
visibleTurfs += t
|
||||
|
||||
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)
|
||||
|
||||
dim += t.dim
|
||||
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
/datum/cameranet
|
||||
var/list/cameras = list()
|
||||
var/list/chunks = list()
|
||||
var/network = "net1"
|
||||
var/ready = 0
|
||||
|
||||
/datum/cameranet/New()
|
||||
..()
|
||||
|
||||
/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()
|
||||
|
||||
|
||||
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
|
||||
|
||||
/mob/living/silicon/ai/New()
|
||||
..()
|
||||
eyeobj.ai = src
|
||||
|
||||
/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(client.eye == eyeobj)
|
||||
client.eye = src
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
else
|
||||
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)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
/proc/getbrokeninhands()
|
||||
var/icon/IL = new('icons/mob/items_lefthand.dmi')
|
||||
var/list/Lstates = IL.IconStates()
|
||||
var/icon/IR = new('icons/mob/items_righthand.dmi')
|
||||
var/list/Rstates = IR.IconStates()
|
||||
|
||||
|
||||
var/text
|
||||
for(var/A in typesof(/obj/item))
|
||||
var/obj/item/O = new A( locate(1,1,1) )
|
||||
if(!O) continue
|
||||
var/icon/J = new(O.icon)
|
||||
var/list/istates = J.IconStates()
|
||||
if(!Lstates.Find(O.icon_state) && !Lstates.Find(O.item_state))
|
||||
if(O.icon_state)
|
||||
text += "[O.type] WANTS IN LEFT HAND CALLED\n\"[O.icon_state]\".\n"
|
||||
if(!Rstates.Find(O.icon_state) && !Rstates.Find(O.item_state))
|
||||
if(O.icon_state)
|
||||
text += "[O.type] WANTS IN RIGHT HAND CALLED\n\"[O.icon_state]\".\n"
|
||||
|
||||
|
||||
if(O.icon_state)
|
||||
if(!istates.Find(O.icon_state))
|
||||
text += "[O.type] MISSING NORMAL ICON CALLED\n\"[O.icon_state]\" IN \"[O.icon]\"\n"
|
||||
if(O.item_state)
|
||||
if(!istates.Find(O.item_state))
|
||||
text += "[O.type] MISSING NORMAL ICON CALLED\n\"[O.item_state]\" IN \"[O.icon]\"\n"
|
||||
text+="\n"
|
||||
del(O)
|
||||
if(text)
|
||||
var/F = file("broken_icons.txt")
|
||||
fdel(F)
|
||||
F << text
|
||||
world << "Completely successfully and written to [F]"
|
||||
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
//UltraLight system, by Sukasa
|
||||
|
||||
const/ar/UL_LUMINOSITY = 0
|
||||
const/ar/UL_SQUARELIGHT = 0
|
||||
|
||||
const/ar/UL_RGB = 1
|
||||
const/ar/UL_ROUNDLIGHT = 2
|
||||
|
||||
const/ar/UL_I_FALLOFF_SQUARE = 0
|
||||
const/ar/UL_I_FALLOFF_ROUND = 1
|
||||
|
||||
const/ar/UL_I_LUMINOSITY = 0
|
||||
const/ar/UL_I_RGB = 1
|
||||
|
||||
const/ar/UL_I_LIT = 0
|
||||
const/ar/UL_I_EXTINGUISHED = 1
|
||||
const/ar/UL_I_ONZERO = 2
|
||||
|
||||
ul_LightingEnabled = 1
|
||||
ul_LightingResolution = 1
|
||||
ul_Steps = 7
|
||||
ul_LightingModel = UL_I_RGB
|
||||
ul_FalloffStyle = UL_I_FALLOFF_ROUND
|
||||
ul_TopLuminosity = 0
|
||||
ul_Layer = 10
|
||||
ul_SuppressLightLevelChanges = 0
|
||||
|
||||
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)
|
||||
|
||||
|
||||
proc
|
||||
ul_Clamp(var/Value)
|
||||
return min(max(Value, 0), ul_Steps)
|
||||
|
||||
atom
|
||||
var/LuminosityRed = 0
|
||||
var/LuminosityGreen = 0
|
||||
var/LuminosityBlue = 0
|
||||
|
||||
var/ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
proc
|
||||
sd_SetLuminosity(var/Red, var/Green = Red, var/Blue = Red)
|
||||
|
||||
if(LuminosityRed == Red && LuminosityGreen == Green && LuminosityBlue == Blue)
|
||||
return //No point doing all that work if it won't have any effect anyways...
|
||||
|
||||
if (ul_Extinguished == UL_I_EXTINGUISHED)
|
||||
LuminosityRed = Red
|
||||
LuminosityGreen = Green
|
||||
LuminosityBlue = Blue
|
||||
|
||||
return
|
||||
|
||||
if (ul_IsLuminous())
|
||||
ul_Extinguish()
|
||||
|
||||
LuminosityRed = Red
|
||||
LuminosityGreen = Green
|
||||
LuminosityBlue = Blue
|
||||
|
||||
ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
if (ul_IsLuminous())
|
||||
ul_Illuminate()
|
||||
|
||||
return
|
||||
|
||||
ul_Illuminate()
|
||||
if (ul_Extinguished == UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_LIT
|
||||
|
||||
ul_UpdateTopLuminosity()
|
||||
luminosity = ul_Luminosity()
|
||||
|
||||
for(var/turf/Affected in view(ul_Luminosity(), src))
|
||||
var/Falloff = src.ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = LuminosityRed - Falloff
|
||||
var/DeltaGreen = LuminosityGreen - Falloff
|
||||
var/DeltaBlue = LuminosityBlue - Falloff
|
||||
|
||||
if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue))
|
||||
|
||||
Affected.LightLevelRed += max(DeltaRed, 0)
|
||||
Affected.LightLevelGreen += max(DeltaGreen, 0)
|
||||
Affected.LightLevelBlue += max(DeltaBlue, 0)
|
||||
|
||||
Affected.MaxRed += LuminosityRed
|
||||
Affected.MaxGreen += LuminosityGreen
|
||||
Affected.MaxBlue += LuminosityBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
return
|
||||
|
||||
ul_Extinguish()
|
||||
|
||||
if (ul_Extinguished != UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_EXTINGUISHED
|
||||
|
||||
for(var/turf/Affected in view(ul_Luminosity(), src))
|
||||
|
||||
var/Falloff = ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = LuminosityRed - Falloff
|
||||
var/DeltaGreen = LuminosityGreen - Falloff
|
||||
var/DeltaBlue = LuminosityBlue - Falloff
|
||||
|
||||
if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue))
|
||||
|
||||
Affected.LightLevelRed -= max(DeltaRed, 0)
|
||||
Affected.LightLevelGreen -= max(DeltaGreen, 0)
|
||||
Affected.LightLevelBlue -= max(DeltaBlue, 0)
|
||||
|
||||
Affected.MaxRed -= LuminosityRed
|
||||
Affected.MaxGreen -= LuminosityGreen
|
||||
Affected.MaxBlue -= LuminosityBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
|
||||
luminosity = 0
|
||||
|
||||
return
|
||||
|
||||
ul_FalloffAmount(var/atom/ref)
|
||||
if (ul_FalloffStyle == UL_I_FALLOFF_ROUND)
|
||||
var/x = (ref.x - src.x)
|
||||
var/y = (ref.y - src.y)
|
||||
if ((x*x + y*y) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= x*x+y*y, i++)
|
||||
ul_FastRoot += round(sqrt(x*x+y*y))
|
||||
return round(ul_LightingResolution * ul_FastRoot[x*x + y*y + 1], 1)
|
||||
|
||||
else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE)
|
||||
return get_dist(src, ref)
|
||||
|
||||
return 0
|
||||
|
||||
ul_SetOpacity(var/NewOpacity)
|
||||
if(opacity != NewOpacity)
|
||||
|
||||
var/list/Blanked = ul_BlankLocal()
|
||||
var/atom/T = src
|
||||
while(T && !isturf(T))
|
||||
T = T.loc
|
||||
|
||||
opacity = NewOpacity
|
||||
|
||||
if(T)
|
||||
T:LightLevelRed = 0
|
||||
T:LightLevelGreen = 0
|
||||
T:LightLevelBlue = 0
|
||||
|
||||
ul_UnblankLocal(Blanked)
|
||||
|
||||
return
|
||||
|
||||
ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src))
|
||||
for(var/atom/Light in ReApply)
|
||||
if(Light.ul_IsLuminous())
|
||||
Light.ul_Illuminate()
|
||||
|
||||
return
|
||||
|
||||
ul_BlankLocal()
|
||||
var/list/Blanked = list( )
|
||||
var/TurfAdjust = isturf(src) ? 1 : 0
|
||||
|
||||
for(var/atom/Affected in view(ul_TopLuminosity, src))
|
||||
if(Affected.ul_IsLuminous() && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= Affected.luminosity + TurfAdjust))
|
||||
Affected.ul_Extinguish()
|
||||
Blanked += Affected
|
||||
|
||||
return Blanked
|
||||
|
||||
ul_UpdateTopLuminosity()
|
||||
|
||||
if (ul_TopLuminosity < LuminosityRed)
|
||||
ul_TopLuminosity = LuminosityRed
|
||||
|
||||
if (ul_TopLuminosity < LuminosityGreen)
|
||||
ul_TopLuminosity = LuminosityGreen
|
||||
|
||||
if (ul_TopLuminosity < LuminosityBlue)
|
||||
ul_TopLuminosity = LuminosityBlue
|
||||
|
||||
return
|
||||
|
||||
ul_Luminosity()
|
||||
return max(LuminosityRed, LuminosityGreen, LuminosityBlue)
|
||||
|
||||
ul_IsLuminous(var/Red = LuminosityRed, var/Green = LuminosityGreen, var/Blue = LuminosityBlue)
|
||||
return (Red > 0 || Green > 0 || Blue > 0)
|
||||
|
||||
ul_LightLevelChanged()
|
||||
//Designed for client projects to use. Called on items when the turf they are in has its light level changed
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
if(ul_IsLuminous())
|
||||
spawn(1)
|
||||
ul_Illuminate()
|
||||
return
|
||||
|
||||
Del()
|
||||
if(ul_IsLuminous())
|
||||
ul_Extinguish()
|
||||
|
||||
..()
|
||||
|
||||
return
|
||||
|
||||
movable
|
||||
Move()
|
||||
ul_Extinguish()
|
||||
..()
|
||||
ul_Illuminate()
|
||||
return
|
||||
|
||||
turf
|
||||
var/LightLevelRed = 0
|
||||
var/LightLevelGreen = 0
|
||||
var/LightLevelBlue = 0
|
||||
|
||||
var/list/MaxRed = list( )
|
||||
var/list/MaxGreen = list( )
|
||||
var/list/MaxBlue = list( )
|
||||
|
||||
proc
|
||||
|
||||
ul_GetRed()
|
||||
return ul_Clamp(min(LightLevelRed, max(MaxRed)))
|
||||
ul_GetGreen()
|
||||
return ul_Clamp(min(LightLevelGreen, max(MaxGreen)))
|
||||
ul_GetBlue()
|
||||
return ul_Clamp(min(LightLevelBlue, max(MaxBlue)))
|
||||
|
||||
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
|
||||
|
||||
ul_Recalculate()
|
||||
|
||||
ul_SuppressLightLevelChanges++
|
||||
|
||||
var/list/Lights = ul_BlankLocal()
|
||||
|
||||
LightLevelRed = 0
|
||||
LightLevelGreen = 0
|
||||
LightLevelBlue = 0
|
||||
|
||||
ul_UnblankLocal(Lights)
|
||||
|
||||
ul_SuppressLightLevelChanges--
|
||||
|
||||
return
|
||||
|
||||
area
|
||||
var/ul_Overlay = null
|
||||
var/ul_Lighting = 1
|
||||
|
||||
var/LightLevelRed = 0
|
||||
var/LightLevelGreen = 0
|
||||
var/LightLevelBlue = 0
|
||||
|
||||
proc
|
||||
ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue)
|
||||
|
||||
if(!src || !src.ul_Lighting)
|
||||
return
|
||||
|
||||
overlays -= ul_Overlay
|
||||
|
||||
LightLevelRed = Red
|
||||
LightLevelGreen = Green
|
||||
LightLevelBlue = Blue
|
||||
|
||||
luminosity = ul_IsLuminous(LightLevelRed, LightLevelGreen, LightLevelBlue)
|
||||
|
||||
ul_Overlay = image('icons/effects/ULIcons.dmi', , num2text(LightLevelRed) + "-" + num2text(LightLevelGreen) + "-" + num2text(LightLevelBlue), ul_Layer)
|
||||
|
||||
overlays += ul_Overlay
|
||||
|
||||
return
|
||||
|
||||
ul_Prep()
|
||||
|
||||
if(!tag)
|
||||
tag = "[type]"
|
||||
if(ul_Lighting)
|
||||
if(!findtext(tag,":UL"))
|
||||
ul_Light()
|
||||
//world.log << tag
|
||||
|
||||
return
|
||||
@@ -0,0 +1,12 @@
|
||||
var/list/prob_G_list = list()
|
||||
|
||||
/proc/probG(var/define,var/everyother)
|
||||
if(prob_G_list["[define]"])
|
||||
prob_G_list["[define]"] += 1
|
||||
if(prob_G_list["[define]"] == everyother)
|
||||
prob_G_list["[define]"] = 0
|
||||
return 1
|
||||
else
|
||||
(prob_G_list["[define]"]) = 0
|
||||
(prob_G_list["[define]"]) = rand(1,everyother-1)
|
||||
return 0
|
||||
@@ -0,0 +1,619 @@
|
||||
// NOTE WELL!
|
||||
// Only include this file when debugging locally
|
||||
// Do not include in release versions
|
||||
|
||||
|
||||
#define VARSICON 1
|
||||
#define SDEBUG 1
|
||||
|
||||
/client/verb/Debug()
|
||||
set category = "Debug"
|
||||
set name = "Debug-Debug"
|
||||
if(src.holder.rank == "Game Admin")
|
||||
Debug = !Debug
|
||||
|
||||
world << "Debugging [Debug ? "On" : "Off"]"
|
||||
else
|
||||
alert("Coders only baby")
|
||||
return
|
||||
|
||||
/turf/verb/Flow()
|
||||
set category = "Debug"
|
||||
//set hidden = 1
|
||||
if(Debug)
|
||||
for(var/turf/T in range(5))
|
||||
|
||||
var/obj/effect/mark/O = locate(/obj/effect/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/effect/mark(T)
|
||||
else
|
||||
O.overlays.Cut()
|
||||
|
||||
var/obj/move/OM = locate(/obj/move/, T)
|
||||
|
||||
if(OM)
|
||||
|
||||
if(! OM.updatecell)
|
||||
O.icon_state = "x2"
|
||||
else
|
||||
O.icon_state = "blank"
|
||||
/*
|
||||
Doing this because FindTurfs() isn't even used
|
||||
for(var/atom/U in OM.FindTurfs() )
|
||||
var/dirn = get_dir(OM, U)
|
||||
if(dirn == 1)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==1?"up":"fup")
|
||||
else if(dirn == 2)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==2?"dn":"fdn")
|
||||
else if(dirn == 4)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==4?"rt":"frt")
|
||||
else if(dirn == 8)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==8?"lf":"flf")
|
||||
*/
|
||||
else
|
||||
|
||||
if(!(T.updatecell))
|
||||
O.icon_state = "x2"
|
||||
else
|
||||
O.icon_state = "blank"
|
||||
|
||||
if(T.airN)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==1?"up":"fup")
|
||||
|
||||
if(T.airS)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==2?"dn":"fdn")
|
||||
|
||||
if(T.airW)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==8?"lf":"flf")
|
||||
|
||||
if(T.airE)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==4?"rt":"frt")
|
||||
|
||||
|
||||
if(T.condN)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condN == 1?"yup":"rup")
|
||||
|
||||
if(T.condS)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condS == 1?"ydn":"rdn")
|
||||
|
||||
if(T.condE)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condE == 1?"yrt":"rrt")
|
||||
|
||||
if(T.condW)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condW == 1?"ylf":"rlf")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/turf/verb/Clear()
|
||||
set category = "Debug"
|
||||
//set hidden = 1
|
||||
if(Debug)
|
||||
for(var/obj/effect/mark/O in world)
|
||||
del(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/proc/numbericon(var/tn as text,var/s = 0)
|
||||
if(Debug)
|
||||
var/image/I = image('icons/misc/mark.dmi', "blank")
|
||||
|
||||
if(lentext(tn)>8)
|
||||
tn = "*"
|
||||
|
||||
var/len = lentext(tn)
|
||||
|
||||
for(var/d = 1 to lentext(tn))
|
||||
|
||||
|
||||
var/char = copytext(tn, len-d+1, len-d+2)
|
||||
|
||||
if(char == " ")
|
||||
continue
|
||||
|
||||
var/image/ID = image('icons/misc/mark.dmi', char)
|
||||
|
||||
ID.pixel_x = -(d-1)*4
|
||||
ID.pixel_y = s
|
||||
//if(d>1) I.Shift(WEST, (d-1)*8)
|
||||
|
||||
I.overlays += ID
|
||||
|
||||
|
||||
|
||||
return I
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/*/turf/verb/Stats()
|
||||
set category = "Debug"
|
||||
for(var/turf/T in range(5))
|
||||
|
||||
var/obj/effect/mark/O = locate(/obj/effect/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/effect/mark(T)
|
||||
else
|
||||
O.overlays.Cut()
|
||||
|
||||
|
||||
var/temp = round(T.temp-T0C, 0.1)
|
||||
|
||||
O.overlays += numbericon("[temp]C")
|
||||
|
||||
var/pres = round(T.tot_gas() / CELLSTANDARD * 100, 0.1)
|
||||
|
||||
O.overlays += numbericon("[pres]", -8)
|
||||
O.mark = "[temp]/[pres]"
|
||||
*/
|
||||
/*
|
||||
/turf/verb/Pipes()
|
||||
set category = "Debug"
|
||||
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//world << "Turf [T] at ([T.x],[T.y])"
|
||||
|
||||
for(var/obj/machinery/M in T)
|
||||
//world <<" Mach [M] with pdir=[M.p_dir]"
|
||||
|
||||
if(M && M.p_dir)
|
||||
|
||||
//world << "Accepted"
|
||||
var/obj/effect/mark/O = locate(/obj/effect/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/effect/mark(T)
|
||||
else
|
||||
O.overlays.Cut()
|
||||
|
||||
if(istype(M, /obj/machinery/pipes))
|
||||
var/obj/machinery/pipes/P = M
|
||||
O.overlays += numbericon("[P.plnum] ", -20)
|
||||
M = P.pl
|
||||
|
||||
|
||||
var/obj/substance/gas/G = M.get_gas()
|
||||
|
||||
if(G)
|
||||
|
||||
var/cap = round( 100*(G.tot_gas()/ M.capmult / 6e6), 0.1)
|
||||
var/temp = round(G.temperature - T0C, 0.1)
|
||||
O.overlays += numbericon("[temp]C", 0)
|
||||
O.overlays += numbericon("[cap]", -8)
|
||||
|
||||
break
|
||||
*/
|
||||
/turf/verb/Cables()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//world << "Turf [T] at ([T.x],[T.y])"
|
||||
|
||||
var/obj/effect/mark/O = locate(/obj/effect/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/effect/mark(T)
|
||||
else
|
||||
O.overlays.Cut()
|
||||
|
||||
var/marked = 0
|
||||
for(var/obj/M in T)
|
||||
//world <<" Mach [M] with pdir=[M.p_dir]"
|
||||
|
||||
|
||||
if(M && istype(M, /obj/structure/cable/))
|
||||
|
||||
|
||||
var/obj/structure/cable/C = M
|
||||
//world << "Accepted"
|
||||
|
||||
O.overlays += numbericon("[C.netnum] " , marked)
|
||||
|
||||
marked -= 8
|
||||
|
||||
else if(M && istype(M, /obj/machinery/power/))
|
||||
|
||||
var/obj/machinery/power/P = M
|
||||
O.overlays += numbericon("*[P.netnum] " , marked)
|
||||
marked -= 8
|
||||
|
||||
if(!marked)
|
||||
del(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/turf/verb/Solar()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//world << "Turf [T] at ([T.x],[T.y])"
|
||||
|
||||
var/obj/effect/mark/O = locate(/obj/effect/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/effect/mark(T)
|
||||
else
|
||||
O.overlays.Cut()
|
||||
|
||||
|
||||
var/obj/machinery/power/solar/S
|
||||
|
||||
S = locate(/obj/machinery/power/solar, T)
|
||||
|
||||
if(S)
|
||||
|
||||
O.overlays += numbericon("[S.obscured] " , 0)
|
||||
O.overlays += numbericon("[round(S.sunfrac*100,0.1)] " , -12)
|
||||
|
||||
else
|
||||
del(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/Showports()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/turf/T
|
||||
var/obj/machinery/pipes/P
|
||||
var/list/ndirs
|
||||
|
||||
for(var/obj/machinery/pipeline/PL in plines)
|
||||
|
||||
var/num = plines.Find(PL)
|
||||
|
||||
P = PL.nodes[1] // 1st node in list
|
||||
ndirs = P.get_node_dirs()
|
||||
|
||||
T = get_step(P, ndirs[1])
|
||||
|
||||
var/obj/effect/mark/O = new(T)
|
||||
|
||||
O.overlays += numbericon("[num] * 1 ", -4)
|
||||
O.overlays += numbericon("[ndirs[1]] - [ndirs[2]]",-16)
|
||||
|
||||
|
||||
P = PL.nodes[PL.nodes.len] // last node in list
|
||||
|
||||
ndirs = P.get_node_dirs()
|
||||
T = get_step(P, ndirs[2])
|
||||
|
||||
O = new(T)
|
||||
|
||||
O.overlays += numbericon("[num] * 2 ", -4)
|
||||
O.overlays += numbericon("[ndirs[1]] - [ndirs[2]]", -16)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/atom/verb/delete()
|
||||
set category = "Debug"
|
||||
set src in view()
|
||||
if(Debug)
|
||||
del(src)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/area/verb/dark()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
if(src.icon_state == "dark")
|
||||
icon_state = null
|
||||
else
|
||||
icon_state = "dark"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/area/verb/power()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
power_equip = !power_equip
|
||||
power_environ = !power_environ
|
||||
|
||||
world << "Power ([src]) = [power_equip]"
|
||||
|
||||
power_change()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
// *****RM
|
||||
|
||||
// *****
|
||||
|
||||
|
||||
/mob/verb/ShowPlasma()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
Plasma()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobcount()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
world << "Blob count: [blobs.len]"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/Blobkill()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
blobs = list()
|
||||
world << "Blob killed."
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobmode()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
world << "Event=[ticker.event]"
|
||||
world << "Time =[(ticker.event_time - world.realtime)/10]s"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobnext()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
ticker.event_time = world.realtime
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/callshuttle()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
ticker.timeleft = 300
|
||||
ticker.timing = 1
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/apcs()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
for(var/obj/machinery/power/apc/APC in world)
|
||||
world << APC.report()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Globals()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
debugobj = new()
|
||||
|
||||
debugobj.debuglist = list( powernets, plines, vote, config, admins, ticker, SS13_airtunnel, sun )
|
||||
|
||||
|
||||
world << "<A href='?src=\ref[debugobj];Vars=1'>Debug</A>"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
/*for(var/obj/O in plines)
|
||||
|
||||
world << "<A href='?src=\ref[O];Vars=1'>[O.name]</A>"
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/verb/Mach()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/n = 0
|
||||
for(var/obj/machinery/M in world)
|
||||
n++
|
||||
if(! (M in machines) )
|
||||
world << "[M] [M.type]: not in list"
|
||||
|
||||
world << "in world: [n]; in list:[machines.len]"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/*/mob/verb/air()
|
||||
set category = "Debug"
|
||||
|
||||
Air()
|
||||
|
||||
/proc/Air()
|
||||
|
||||
|
||||
var/area/A = locate(/area/airintake)
|
||||
|
||||
var/atot = 0
|
||||
for(var/turf/T in A)
|
||||
atot += T.tot_gas()
|
||||
|
||||
var/ptot = 0
|
||||
for(var/obj/machinery/pipeline/PL in plines)
|
||||
if(PL.suffix == "d")
|
||||
ptot += PL.ngas.tot_gas()
|
||||
|
||||
var/vtot = 0
|
||||
for(var/obj/machinery/atmoalter/V in machines)
|
||||
if(V.suffix == "d")
|
||||
vtot += V.gas.tot_gas()
|
||||
|
||||
var/ctot = 0
|
||||
for(var/obj/machinery/connector/C in machines)
|
||||
if(C.suffix == "d")
|
||||
ctot += C.ngas.tot_gas()
|
||||
|
||||
|
||||
var/tot = atot + ptot + vtot + ctot
|
||||
|
||||
diary << "A=[num2text(atot,10)] P=[num2text(ptot,10)] V=[num2text(vtot,10)] C=[num2text(ctot,10)] : Total=[num2text(tot,10)]"
|
||||
*/
|
||||
/mob/verb/Revive()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
adjustFireLoss(0 - getBruteLoss())
|
||||
setToxLoss(0)
|
||||
adjustBruteLoss(0 - getBruteLoss())
|
||||
setOxyLoss(0)
|
||||
paralysis = 0
|
||||
stunned = 0
|
||||
weakened = 0
|
||||
health = 100
|
||||
if(stat > 1) stat=0
|
||||
disabilities = initial(disabilities)
|
||||
sdisabilities = initial(sdisabilities)
|
||||
for(var/datum/organ/external/e in src)
|
||||
e.brute_dam = 0.0
|
||||
e.burn_dam = 0.0
|
||||
e.bandaged = 0.0
|
||||
e.wound_size = 0.0
|
||||
e.max_damage = initial(e.max_damage)
|
||||
e.broken = 0
|
||||
e.destroyed = 0
|
||||
e.perma_injury = 0
|
||||
e.update_icon()
|
||||
if(src.type == /mob/living/carbon/human)
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.update_body()
|
||||
H.UpdateDamageIcon()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Smoke()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/obj/effect/smoke/O = new /obj/effect/smoke( src.loc )
|
||||
O.dir = pick(NORTH, SOUTH, EAST, WEST)
|
||||
spawn( 0 )
|
||||
O.Life()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/revent(number as num)
|
||||
set category = "Debug"
|
||||
set name = "Change event %"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
if(src.holder)
|
||||
eventchance = number
|
||||
log_admin("[src.key] set the random event chance to [eventchance]%")
|
||||
message_admins("[src.key] set the random event chance to [eventchance]%")
|
||||
|
||||
/* Does nothing but blow up the station.
|
||||
/mob/verb/funbutton()
|
||||
set category = "Admin"
|
||||
set name = "Random Expl.(REMOVE ME)"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
for(var/turf/T in world)
|
||||
if(prob(4) && T.z == 1 && istype(T,/turf/station/floor))
|
||||
spawn(50+rand(0,3000))
|
||||
var/obj/item/weapon/tank/plasmatank/pt = new /obj/item/weapon/tank/plasmatank( T )
|
||||
pt.gas.temperature = 400+T0C
|
||||
pt.ignite()
|
||||
for(var/turf/P in view(3, T))
|
||||
if (P.poison)
|
||||
P.poison = 0
|
||||
P.oldpoison = 0
|
||||
P.tmppoison = 0
|
||||
P.oxygen = 755985
|
||||
P.oldoxy = 755985
|
||||
P.tmpoxy = 755985
|
||||
usr << "\blue Blowing up station ..."
|
||||
world << "[usr.key] has used boom boom boom shake the room"
|
||||
*/
|
||||
|
||||
/mob/verb/removeplasma()
|
||||
set category = "Debug"
|
||||
set name = "Stabilize Atmos."
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
spawn(0)
|
||||
for(var/turf/T in view())
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.oxygen = 755985
|
||||
T.oldoxy = 755985
|
||||
T.tmpoxy = 755985
|
||||
T.co2 = 14.8176
|
||||
T.oldco2 = 14.8176
|
||||
T.tmpco2 = 14.8176
|
||||
T.n2 = 2.844e+006
|
||||
T.on2 = 2.844e+006
|
||||
T.tn2 = 2.844e+006
|
||||
T.tsl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.sl_gas = 0
|
||||
T.temp = 293.15
|
||||
T.otemp = 293.15
|
||||
T.ttemp = 293.15
|
||||
|
||||
/mob/verb/fire(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create Fire"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
world << "[usr.key] created fire"
|
||||
spawn(0)
|
||||
T.poison += 30000000
|
||||
T.firelevel = T.poison
|
||||
|
||||
/mob/verb/co2(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create CO2"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
world << "[usr.key] created CO2"
|
||||
spawn(0)
|
||||
T.co2 += 300000000
|
||||
|
||||
/mob/verb/n2o(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create N2O"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
world << "[usr.key] created N2O"
|
||||
spawn(0)
|
||||
T.sl_gas += 30000000
|
||||
|
||||
/mob/verb/explosion(T as obj|mob|turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create Explosion"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
world << "[usr.key] created an explosion"
|
||||
var/obj/item/weapon/tank/plasmatank/pt = new /obj/item/weapon/tank/plasmatank( T )
|
||||
playsound(pt.loc, "explosion", 100, 1,3)
|
||||
playsound(pt.loc, 'sound/effects/explosionfar.ogg', 100, 1,10)
|
||||
pt.gas.temperature = 500+T0C
|
||||
pt.ignite()
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/mob/living/silicon/ai/proc/lockdown()
|
||||
set category = "AI Commands"
|
||||
set name = "Lockdown"
|
||||
|
||||
if(usr.stat == 2)
|
||||
usr <<"You cannot initiate lockdown because you are dead!"
|
||||
return
|
||||
|
||||
src << "<b>Initiating lockdowns has been disabled due to system stress.</b>"
|
||||
// Commented this out to disable Lockdowns -- TLE
|
||||
/* world << "\red Lockdown initiated by [usr.name]!"
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world) //activate firealarms
|
||||
spawn( 0 )
|
||||
if(FA.lockdownbyai == 0)
|
||||
FA.lockdownbyai = 1
|
||||
FA.alarm()
|
||||
for(var/obj/machinery/door/airlock/AL in world) //close airlocks
|
||||
spawn( 0 )
|
||||
if(AL.canAIControl() && AL.icon_state == "door0" && AL.lockdownbyai == 0)
|
||||
AL.close()
|
||||
AL.lockdownbyai = 1
|
||||
|
||||
var/obj/machinery/computer/communications/C = locate() in world
|
||||
if(C)
|
||||
C.post_status("alert", "lockdown")
|
||||
*/
|
||||
|
||||
/* src.verbs -= /mob/living/silicon/ai/proc/lockdown
|
||||
src.verbs += /mob/living/silicon/ai/proc/disablelockdown
|
||||
usr << "\red Disable lockdown command enabled!"
|
||||
winshow(usr,"rpane",1)
|
||||
*/
|
||||
|
||||
/mob/living/silicon/ai/proc/disablelockdown()
|
||||
set category = "AI Commands"
|
||||
set name = "Disable Lockdown"
|
||||
|
||||
if(usr.stat == 2)
|
||||
usr <<"You cannot disable lockdown because you are dead!"
|
||||
return
|
||||
|
||||
world << "\red Lockdown cancelled by [usr.name]!"
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world) //deactivate firealarms
|
||||
spawn( 0 )
|
||||
if(FA.lockdownbyai == 1)
|
||||
FA.lockdownbyai = 0
|
||||
FA.reset()
|
||||
for(var/obj/machinery/door/airlock/AL in world) //open airlocks
|
||||
spawn ( 0 )
|
||||
if(AL.canAIControl() && AL.lockdownbyai == 1)
|
||||
AL.open()
|
||||
AL.lockdownbyai = 0
|
||||
|
||||
/* src.verbs -= /mob/living/silicon/ai/proc/disablelockdown
|
||||
src.verbs += /mob/living/silicon/ai/proc/lockdown
|
||||
usr << "\red Disable lockdown command removed until lockdown initiated again!"
|
||||
winshow(usr,"rpane",1)
|
||||
*/
|
||||
@@ -0,0 +1,463 @@
|
||||
/obj/machinery/sec_lock//P'sure this was part of the tunnel
|
||||
name = "Security Pad"
|
||||
desc = "A lock, for doors. Used by security."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "sec_lock"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/a_type = 0.0
|
||||
var/obj/machinery/door/d1 = null
|
||||
var/obj/machinery/door/d2 = null
|
||||
anchored = 1.0
|
||||
req_access = list(access_brig)
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/move/airtunnel/process()
|
||||
if (!( src.deployed ))
|
||||
return null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/create(num, y_coord)
|
||||
if (((num < 7 || (num > 16 && num < 23)) && y_coord == airtunnel_bottom))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/move_right()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/move_left()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_left()
|
||||
src.relocate(get_step(src, WEST))
|
||||
if ((src.next && src.next.deployed))
|
||||
return src.next.move_left()
|
||||
else
|
||||
return src.next
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_right()
|
||||
src.relocate(get_step(src, EAST))
|
||||
if ((src.previous && src.previous.deployed))
|
||||
src.previous.move_right()
|
||||
return src.previous
|
||||
|
||||
/obj/move/airtunnel/proc/create(num, y_coord)
|
||||
if (y_coord == airtunnel_bottom)
|
||||
if ((num < 7 || (num > 16 && num < 23)))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/at_indicator/proc/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "reader_broken"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
if(!SS13_airtunnel.connectors)
|
||||
return
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("reader[][]", (SS13_airtunnel.siphon_status == 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
src.update_icon()
|
||||
return
|
||||
use_power(5, ENVIRON)
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
obj/machinery/computer/airtunnel/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
dat += text("<A href='?src=\ref[];retract=1'>Retract</A> <A href='?src=\ref[];stop=1'>Stop</A> <A href='?src=\ref[];extend=1'>Extend</A><BR>", src, src, src)
|
||||
dat += text("<BR><B>Air Level:</B> []<BR>", (SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS"))
|
||||
dat += "<B>Air System Status:</B> "
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];refresh=1'>(Refresh)</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[];stop_siph=1'>Stop</A> <A href='?src=\ref[];auto=1'>Regulate</A><BR>", src, src, src, src)
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/proc/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("console[][]", (SS13_airtunnel.siphon_status >= 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/process()
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sec_lock/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
use_power(10)
|
||||
|
||||
if (src.loc == user.loc)
|
||||
var/dat = text("<B>Security Pad:</B><BR>\nKeycard: []<BR>\n<A href='?src=\ref[];door1=1'>Toggle Outer Door</A><BR>\n<A href='?src=\ref[];door2=1'>Toggle Inner Door</A><BR>\n<BR>\n<A href='?src=\ref[];em_cl=1'>Emergency Close</A><BR>\n<A href='?src=\ref[];em_op=1'>Emergency Open</A><BR>", (src.scan ? text("<A href='?src=\ref[];card=1'>[]</A>", src, src.scan.name) : text("<A href='?src=\ref[];card=1'>-----</A>", src)), src, src, src, src)
|
||||
user << browse(dat, "window=sec_lock")
|
||||
onclose(user, "sec_lock")
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/attackby(nothing, user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/New()
|
||||
..()
|
||||
spawn( 2 )
|
||||
if (src.a_type == 1)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y - 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTHWEST))
|
||||
else
|
||||
if (src.a_type == 2)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y + 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, NORTHWEST))
|
||||
else
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTH))
|
||||
src.d2 = locate(/obj/machinery/door, get_step(src, SOUTHEAST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((!( src.d1 ) || !( src.d2 )))
|
||||
usr << "\red Error: Cannot interface with door security!"
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["card"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/weapon/card/id/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
if (href_list["door1"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d1.density)
|
||||
spawn( 0 )
|
||||
src.d1.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d1.close()
|
||||
return
|
||||
if (href_list["door2"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d2.density)
|
||||
spawn( 0 )
|
||||
src.d2.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_cl"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (!( src.d1.density ))
|
||||
src.d1.close()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (!( src.d2.density ))
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_op"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
spawn( 0 )
|
||||
if (src.d1.density)
|
||||
src.d1.open()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (src.d2.density)
|
||||
src.d2.open()
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/air_tunnel/air_tunnel1/New()
|
||||
..()
|
||||
for(var/obj/move/airtunnel/A in locate(/area/airtunnel1))
|
||||
A.master = src
|
||||
A.create()
|
||||
src.connectors += A
|
||||
//Foreach goto(21)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/siphons()
|
||||
switch(src.siphon_status)
|
||||
if(0.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(1.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 2
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(2.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 4
|
||||
if(3.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 1
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
else
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/stop()
|
||||
src.operating = 0
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/extend()
|
||||
if (src.operating)
|
||||
return
|
||||
|
||||
spawn(0)
|
||||
src.operating = 2
|
||||
while(src.operating == 2)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.next ))
|
||||
src.operating = 0
|
||||
return
|
||||
if (!( A.move_left() ))
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current)
|
||||
A.current.next.loc = get_step(A.current.loc, EAST)
|
||||
A.current = A.current.next
|
||||
A.current.deployed = 1
|
||||
else
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/retract()
|
||||
if (src.operating)
|
||||
return
|
||||
spawn(0)
|
||||
src.operating = 1
|
||||
while(src.operating == 1)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current == A)
|
||||
src.operating = 0
|
||||
return
|
||||
if (A.current)
|
||||
A.current.loc = null
|
||||
A.current.deployed = 0
|
||||
A.current = A.current.previous
|
||||
else
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.move_right() ))
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
@@ -0,0 +1,951 @@
|
||||
/*/obj/item/assembly
|
||||
name = "assembly"
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
item_state = "assembly"
|
||||
var/status = 0.0
|
||||
throwforce = 10
|
||||
w_class = 3.0
|
||||
throw_speed = 4
|
||||
throw_range = 10
|
||||
|
||||
/obj/item/assembly/a_i_a
|
||||
name = "Health-Analyzer/Igniter/Armor Assembly"
|
||||
desc = "A health-analyzer, igniter and armor assembly."
|
||||
icon_state = "armor-igniter-analyzer"
|
||||
var/obj/item/device/healthanalyzer/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
var/obj/item/clothing/suit/armor/vest/part3 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/m_i_ptank
|
||||
desc = "A very intricate igniter and proximity sensor electrical assembly mounted onto top of a plasma tank."
|
||||
name = "Proximity/Igniter/Plasma Tank Assembly"
|
||||
icon_state = "prox-igniter-tank0"
|
||||
var/obj/item/device/prox_sensor/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
var/obj/item/weapon/tank/plasma/part3 = null
|
||||
status = 0.0
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/prox_ignite
|
||||
name = "Proximity/Igniter Assembly"
|
||||
desc = "A proximity-activated igniter assembly."
|
||||
icon_state = "prox-igniter0"
|
||||
var/obj/item/device/prox_sensor/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/r_i_ptank
|
||||
desc = "A very intricate igniter and signaller electrical assembly mounted onto top of a plasma tank."
|
||||
name = "Radio/Igniter/Plasma Tank Assembly"
|
||||
icon_state = "radio-igniter-tank"
|
||||
var/obj/item/device/radio/signaler/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
var/obj/item/weapon/tank/plasma/part3 = null
|
||||
status = 0.0
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/anal_ignite
|
||||
name = "Health-Analyzer/Igniter Assembly"
|
||||
desc = "A health-analyzer igniter assembly."
|
||||
icon_state = "timer-igniter0"
|
||||
var/obj/item/device/healthanalyzer/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
item_state = "electronic"
|
||||
|
||||
/obj/item/assembly/time_ignite
|
||||
name = "Timer/Igniter Assembly"
|
||||
desc = "A timer-activated igniter assembly."
|
||||
icon_state = "timer-igniter0"
|
||||
var/obj/item/device/timer/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/t_i_ptank
|
||||
desc = "A very intricate igniter and timer assembly mounted onto top of a plasma tank."
|
||||
name = "Timer/Igniter/Plasma Tank Assembly"
|
||||
icon_state = "timer-igniter-tank0"
|
||||
var/obj/item/device/timer/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
var/obj/item/weapon/tank/plasma/part3 = null
|
||||
status = 0.0
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/rad_ignite
|
||||
name = "Radio/Igniter Assembly"
|
||||
desc = "A radio-activated igniter assembly."
|
||||
icon_state = "radio-igniter"
|
||||
var/obj/item/device/radio/signaler/part1 = null
|
||||
var/obj/item/device/igniter/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/rad_infra
|
||||
name = "Signaller/Infrared Assembly"
|
||||
desc = "An infrared-activated radio signaller"
|
||||
icon_state = "infrared-radio0"
|
||||
var/obj/item/device/radio/signaler/part1 = null
|
||||
var/obj/item/device/infra/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/rad_prox
|
||||
name = "Signaller/Prox Sensor Assembly"
|
||||
desc = "A proximity-activated radio signaller."
|
||||
icon_state = "prox-radio0"
|
||||
var/obj/item/device/radio/signaler/part1 = null
|
||||
var/obj/item/device/prox_sensor/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/rad_time
|
||||
name = "Signaller/Timer Assembly"
|
||||
desc = "A radio signaller activated by a count-down timer."
|
||||
icon_state = "timer-radio0"
|
||||
var/obj/item/device/radio/signaler/part1 = null
|
||||
var/obj/item/device/timer/part2 = null
|
||||
status = null
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
*/
|
||||
|
||||
/obj/item/assembly/time_ignite/premade/New()
|
||||
..()
|
||||
part1 = new(src)
|
||||
part2 = new(src)
|
||||
part1.master = src
|
||||
part2.master = src
|
||||
//part2.status = 0
|
||||
|
||||
/obj/item/assembly/time_ignite/Del()
|
||||
del(part1)
|
||||
del(part2)
|
||||
..()
|
||||
|
||||
/obj/item/assembly/time_ignite/attack_self(mob/user as mob)
|
||||
if (src.part1)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/time_ignite/receive_signal()
|
||||
if (!status)
|
||||
return
|
||||
for(var/mob/O in hearers(1, src.loc))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
src.part2.Activate()
|
||||
return
|
||||
|
||||
/obj/effect/decal/ash/attack_hand(mob/user as mob)
|
||||
usr << "\blue The ashes slip through your fingers."
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/assembly/time_ignite/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part1.master = null
|
||||
src.part1 = null
|
||||
src.part2.loc = T
|
||||
src.part2.master = null
|
||||
src.part2 = null
|
||||
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The timer is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The timer is now unsecured!", 1)
|
||||
src.part2.secured = src.status
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/time_ignite/c_state(n)
|
||||
src.icon_state = text("timer-igniter[]", n)
|
||||
return
|
||||
|
||||
//***********
|
||||
|
||||
/obj/item/assembly/anal_ignite/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part1.master = null
|
||||
src.part1 = null
|
||||
src.part2.loc = T
|
||||
src.part2.master = null
|
||||
src.part2 = null
|
||||
|
||||
del(src)
|
||||
return
|
||||
if (( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The analyzer is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The analyzer is now unsecured!", 1)
|
||||
src.part2.secured = src.status
|
||||
src.add_fingerprint(user)
|
||||
if(( istype(W, /obj/item/clothing/suit/armor/vest) ) && src.status)
|
||||
var/obj/item/assembly/a_i_a/R = new
|
||||
R.part1 = part1
|
||||
R.part1.master = R
|
||||
part1 = null
|
||||
|
||||
R.part2 = part2
|
||||
R.part2.master = R
|
||||
part2 = null
|
||||
|
||||
user.put_in_hand(R)
|
||||
user.before_take_item(W)
|
||||
R.part3 = W
|
||||
R.part3.master = R
|
||||
del(src)
|
||||
|
||||
/* WTF THIS SHIT? It is working? Shouldn't. --rastaf0
|
||||
W.loc = R
|
||||
R.part1 = W
|
||||
R.part2 = W
|
||||
W.layer = initial(W.layer)
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
if (user.r_hand == W)
|
||||
user.u_equip(W)
|
||||
user.r_hand = R
|
||||
else
|
||||
user.u_equip(W)
|
||||
user.l_hand = R
|
||||
W.master = R
|
||||
src.master = R
|
||||
src.layer = initial(src.layer)
|
||||
user.u_equip(src)
|
||||
if (user.client)
|
||||
user.client.screen -= src
|
||||
src.loc = R
|
||||
R.part3 = src
|
||||
R.layer = 20
|
||||
R.loc = user
|
||||
src.add_fingerprint(user)
|
||||
*/
|
||||
return
|
||||
/* else if ((istype(W, /obj/item/device/timer) && !( src.status )))
|
||||
|
||||
var/obj/item/assembly/time_ignite/R = new /obj/item/assembly/time_ignite( user )
|
||||
W.loc = R
|
||||
R.part1 = W
|
||||
W.layer = initial(W.layer)
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
if (user.r_hand == W)
|
||||
user.u_equip(W)
|
||||
user.r_hand = R
|
||||
else
|
||||
user.u_equip(W)
|
||||
user.l_hand = R
|
||||
W.master = R
|
||||
src.master = R
|
||||
src.layer = initial(src.layer)
|
||||
user.u_equip(src)
|
||||
if (user.client)
|
||||
user.client.screen -= src
|
||||
src.loc = R
|
||||
R.part2 = src
|
||||
R.layer = 20
|
||||
R.loc = user
|
||||
src.add_fingerprint(user)
|
||||
*/
|
||||
|
||||
/obj/item/assembly/proc/c_state(n, O as obj)
|
||||
return
|
||||
|
||||
/obj/item/assembly/a_i_a/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part1.master = null
|
||||
src.part1 = null
|
||||
src.part2.loc = T
|
||||
src.part2.master = null
|
||||
src.part2 = null
|
||||
src.part3.loc = T
|
||||
src.part3.master = null
|
||||
src.part3 = null
|
||||
|
||||
del(src)
|
||||
return
|
||||
if (( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
if (!src.status && (!part1||!part2||!part3))
|
||||
user << "\red You cannot finish the assembly, not all components are in place!"
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The armor is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The armor is now unsecured!", 1)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
/obj/item/assembly/a_i_a/Del()
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
del(src.part3)
|
||||
..()
|
||||
return
|
||||
//*****
|
||||
|
||||
/obj/item/assembly/rad_time/Del()
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_time/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The signaler is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The signaler is now unsecured!", 1)
|
||||
src.part1.b_stat = !( src.status )
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_time/attack_self(mob/user as mob)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.part2.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_time/receive_signal(datum/signal/signal)
|
||||
if (signal.source == src.part2)
|
||||
src.part1.send_signal("ACTIVATE")
|
||||
return
|
||||
//*******************
|
||||
/obj/item/assembly/rad_prox/c_state(n)
|
||||
src.icon_state = "prox-radio[n]"
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/Del()
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/HasProximity(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/effect/beam))
|
||||
return
|
||||
if (AM.move_speed < 12)
|
||||
src.part2.sense()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The proximity sensor is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The proximity sensor is now unsecured!", 1)
|
||||
src.part1.b_stat = !( src.status )
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/attack_self(mob/user as mob)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.part2.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/receive_signal(datum/signal/signal)
|
||||
if (signal.source == src.part2)
|
||||
src.part1.send_signal("ACTIVATE")
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/Move()
|
||||
..()
|
||||
src.part2.sense()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_prox/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/assembly/rad_prox/dropped()
|
||||
spawn( 0 )
|
||||
src.part2.sense()
|
||||
return
|
||||
return
|
||||
//************************
|
||||
/obj/item/assembly/rad_infra/c_state(n)
|
||||
src.icon_state = text("infrared-radio[]", n)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/Del()
|
||||
del(src.part1)
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The infrared laser is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The infrared laser is now unsecured!", 1)
|
||||
src.part1.b_stat = !( src.status )
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/attack_self(mob/user as mob)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.part2.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/receive_signal(datum/signal/signal)
|
||||
|
||||
if (signal.source == src.part2)
|
||||
src.part1.send_signal("ACTIVATE")
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/verb/rotate()
|
||||
set name = "Rotate Assembly"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
src.part2.dir = src.dir
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/Move()
|
||||
|
||||
var/t = src.dir
|
||||
..()
|
||||
src.dir = t
|
||||
//src.part2.first = null
|
||||
del(src.part2.first)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_infra/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/assembly/rad_infra/attack_hand(M)
|
||||
del(src.part2.first)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/HasProximity(atom/movable/AM as mob|obj)
|
||||
|
||||
if (istype(AM, /obj/effect/beam))
|
||||
return
|
||||
if (AM.move_speed < 12 && src.part1)
|
||||
src.part1.sense()
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/dropped()
|
||||
spawn( 0 )
|
||||
src.part1.sense()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/Del()
|
||||
del(src.part1)
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/c_state(n)
|
||||
src.icon_state = text("prox-igniter[]", n)
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The proximity sensor is now secured! The igniter now works!", 1)
|
||||
else
|
||||
user.show_message("\blue The proximity sensor is now unsecured! The igniter will not work.", 1)
|
||||
src.part2.secured = src.status
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/attack_self(mob/user as mob)
|
||||
|
||||
if (src.part1)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/prox_ignite/receive_signal()
|
||||
for(var/mob/O in hearers(1, src.loc))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
src.part2.Activate()
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_ignite/Del()
|
||||
del(src.part1)
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/assembly/rad_ignite/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (src.status)
|
||||
user.show_message("\blue The radio is now secured! The igniter now works!", 1)
|
||||
else
|
||||
user.show_message("\blue The radio is now unsecured! The igniter will not work.", 1)
|
||||
src.part2.secured = src.status
|
||||
src.part1.b_stat = !( src.status )
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_ignite/attack_self(mob/user as mob)
|
||||
|
||||
if (src.part1)
|
||||
src.part1.attack_self(user, src.status)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/rad_ignite/receive_signal()
|
||||
for(var/mob/O in hearers(1, src.loc))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
src.part2.Activate()
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/c_state(n)
|
||||
|
||||
src.icon_state = text("prox-igniter-tank[]", n)
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/HasProximity(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/effect/beam))
|
||||
return
|
||||
if (AM.move_speed < 12 && src.part1)
|
||||
src.part1.sense()
|
||||
return
|
||||
|
||||
|
||||
//*****RM
|
||||
/obj/item/assembly/m_i_ptank/Bump(atom/O)
|
||||
spawn(0)
|
||||
//world << "miptank bumped into [O]"
|
||||
if(src.part1.secured)
|
||||
//world << "sending signal"
|
||||
receive_signal()
|
||||
else
|
||||
//world << "not active"
|
||||
..()
|
||||
|
||||
/obj/item/assembly/m_i_ptank/proc/prox_check()
|
||||
if(!part1 || !part1.secured)
|
||||
return
|
||||
for(var/atom/A in view(1, src.loc))
|
||||
if(A!=src && !istype(A, /turf/space) && !isarea(A))
|
||||
//world << "[A]:[A.type] was sensed"
|
||||
src.part1.sense()
|
||||
break
|
||||
|
||||
spawn(10)
|
||||
prox_check()
|
||||
|
||||
|
||||
//*****
|
||||
|
||||
|
||||
/obj/item/assembly/m_i_ptank/dropped()
|
||||
|
||||
spawn( 0 )
|
||||
part1.sense()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/examine()
|
||||
..()
|
||||
part3.examine()
|
||||
|
||||
/obj/item/assembly/m_i_ptank/Del()
|
||||
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
//src.part3 = null
|
||||
del(src.part3)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/device/analyzer))
|
||||
src.part3.attackby(W, user)
|
||||
return
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/obj/item/assembly/prox_ignite/R = new(get_turf(src.loc))
|
||||
R.part1 = src.part1
|
||||
R.part1.master = R
|
||||
R.part1.loc = R
|
||||
R.part2 = src.part2
|
||||
R.part2.master = R
|
||||
R.part2.loc = R
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.put_in_inactive_hand(part3)
|
||||
else
|
||||
part3.loc = src.loc
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
src.part3 = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/weldingtool)&&W:welding ))
|
||||
return
|
||||
if (!( src.status ))
|
||||
src.status = 1
|
||||
bombers += "[key_name(user)] welded a prox bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
message_admins("[key_name_admin(user)] welded a prox bomb. Temp: [src.part3.air_contents.temperature-T0C]")
|
||||
user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1)
|
||||
else
|
||||
src.status = 0
|
||||
bombers += "[key_name(user)] unwelded a prox bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
user << "\blue The hole has been closed."
|
||||
src.part2.secured = src.status
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/attack_self(mob/user as mob)
|
||||
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 100, 1)
|
||||
src.part1.attack_self(user, 1)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/receive_signal()
|
||||
//world << "miptank [src] got signal"
|
||||
for(var/mob/O in hearers(1, null))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
//Foreach goto(19)
|
||||
|
||||
if ((src.status && prob(90)))
|
||||
//world << "sent ignite() to [src.part3]"
|
||||
src.part3.ignite()
|
||||
else
|
||||
if(!src.status)
|
||||
src.part3.release()
|
||||
src.part1.secured = 0.0
|
||||
|
||||
return
|
||||
|
||||
/obj/item/assembly/m_i_ptank/emp_act(severity)
|
||||
|
||||
if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
|
||||
part3.ignite()
|
||||
..()
|
||||
|
||||
//*****RM
|
||||
|
||||
/obj/item/assembly/t_i_ptank/c_state(n)
|
||||
|
||||
src.icon_state = text("timer-igniter-tank[]", n)
|
||||
return
|
||||
|
||||
/obj/item/assembly/t_i_ptank/examine()
|
||||
..()
|
||||
src.part3.examine()
|
||||
|
||||
/obj/item/assembly/t_i_ptank/Del()
|
||||
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
//src.part3 = null
|
||||
del(src.part3)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/t_i_ptank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if (istype(W, /obj/item/device/analyzer))
|
||||
src.part3.attackby(W, user)
|
||||
return
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/obj/item/assembly/time_ignite/R = new(get_turf(src.loc))
|
||||
R.part1 = src.part1
|
||||
R.part1.master = R
|
||||
R.part1.loc = R
|
||||
R.part2 = src.part2
|
||||
R.part2.master = R
|
||||
R.part2.loc = R
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.put_in_inactive_hand(part3)
|
||||
else
|
||||
part3.loc = src.loc
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
src.part3 = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/weldingtool) && W:welding))
|
||||
return
|
||||
if (!( src.status ))
|
||||
src.status = 1
|
||||
bombers += "[key_name(user)] welded a time bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
message_admins("[key_name_admin(user)] welded a time bomb. Temp: [src.part3.air_contents.temperature-T0C]")
|
||||
user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1)
|
||||
else
|
||||
if(src)
|
||||
src.status = 0
|
||||
bombers += "[key_name(user)] unwelded a time bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
user << "\blue The hole has been closed."
|
||||
src.part2.secured = src.status
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/t_i_ptank/attack_self(mob/user as mob)
|
||||
|
||||
src.part1.attack_self(user, 1)
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 100, 1)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/t_i_ptank/receive_signal()
|
||||
//world << "tiptank [src] got signal"
|
||||
for(var/mob/O in hearers(1, null))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
//Foreach goto(19)
|
||||
if ((src.status && prob(90)))
|
||||
//world << "sent ignite() to [src.part3]"
|
||||
src.part3.ignite()
|
||||
else
|
||||
if(!src.status)
|
||||
src.part3.release()
|
||||
return
|
||||
|
||||
/obj/item/assembly/t_i_ptank/emp_act(severity)
|
||||
if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
|
||||
part3.ignite()
|
||||
..()
|
||||
|
||||
/obj/item/assembly/r_i_ptank/examine()
|
||||
..()
|
||||
src.part3.examine()
|
||||
|
||||
/obj/item/assembly/r_i_ptank/Del()
|
||||
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
//src.part3 = null
|
||||
del(src.part3)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/r_i_ptank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if (istype(W, /obj/item/device/analyzer))
|
||||
src.part3.attackby(W, user)
|
||||
return
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/obj/item/assembly/rad_ignite/R = new(get_turf(src.loc))
|
||||
R.part1 = src.part1
|
||||
R.part1.master = R
|
||||
R.part1.loc = R
|
||||
R.part2 = src.part2
|
||||
R.part2.master = R
|
||||
R.part2.loc = R
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.put_in_inactive_hand(part3)
|
||||
else
|
||||
part3.loc = src.loc
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
src.part3 = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/weldingtool) && W:welding ))
|
||||
return
|
||||
if (!( src.status ))
|
||||
src.status = 1
|
||||
bombers += "[key_name(user)] welded a radio bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
message_admins("[key_name_admin(user)] welded a radio bomb. Temp: [src.part3.air_contents.temperature-T0C]")
|
||||
user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1)
|
||||
else
|
||||
src.status = 0
|
||||
bombers += "[key_name(user)] unwelded a radio bomb. Temp: [src.part3.air_contents.temperature-T0C]"
|
||||
user << "\blue The hole has been closed."
|
||||
src.part2.secured = src.status
|
||||
src.part1.b_stat = !( src.status )
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/r_i_ptank/emp_act(severity)
|
||||
if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
|
||||
part3.ignite()
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/clothing/suit/armor/a_i_a_ptank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/device/analyzer))
|
||||
src.part4.attackby(W, user)
|
||||
return
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/obj/item/assembly/a_i_a/R = new(get_turf(src.loc))
|
||||
R.part1 = src.part1
|
||||
R.part1.master = R
|
||||
R.part1.loc = R
|
||||
R.part2 = src.part2
|
||||
R.part2.master = R
|
||||
R.part2.loc = R
|
||||
R.part3 = src.part3
|
||||
R.part3.master = R
|
||||
R.part3.loc = R
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.put_in_inactive_hand(part4)
|
||||
else
|
||||
part4.loc = src.loc
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
src.part3 = null
|
||||
src.part4 = null
|
||||
del(src)
|
||||
return
|
||||
if (( istype(W, /obj/item/weapon/weldingtool) && W:welding))
|
||||
return
|
||||
if (!( src.status ))
|
||||
src.status = 1
|
||||
bombers += "[key_name(user)] welded a suicide bomb. Temp: [src.part4.air_contents.temperature-T0C]"
|
||||
message_admins("[key_name_admin(user)] welded a suicide bomb. Temp: [src.part4.air_contents.temperature-T0C]")
|
||||
user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1)
|
||||
else
|
||||
src.status = 0
|
||||
bombers += "[key_name(user)] unwelded a suicide bomb. Temp: [src.part4.air_contents.temperature-T0C]"
|
||||
user << "\blue The hole has been closed."
|
||||
// src.part3.status = src.status
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/r_i_ptank/attack_self(mob/user as mob)
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 100, 1)
|
||||
src.part1.attack_self(user, 1)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/r_i_ptank/receive_signal()
|
||||
//world << "riptank [src] got signal"
|
||||
for(var/mob/O in hearers(1, null))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
//Foreach goto(19)
|
||||
if ((src.status && prob(90)))
|
||||
//world << "sent ignite() to [src.part3]"
|
||||
src.part3.ignite()
|
||||
else
|
||||
if(!src.status)
|
||||
src.part3.release()
|
||||
return
|
||||
|
||||
|
||||
//*****RM
|
||||
@@ -0,0 +1,105 @@
|
||||
/obj/item/device/gps
|
||||
name = "GPS"
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "pinoff"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
m_amt = 500
|
||||
var/obj/effect/ship_landing_beacon/beacon = null
|
||||
var/active = 0
|
||||
|
||||
attack_self()
|
||||
if(!active)
|
||||
active = 1
|
||||
work()
|
||||
usr << "\blue You activate the GPS"
|
||||
else
|
||||
active = 0
|
||||
icon_state = "pinoff"
|
||||
usr << "\blue You deactivate the GPS"
|
||||
|
||||
proc/work()
|
||||
while(active)
|
||||
if(!beacon)
|
||||
for(var/obj/effect/ship_landing_beacon/B in world)
|
||||
if(B.name == "Beacon - SS13")
|
||||
beacon = B
|
||||
break
|
||||
|
||||
if(!beacon)
|
||||
usr << "\red Unable to detect beacon signal."
|
||||
active = 0
|
||||
icon_state = "pinonnull"
|
||||
return
|
||||
|
||||
if(!istype(src.loc, /turf) && !istype(src.loc, /mob))
|
||||
usr << "\red Too much interference. Please hold the device in hand or place it on belt."
|
||||
active = 0
|
||||
icon_state = "pinonnull"
|
||||
return
|
||||
|
||||
src.icon_state = "pinonfar"
|
||||
|
||||
var/atom/cur_loc = src.loc
|
||||
|
||||
if(cur_loc.z == beacon.z)
|
||||
src.dir = get_dir(cur_loc,beacon)
|
||||
else
|
||||
var/list/beacon_global_loc = beacon.get_global_map_pos()
|
||||
var/list/src_global_loc = cur_loc.get_global_map_pos()
|
||||
if(beacon_global_loc && src_global_loc)
|
||||
var/hor_dir = 0
|
||||
var/ver_dir = 0
|
||||
if(beacon_global_loc["x"]>src_global_loc["x"])
|
||||
hor_dir = EAST
|
||||
else if(beacon_global_loc["x"]<src_global_loc["x"])
|
||||
hor_dir = WEST
|
||||
|
||||
if(beacon_global_loc["y"]>src_global_loc["y"])
|
||||
ver_dir = NORTH
|
||||
else if(beacon_global_loc["y"]<src_global_loc["y"])
|
||||
ver_dir = SOUTH
|
||||
|
||||
src.dir = hor_dir|ver_dir
|
||||
sleep(5)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/explorers_box
|
||||
name = "SpaceFriend(tm)"
|
||||
icon_state = "box"
|
||||
desc = "Everything a dashing space explorer would want to have near in the grim darkness of... whatever."
|
||||
|
||||
/obj/item/weapon/storage/explorers_box/New()
|
||||
..()
|
||||
new /obj/item/device/radio/beacon(src)
|
||||
new /obj/item/device/gps(src)
|
||||
new /obj/item/device/flashlight(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/beer(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/chips(src)
|
||||
new /obj/item/weapon/storage/fancy/cigarettes(src)
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src)
|
||||
P.reagents.add_reagent("nutriment", 500)
|
||||
P.name = "Cyanide pill"
|
||||
return
|
||||
|
||||
/obj/effect/ship_landing_beacon
|
||||
icon = 'craft.dmi'
|
||||
icon_state = "beacon"
|
||||
name = "Beacon"
|
||||
var/active = 0
|
||||
|
||||
proc
|
||||
deploy()
|
||||
if(active)
|
||||
return
|
||||
src.active = 1
|
||||
src.anchored = 1
|
||||
deactivate()
|
||||
if(!active)
|
||||
return
|
||||
src.active = 0
|
||||
src.anchored = 0
|
||||
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
/client/proc/authorize()
|
||||
set name = "Authorize"
|
||||
|
||||
if (src.authenticating)
|
||||
return
|
||||
|
||||
if (!config.enable_authentication)
|
||||
src.authenticated = 1
|
||||
return
|
||||
|
||||
src.authenticating = 1
|
||||
|
||||
spawn (rand(4, 18))
|
||||
var/result = world.Export("http://byond.lljk.net/status/?key=[src.ckey]")
|
||||
var/success = 0
|
||||
|
||||
if(lowertext(result["STATUS"]) == "200 ok")
|
||||
var/content = file2text(result["CONTENT"])
|
||||
|
||||
var/pos = findtext(content, " ")
|
||||
var/code
|
||||
var/account = ""
|
||||
|
||||
if (!pos)
|
||||
code = lowertext(content)
|
||||
else
|
||||
code = lowertext(copytext(content, 1, pos))
|
||||
account = copytext(content, pos + 1)
|
||||
|
||||
if (code == "ok" && account)
|
||||
src.verbs -= /client/proc/authorize
|
||||
src.authenticated = account
|
||||
src << "Key authorized: Hello [html_encode(account)]!"
|
||||
src << "\blue[auth_motd]"
|
||||
success = 1
|
||||
|
||||
if (!success)
|
||||
src.verbs += /client/proc/authorize
|
||||
src << "Failed to authenticate your key."
|
||||
src << "If you have not already authorize it at http://byond.lljk.net/ - your BYOND key is [src.key]."
|
||||
src << "Try again using the <b>Authorize</b> command, sometimes the server will hiccup and not correctly authorize."
|
||||
src << "\blue[no_auth_motd]"
|
||||
src.authenticating = 0
|
||||
*/
|
||||
|
||||
/* The old goon auth/beta code is here
|
||||
/client/proc/beta_tester_auth()
|
||||
set name = "Tester?"
|
||||
/*if(istester(src))
|
||||
src << "\blue <B>Key accepted as beta tester</B>"
|
||||
else
|
||||
src << "\red<B>Key not accepted as beta tester. You may only observe the rounds. */
|
||||
|
||||
/client/proc/goonauth()
|
||||
set name = "Goon?"
|
||||
|
||||
if (src.authenticating)
|
||||
return
|
||||
|
||||
if(isgoon(src))
|
||||
src.goon = goon_keylist[src.ckey]
|
||||
src.verbs -= /client/proc/goonauth
|
||||
src << "Key authorized: Hello [goon_keylist[src.ckey]]!"
|
||||
src << "\blue[auth_motd]"
|
||||
return
|
||||
|
||||
if (config.enable_authentication) //so that this verb isn't used when its goon only
|
||||
if(src.authenticated && src.authenticated != 1)
|
||||
src.goon = src.authenticated
|
||||
src.verbs -= /client/proc/goonauth
|
||||
src << "Key authorized: Hello [src.goon]!"
|
||||
src << "\blue[auth_motd]"
|
||||
else
|
||||
src << "Please authorize first"
|
||||
return
|
||||
|
||||
src.authenticating = 1
|
||||
|
||||
spawn (rand(4, 18))
|
||||
var/result = world.Export("http://byond.lljk.net/status/?key=[src.ckey]")
|
||||
var/success = 0
|
||||
|
||||
if(lowertext(result["STATUS"]) == "200 ok")
|
||||
var/content = file2text(result["CONTENT"])
|
||||
|
||||
var/pos = findtext(content, " ")
|
||||
var/code
|
||||
var/account = ""
|
||||
|
||||
if (!pos)
|
||||
code = lowertext(content)
|
||||
else
|
||||
code = lowertext(copytext(content, 1, pos))
|
||||
account = copytext(content, pos + 1)
|
||||
|
||||
if (code == "ok" && account)
|
||||
src.verbs -= /client/proc/goonauth
|
||||
src.goon = account
|
||||
src << "Key authorized: Hello [html_encode(account)]!"
|
||||
src << "\blue[auth_motd]"
|
||||
success = 1
|
||||
goon_key(src.ckey, account)
|
||||
|
||||
if (!success)
|
||||
src.verbs += /client/proc/goonauth
|
||||
//src << "Failed"
|
||||
src << "\blue[no_auth_motd]"
|
||||
|
||||
src.authenticating = 0
|
||||
|
||||
var/goon_keylist[0]
|
||||
var/list/beta_tester_keylist
|
||||
|
||||
/proc/beta_tester_loadfile()
|
||||
beta_tester_keylist = new/list()
|
||||
var/text = file2text("config/testers.txt")
|
||||
if (!text)
|
||||
diary << "Failed to load config/testers.txt\n"
|
||||
else
|
||||
var/list/lines = dd_text2list(text, "\n")
|
||||
for(var/line in lines)
|
||||
if (!line)
|
||||
continue
|
||||
|
||||
var/tester_key = copytext(line, 1, 0)
|
||||
beta_tester_keylist.Add(tester_key)
|
||||
|
||||
|
||||
/proc/goon_loadfile()
|
||||
var/savefile/S=new("data/goon.goon")
|
||||
S["key[0]"] >> goon_keylist
|
||||
log_admin("Loading goon_keylist")
|
||||
if (!length(goon_keylist))
|
||||
goon_keylist=list()
|
||||
log_admin("goon_keylist was empty")
|
||||
|
||||
/proc/goon_savefile()
|
||||
var/savefile/S=new("data/goon.goon")
|
||||
S["key[0]"] << goon_keylist
|
||||
|
||||
/proc/goon_key(key as text,account as text)
|
||||
var/ckey=ckey(key)
|
||||
if (!goon_keylist.Find(ckey))
|
||||
goon_keylist.Add(ckey)
|
||||
goon_keylist[ckey] = account
|
||||
goon_savefile()
|
||||
|
||||
/proc/isgoon(X)
|
||||
if (istype(X,/mob)) X=X:ckey
|
||||
if (istype(X,/client)) X=X:ckey
|
||||
if ((ckey(X) in goon_keylist)) return 1
|
||||
else return 0
|
||||
|
||||
/proc/istester(X)
|
||||
if (istype(X,/mob)) X=X:ckey
|
||||
if (istype(X,/client)) X=X:ckey
|
||||
if ((ckey(X) in beta_tester_keylist)) return 1
|
||||
else return 0
|
||||
|
||||
/proc/remove_goon(key as text)
|
||||
var/ckey=ckey(key)
|
||||
if (key && goon_keylist.Find(ckey))
|
||||
goon_keylist.Remove(ckey)
|
||||
goon_savefile()
|
||||
return 1
|
||||
return 0
|
||||
*/
|
||||
@@ -0,0 +1 @@
|
||||
mob/living/carbon/beast
|
||||
@@ -0,0 +1,16 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
datum/bodypart
|
||||
var/name = "unidentified bodypart"
|
||||
var/health = 50
|
||||
|
||||
datum/bodypart/body
|
||||
health = 100
|
||||
|
||||
datum/bodypart/head
|
||||
health = 30
|
||||
|
||||
datum/bodypart/limb
|
||||
|
||||
datum/bodypart/tail
|
||||
health = 15
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
var/mob/dead/phantasm/P = new (src.loc)
|
||||
for(var/obj/O in src.contents) // Where src is a mob
|
||||
if(istype(O, /obj/item)) // Only remember carried items (sanity checking, mostly)
|
||||
src.u_equip(O) // Unequip the item if we're wearing it
|
||||
if (src.client)
|
||||
src.client.screen -= O // Clear out any overlays the item added, notably in the equip windows
|
||||
O.loc = src.loc // Honestly not sure if these two steps are necessary
|
||||
O.dropped(src) // but they seem to occur everywhere else in the code, so we're not taking any chances.
|
||||
O.layer = initial(O.layer)
|
||||
O.loc = P // Add the item to the phantasm's inventory
|
||||
src.Death(0)
|
||||
*/
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
This is a kitchen appliance to go along with the processor and the microwave. The Blender is for food items that are mixes or purees.
|
||||
Currently, the end products of the blender are not compatable with the microwave but I hope to fix that eventually.
|
||||
|
||||
Summary of Blender Code: It's basically a large reagent container and, like any other container, reactions can occur in it. However,
|
||||
unlike a normal container, if you stick certain kinds of "blendable" items (ie. many food products), it'll convert the food item from
|
||||
an object (which you can pick up and eat) into a reagent (which you can pour and drink). Containers with reagents in it can be poured
|
||||
directly into the blender. Other food items will be converted into reagents by the blender. When deciding whether should be made with
|
||||
the blender or the processor: Processor items are solid objects and Blender results are reagents.
|
||||
*/
|
||||
|
||||
/obj/machinery/blender
|
||||
name = "Blender"
|
||||
desc = "A kitchen appliance used to blend stuff."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "blender_e"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 50
|
||||
flags = OPENCONTAINER //So that you can pour stuff into it.
|
||||
var/processing = 0 //This turns on (1) while it is processing so you don't accidentally get multiples from the same item.
|
||||
var/container = 1 //Is there a jug attached? Could have been done with a for loop but it's less code this way.
|
||||
|
||||
New()
|
||||
var/datum/reagents/R = new/datum/reagents(100) //Its large since you only get one.
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
src.contents += new /obj/item/weapon/reagent_containers/glass/blender_jug(src)
|
||||
src.container = "/obj/item/weapon/reagent_containers/glass/blender_jug" //Loads a jug into the blender.
|
||||
|
||||
on_reagent_change() //When the reagents change, change the icon as well.
|
||||
update_icon()
|
||||
|
||||
|
||||
update_icon() //Changes the icon depending on how full it is and whether it has the jug attached.
|
||||
if(src.container)
|
||||
switch(src.reagents.total_volume)
|
||||
if(0)
|
||||
src.icon_state = "blender_e" //Empty
|
||||
if(1 to 75)
|
||||
src.icon_state = "blender_h" //Some but not full
|
||||
if(76 to 100)
|
||||
src.icon_state = "blender_f" //Mostly full.
|
||||
else
|
||||
src.icon_state = "blender_d" //No jug. Should be redundant but just in case.
|
||||
return
|
||||
|
||||
/obj/machinery/blender/attackby(var/obj/item/O as obj, var/mob/user as mob) //Attack it with an object.
|
||||
if(src.contents.len >= 10 || src.reagents.total_volume >= 80) //Too full. Max 10 items or 80 units of reagent
|
||||
user << "Too many items are already in the blending chamber."
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/glass/blender_jug) && src.container == 0) //Load jug.
|
||||
O.reagents.trans_to(src, O.reagents.total_volume)
|
||||
del(O)
|
||||
src.contents += new /obj/item/weapon/reagent_containers/glass/blender_jug(src)
|
||||
//user.drop_item()
|
||||
//O.loc = src
|
||||
src.container = 1
|
||||
src.flags = OPENCONTAINER
|
||||
src.update_icon()
|
||||
else if(src.container == 0) //No jug to load in to.
|
||||
user << "There is no container to put [O] in to!"
|
||||
else
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks)) //Will only blend food items. Add others in this else clause.
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
user << "You drop the [O] into the blender."
|
||||
else if (istype(O, /obj/item/weapon/plantbag)) //Allows plant bags to empty into the blender.
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
|
||||
O.contents -= G
|
||||
G.loc = src
|
||||
if(src.contents.len >= 10 || src.reagents.total_volume >= 80) //Sanity checking so the blender doesn't overfill
|
||||
user << "You fill the blender to the brim."
|
||||
break
|
||||
if(src.contents.len < 10 && src.reagents.total_volume < 80)
|
||||
user << "You empty the plant bag into the blender."
|
||||
else
|
||||
user << "That probably won't blend."
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/blender/verb/blend() //Blend shit. Note: In the actual blending loop, make sure it can't include the jug.
|
||||
set category = "Object"
|
||||
set name = "Turn Blender On"
|
||||
set src in oview(1) // Otherwise, it'll try to blend it too.
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (src.stat != 0) //NOPOWER etc
|
||||
return
|
||||
if(src.processing)
|
||||
usr << "\red The blender is in the process of blending."
|
||||
return
|
||||
if(!src.container)
|
||||
usr << "\red The blender doesn't have an attached container!"
|
||||
return
|
||||
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
src.processing = 1
|
||||
usr << "\blue You turn on the blender."
|
||||
use_power(250)
|
||||
for(var/obj/O in src.contents)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/soybeans)) // Mass balance law
|
||||
src.reagents.add_reagent("soymilk", O.reagents.get_reagent_amount("nutriment"))
|
||||
O.reagents.del_reagent("nutriment")
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/tomato)) // Mass balance law
|
||||
src.reagents.add_reagent("ketchup", O.reagents.get_reagent_amount("nutriment"))
|
||||
O.reagents.del_reagent("nutriment")
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/corn)) // Mass balance law
|
||||
src.reagents.add_reagent("cornoil", O.reagents.get_reagent_amount("nutriment"))
|
||||
O.reagents.del_reagent("nutriment")
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks)) //This is intentionally not an "else if"
|
||||
O.reagents.trans_to(src, O.reagents.total_volume) //Think of it as the "pulp" leftover.
|
||||
del(O)
|
||||
src.processing = 0
|
||||
usr << "The contents of the blender have been blended."
|
||||
return
|
||||
|
||||
/obj/machinery/blender/verb/detach() //Transfers the contents of the Blender to the Blender Jug and then ejects the jug.
|
||||
set category = "Object"
|
||||
set name = "Detach Blender Jug"
|
||||
set src in oview(1)
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if(src.processing)
|
||||
usr << "The blender is in the process of blending."
|
||||
else if(!src.container)
|
||||
usr << "There is nothing to detach!"
|
||||
else
|
||||
for(var/obj/O in src.contents) //Searches through the contents for the jug.
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass/blender_jug))
|
||||
O.loc = get_turf(src)
|
||||
src.reagents.trans_to(O, src.reagents.total_volume)
|
||||
O = null
|
||||
src.flags = null
|
||||
src.icon_state = "blender_d"
|
||||
usr << "You detatch the blending jug."
|
||||
src.container = 0
|
||||
return
|
||||
|
||||
/obj/machinery/blender/verb/eject() //Ejects the non-reagent contents of the blender besides the jug.
|
||||
set category = "Object"
|
||||
set name = "Empty Blender Jug"
|
||||
set src in oview(1)
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if(src.processing)
|
||||
usr << "The blender is in the process of blending."
|
||||
else if(!src.container)
|
||||
usr << "There is nothing to eject!"
|
||||
else
|
||||
for(var/obj/O in src.contents)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
|
||||
O.loc = get_turf(src)
|
||||
O = null
|
||||
return
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/proc/carpetsplosion(turf/location as turf,range = 10)
|
||||
var/obj/effect/spreader/spreadEpicentre = new /obj/effect/spreader(location,range)
|
||||
var/list/turf/spreadTurfs = list()
|
||||
|
||||
sleep(5)
|
||||
|
||||
for(var/obj/effect/spreader/spread in spreadEpicentre.spreadList)
|
||||
spreadTurfs += get_turf(spread)
|
||||
|
||||
del(spreadEpicentre)
|
||||
return
|
||||
|
||||
//DEBUG START
|
||||
/obj/carpetnade
|
||||
New()
|
||||
..()
|
||||
carpetsplosion(loc)
|
||||
|
||||
//DEBUG END
|
||||
|
||||
/obj/effect/spreader
|
||||
var/list/obj/effect/spreader/spreadList = list()
|
||||
|
||||
/obj/effect/spreader/Del()
|
||||
for(var/obj/effect/spreader/spread in spreadList)
|
||||
if(spread != src)
|
||||
del(spread)
|
||||
..()
|
||||
|
||||
/obj/effect/spreader/New(location,var/amount = 1,obj/effects/spreader/source = src) //just a copypaste job from foam
|
||||
if(amount <= 0)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
for(var/direction in cardinal)
|
||||
var/turf/T = get_step(src,direction)
|
||||
if(!T)
|
||||
continue
|
||||
|
||||
if(!T.Enter(src))
|
||||
continue
|
||||
|
||||
var/obj/effect/spreader/S = locate() in T
|
||||
if(S)
|
||||
continue
|
||||
|
||||
new /obj/effect/spreader(T,amount-1,source)
|
||||
|
||||
source.spreadList += src
|
||||
|
||||
/*
|
||||
/obj/effect/foam/proc/process()
|
||||
if(--amount < 0)
|
||||
return
|
||||
|
||||
|
||||
while(expand) // keep trying to expand while true
|
||||
|
||||
for(var/direction in cardinal)
|
||||
|
||||
|
||||
var/turf/T = get_step(src,direction)
|
||||
if(!T)
|
||||
continue
|
||||
|
||||
if(!T.Enter(src))
|
||||
continue
|
||||
|
||||
var/obj/effect/foam/F = locate() in T
|
||||
if(F)
|
||||
continue
|
||||
|
||||
F = new(T, metal)
|
||||
F.amount = amount
|
||||
if(!metal)
|
||||
F.create_reagents(10)
|
||||
if (reagents)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
F.reagents.add_reagent(R.id,1)
|
||||
sleep(15)
|
||||
*/
|
||||
@@ -0,0 +1,60 @@
|
||||
/datum/computer/file/computer_program/airlock_control
|
||||
name = "Airlock Master"
|
||||
size = 16.0
|
||||
id_tag = "TAG"
|
||||
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<a href='byond://?src=\ref[src];close=1'>Close</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];quit=1'>Quit</a>"
|
||||
|
||||
/*
|
||||
dat += "<br><TT>Frequency: "
|
||||
dat += "<a href='?src=\ref[src];adj_freq=-10'>--</a> "
|
||||
dat += "<a href='?src=\ref[src];adj_freq=-2'>-</a> "
|
||||
dat += "[format_frequency(src.master.frequency)] "
|
||||
dat += "<a href='?src=\ref[src];adj_freq=2'>+</a> "
|
||||
dat += "<a href='?src=\ref[src];adj_freq=10'>++</a>"
|
||||
dat += "</TT><br>"
|
||||
*/
|
||||
|
||||
|
||||
dat += "<br>ID:<a href='byond://?src=\ref[src];set_tag=1'>[src.id_tag]</a><br>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];send_command=cycle'>Cycle</a>"
|
||||
|
||||
|
||||
dat += "</b></center>"
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["set_tag"])
|
||||
var/t = input(usr, "Please enter new tag", src.id_tag, null) as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src.master, usr))
|
||||
return
|
||||
|
||||
src.id_tag = t
|
||||
|
||||
// if(href_list["adj_freq"])
|
||||
// var/new_frequency = (src.master.frequency + text2num(href_list["adj_freq"]))
|
||||
// src.master.set_frequency(new_frequency)
|
||||
|
||||
if(href_list["send_command"])
|
||||
var/datum/signal/signal = new
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["command"] = href_list["send_command"]
|
||||
peripheral_command("send signal", signal)
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,136 @@
|
||||
/datum/computer/file/computer_program/arcade
|
||||
name = "Arcade 500"
|
||||
size = 8.0
|
||||
var/enemy_name = "Space Villian"
|
||||
var/temp = "Winners Don't Use Spacedrugs" //Temporary message, for attack messages, etc
|
||||
var/player_hp = 30 //Player health/attack points
|
||||
var/player_mp = 10
|
||||
var/enemy_hp = 45 //Enemy health/attack points
|
||||
var/enemy_mp = 20
|
||||
var/gameover = 0
|
||||
var/blocked = 0 //Player cannot attack/heal while set
|
||||
|
||||
New(obj/holding as obj)
|
||||
if(holding)
|
||||
src.holder = holding
|
||||
|
||||
if(istype(src.holder.loc,/obj/machinery/computer2))
|
||||
src.master = src.holder.loc
|
||||
|
||||
// var/name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ")
|
||||
|
||||
var/name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Evil ", "the Dread King ", "the Space ", "Lord ")
|
||||
var/name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon")
|
||||
|
||||
src.enemy_name = replacetext((name_part1 + name_part2), "the ", "")
|
||||
// src.name = (name_action + name_part1 + name_part2)
|
||||
|
||||
|
||||
|
||||
/datum/computer/file/computer_program/arcade/return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<a href='byond://?src=\ref[src];close=1'>Close</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];quit=1'>Quit</a>"
|
||||
|
||||
dat += "<center><h4>[src.enemy_name]</h4></center>"
|
||||
|
||||
dat += "<br><center><h3>[src.temp]</h3></center>"
|
||||
dat += "<br><center>Health: [src.player_hp] | Magic: [src.player_mp] | Enemy Health: [src.enemy_hp]</center>"
|
||||
|
||||
if (src.gameover)
|
||||
dat += "<center><b><a href='byond://?src=\ref[src];newgame=1'>New Game</a>"
|
||||
else
|
||||
dat += "<center><b><a href='byond://?src=\ref[src];attack=1'>Attack</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];heal=1'>Heal</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];charge=1'>Recharge Power</a>"
|
||||
|
||||
dat += "</b></center>"
|
||||
|
||||
return dat
|
||||
|
||||
/datum/computer/file/computer_program/arcade/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if (!src.blocked)
|
||||
if (href_list["attack"])
|
||||
src.blocked = 1
|
||||
var/attackamt = rand(2,6)
|
||||
src.temp = "You attack for [attackamt] damage!"
|
||||
src.master.updateUsrDialog()
|
||||
|
||||
sleep(10)
|
||||
src.enemy_hp -= attackamt
|
||||
src.arcade_action()
|
||||
|
||||
else if (href_list["heal"])
|
||||
src.blocked = 1
|
||||
var/pointamt = rand(1,3)
|
||||
var/healamt = rand(6,8)
|
||||
src.temp = "You use [pointamt] magic to heal for [healamt] damage!"
|
||||
src.master.updateUsrDialog()
|
||||
|
||||
sleep(10)
|
||||
src.player_mp -= pointamt
|
||||
src.player_hp += healamt
|
||||
src.blocked = 1
|
||||
src.master.updateUsrDialog()
|
||||
src.arcade_action()
|
||||
|
||||
else if (href_list["charge"])
|
||||
src.blocked = 1
|
||||
var/chargeamt = rand(4,7)
|
||||
src.temp = "You regain [chargeamt] points"
|
||||
src.player_mp += chargeamt
|
||||
|
||||
src.master.updateUsrDialog()
|
||||
sleep(10)
|
||||
src.arcade_action()
|
||||
|
||||
if (href_list["newgame"]) //Reset everything
|
||||
temp = "New Round"
|
||||
player_hp = 30
|
||||
player_mp = 10
|
||||
enemy_hp = 45
|
||||
enemy_mp = 20
|
||||
gameover = 0
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/computer/file/computer_program/arcade/proc/arcade_action()
|
||||
if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0))
|
||||
src.gameover = 1
|
||||
src.temp = "[src.enemy_name] has fallen! Rejoice!"
|
||||
src.peripheral_command("vend prize")
|
||||
|
||||
else if ((src.enemy_mp <= 5) && (prob(70)))
|
||||
var/stealamt = rand(2,3)
|
||||
src.temp = "[src.enemy_name] steals [stealamt] of your power!"
|
||||
src.player_mp -= stealamt
|
||||
src.master.updateUsrDialog()
|
||||
|
||||
if (src.player_mp <= 0)
|
||||
src.gameover = 1
|
||||
sleep(10)
|
||||
src.temp = "You have been drained! GAME OVER"
|
||||
|
||||
else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4))
|
||||
src.temp = "[src.enemy_name] heals for 4 health!"
|
||||
src.enemy_hp += 4
|
||||
src.enemy_mp -= 4
|
||||
|
||||
else
|
||||
var/attackamt = rand(3,6)
|
||||
src.temp = "[src.enemy_name] attacks for [attackamt] damage!"
|
||||
src.player_hp -= attackamt
|
||||
|
||||
if ((src.player_mp <= 0) || (src.player_hp <= 0))
|
||||
src.gameover = 1
|
||||
src.temp = "You have been crushed! GAME OVER"
|
||||
|
||||
src.blocked = 0
|
||||
return
|
||||
@@ -0,0 +1,263 @@
|
||||
/datum/computer
|
||||
var/size = 4.0
|
||||
var/obj/item/weapon/disk/data/holder = null
|
||||
var/datum/computer/folder/holding_folder = null
|
||||
folder
|
||||
name = "Folder"
|
||||
size = 0.0
|
||||
var/gen = 0
|
||||
Del()
|
||||
for(var/datum/computer/F in src.contents)
|
||||
del(F)
|
||||
..()
|
||||
proc
|
||||
add_file(datum/computer/R)
|
||||
if(!holder || holder.read_only || !R)
|
||||
return 0
|
||||
if(istype(R,/datum/computer/folder) && (src.gen>=10))
|
||||
return 0
|
||||
if((holder.file_used + R.size) <= holder.file_amount)
|
||||
src.contents.Add(R)
|
||||
R.holder = holder
|
||||
R.holding_folder = src
|
||||
src.holder.file_used -= src.size
|
||||
src.size += R.size
|
||||
src.holder.file_used += src.size
|
||||
if(istype(R,/datum/computer/folder))
|
||||
R:gen = (src.gen+1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
remove_file(datum/computer/R)
|
||||
if(holder && !holder.read_only || !R)
|
||||
// world << "Removing file [R]. File_used: [src.holder.file_used]"
|
||||
src.contents.Remove(R)
|
||||
src.holder.file_used -= src.size
|
||||
src.size -= R.size
|
||||
src.holder.file_used += src.size
|
||||
src.holder.file_used = max(src.holder.file_used, 0)
|
||||
// world << "Removed file [R]. File_used: [src.holder.file_used]"
|
||||
return 1
|
||||
return 0
|
||||
file
|
||||
name = "File"
|
||||
var/extension = "FILE" //Differentiate between types of files, why not
|
||||
proc
|
||||
copy_file_to_folder(datum/computer/folder/newfolder)
|
||||
if(!newfolder || (!istype(newfolder)) || (!newfolder.holder) || (newfolder.holder.read_only))
|
||||
return 0
|
||||
|
||||
if((newfolder.holder.file_used + src.size) <= newfolder.holder.file_amount)
|
||||
var/datum/computer/file/newfile = new src.type
|
||||
|
||||
for(var/V in src.vars)
|
||||
if (issaved(src.vars[V]) && V != "holder")
|
||||
newfile.vars[V] = src.vars[V]
|
||||
|
||||
if(!newfolder.add_file(newfile))
|
||||
del(newfile)
|
||||
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
Del()
|
||||
if(holder && holding_folder)
|
||||
holding_folder.remove_file(src)
|
||||
..()
|
||||
|
||||
|
||||
/datum/computer/file/computer_program
|
||||
name = "blank program"
|
||||
extension = "PROG"
|
||||
//var/size = 4.0
|
||||
//var/obj/item/weapon/disk/data/holder = null
|
||||
var/obj/machinery/computer2/master = null
|
||||
var/active_icon = null
|
||||
var/id_tag = null
|
||||
var/list/req_access = list()
|
||||
|
||||
New(obj/holding as obj)
|
||||
if(holding)
|
||||
src.holder = holding
|
||||
|
||||
if(istype(src.holder.loc,/obj/machinery/computer2))
|
||||
src.master = src.holder.loc
|
||||
|
||||
Del()
|
||||
if(master)
|
||||
master.processing_programs.Remove(src)
|
||||
..()
|
||||
|
||||
proc
|
||||
return_text()
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(master.stat & (NOPOWER|BROKEN))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
//world << "Holder [holder] not in [master] of prg:[src]"
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
if(!src.holder.root)
|
||||
src.holder.root = new /datum/computer/folder
|
||||
src.holder.root.holder = src
|
||||
src.holder.root.name = "root"
|
||||
|
||||
return 0
|
||||
|
||||
process()
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
master.processing_programs.Remove(src)
|
||||
return 1
|
||||
|
||||
if(!src.holder.root)
|
||||
src.holder.root = new /datum/computer/folder
|
||||
src.holder.root.holder = src
|
||||
src.holder.root.name = "root"
|
||||
|
||||
return 0
|
||||
|
||||
receive_command(obj/source, command, datum/signal/signal)
|
||||
if((!src.holder) || (!src.master) || (!source) || (source != src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(master.stat & (NOPOWER|BROKEN))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
peripheral_command(command, datum/signal/signal)
|
||||
if(master)
|
||||
master.send_command(command, signal)
|
||||
else
|
||||
del(signal)
|
||||
|
||||
transfer_holder(obj/item/weapon/disk/data/newholder,datum/computer/folder/newfolder)
|
||||
|
||||
if((newholder.file_used + src.size) > newholder.file_amount)
|
||||
return 0
|
||||
|
||||
if(!newholder.root)
|
||||
newholder.root = new /datum/computer/folder
|
||||
newholder.root.holder = newholder
|
||||
newholder.root.name = "root"
|
||||
|
||||
if(!newfolder)
|
||||
newfolder = newholder.root
|
||||
|
||||
if((src.holder && src.holder.read_only) || newholder.read_only)
|
||||
return 0
|
||||
|
||||
if((src.holder) && (src.holder.root))
|
||||
src.holder.root.remove_file(src)
|
||||
|
||||
newfolder.add_file(src)
|
||||
|
||||
if(istype(newholder.loc,/obj/machinery/computer2))
|
||||
src.master = newholder.loc
|
||||
|
||||
//world << "Setting [src.holder] to [newholder]"
|
||||
src.holder = newholder
|
||||
return 1
|
||||
|
||||
//Check access per program.
|
||||
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.equipped()) || src.check_access(H.wear_id))
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/monkey))
|
||||
var/mob/living/carbon/monkey/george = M
|
||||
//they can only hold things :(
|
||||
if(george.equipped() && istype(george.equipped(), /obj/item/weapon/card/id) && src.check_access(george.equipped()))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
check_access(obj/item/weapon/card/id/I)
|
||||
if(!src.req_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) //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
|
||||
return 1
|
||||
|
||||
Topic(href, href_list)
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(master.stat & (NOPOWER|BROKEN))
|
||||
return 1
|
||||
|
||||
if(src.master.active_program != src)
|
||||
return 1
|
||||
|
||||
if ((!usr.contents.Find(src.master) && (!in_range(src.master, usr) || !istype(src.master.loc, /turf))) && (!istype(usr, /mob/living/silicon)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
usr.machine = src.master
|
||||
|
||||
if (href_list["close"])
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=comp2")
|
||||
return 0
|
||||
|
||||
if (href_list["quit"])
|
||||
// src.master.processing_programs.Remove(src)
|
||||
if(src.master.host_program && src.master.host_program.holder && (src.master.host_program.holder in src.master.contents))
|
||||
src.master.run_program(src.master.host_program)
|
||||
src.master.updateUsrDialog()
|
||||
return 1
|
||||
else
|
||||
src.master.active_program = null
|
||||
src.master.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
return 0
|
||||
@@ -0,0 +1,150 @@
|
||||
//Motherboard is just used in assembly/disassembly, doesn't exist in the actual computer object.
|
||||
/obj/item/weapon/motherboard
|
||||
name = "Computer mainboard"
|
||||
desc = "A computer motherboard."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "mainboard"
|
||||
item_state = "electronic"
|
||||
w_class = 3
|
||||
var/created_name = null //If defined, result computer will have this name.
|
||||
|
||||
/obj/computer2frame
|
||||
density = 1
|
||||
anchored = 0
|
||||
name = "Computer-frame"
|
||||
icon = 'icons/obj/stock_parts.dmi'
|
||||
icon_state = "0"
|
||||
var/state = 0
|
||||
var/obj/item/weapon/motherboard/mainboard = null
|
||||
var/obj/item/weapon/disk/data/fixed_disk/hd = null
|
||||
var/list/peripherals = list()
|
||||
var/created_icon_state = "aiupload"
|
||||
|
||||
/obj/computer2frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You wrench the frame into place."
|
||||
src.anchored = 1
|
||||
src.state = 1
|
||||
if(istype(P, /obj/item/weapon/weldingtool))
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You deconstruct the frame."
|
||||
new /obj/item/stack/sheet/metal( src.loc, 5 )
|
||||
del(src)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You unfasten the frame."
|
||||
src.anchored = 0
|
||||
src.state = 0
|
||||
if(istype(P, /obj/item/weapon/motherboard) && !mainboard)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You place the mainboard inside the frame."
|
||||
src.icon_state = "1"
|
||||
src.mainboard = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && mainboard)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You screw the mainboard into place."
|
||||
src.state = 2
|
||||
src.icon_state = "2"
|
||||
if(istype(P, /obj/item/weapon/crowbar) && mainboard)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the mainboard."
|
||||
src.state = 1
|
||||
src.icon_state = "0"
|
||||
mainboard.loc = src.loc
|
||||
src.mainboard = null
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && mainboard && (!peripherals.len))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You unfasten the mainboard."
|
||||
src.state = 1
|
||||
src.icon_state = "1"
|
||||
|
||||
if(istype(P, /obj/item/weapon/peripheral))
|
||||
if(src.peripherals.len < 3)
|
||||
user.drop_item()
|
||||
src.peripherals.Add(P)
|
||||
P.loc = src
|
||||
user << "\blue You add [P] to the frame."
|
||||
else
|
||||
user << "\red There is no more room for peripheral cards."
|
||||
|
||||
if(istype(P, /obj/item/weapon/crowbar) && src.peripherals.len)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the peripheral boards."
|
||||
for(var/obj/item/weapon/peripheral/W in src.peripherals)
|
||||
W.loc = src.loc
|
||||
src.peripherals.Remove(W)
|
||||
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
if(P:amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
P:amount -= 5
|
||||
if(!P:amount) del(P)
|
||||
user << "\blue You add cables to the frame."
|
||||
src.state = 3
|
||||
src.icon_state = "3"
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cables."
|
||||
src.state = 2
|
||||
src.icon_state = "2"
|
||||
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
|
||||
A.amount = 5
|
||||
if(src.hd)
|
||||
src.hd.loc = src.loc
|
||||
src.hd = null
|
||||
|
||||
if(istype(P, /obj/item/weapon/disk/data/fixed_disk) && !src.hd)
|
||||
user.drop_item()
|
||||
src.hd = P
|
||||
P.loc = src
|
||||
user << "\blue You connect the drive to the cabling."
|
||||
|
||||
if(istype(P, /obj/item/weapon/crowbar) && src.hd)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the hard drive."
|
||||
src.hd.loc = src.loc
|
||||
src.hd = null
|
||||
|
||||
if(istype(P, /obj/item/stack/sheet/glass))
|
||||
if(P:amount >= 2)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
P:use(2)
|
||||
user << "\blue You put in the glass panel."
|
||||
src.state = 4
|
||||
src.icon_state = "4"
|
||||
if(4)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the glass panel."
|
||||
src.state = 3
|
||||
src.icon_state = "3"
|
||||
new /obj/item/stack/sheet/glass( src.loc, 2 )
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You connect the monitor."
|
||||
var/obj/machinery/computer2/C= new /obj/machinery/computer2( src.loc )
|
||||
C.setup_drive_size = 0
|
||||
C.icon_state = src.created_icon_state
|
||||
if(mainboard.created_name) C.name = mainboard.created_name
|
||||
del(mainboard)
|
||||
if(hd)
|
||||
C.hd = hd
|
||||
hd.loc = C
|
||||
for(var/obj/item/weapon/peripheral/W in src.peripherals)
|
||||
W.loc = C
|
||||
W.host = C
|
||||
C.peripherals.Add(W)
|
||||
del(src)
|
||||
@@ -0,0 +1,414 @@
|
||||
|
||||
/obj/machinery/computer2
|
||||
name = "computer"
|
||||
desc = "A computer workstation."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
req_access = list() //This doesn't determine PROGRAM req access, just the access needed to install/delete programs.
|
||||
var/base_icon_state = "aiupload" //Assembly creates a new computer2 and not a child typepath, so initial doesn't work!!
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/obj/item/weapon/disk/data/fixed_disk/hd = null
|
||||
var/datum/computer/file/computer_program/active_program
|
||||
var/datum/computer/file/computer_program/host_program //active is set to this when the normal active quits, if available
|
||||
var/list/processing_programs = list()
|
||||
var/obj/item/weapon/card/id/authid = null //For records computers etc
|
||||
var/obj/item/weapon/card/id/auxid = null //For computers that need two ids for some reason.
|
||||
var/obj/item/weapon/disk/data/diskette = null
|
||||
var/list/peripherals = list()
|
||||
//Setup for Starting program & peripherals
|
||||
var/setup_starting_program = null //If set to a program path it will start with this one active.
|
||||
var/setup_starting_peripheral = null //Spawn with radio card and whatever path is here.
|
||||
var/setup_drive_size = 64.0 //How big is the drive (set to 0 for no drive)
|
||||
var/setup_id_tag
|
||||
var/setup_has_radio = 0 //Does it spawn with a radio peripheral?
|
||||
var/setup_radio_tag
|
||||
var/setup_frequency = 1411
|
||||
|
||||
/obj/item/weapon/disk/data
|
||||
var/datum/computer/folder/root = null
|
||||
var/file_amount = 32.0
|
||||
var/file_used = 0.0
|
||||
var/portable = 1
|
||||
var/title = "Data Disk"
|
||||
New()
|
||||
src.root = new /datum/computer/folder
|
||||
src.root.holder = src
|
||||
src.root.name = "root"
|
||||
|
||||
/obj/item/weapon/disk/data/fixed_disk
|
||||
name = "Storage Drive"
|
||||
icon_state = "harddisk"
|
||||
title = "Storage Drive"
|
||||
file_amount = 80.0
|
||||
portable = 0
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/disk/data/computer2test
|
||||
name = "Programme Diskette"
|
||||
file_amount = 128.0
|
||||
New()
|
||||
..()
|
||||
src.root.add_file( new /datum/computer/file/computer_program/arcade(src))
|
||||
src.root.add_file( new /datum/computer/file/computer_program/med_data(src))
|
||||
src.root.add_file( new /datum/computer/file/computer_program/airlock_control(src))
|
||||
src.root.add_file( new /datum/computer/file/computer_program/messenger(src))
|
||||
src.root.add_file( new /datum/computer/file/computer_program/progman(src))
|
||||
|
||||
/obj/machinery/computer2/medical
|
||||
name = "Medical computer"
|
||||
icon_state = "dna"
|
||||
setup_has_radio = 1
|
||||
setup_starting_program = /datum/computer/file/computer_program/med_data
|
||||
setup_starting_peripheral = /obj/item/weapon/peripheral/printer
|
||||
|
||||
/obj/machinery/computer2/arcade
|
||||
name = "arcade machine"
|
||||
icon_state = "arcade"
|
||||
desc = "An arcade machine."
|
||||
setup_drive_size = 16.0
|
||||
setup_starting_program = /datum/computer/file/computer_program/arcade
|
||||
setup_starting_peripheral = /obj/item/weapon/peripheral/prize_vendor
|
||||
|
||||
|
||||
/obj/machinery/computer2/New()
|
||||
..()
|
||||
|
||||
spawn(4)
|
||||
if(setup_has_radio)
|
||||
var/obj/item/weapon/peripheral/radio/radio = new /obj/item/weapon/peripheral/radio(src)
|
||||
radio.frequency = setup_frequency
|
||||
radio.code = setup_radio_tag
|
||||
|
||||
if(!hd && (setup_drive_size > 0))
|
||||
src.hd = new /obj/item/weapon/disk/data/fixed_disk(src)
|
||||
src.hd.file_amount = src.setup_drive_size
|
||||
|
||||
if(ispath(src.setup_starting_program))
|
||||
src.active_program = new src.setup_starting_program
|
||||
src.active_program.id_tag = setup_id_tag
|
||||
|
||||
src.hd.file_amount = max(src.hd.file_amount, src.active_program.size)
|
||||
|
||||
src.active_program.transfer_holder(src.hd)
|
||||
|
||||
if(ispath(src.setup_starting_peripheral))
|
||||
new src.setup_starting_peripheral(src)
|
||||
|
||||
src.base_icon_state = src.icon_state
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer2/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
|
||||
var/dat
|
||||
if((src.active_program) && (src.active_program.master == src) && (src.active_program.holder in src))
|
||||
dat = src.active_program.return_text()
|
||||
else
|
||||
dat = "<TT><b>Thinktronic BIOS V1.4</b><br><br>"
|
||||
|
||||
dat += "Current ID: <a href='?src=\ref[src];id=auth'>[src.authid ? "[src.authid.name]" : "----------"]</a><br>"
|
||||
dat += "Auxiliary ID: <a href='?src=\ref[src];id=aux'>[src.auxid ? "[src.auxid.name]" : "----------"]</a><br><br>"
|
||||
|
||||
var/progdat
|
||||
if((src.hd) && (src.hd.root))
|
||||
for(var/datum/computer/file/computer_program/P in src.hd.root.contents)
|
||||
progdat += "<tr><td>[P.name]</td><td>Size: [P.size]</td>"
|
||||
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=run'>Run</a></td>"
|
||||
|
||||
if(P in src.processing_programs)
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=unload'>Halt</a></td>"
|
||||
else
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=load'>Load</a></td>"
|
||||
|
||||
progdat += "<td><a href='byond://?src=\ref[src];file=\ref[P];function=delete'>Del</a></td></tr>"
|
||||
|
||||
continue
|
||||
|
||||
dat += "Disk Space: \[[src.hd.file_used]/[src.hd.file_amount]\]<br>"
|
||||
dat += "<b>Programs on Fixed Disk:</b><br>"
|
||||
|
||||
if(!progdat)
|
||||
progdat = "No programs found.<br>"
|
||||
dat += "<center><table cellspacing=4>[progdat]</table></center>"
|
||||
|
||||
else
|
||||
|
||||
dat += "<b>Programs on Fixed Disk:</b><br>"
|
||||
dat += "<center>No fixed disk detected.</center><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
progdat = null
|
||||
if((src.diskette) && (src.diskette.root))
|
||||
|
||||
dat += "<font size=1><a href='byond://?src=\ref[src];disk=1'>Eject</a></font><br>"
|
||||
|
||||
for(var/datum/computer/file/computer_program/P in src.diskette.root.contents)
|
||||
progdat += "<tr><td>[P.name]</td><td>Size: [P.size]</td>"
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=run'>Run</a></td>"
|
||||
|
||||
if(P in src.processing_programs)
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=unload'>Halt</a></td>"
|
||||
else
|
||||
progdat += "<td><a href='byond://?src=\ref[src];prog=\ref[P];function=load'>Load</a></td>"
|
||||
|
||||
progdat += "<td><a href='byond://?src=\ref[src];file=\ref[P];function=install'>Install</a></td></tr>"
|
||||
|
||||
continue
|
||||
|
||||
dat += "Disk Space: \[[src.diskette.file_used]/[src.diskette.file_amount]\]<br>"
|
||||
dat += "<b>Programs on Disk:</b><br>"
|
||||
|
||||
if(!progdat)
|
||||
progdat = "No data found.<br>"
|
||||
dat += "<center><table cellspacing=4>[progdat]</table></center>"
|
||||
|
||||
else
|
||||
|
||||
dat += "<b>Programs on Disk:</b><br>"
|
||||
dat += "<center>No diskette loaded.</center><br>"
|
||||
|
||||
dat += "</TT>"
|
||||
|
||||
user << browse(dat,"window=comp2")
|
||||
onclose(user,"comp2")
|
||||
return
|
||||
|
||||
/obj/machinery/computer2/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!src.active_program)
|
||||
if((href_list["prog"]) && (href_list["function"]))
|
||||
var/datum/computer/file/computer_program/newprog = locate(href_list["prog"])
|
||||
if(newprog && istype(newprog))
|
||||
switch(href_list["function"])
|
||||
if("run")
|
||||
src.run_program(newprog)
|
||||
if("load")
|
||||
src.load_program(newprog)
|
||||
if("unload")
|
||||
src.unload_program(newprog)
|
||||
if((href_list["file"]) && (href_list["function"]))
|
||||
var/datum/computer/file/newfile = locate(href_list["file"])
|
||||
if(!newfile)
|
||||
return
|
||||
switch(href_list["function"])
|
||||
if("install")
|
||||
if((src.hd) && (src.hd.root) && (src.allowed(usr)))
|
||||
newfile.copy_file_to_folder(src.hd.root)
|
||||
|
||||
if("delete")
|
||||
if(src.allowed(usr))
|
||||
src.delete_file(newfile)
|
||||
|
||||
//If there is already one loaded eject, or if not and they have one insert it.
|
||||
if (href_list["id"])
|
||||
switch(href_list["id"])
|
||||
if("auth")
|
||||
if(!isnull(src.authid))
|
||||
src.authid.loc = get_turf(src)
|
||||
src.authid = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.authid = I
|
||||
if("aux")
|
||||
if(!isnull(src.auxid))
|
||||
src.auxid.loc = get_turf(src)
|
||||
src.auxid = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.auxid = I
|
||||
|
||||
//Same but for a data disk
|
||||
else if (href_list["disk"])
|
||||
if(!isnull(src.diskette))
|
||||
src.diskette.loc = get_turf(src)
|
||||
src.diskette = null
|
||||
/* else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/disk/data))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.diskette = I
|
||||
*/
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer2/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
for(var/datum/computer/file/computer_program/P in src.processing_programs)
|
||||
P.process()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer2/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = src.base_icon_state
|
||||
src.icon_state += "b"
|
||||
|
||||
else if(powered())
|
||||
icon_state = src.base_icon_state
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
icon_state = src.base_icon_state
|
||||
src.icon_state += "0"
|
||||
stat |= NOPOWER
|
||||
|
||||
|
||||
/obj/machinery/computer2/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES
|
||||
if ((!src.diskette) && W:portable)
|
||||
user.machine = src
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
src.diskette = W
|
||||
user << "You insert [W]."
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
var/obj/computer2frame/A = new /obj/computer2frame( src.loc )
|
||||
A.created_icon_state = src.base_icon_state
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
for (var/obj/item/weapon/peripheral/C in src.peripherals)
|
||||
C.loc = A
|
||||
A.peripherals.Add(C)
|
||||
|
||||
if(src.diskette)
|
||||
src.diskette.loc = src.loc
|
||||
|
||||
//TO-DO: move card reading to peripheral cards instead
|
||||
if(src.authid)
|
||||
src.authid.loc = src.loc
|
||||
|
||||
if(src.auxid)
|
||||
src.auxid.loc = src.loc
|
||||
|
||||
if(src.hd)
|
||||
src.hd.loc = A
|
||||
A.hd = src.hd
|
||||
|
||||
A.mainboard = new /obj/item/weapon/motherboard(A)
|
||||
A.mainboard.created_name = src.name
|
||||
|
||||
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer2/proc/send_command(command, datum/signal/signal)
|
||||
for(var/obj/item/weapon/peripheral/P in src.peripherals)
|
||||
P.receive_command(src, command, signal)
|
||||
|
||||
del(signal)
|
||||
|
||||
/obj/machinery/computer2/proc/receive_command(obj/source, command, datum/signal/signal)
|
||||
if(source in src.contents)
|
||||
|
||||
for(var/datum/computer/file/computer_program/P in src.processing_programs)
|
||||
P.receive_command(src, command, signal)
|
||||
|
||||
del(signal)
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer2/proc/run_program(datum/computer/file/computer_program/program,datum/computer/file/computer_program/host)
|
||||
if(!program)
|
||||
return 0
|
||||
|
||||
// src.unload_program(src.active_program)
|
||||
|
||||
if(src.load_program(program))
|
||||
if(host && istype(host))
|
||||
src.host_program = host
|
||||
else
|
||||
src.host_program = null
|
||||
|
||||
src.active_program = program
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer2/proc/load_program(datum/computer/file/computer_program/program)
|
||||
if((!program) || (!program.holder))
|
||||
return 0
|
||||
|
||||
if(!(program.holder in src))
|
||||
// world << "Not in src"
|
||||
program = new program.type
|
||||
program.transfer_holder(src.hd)
|
||||
|
||||
if(program.master != src)
|
||||
program.master = src
|
||||
|
||||
if(program in src.processing_programs)
|
||||
return 1
|
||||
else
|
||||
src.processing_programs.Add(program)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer2/proc/unload_program(datum/computer/file/computer_program/program)
|
||||
if((!program) || (!src.hd))
|
||||
return 0
|
||||
|
||||
if(program in src.processing_programs)
|
||||
src.processing_programs.Remove(program)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer2/proc/delete_file(datum/computer/file/file)
|
||||
//world << "Deleting [file]..."
|
||||
if((!file) || (!file.holder) || (file.holder.read_only))
|
||||
//world << "Cannot delete :("
|
||||
return 0
|
||||
|
||||
if(file in src.processing_programs)
|
||||
src.processing_programs.Remove(file)
|
||||
|
||||
if(src.active_program == file)
|
||||
src.active_program = null
|
||||
|
||||
// file.holder.root.remove_file(file)
|
||||
|
||||
//world << "Now calling del on [file]..."
|
||||
del(file)
|
||||
return 1
|
||||
@@ -0,0 +1,164 @@
|
||||
/datum/computer/file/computer_program/progman
|
||||
name = "ProgManager"
|
||||
size = 16.0
|
||||
var/datum/computer/folder/current_folder
|
||||
var/mode = 0
|
||||
var/datum/computer/file/clipboard
|
||||
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
if((!src.current_folder) || !(src.current_folder.holder in src.master))
|
||||
src.current_folder = src.holder.root
|
||||
|
||||
var/dat = "<a href='byond://?src=\ref[src];close=1'>Close</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];quit=1'>Quit</a>"
|
||||
|
||||
switch(mode)
|
||||
if(0)
|
||||
dat += " |<a href='byond://?src=\ref[src];create=folder'>Create Folder</a>"
|
||||
//dat += " | <a href='byond://?src=\ref[src];create=file'>Create File</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];file=\ref[src.current_folder];function=paste'>Paste</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];top_folder=1'>Root</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];mode=1'>Drive</a><br>"
|
||||
|
||||
dat += "<b>Contents of [current_folder] | Drive:\[[src.current_folder.holder.title]]</b><br>"
|
||||
dat += "<b>Used: \[[src.current_folder.holder.file_used]/[src.current_folder.holder.file_amount]\]</b><hr>"
|
||||
|
||||
dat += "<table cellspacing=5>"
|
||||
for(var/datum/computer/P in current_folder.contents)
|
||||
if(P == src)
|
||||
dat += "<tr><td>System</td><td>Size: [src.size]</td><td>SYSTEM</td></tr>"
|
||||
continue
|
||||
dat += "<tr><td><a href='byond://?src=\ref[src];file=\ref[P];function=open'>[P.name]</a></td>"
|
||||
dat += "<td>Size: [P.size]</td>"
|
||||
|
||||
dat += "<td>[(istype(P,/datum/computer/folder)) ? "FOLDER" : "[P:extension]"]</td>"
|
||||
|
||||
dat += "<td><a href='byond://?src=\ref[src];file=\ref[P];function=delete'>Del</a></td>"
|
||||
dat += "<td><a href='byond://?src=\ref[src];file=\ref[P];function=rename'>Rename</a></td>"
|
||||
|
||||
|
||||
if(istype(P,/datum/computer/file))
|
||||
dat += "<td><a href='byond://?src=\ref[src];file=\ref[P];function=copy'>Copy</a></td>"
|
||||
|
||||
dat += "</tr>"
|
||||
|
||||
dat += "</table>"
|
||||
|
||||
if(1)
|
||||
dat += " | <a href='byond://?src=\ref[src];mode=0'>Main</a>"
|
||||
dat += " | <a href='byond://?src=\ref[master];disk=1'>Eject</a><br>"
|
||||
|
||||
for(var/obj/item/weapon/disk/data/D in src.master)
|
||||
if(D == current_folder.holder)
|
||||
dat += "[D.name]<br>"
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];drive=\ref[D]'>[D.title]</a><br>"
|
||||
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["create"])
|
||||
if(current_folder)
|
||||
var/datum/computer/F = null
|
||||
switch(href_list["create"])
|
||||
if("folder")
|
||||
F = new /datum/computer/folder
|
||||
if(!current_folder.add_file(F))
|
||||
//world << "Couldn't add folder :("
|
||||
del(F)
|
||||
if("file")
|
||||
F = new /datum/computer/file
|
||||
if(!current_folder.add_file(F))
|
||||
//world << "Couldn't add file :("
|
||||
del(F)
|
||||
|
||||
if(href_list["file"] && href_list["function"])
|
||||
var/datum/computer/F = locate(href_list["file"])
|
||||
if(!F || !istype(F))
|
||||
return
|
||||
switch(href_list["function"])
|
||||
if("open")
|
||||
if(istype(F,/datum/computer/folder))
|
||||
src.current_folder = F
|
||||
else if(istype(F,/datum/computer/file/computer_program))
|
||||
src.master.run_program(F,src)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
|
||||
if("delete")
|
||||
src.master.delete_file(F)
|
||||
|
||||
if("copy")
|
||||
if(istype(F,/datum/computer/file) && (!F.holder || (F.holder in src.master.contents)))
|
||||
src.clipboard = F
|
||||
|
||||
if("paste")
|
||||
if(istype(F,/datum/computer/folder))
|
||||
if(!src.clipboard || !src.clipboard.holder || !(src.clipboard.holder in src.master.contents))
|
||||
return
|
||||
|
||||
if(!istype(src.clipboard))
|
||||
return
|
||||
|
||||
src.clipboard.copy_file_to_folder(F)
|
||||
|
||||
if("rename")
|
||||
spawn(0)
|
||||
var/t = input(usr, "Please enter new name", F.name, null) as text
|
||||
t = copytext(sanitize(t), 1, 16)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src.master, usr) || !(F.holder in src.master))
|
||||
return
|
||||
if(F.holder.read_only)
|
||||
return
|
||||
F.name = capitalize(lowertext(t))
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
if(href_list["open"])
|
||||
var/datum/computer/F = locate(href_list["open"])
|
||||
if(!F || !istype(F))
|
||||
return
|
||||
|
||||
if(istype(F,/datum/computer/folder))
|
||||
src.current_folder = F
|
||||
else if(istype(F,/datum/computer/file/computer_program))
|
||||
src.master.run_program(F)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["delete"])
|
||||
var/datum/computer/F = locate(href_list["delete"])
|
||||
if(!F || !istype(F))
|
||||
return
|
||||
|
||||
src.master.delete_file(F)
|
||||
*/
|
||||
if(href_list["top_folder"])
|
||||
src.current_folder = src.current_folder.holder.root
|
||||
|
||||
if(href_list["mode"])
|
||||
var/newmode = text2num(href_list["mode"])
|
||||
newmode = max(newmode,0)
|
||||
src.mode = newmode
|
||||
|
||||
if(href_list["drive"])
|
||||
var/obj/item/weapon/disk/data/D = locate(href_list["drive"])
|
||||
if(D && istype(D) && D.root)
|
||||
current_folder = D.root
|
||||
src.mode = 0
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,463 @@
|
||||
/datum/computer/file/computer_program/med_data
|
||||
name = "Medical Records"
|
||||
size = 32.0
|
||||
active_icon = "dna"
|
||||
req_access = list(ACCESS_MEDICAL)
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
var/a_id = null
|
||||
var/temp = null
|
||||
|
||||
/datum/computer/file/computer_program/med_data/return_text()
|
||||
if(..())
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
|
||||
else
|
||||
dat = text("Confirm Identity: <A href='?src=\ref[];id=auth'>[]</A><HR>", master, (src.master.authid ? text("[]", src.master.authid.name) : "----------"))
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += {"
|
||||
<A href='?src=\ref[src];search=1'>Search Records</A>
|
||||
<BR><A href='?src=\ref[src];screen=2'>List Records</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=5'>Virus Database</A>
|
||||
<BR><A href='?src=\ref[src];screen=6'>Medbot Tracking</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=3'>Record Maintenance</A>
|
||||
<BR><A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
|
||||
"}
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
|
||||
//Foreach goto(132)
|
||||
dat += text("<HR><A href='?src=\ref[];screen=1'>Back</A>", src)
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
dat += text("Name: [] ID: []<BR>\nSex: <A href='?src=\ref[];field=sex'>[]</A><BR>\nAge: <A href='?src=\ref[];field=age'>[]</A><BR>\nFingerprint: <A href='?src=\ref[];field=fingerprint'>[]</A><BR>\nPhysical Status: <A href='?src=\ref[];field=p_stat'>[]</A><BR>\nMental Status: <A href='?src=\ref[];field=m_stat'>[]</A><BR>", src.active1.fields["name"], src.active1.fields["id"], src, src.active1.fields["sex"], src, src.active1.fields["age"], src, src.active1.fields["fingerprint"], src, src.active1.fields["p_stat"], src, src.active1.fields["m_stat"])
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: <A href='?src=\ref[];field=b_type'>[]</A><BR>\n<BR>\nMinor Disabilities: <A href='?src=\ref[];field=mi_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_dis_d'>[]</A><BR>\n<BR>\nMajor Disabilities: <A href='?src=\ref[];field=ma_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_dis_d'>[]</A><BR>\n<BR>\nAllergies: <A href='?src=\ref[];field=alg'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=alg_d'>[]</A><BR>\n<BR>\nCurrent Diseases: <A href='?src=\ref[];field=cdi'>[]</A> (per disease info placed in log/comment section)<BR>\nDetails: <A href='?src=\ref[];field=cdi_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["b_type"], src, src.active2.fields["mi_dis"], src, src.active2.fields["mi_dis_d"], src, src.active2.fields["ma_dis"], src, src.active2.fields["ma_dis_d"], src, src.active2.fields["alg"], src, src.active2.fields["alg_d"], src, src.active2.fields["cdi"], src, src.active2.fields["cdi_d"], src, src.active2.fields["notes"])
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Medical Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Medical Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[src];new=1'>New Record</A><BR><BR>")
|
||||
dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src)
|
||||
if(5.0)
|
||||
dat += {"<CENTER><B>Virus Database</B></CENTER>
|
||||
<br><a href='?src=\ref[src];vir=gbs'>GBS</a>
|
||||
<br><a href='?src=\ref[src];vir=cc'>Common Cold</a>
|
||||
<br><a href='?src=\ref[src];vir=f'>Flu</A>
|
||||
<br><a href='?src=\ref[src];vir=jf'>Jungle Fever</a>
|
||||
<br><a href='?src=\ref[src];vir=ca'>Clowning Around</a>
|
||||
<br><a href='?src=\ref[src];vir=p'>Plasmatoid</a>
|
||||
<br><a href='?src=\ref[src];vir=dna'>Space Rhinovirus</a>
|
||||
<br><a href='?src=\ref[src];vir=bot'>Robot Transformation</a>
|
||||
<br><a href='?src=\ref[src];screen=1'>Back</a>"}
|
||||
if(6.0)
|
||||
dat += "<center><b>Medical Robot Monitor</b></center>"
|
||||
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/obj/machinery/bot/medbot/M in world)
|
||||
var/turf/bl = get_turf(M)
|
||||
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
|
||||
if(!isnull(M.reagent_glass))
|
||||
bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]"
|
||||
else
|
||||
bdat += "Using Internal Synthesizer."
|
||||
|
||||
if(!bdat)
|
||||
dat += "<br><center>None detected</center>"
|
||||
else
|
||||
dat += "[bdat]"
|
||||
|
||||
else
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
|
||||
dat += "<br><a href='byond://?src=\ref[src];quit=1'>{Quit}</a>"
|
||||
|
||||
return dat
|
||||
|
||||
/datum/computer/file/computer_program/med_data/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if (!( data_core.general.Find(src.active1) ))
|
||||
src.active1 = null
|
||||
if (!( data_core.medical.Find(src.active2) ))
|
||||
src.active2 = null
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
else if (href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else if (href_list["login"])
|
||||
if (istype(usr, /mob/living/silicon))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = 1
|
||||
src.rank = "AI"
|
||||
src.screen = 1
|
||||
else if (istype(src.master.authid, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
if (src.check_access(src.master.authid))
|
||||
src.authenticated = src.master.authid.registered_name
|
||||
src.rank = src.master.authid.assignment
|
||||
src.screen = 1
|
||||
if (src.authenticated)
|
||||
|
||||
if(href_list["screen"])
|
||||
src.screen = text2num(href_list["screen"])
|
||||
if(src.screen < 1)
|
||||
src.screen = 1
|
||||
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if(href_list["vir"])
|
||||
switch(href_list["vir"])
|
||||
if("gbs")
|
||||
src.temp = {"<b>Name:</b> GBS
|
||||
<BR><b>Number of stages:</b> 5
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Spaceacillin
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> If left untreated death will occur.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Major"}
|
||||
if("cc")
|
||||
src.temp = {"<b>Name:</b> Common Cold
|
||||
<BR><b>Number of stages:</b> 3
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Rest
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> If left untreated the subject will contract the flu.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Minor"}
|
||||
if("f")
|
||||
src.temp = {"<b>Name:</b> The Flu
|
||||
<BR><b>Number of stages:</b> 3
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Rest
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> If left untreated the subject will feel quite unwell.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Medium"}
|
||||
if("jf")
|
||||
src.temp = {"<b>Name:</b> Jungle Fever
|
||||
<BR><b>Number of stages:</b> 1
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> None
|
||||
<BR><b>Affected Species:</b> Monkey
|
||||
<BR>
|
||||
<BR><b>Notes:</b> monkeys with this disease will bite humans, causing humans to spontaneously to mutate into a monkey.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Medium"}
|
||||
if("ca")
|
||||
src.temp = {"<b>Name:</b> Clowning Around
|
||||
<BR><b>Number of stages:</b> 4
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Spaceacillin
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> Subjects are affected by rampant honking and a fondness for shenanigans. They may also spontaneously phase through closed airlocks.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Laughable"}
|
||||
if("p")
|
||||
src.temp = {"<b>Name:</b> Plasmatoid
|
||||
<BR><b>Number of stages:</b> 3
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Inaprovaline
|
||||
<BR><b>Affected Species:</b> Human and Monkey
|
||||
<BR>
|
||||
<BR><b>Notes:</b> With this disease the victim will need plasma to breathe.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Major"}
|
||||
if("dna")
|
||||
src.temp = {"<b>Name:</b> Space Rhinovirus
|
||||
<BR><b>Number of stages:</b> 4
|
||||
<BR><b>Spread:</b> Airborne Transmission
|
||||
<BR><b>Possible Cure:</b> Spaceacillin
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> This disease transplants the genetic code of the intial vector into new hosts.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Medium"}
|
||||
if("bot")
|
||||
src.temp = {"<b>Name:</b> Robot Transformation
|
||||
<BR><b>Number of stages:</b> 5
|
||||
<BR><b>Spread:</b> Infected food
|
||||
<BR><b>Possible Cure:</b> None
|
||||
<BR><b>Affected Species:</b> Human
|
||||
<BR>
|
||||
<BR><b>Notes:</b> This disease, actually acute nanomachine infection, converts the victim into a cyborg.
|
||||
<BR>
|
||||
<BR><b>Severity:</b> Major"}
|
||||
|
||||
if (href_list["del_all"])
|
||||
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
del(R)
|
||||
src.temp = "All records deleted."
|
||||
|
||||
if (href_list["field"])
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input fingerprint hash:", "Med. records", src.active1.fields["id"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || (!src.master) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("p_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unconscious'>*Unconscious*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>", src, src, src, src)
|
||||
if("m_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
|
||||
if("b_type")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
else
|
||||
|
||||
if (href_list["p_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["p_stat"])
|
||||
if("deceased")
|
||||
src.active1.fields["p_stat"] = "*Deceased*"
|
||||
if("unconscious")
|
||||
src.active1.fields["p_stat"] = "*Unconscious*"
|
||||
if("active")
|
||||
src.active1.fields["p_stat"] = "Active"
|
||||
if("unfit")
|
||||
src.active1.fields["p_stat"] = "Physically Unfit"
|
||||
|
||||
if (href_list["m_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["m_stat"])
|
||||
if("insane")
|
||||
src.active1.fields["m_stat"] = "*Insane*"
|
||||
if("unstable")
|
||||
src.active1.fields["m_stat"] = "*Unstable*"
|
||||
if("watch")
|
||||
src.active1.fields["m_stat"] = "*Watch*"
|
||||
if("stable")
|
||||
src.active2.fields["m_stat"] = "Stable"
|
||||
|
||||
|
||||
if (href_list["b_type"])
|
||||
if (src.active2)
|
||||
switch(href_list["b_type"])
|
||||
if("an")
|
||||
src.active2.fields["b_type"] = "A-"
|
||||
if("bn")
|
||||
src.active2.fields["b_type"] = "B-"
|
||||
if("abn")
|
||||
src.active2.fields["b_type"] = "AB-"
|
||||
if("on")
|
||||
src.active2.fields["b_type"] = "O-"
|
||||
if("ap")
|
||||
src.active2.fields["b_type"] = "A+"
|
||||
if("bp")
|
||||
src.active2.fields["b_type"] = "B+"
|
||||
if("abp")
|
||||
src.active2.fields["b_type"] = "AB+"
|
||||
if("op")
|
||||
src.active2.fields["b_type"] = "O+"
|
||||
|
||||
|
||||
if (href_list["del_r"])
|
||||
if (src.active2)
|
||||
src.temp = "Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[src];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[src];temp=1'>No</A><br>"
|
||||
|
||||
if (href_list["del_r2"])
|
||||
if (src.active2)
|
||||
del(src.active2)
|
||||
|
||||
if (href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/datum/data/record/M = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
else
|
||||
//Foreach continue //goto(2540)
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["new"])
|
||||
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Medical Record #[]", R.fields["id"])
|
||||
R.fields["b_type"] = "Unknown"
|
||||
R.fields["mi_dis"] = "None"
|
||||
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
R.fields["ma_dis"] = "None"
|
||||
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
R.fields["alg"] = "None"
|
||||
R.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
R.fields["cdi"] = "None"
|
||||
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.medical += R
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["add_c"])
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = input("Add Comment:", "Med. records", null, null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src.master, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2556<BR>[]", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
|
||||
|
||||
if (href_list["del_c"])
|
||||
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
|
||||
if (href_list["search"])
|
||||
var/t1 = input("Search String: (Name or ID)", "Med. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || (!src.master) || !( src.authenticated ) || usr.restrained() || ((!in_range(src.master, usr)) && (!istype(usr, /mob/living/silicon)))))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"])))
|
||||
src.active1 = R
|
||||
else
|
||||
|
||||
if (!( src.active1 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
|
||||
src.active2 = E
|
||||
else
|
||||
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["print_p"])
|
||||
var/info = "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"], src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
|
||||
else
|
||||
info += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src.active2.fields["b_type"], src.active2.fields["mi_dis"], src.active2.fields["mi_dis_d"], src.active2.fields["ma_dis"], src.active2.fields["ma_dis_d"], src.active2.fields["alg"], src.active2.fields["alg_d"], src.active2.fields["cdi"], src.active2.fields["cdi_d"], src.active2.fields["notes"])
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
info += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
info += "<B>Medical Record Lost!</B><BR>"
|
||||
info += "</TT>"
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.data["data"] = info
|
||||
signal.data["title"] = "Medical Record"
|
||||
src.peripheral_command("print",signal)
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,97 @@
|
||||
/datum/computer/file/computer_program/messenger
|
||||
name = "Messenger"
|
||||
size = 8.0
|
||||
var/messages = null
|
||||
var/screen_name = "User"
|
||||
|
||||
//To-do: take screen_name from inserted id card??
|
||||
//Saving log to file datum
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<a href='byond://?src=\ref[src];close=1'>Close</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];quit=1'>Quit</a><br>"
|
||||
|
||||
dat += "<b>SpaceMessenger V4.1.2</b><br>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];send_msg=1'>Send Message</a>"
|
||||
|
||||
dat += " | <a href='byond://?src=\ref[src];func_msg=clear'>Clear</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];func_msg=print'>Print</a>"
|
||||
|
||||
dat += " | Name:<a href='byond://?src=\ref[src];set_name=1'>[src.screen_name]</a><hr>"
|
||||
|
||||
dat += messages
|
||||
|
||||
dat += "</center>"
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["send_msg"])
|
||||
var/t = input(usr, "Please enter messenger", src.id_tag, null) as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src.master, usr))
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.data["type"] = "message"
|
||||
signal.data["data"] = t
|
||||
signal.data["sender"] = src.screen_name
|
||||
src.messages += "<i><b>→ You:</b></i><br>[t]<br>"
|
||||
|
||||
peripheral_command("send signal", signal)
|
||||
|
||||
if(href_list["func_msg"])
|
||||
switch(href_list["func_msg"])
|
||||
if("clear")
|
||||
src.messages = null
|
||||
|
||||
if("print")
|
||||
var/datum/signal/signal = new
|
||||
signal.data["data"] = src.messages
|
||||
signal.data["title"] = "Chatlog"
|
||||
peripheral_command("print", signal)
|
||||
|
||||
//if("save")
|
||||
//TO-DO
|
||||
|
||||
|
||||
if(href_list["set_name"])
|
||||
var/t = input(usr, "Please enter screen name", src.id_tag, null) as text
|
||||
t = copytext(sanitize(t), 1, 20)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src.master, usr))
|
||||
return
|
||||
|
||||
src.screen_name = t
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateUsrDialog()
|
||||
return
|
||||
|
||||
receive_command(obj/source, command, datum/signal/signal)
|
||||
if(..() || !signal)
|
||||
return
|
||||
|
||||
if(command == "radio signal")
|
||||
switch(signal.data["type"])
|
||||
if("message")
|
||||
var/sender = signal.data["sender"]
|
||||
if(!sender)
|
||||
sender = "Unknown"
|
||||
|
||||
src.messages += "<i><b>← From [sender]:</b></i><br>[signal.data["data"]]<br>"
|
||||
if(src.master.active_program == src)
|
||||
playsound(src.master.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
src.master.updateUsrDialog()
|
||||
|
||||
return
|
||||
@@ -0,0 +1,209 @@
|
||||
/obj/item/weapon/peripheral
|
||||
name = "Peripheral card"
|
||||
desc = "A computer circuit board."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "id_mod"
|
||||
item_state = "electronic"
|
||||
w_class = 2
|
||||
var/obj/machinery/computer2/host
|
||||
var/id = null
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(2)
|
||||
if(istype(src.loc,/obj/machinery/computer2))
|
||||
host = src.loc
|
||||
host.peripherals.Add(src)
|
||||
// var/setup_id = "\ref[src]"
|
||||
// src.id = copytext(setup_id,4,(length(setup_id)-1) )
|
||||
|
||||
Del()
|
||||
if(host)
|
||||
host.peripherals.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
proc
|
||||
receive_command(obj/source, command, datum/signal/signal)
|
||||
if((source != host) || !(src in host))
|
||||
return 1
|
||||
|
||||
if(!command)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
send_command(command, datum/signal/signal)
|
||||
if(!command || !host)
|
||||
return
|
||||
|
||||
src.host.receive_command(src, command, signal)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/peripheral/radio
|
||||
name = "Wireless card"
|
||||
var/frequency = 1419
|
||||
var/code = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
receive_command(obj/source, command, datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!signal || !radio_connection)
|
||||
return
|
||||
|
||||
switch(command)
|
||||
if("send signal")
|
||||
src.radio_connection.post_signal(src, signal)
|
||||
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || (signal.encryption && signal.encryption != code))
|
||||
return
|
||||
|
||||
var/datum/signal/newsignal = new
|
||||
newsignal.data = signal.data
|
||||
if(src.code)
|
||||
newsignal.encryption = src.code
|
||||
|
||||
send_command("radio signal",newsignal)
|
||||
return
|
||||
|
||||
/obj/item/weapon/peripheral/printer
|
||||
name = "Printer module"
|
||||
desc = "A small printer designed to fit into a computer casing."
|
||||
icon_state = "card_mod"
|
||||
var/printing = 0
|
||||
|
||||
receive_command(obj/source,command, datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!signal)
|
||||
return
|
||||
|
||||
if((command == "print") && !src.printing)
|
||||
src.printing = 1
|
||||
|
||||
var/print_data = signal.data["data"]
|
||||
var/print_title = signal.data["title"]
|
||||
if(!print_data)
|
||||
src.printing = 0
|
||||
return
|
||||
spawn(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.host.loc )
|
||||
P.info = print_data
|
||||
if(print_title)
|
||||
P.name = "paper - '[print_title]'"
|
||||
|
||||
src.printing = 0
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/peripheral/prize_vendor
|
||||
name = "Prize vending module"
|
||||
desc = "An arcade prize dispenser designed to fit inside a computer casing."
|
||||
icon_state = "power_mod"
|
||||
var/last_vend = 0 //Delay between vends if manually activated(ie a dude is holding it and shaking stuff out)
|
||||
|
||||
receive_command(obj/source,command, datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(command == "vend prize")
|
||||
src.vend_prize()
|
||||
|
||||
return
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
if( (last_vend + 400) < world.time)
|
||||
user << "You shake something out of [src]!"
|
||||
src.vend_prize()
|
||||
src.last_vend = world.time
|
||||
else
|
||||
user << "\red [src] isn't ready to dispense a prize yet."
|
||||
|
||||
return
|
||||
|
||||
proc/vend_prize()
|
||||
var/obj/item/prize
|
||||
var/prizeselect = rand(1,4)
|
||||
var/turf/prize_location = null
|
||||
|
||||
if(src.host)
|
||||
prize_location = src.host.loc
|
||||
else
|
||||
prize_location = get_turf(src)
|
||||
|
||||
switch(prizeselect)
|
||||
if(1)
|
||||
prize = new /obj/item/weapon/money( prize_location )
|
||||
prize.name = "space ticket"
|
||||
prize.desc = "It's almost like actual currency!"
|
||||
if(2)
|
||||
prize = new /obj/item/device/radio/beacon( prize_location )
|
||||
prize.name = "electronic blink toy game"
|
||||
prize.desc = "Blink. Blink. Blink."
|
||||
if(3)
|
||||
prize = new /obj/item/weapon/lighter/zippo( prize_location )
|
||||
prize.name = "Burno Lighter"
|
||||
prize.desc = "Almost like a decent lighter!"
|
||||
if(4)
|
||||
prize = new /obj/item/weapon/c_tube( prize_location )
|
||||
prize.name = "toy sword"
|
||||
prize.icon = 'icons/obj/weapons.dmi'
|
||||
prize.icon_state = "sword1"
|
||||
prize.desc = "A sword made of cheap plastic."
|
||||
|
||||
/*
|
||||
/obj/item/weapon/peripheral/card_scanner
|
||||
name = "ID scanner module"
|
||||
icon_state = "card_mod"
|
||||
var/obj/item/weapon/card/id/authid = null
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
if(authid)
|
||||
user << "The card falls out."
|
||||
src.authid.loc = get_turf(user)
|
||||
src.authid = null
|
||||
|
||||
return
|
||||
|
||||
receive_command(obj/source,command, datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!signal || (signal.data["ref_id"] != "\ref[src]") )
|
||||
return
|
||||
|
||||
switch(command)
|
||||
if("eject card")
|
||||
if(src.authid)
|
||||
src.authid.loc = src.host.loc
|
||||
src.authid = null
|
||||
if("add card access")
|
||||
var/new_access = signal.data["access"]
|
||||
if(!new_access)
|
||||
return
|
||||
|
||||
|
||||
|
||||
return
|
||||
*/
|
||||
@@ -0,0 +1,398 @@
|
||||
// converyor belt
|
||||
|
||||
// moves items/mobs/movables in set direction every ptick
|
||||
|
||||
|
||||
/obj/machinery/conveyor
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "conveyor0"
|
||||
name = "conveyor belt"
|
||||
desc = "A conveyor belt."
|
||||
anchored = 1
|
||||
var/operating = 0 // 1 if running forward, -1 if backwards, 0 if off
|
||||
var/operable = 1 // true if can operate (no broken segments in this belt run)
|
||||
var/basedir // this is the default (forward) direction, set by the map dir
|
||||
// note dir var can vary when the direction changes
|
||||
|
||||
var/list/affecting // the list of all items that will be moved this ptick
|
||||
var/id = "" // the control ID - must match controller ID
|
||||
// following two only used if a diverter is present
|
||||
var/divert = 0 // if non-zero, direction to divert items
|
||||
var/divdir = 0 // if diverting, will be conveyer dir needed to divert (otherwise dense)
|
||||
|
||||
|
||||
|
||||
// create a conveyor
|
||||
|
||||
/obj/machinery/conveyor/New()
|
||||
..()
|
||||
basedir = dir
|
||||
setdir()
|
||||
|
||||
// set the dir and target turf depending on the operating direction
|
||||
|
||||
/obj/machinery/conveyor/proc/setdir()
|
||||
if(operating == -1)
|
||||
dir = turn(basedir,180)
|
||||
else
|
||||
dir = basedir
|
||||
update()
|
||||
|
||||
|
||||
// update the icon depending on the operating condition
|
||||
|
||||
/obj/machinery/conveyor/proc/update()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "conveyor-b"
|
||||
operating = 0
|
||||
return
|
||||
if(!operable)
|
||||
operating = 0
|
||||
icon_state = "conveyor[(operating != 0) && !(stat & NOPOWER)]"
|
||||
|
||||
|
||||
// machine process
|
||||
// move items to the target location
|
||||
/obj/machinery/conveyor/process()
|
||||
if(stat & (BROKEN | NOPOWER))
|
||||
return
|
||||
if(!operating)
|
||||
return
|
||||
use_power(100)
|
||||
|
||||
var/movedir = dir // base movement dir
|
||||
if(divert && dir==divdir) // update if diverter present
|
||||
movedir = divert
|
||||
|
||||
|
||||
affecting = loc.contents - src // moved items will be all in loc
|
||||
spawn(1) // slight delay to prevent infinite propagation due to map order
|
||||
var/items_moved = 0
|
||||
for(var/atom/movable/A in affecting)
|
||||
if(!A.anchored)
|
||||
if(isturf(A.loc)) // this is to prevent an ugly bug that forces a player to drop what they're holding if they recently pick it up from the conveyer belt
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
if(M.buckled == src)
|
||||
var/obj/machinery/conveyor/C = locate() in get_step(src, dir)
|
||||
M.buckled = null
|
||||
step(M,dir)
|
||||
if(C)
|
||||
M.buckled = C
|
||||
else
|
||||
new/obj/item/weapon/cable_coil/cut(M.loc)
|
||||
else
|
||||
step(M,movedir)
|
||||
else
|
||||
step(A,movedir)
|
||||
items_moved++
|
||||
if(items_moved >= 10)
|
||||
break
|
||||
|
||||
// attack with item, place item on conveyor
|
||||
|
||||
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/grab)) // special handling if grabbing a mob
|
||||
var/obj/item/weapon/grab/G = I
|
||||
G.affecting.Move(src.loc)
|
||||
del(G)
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/cable_coil)) // if cable, see if a mob is present
|
||||
var/mob/M = locate() in src.loc
|
||||
if(M)
|
||||
if (M == user)
|
||||
src.visible_message("\blue [M] ties \himself to the conveyor.")
|
||||
// note don't check for lying if self-tying
|
||||
else
|
||||
if(M.lying)
|
||||
user.visible_message("\blue [M] has been tied to the conveyor by [user].", "\blue You tie [M] to the converyor!")
|
||||
else
|
||||
user << "\blue [M] must be lying down to be tied to the converyor!"
|
||||
return
|
||||
M.buckled = src
|
||||
src.add_fingerprint(user)
|
||||
I:use(1)
|
||||
M.lying = 1
|
||||
return
|
||||
|
||||
// else if no mob in loc, then allow coil to be placed
|
||||
|
||||
else if(istype(I, /obj/item/weapon/wirecutters))
|
||||
var/mob/M = locate() in src.loc
|
||||
if(M && M.buckled == src)
|
||||
M.buckled = null
|
||||
src.add_fingerprint(user)
|
||||
if (M == user)
|
||||
src.visible_message("\blue [M] cuts \himself free from the conveyor.")
|
||||
else
|
||||
src.visible_message("\blue [M] had been cut free from the conveyor by [user].")
|
||||
return
|
||||
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
// otherwise drop and place on conveyor
|
||||
user.drop_item()
|
||||
if(I && I.loc) I.loc = src.loc
|
||||
return
|
||||
|
||||
// attack with hand, move pulled object onto conveyor
|
||||
|
||||
/obj/machinery/conveyor/attack_hand(mob/user as mob)
|
||||
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
|
||||
return
|
||||
if (user.pulling.anchored)
|
||||
return
|
||||
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
|
||||
return
|
||||
if (ismob(user.pulling))
|
||||
var/mob/M = user.pulling
|
||||
M.stop_pulling()
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
user.stop_pulling()
|
||||
else
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
user.stop_pulling()
|
||||
return
|
||||
|
||||
|
||||
// make the conveyor broken
|
||||
// also propagate inoperability to any connected conveyor with the same ID
|
||||
/obj/machinery/conveyor/proc/broken()
|
||||
stat |= BROKEN
|
||||
update()
|
||||
|
||||
var/obj/machinery/conveyor/C = locate() in get_step(src, basedir)
|
||||
if(C)
|
||||
C.set_operable(basedir, id, 0)
|
||||
|
||||
C = locate() in get_step(src, turn(basedir,180))
|
||||
if(C)
|
||||
C.set_operable(turn(basedir,180), id, 0)
|
||||
|
||||
|
||||
//set the operable var if ID matches, propagating in the given direction
|
||||
|
||||
/obj/machinery/conveyor/proc/set_operable(stepdir, match_id, op)
|
||||
|
||||
if(id != match_id)
|
||||
return
|
||||
operable = op
|
||||
|
||||
update()
|
||||
var/obj/machinery/conveyor/C = locate() in get_step(src, stepdir)
|
||||
if(C)
|
||||
C.set_operable(stepdir, id, op)
|
||||
|
||||
/*
|
||||
/obj/machinery/conveyor/verb/destroy()
|
||||
set src in view()
|
||||
src.broken()
|
||||
*/
|
||||
|
||||
/obj/machinery/conveyor/power_change()
|
||||
..()
|
||||
update()
|
||||
|
||||
|
||||
// converyor diverter
|
||||
// extendable arm that can be switched so items on the conveyer are diverted sideways
|
||||
// situate in same turf as conveyor
|
||||
// only works if belts is running proper direction
|
||||
//
|
||||
//
|
||||
/obj/machinery/diverter
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "diverter0"
|
||||
name = "diverter"
|
||||
desc = "A diverter arm for a conveyor belt."
|
||||
anchored = 1
|
||||
layer = FLY_LAYER
|
||||
var/obj/machinery/conveyor/conv // the conveyor this diverter works on
|
||||
var/deployed = 0 // true if diverter arm is extended
|
||||
var/operating = 0 // true if arm is extending/contracting
|
||||
var/divert_to // the dir that diverted items will be moved
|
||||
var/divert_from // the dir items must be moving to divert
|
||||
|
||||
|
||||
// create a diverter
|
||||
// set up divert_to and divert_from directions depending on dir state
|
||||
/obj/machinery/diverter/New()
|
||||
|
||||
..()
|
||||
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
divert_to = WEST // stuff will be moved to the west
|
||||
divert_from = NORTH // if entering from the north
|
||||
if(SOUTH)
|
||||
divert_to = EAST
|
||||
divert_from = NORTH
|
||||
if(EAST)
|
||||
divert_to = EAST
|
||||
divert_from = SOUTH
|
||||
if(WEST)
|
||||
divert_to = WEST
|
||||
divert_from = SOUTH
|
||||
if(NORTHEAST)
|
||||
divert_to = NORTH
|
||||
divert_from = EAST
|
||||
if(NORTHWEST)
|
||||
divert_to = NORTH
|
||||
divert_from = WEST
|
||||
if(SOUTHEAST)
|
||||
divert_to = SOUTH
|
||||
divert_from = EAST
|
||||
if(SOUTHWEST)
|
||||
divert_to = SOUTH
|
||||
divert_from = WEST
|
||||
spawn(2)
|
||||
// wait for map load then find the conveyor in this turf
|
||||
conv = locate() in src.loc
|
||||
if(conv) // divert_from dir must match possible conveyor movement
|
||||
if(conv.basedir != divert_from && conv.basedir != turn(divert_from,180) )
|
||||
del(src) // if no dir match, then delete self
|
||||
set_divert()
|
||||
update()
|
||||
|
||||
// update the icon state depending on whether the diverter is extended
|
||||
/obj/machinery/diverter/proc/update()
|
||||
icon_state = "diverter[deployed]"
|
||||
|
||||
// call to set the diversion vars of underlying conveyor
|
||||
/obj/machinery/diverter/proc/set_divert()
|
||||
if(conv)
|
||||
if(deployed)
|
||||
conv.divert = divert_to
|
||||
conv.divdir = divert_from
|
||||
else
|
||||
conv.divert= 0
|
||||
|
||||
|
||||
// *** TESTING click to toggle
|
||||
/obj/machinery/diverter/Click()
|
||||
toggle()
|
||||
|
||||
|
||||
// toggle between arm deployed and not deployed, showing animation
|
||||
//
|
||||
/obj/machinery/diverter/proc/toggle()
|
||||
if( stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(operating)
|
||||
return
|
||||
|
||||
use_power(50)
|
||||
operating = 1
|
||||
if(deployed)
|
||||
flick("diverter10",src)
|
||||
icon_state = "diverter0"
|
||||
sleep(10)
|
||||
deployed = 0
|
||||
else
|
||||
flick("diverter01",src)
|
||||
icon_state = "diverter1"
|
||||
sleep(10)
|
||||
deployed = 1
|
||||
operating = 0
|
||||
update()
|
||||
set_divert()
|
||||
|
||||
// don't allow movement into the 'backwards' direction if deployed
|
||||
/obj/machinery/diverter/CanPass(atom/movable/O, var/turf/target)
|
||||
var/direct = get_dir(O, target)
|
||||
if(direct == divert_to) // prevent movement through body of diverter
|
||||
return 0
|
||||
if(!deployed)
|
||||
return 1
|
||||
return(direct != turn(divert_from,180))
|
||||
|
||||
// don't allow movement through the arm if deployed
|
||||
/obj/machinery/diverter/CheckExit(atom/movable/O, var/turf/target)
|
||||
var/direct = get_dir(O, target)
|
||||
if(direct == turn(divert_to,180)) // prevent movement through body of diverter
|
||||
return 0
|
||||
if(!deployed)
|
||||
return 1
|
||||
return(direct != divert_from)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// the conveyor control switch
|
||||
//
|
||||
//
|
||||
|
||||
/obj/machinery/conveyor_switch
|
||||
|
||||
name = "conveyor switch"
|
||||
desc = "A conveyor control switch."
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "switch-off"
|
||||
var/position = 0 // 0 off, -1 reverse, 1 forward
|
||||
var/last_pos = -1 // last direction setting
|
||||
var/operated = 1 // true if just operated
|
||||
|
||||
var/id = "" // must match conveyor IDs to control them
|
||||
|
||||
var/list/conveyors // the list of converyors that are controlled by this switch
|
||||
anchored = 1
|
||||
|
||||
|
||||
|
||||
/obj/machinery/conveyor_switch/New()
|
||||
..()
|
||||
update()
|
||||
|
||||
spawn(5) // allow map load
|
||||
conveyors = list()
|
||||
for(var/obj/machinery/conveyor/C in world)
|
||||
if(C.id == id)
|
||||
conveyors += C
|
||||
|
||||
// update the icon depending on the position
|
||||
|
||||
/obj/machinery/conveyor_switch/proc/update()
|
||||
if(position<0)
|
||||
icon_state = "switch-rev"
|
||||
else if(position>0)
|
||||
icon_state = "switch-fwd"
|
||||
else
|
||||
icon_state = "switch-off"
|
||||
|
||||
|
||||
// timed process
|
||||
// if the switch changed, update the linked conveyors
|
||||
|
||||
/obj/machinery/conveyor_switch/process()
|
||||
if(!operated)
|
||||
return
|
||||
operated = 0
|
||||
|
||||
for(var/obj/machinery/conveyor/C in conveyors)
|
||||
C.operating = position
|
||||
C.setdir()
|
||||
|
||||
// attack with hand, switch position
|
||||
/obj/machinery/conveyor_switch/attack_hand(mob/user)
|
||||
if(position == 0)
|
||||
if(last_pos < 0)
|
||||
position = 1
|
||||
last_pos = 0
|
||||
else
|
||||
position = -1
|
||||
last_pos = 0
|
||||
else
|
||||
last_pos = position
|
||||
position = 0
|
||||
|
||||
operated = 1
|
||||
update()
|
||||
|
||||
// find any switches with same id as this one, and set their positions to match us
|
||||
for(var/obj/machinery/conveyor_switch/S in world)
|
||||
if(S.id == src.id)
|
||||
S.position = position
|
||||
S.update()
|
||||
@@ -0,0 +1,75 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "Disease Analyser"
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
|
||||
var/scanning = 0
|
||||
var/pause = 0
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
|
||||
|
||||
|
||||
else
|
||||
user << "There is already a dish inserted"
|
||||
|
||||
//else
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(scanning == 0)
|
||||
var/r = "GNAv2 based virus lifeform"
|
||||
r += "<BR>Infection rate : [dish.virus2.infectionchance * 10]"
|
||||
r += "<BR>Spread form : [dish.virus2.spreadtype]"
|
||||
r += "<BR>Progress Speed : [dish.virus2.stageprob * 10]"
|
||||
for(var/datum/disease2/effectholder/E in dish.virus2.effects)
|
||||
r += "<BR>Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]."
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.info = r
|
||||
dish.info = r
|
||||
dish.analysed = 1
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
icon_state = "analyser"
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3)
|
||||
else if(dish && !scanning && !pause)
|
||||
if(dish.virus2 && dish.growth > 50)
|
||||
dish.growth -= 10
|
||||
scanning = 25
|
||||
icon_state = "analyser_processing"
|
||||
else
|
||||
pause = 1
|
||||
spawn(25)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\icon[src] \blue The [src.name] buzzes", 2)
|
||||
pause = 0
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -0,0 +1,331 @@
|
||||
//To simplify, all diseases have 4 stages, with effects starting at stage 2
|
||||
//Stage 1 = Rest,Minor disease
|
||||
//Stage 2 = Minimal effect
|
||||
//Stage 3 = Medium effect
|
||||
//Stage 4 = Death/Really Really really bad effect
|
||||
|
||||
|
||||
/proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0)
|
||||
if(prob(disease.infectionchance))
|
||||
if(M.virus2)
|
||||
return
|
||||
else
|
||||
var/score = 0
|
||||
if(!forced)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(M:gloves)
|
||||
score += 5
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space)) score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
|
||||
if(istype(M:head, /obj/item/clothing/head/helmet/space)) score += 5
|
||||
if(istype(M:head, /obj/item/clothing/head/bio_hood)) score += 5
|
||||
if(M.wear_mask)
|
||||
score += 5
|
||||
if((istype(M:wear_mask, /obj/item/clothing/mask) || istype(M:wear_mask, /obj/item/clothing/mask/surgical)) && !M.internal)
|
||||
score += 5
|
||||
if(M.internal)
|
||||
score += 5
|
||||
|
||||
if(score > 15)
|
||||
return
|
||||
// else if(score == 20 && prob(95))
|
||||
// return
|
||||
else if(score == 15 && prob(75))
|
||||
return
|
||||
else if(score == 10 && prob(55))
|
||||
return
|
||||
else if(score == 5 && prob(35))
|
||||
return
|
||||
|
||||
M.virus2 = disease.getcopy()
|
||||
M.virus2.minormutate()
|
||||
|
||||
for(var/datum/disease2/resistance/res in M.resistances)
|
||||
if(res.resistsdisease(M.virus2))
|
||||
M.virus2 = null
|
||||
|
||||
|
||||
|
||||
/datum/disease2/resistance
|
||||
var/list/datum/disease2/effect/resistances = list()
|
||||
|
||||
proc/resistsdisease(var/datum/disease2/disease/virus2)
|
||||
var/list/res2 = list()
|
||||
for(var/datum/disease2/effect/e in resistances)
|
||||
res2 += e.type
|
||||
for(var/datum/disease2/effectholder/holder in virus2)
|
||||
if(!(holder.effect.type in res2))
|
||||
return 0
|
||||
else
|
||||
res2 -= holder.effect.type
|
||||
if(res2.len > 0)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
New(var/datum/disease2/disease/virus2)
|
||||
for(var/datum/disease2/effectholder/h in virus2.effects)
|
||||
resistances += h.effect.type
|
||||
|
||||
|
||||
/proc/infect_mob_random(var/mob/living/carbon/M)
|
||||
if(!M.virus2)
|
||||
M.virus2 = new /datum/disease2/disease
|
||||
M.virus2.makerandom()
|
||||
|
||||
/datum/disease2/disease
|
||||
var/infectionchance = 10
|
||||
var/spreadtype = "Blood" // Can also be "Airborne"
|
||||
var/stage = 1
|
||||
var/stageprob = 2
|
||||
var/dead = 0
|
||||
var/clicks = 0
|
||||
|
||||
var/uniqueID = 0
|
||||
var/list/datum/disease2/effectholder/effects = list()
|
||||
proc/makerandom()
|
||||
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
|
||||
holder.stage = 1
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 2
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 3
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 4
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
uniqueID = rand(0,10000)
|
||||
infectionchance = rand(1,10)
|
||||
spreadtype = "Airborne"
|
||||
proc/minormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.minormutate()
|
||||
infectionchance = min(10,infectionchance + rand(0,1))
|
||||
proc/issame(var/datum/disease2/disease/disease)
|
||||
var/list/types = list()
|
||||
var/list/types2 = list()
|
||||
for(var/datum/disease2/effectholder/d in effects)
|
||||
types += d.effect.type
|
||||
var/equal = 1
|
||||
|
||||
for(var/datum/disease2/effectholder/d in disease.effects)
|
||||
types2 += d.effect.type
|
||||
|
||||
for(var/type in types)
|
||||
if(!(type in types2))
|
||||
equal = 0
|
||||
return equal
|
||||
|
||||
proc/activate(var/mob/living/carbon/mob)
|
||||
if(dead)
|
||||
mob.virus2 = null
|
||||
return
|
||||
if(mob.stat == 2)
|
||||
return
|
||||
if(mob.radiation > 50)
|
||||
if(prob(1))
|
||||
majormutate()
|
||||
if(mob.reagents.has_reagent("spaceacillin"))
|
||||
return
|
||||
if(prob(stageprob) && prob(25 + (clicks/100)) && stage != 4)
|
||||
stage++
|
||||
clicks = 0
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.runeffect(mob,stage)
|
||||
|
||||
proc/cure_added(var/datum/disease2/resistance/res)
|
||||
if(res.resistsdisease(src))
|
||||
dead = 1
|
||||
|
||||
proc/majormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.majormutate()
|
||||
|
||||
|
||||
proc/getcopy()
|
||||
// world << "getting copy"
|
||||
var/datum/disease2/disease/disease = new /datum/disease2/disease
|
||||
disease.infectionchance = infectionchance
|
||||
disease.spreadtype = spreadtype
|
||||
disease.stageprob = stageprob
|
||||
for(var/datum/disease2/effectholder/holder in effects)
|
||||
// world << "adding effects"
|
||||
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
|
||||
newholder.effect = new holder.effect.type
|
||||
newholder.chance = holder.chance
|
||||
newholder.cure = holder.cure
|
||||
newholder.multiplier = holder.multiplier
|
||||
newholder.happensonce = holder.happensonce
|
||||
newholder.stage = holder.stage
|
||||
disease.effects += newholder
|
||||
// world << "[newholder.effect.name]"
|
||||
// world << "[disease]"
|
||||
return disease
|
||||
|
||||
/datum/disease2/effect
|
||||
var/name = "Blanking effect"
|
||||
var/stage = 4
|
||||
var/maxm = 1
|
||||
proc/activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
|
||||
/datum/disease2/effect/gibbingtons
|
||||
name = "Gibbingtons Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.gib()
|
||||
|
||||
/datum/disease2/effect/radian
|
||||
name = "Radian's syndrome"
|
||||
stage = 4
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.radiation += (2*multiplier)
|
||||
|
||||
/datum/disease2/effect/toxins
|
||||
name = "Hyperacid Syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss(2*multiplier)
|
||||
|
||||
/datum/disease2/effect/scream
|
||||
name = "Random screaming syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*scream")
|
||||
|
||||
/datum/disease2/effect/drowsness
|
||||
name = "Automated sleeping syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.drowsyness += 10
|
||||
|
||||
/datum/disease2/effect/shakey
|
||||
name = "World Shaking syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
shake_camera(mob,5*multiplier)
|
||||
|
||||
/datum/disease2/effect/deaf
|
||||
name = "Hard of hearing syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.ear_deaf += 20
|
||||
|
||||
/datum/disease2/effect/invisible
|
||||
name = "Waiting Syndrome"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
return
|
||||
/*
|
||||
/datum/disease2/effect/telepathic
|
||||
name = "Telepathy Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.mutations |= 512
|
||||
*/
|
||||
/datum/disease2/effect/noface
|
||||
name = "Identity Loss syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.real_name = "Unknown"
|
||||
|
||||
/datum/disease2/effect/monkey
|
||||
name = "Monkism syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/h = mob
|
||||
h.monkeyize()
|
||||
|
||||
/datum/disease2/effect/sneeze
|
||||
name = "Coldingtons Effect"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*sneeze")
|
||||
|
||||
/datum/disease2/effect/gunck
|
||||
name = "Flemmingtons"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "\red Mucous runs down the back of your throat."
|
||||
|
||||
/datum/disease2/effect/killertoxins
|
||||
name = "Toxification syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss(15)
|
||||
/*
|
||||
/datum/disease2/effect/hallucinations
|
||||
name = "Hallucinational Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.hallucination += 25
|
||||
*/
|
||||
/datum/disease2/effect/sleepy
|
||||
name = "Resting syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*collapse")
|
||||
|
||||
/datum/disease2/effect/mind
|
||||
name = "Lazy mind syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.setBrainLoss(50)
|
||||
|
||||
/datum/disease2/effect/suicide
|
||||
name = "Suicidal syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.suiciding = 1
|
||||
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
|
||||
viewers(mob) << "\red <b>[mob.name] is attempting to bite off \his tongue. It looks like \he's trying to commit suicide.</b>"
|
||||
mob.oxyloss = max(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss(), mob.getOxyLoss())
|
||||
mob.updatehealth()
|
||||
spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds
|
||||
mob.suiciding = 0
|
||||
|
||||
/datum/disease2/effectholder
|
||||
var/name = "Holder"
|
||||
var/datum/disease2/effect/effect
|
||||
var/chance = 0 //Chance in percentage each tick
|
||||
var/cure = "" //Type of cure it requires
|
||||
var/happensonce = 0
|
||||
var/multiplier = 1 //The chance the effects are WORSE
|
||||
var/stage = 0
|
||||
|
||||
proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
|
||||
if(happensonce > -1 && effect.stage <= stage && prob(chance))
|
||||
effect.activate(mob)
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
proc/getrandomeffect()
|
||||
var/list/datum/disease2/effect/list = list()
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
// world << "Making [e]"
|
||||
var/datum/disease2/effect/f = new e
|
||||
if(f.stage == src.stage)
|
||||
list += f
|
||||
effect = pick(list)
|
||||
chance = rand(1,6)
|
||||
|
||||
proc/minormutate()
|
||||
switch(pick(1,2,3,4,5))
|
||||
if(1)
|
||||
chance = rand(0,100)
|
||||
if(2)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
proc/majormutate()
|
||||
getrandomeffect()
|
||||
|
||||
/proc/dprob(var/p)
|
||||
return(prob(sqrt(p)) && prob(sqrt(p)))
|
||||
@@ -0,0 +1,20 @@
|
||||
/obj/machinery/disease2/biodestroyer
|
||||
name = "Biohazard destroyer"
|
||||
icon = 'icons/obj/pipes/disposal.dmi'
|
||||
icon_state = "disposal"
|
||||
var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk)
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
for(var/path in accepts)
|
||||
if(I.type in typesof(path))
|
||||
user.drop_item()
|
||||
del(I)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
|
||||
return
|
||||
user.drop_item()
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] beeps", 2)
|
||||
@@ -0,0 +1,42 @@
|
||||
/obj/item/weapon/cureimplanter
|
||||
name = "Hypospray injector"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implanter1"
|
||||
var/datum/disease2/resistance/resistance = null
|
||||
var/works = 0
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
item_state = "syringe_0"
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
|
||||
|
||||
/obj/item/weapon/cureimplanter/attack(mob/target as mob, mob/user as mob)
|
||||
if(ismob(target))
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
if (target != user)
|
||||
O.show_message(text("\red <B>[] is trying to inject [] with [src.name]!</B>", user, target), 1)
|
||||
else
|
||||
O.show_message("\red <B>[user] is trying to inject themselves with [src.name]!</B>", 1)
|
||||
if(!do_mob(user, target,60)) return
|
||||
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
if (target != user)
|
||||
O.show_message(text("\red [] injects [] with [src.name]!", user, target), 1)
|
||||
else
|
||||
O.show_message("\red [user] injects themself with [src.name]!", 1)
|
||||
|
||||
|
||||
var/mob/living/carbon/M = target
|
||||
|
||||
if(works == 0 && prob(25))
|
||||
M.resistances2 += resistance
|
||||
if(M.virus2)
|
||||
M.virus2.cure_added(resistance)
|
||||
else if(works == 1)
|
||||
M.adjustToxLoss(rand(20,50))
|
||||
else if(works == 2)
|
||||
M.adjustToxLoss(rand(50,100))
|
||||
else if(works == 3)
|
||||
infect_virus2(M,virus2,1)
|
||||
@@ -0,0 +1,154 @@
|
||||
/obj/machinery/computer/curer
|
||||
name = "Cure Research Machine"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "dna"
|
||||
// brightnessred = 0
|
||||
// brightnessgreen = 2 //Used for multicoloured lighting on BS12
|
||||
// brightnessblue = 2
|
||||
var/curing
|
||||
var/virusing
|
||||
circuit = "/obj/item/weapon/circuitboard/mining"
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
/*if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)*/
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
|
||||
//else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/curer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(curing)
|
||||
dat = "Antibody production in progress"
|
||||
else if(virusing)
|
||||
dat = "Virus production in progress"
|
||||
else if(dish)
|
||||
dat = "Virus dish inserted"
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 100)
|
||||
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
||||
dat += "<BR><A href='?src=\ref[src];virus=1'>Begin virus production</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt to create cure"
|
||||
else
|
||||
dat += "<BR>Please check dish contents"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat = "Please insert dish"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/process()
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(curing)
|
||||
curing -= 1
|
||||
if(curing == 0)
|
||||
icon_state = "dna"
|
||||
if(dish.virus2)
|
||||
createcure(dish.virus2)
|
||||
if(virusing)
|
||||
virusing -= 1
|
||||
if(virusing == 0)
|
||||
icon_state = "dna"
|
||||
if(dish.virus2)
|
||||
createvirus(dish.virus2)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["antibody"])
|
||||
curing = 30
|
||||
dish.growth -= 50
|
||||
src.icon_state = "dna"
|
||||
if (href_list["virus"])
|
||||
virusing = 30
|
||||
dish.growth -= 100
|
||||
src.icon_state = "dna"
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/createcure(var/datum/disease2/disease/virus2)
|
||||
var/obj/item/weapon/cureimplanter/implanter = new /obj/item/weapon/cureimplanter(src.loc)
|
||||
implanter.resistance = new /datum/disease2/resistance(dish.virus2)
|
||||
if(probG("Virus curing",3))
|
||||
implanter.works = 0
|
||||
else
|
||||
implanter.works = rand(1,2)
|
||||
state("The [src.name] Buzzes")
|
||||
|
||||
/obj/machinery/computer/curer/proc/createvirus(var/datum/disease2/disease/virus2)
|
||||
var/obj/item/weapon/cureimplanter/implanter = new /obj/item/weapon/cureimplanter(src.loc)
|
||||
implanter.name = "Viral implanter (MAJOR BIOHAZARD)"
|
||||
implanter.virus2 = dish.virus2.getcopy()
|
||||
implanter.works = 3
|
||||
state("The [src.name] Buzzes")
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
@@ -0,0 +1,202 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "Disease Splicer"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "crew"
|
||||
//brightnessred = 0
|
||||
// brightnessgreen = 2
|
||||
// brightnessblue = 2
|
||||
// broken_icon
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/analysed = 0
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
var/burning = 0
|
||||
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
/*
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)*/
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/diseasedisk))
|
||||
user << "You upload the contents of the disk into the buffer"
|
||||
memorybank = I:effect
|
||||
|
||||
|
||||
//else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(splicing)
|
||||
dat = "Splicing in progress"
|
||||
else if(scanning)
|
||||
dat = "Splicing in progress"
|
||||
else if(burning)
|
||||
dat = "Data disk burning in progress"
|
||||
else
|
||||
if(dish)
|
||||
dat = "Virus dish inserted"
|
||||
|
||||
dat += "<BR>Current DNA strand : "
|
||||
if(memorybank)
|
||||
dat += "<A href='?src=\ref[src];splice=1'>"
|
||||
if(analysed)
|
||||
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
|
||||
else
|
||||
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
|
||||
dat += "</a>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
|
||||
else
|
||||
dat += "Empty"
|
||||
|
||||
dat += "<BR><BR>"
|
||||
|
||||
if(dish)
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 50)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
|
||||
if(dish.analysed)
|
||||
dat += ": [e.effect.name]"
|
||||
dat += " (5-[e.effect.stage])</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt gene splicing"
|
||||
else
|
||||
dat += "<BR>No virus found in dish"
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat += "<BR>Please insert dish"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
state("The [src.name] beeps")
|
||||
icon_state = "crew"
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
state("The [src.name] pings")
|
||||
icon_state = "crew"
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
|
||||
if(analysed)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
else
|
||||
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
state("The [src.name] zings")
|
||||
icon_state = "crew"
|
||||
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["grab"])
|
||||
memorybank = locate(href_list["grab"])
|
||||
analysed = dish.analysed
|
||||
del(dish)
|
||||
dish = null
|
||||
scanning = 30
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
else if(href_list["splice"])
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
splicing = 50
|
||||
dish.virus2.spreadtype = "Blood"
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["disk"])
|
||||
burning = 20
|
||||
icon_state = "crew"
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
|
||||
|
||||
/obj/item/weapon/diseasedisk
|
||||
name = "Blank GNA disk"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "datadisk2"
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/stage = 1
|
||||
|
||||
/obj/item/weapon/diseasedisk/premade/New()
|
||||
name = "Blank GNA disk (stage: [5-stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
@@ -0,0 +1,176 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "Pathogenic incubator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "incubator"
|
||||
var/obj/item/weapon/virusdish/dish
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/radiation = 0
|
||||
|
||||
var/on = 0
|
||||
var/power = 0
|
||||
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/B as obj, var/mob/user as mob)
|
||||
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
if(src.beaker)
|
||||
if(istype(beaker,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "A syringe is already loaded into the machine."
|
||||
else
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
if(src.dish)
|
||||
user << "A dish is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.dish = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
user << "You add the dish to the machine!"
|
||||
src.updateUsrDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!dish) return
|
||||
|
||||
if (href_list["power"])
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "incubator_on"
|
||||
else
|
||||
icon_state = "incubator"
|
||||
if (href_list["ejectchem"])
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
if (href_list["ejectdish"])
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!dish)
|
||||
dat = "Please insert dish into the incubator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
var/string = "Off"
|
||||
if(on)
|
||||
string = "On"
|
||||
dat += "Power status : <A href='?src=\ref[src];power=1'>[string]</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Food supply : [foodsupply]"
|
||||
dat += "<BR>"
|
||||
dat += "Radiation Levels : [radiation] RADS : <A href='?src=\ref[src];rad=1'>Radiate</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Toxins : [toxins]"
|
||||
dat += "<BR><BR>"
|
||||
if(beaker)
|
||||
dat += "Eject chemicals : <A href='?src=\ref[src];ejectchem=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
if(dish)
|
||||
dat += "Eject Virus dish : <A href='?src=\ref[src];ejectdish=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
dat += "<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];flush=1'>Flush system</a>"
|
||||
|
||||
|
||||
user << browse("<TITLE>Pathogenic incubator</TITLE>incubator menu:<BR><BR>[dat]", "window=incubator;size=575x400")
|
||||
onclose(user, "incubator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
|
||||
if(dish && on && dish.virus2)
|
||||
use_power(50,EQUIP)
|
||||
if(!powered(EQUIP))
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
if(foodsupply)
|
||||
foodsupply -= 1
|
||||
dish.growth += 1
|
||||
if(dish.growth == 100)
|
||||
state("The [src.name] pings")
|
||||
if(radiation)
|
||||
if(radiation > 50 & prob(5))
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.analysed = 0
|
||||
state("The [src.name] beeps")
|
||||
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
if(toxins > 50)
|
||||
dish.virus2 = null
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
if(beaker)
|
||||
if(!beaker.reagents.remove_reagent("virusfood",5))
|
||||
foodsupply += 20
|
||||
if(!beaker.reagents.remove_reagent("toxins",1))
|
||||
toxins += 1
|
||||
|
||||
proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
@@ -0,0 +1,139 @@
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "Pathogenic Isolator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "isolator"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/isolating = 0
|
||||
var/beaker = null
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob)
|
||||
if(!istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
return
|
||||
|
||||
if(src.beaker)
|
||||
user << "A syringe is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "isolator_in"
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
|
||||
if (href_list["isolate"])
|
||||
var/datum/reagent/blood/Blood
|
||||
for(var/datum/reagent/blood/B in R.reagent_list)
|
||||
if(B)
|
||||
Blood = B
|
||||
break
|
||||
|
||||
if(Blood.data["virus2"])
|
||||
virus2 = Blood.data["virus2"]
|
||||
isolating = 40
|
||||
icon_state = "isolator_processing"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
else if (href_list["main"])
|
||||
attack_hand(usr)
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
icon_state = "isolator"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert sample into the isolator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
else if(isolating)
|
||||
dat = "Isolating"
|
||||
else
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
|
||||
if(!R.total_volume)
|
||||
dat += "[beaker] is empty."
|
||||
else
|
||||
dat += "Contained reagents:<BR>"
|
||||
for(var/datum/reagent/blood/G in R.reagent_list)
|
||||
dat += " [G.name]: <A href='?src=\ref[src];isolate=[G.id]'>Isolate</a>"
|
||||
user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
|
||||
onclose(user, "isolator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
if(isolating > 0)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
icon_state = "isolator_in"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "Virus containment/growth dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/weapon/hand_labeler))
|
||||
return
|
||||
..()
|
||||
if(prob(50))
|
||||
user << "The dish shatters"
|
||||
if(virus2.infectionchance > 0)
|
||||
infect_virus2(user,virus2)
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine()
|
||||
usr << "This is a virus containment dish"
|
||||
if(src.info)
|
||||
usr << "It has the following information about its contents"
|
||||
usr << src.info
|
||||
@@ -0,0 +1,30 @@
|
||||
/obj/machinery/disease2/monkeycloner
|
||||
name = "Monkey dispensor"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "pod_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/cloning = 0
|
||||
|
||||
/obj/machinery/disease2/monkeycloner/attack_hand()
|
||||
if(!cloning)
|
||||
cloning = 150
|
||||
|
||||
icon_state = "pod_g"
|
||||
|
||||
/obj/machinery/disease2/monkeycloner/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(cloning)
|
||||
cloning -= 1
|
||||
if(!cloning)
|
||||
new /mob/living/carbon/monkey(src.loc)
|
||||
icon_state = "pod_0"
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -0,0 +1,962 @@
|
||||
/proc/scram(n)
|
||||
var/t = ""
|
||||
var/p = null
|
||||
p = 1
|
||||
while(p <= n)
|
||||
t = text("[][]", t, rand(1, 9))
|
||||
p++
|
||||
return t
|
||||
|
||||
/obj/machinery/computer/dna
|
||||
name = "DNA operations computer"
|
||||
desc = "A Computer used to advanced DNA stuff."
|
||||
icon_state = "dna"
|
||||
var/obj/item/weapon/card/data/scan = null
|
||||
var/obj/item/weapon/card/data/modify = null
|
||||
var/obj/item/weapon/card/data/modify2 = null
|
||||
var/mode = null
|
||||
var/temp = null
|
||||
|
||||
/obj/machinery/computer/dna/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/dna/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/dna/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
|
||||
var/dat = text("<I>Please Insert the cards into the slots</I><BR>\n\t\t\t\tFunction Disk: <A href='?src=\ref[];scan=1'>[]</A><BR>\n\t\t\t\tTarget Disk: <A href='?src=\ref[];modify=1'>[]</A><BR>\n\t\t\t\tAux. Data Disk: <A href='?src=\ref[];modify2=1'>[]</A><BR>\n\t\t\t\t\t(Not always used!)<BR>\n\t\t\t\t[]", src, (src.scan ? text("[]", src.scan.name) : "----------"), src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.modify2 ? text("[]", src.modify2.name) : "----------"), (src.scan ? text("<A href='?src=\ref[];execute=1'>Execute Function</A>", src) : "No function disk inserted!"))
|
||||
if (src.temp)
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Clear Message</A>", src.temp, src)
|
||||
user << browse(dat, "window=dna_comp")
|
||||
onclose(user, "dna_comp")
|
||||
else
|
||||
var/dat = text("<I>[]</I><BR>\n\t\t\t\t[] <A href='?src=\ref[];scan=1'>[]</A><BR>\n\t\t\t\t[] <A href='?src=\ref[];modify=1'>[]</A><BR>\n\t\t\t\t[] <A href='?src=\ref[];modify2=1'>[]</A><BR>\n\t\t\t\t\t(Not always used!)<BR>\n\t\t\t\t[]", stars("Please Insert the cards into the slots"), stars("Function Disk:"), src, (src.scan ? text("[]", src.scan.name) : "----------"), stars("Target Disk:"), src, (src.modify ? text("[]", src.modify.name) : "----------"), stars("Aux. Data Disk:"), src, (src.modify2 ? text("[]", src.modify2.name) : "----------"), (src.scan ? text("<A href='?src=\ref[];execute=1'>[]</A>", src, stars("Execute Function")) : stars("No function disk inserted!")))
|
||||
if (src.temp)
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>[]", stars(src.temp), src, stars("Clear Message</A>"))
|
||||
user << browse(dat, "window=dna_comp")
|
||||
onclose(user, "dna_comp")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/dna/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["modify"])
|
||||
if (src.modify)
|
||||
src.modify.loc = src.loc
|
||||
src.modify = null
|
||||
src.mode = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/data))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.modify = I
|
||||
src.mode = null
|
||||
if (href_list["modify2"])
|
||||
if (src.modify2)
|
||||
src.modify2.loc = src.loc
|
||||
src.modify2 = null
|
||||
src.mode = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/data))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.modify2 = I
|
||||
src.mode = null
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
src.mode = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/data))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
src.mode = null
|
||||
if (href_list["clear"])
|
||||
src.temp = null
|
||||
if (href_list["execute"])
|
||||
if ((src.scan && src.scan.function))
|
||||
switch(src.scan.function)
|
||||
if("data_mutate")
|
||||
if (src.modify)
|
||||
if (!( findtext(src.scan.data, "-", 1, null) ))
|
||||
if ((src.modify.data && src.scan.data && length(src.modify.data) >= length(src.scan.data)))
|
||||
src.modify.data = text("[][]", src.scan.data, (length(src.modify.data) > length(src.scan.data) ? copytext(src.modify.data, length(src.scan.data) + 1, length(src.modify.data) + 1) : null))
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot examine data! (Null or wrong format)"
|
||||
else
|
||||
var/d = findtext(src.modify.data, "-", 1, null)
|
||||
var/t = copytext(src.modify.data, d + 1, length(src.modify.data) + 1)
|
||||
d = text2num(copytext(1, d, null))
|
||||
if ((d && t && src.modify.data && src.scan.data && length(src.modify.data) >= (length(t) + d - 1) ))
|
||||
src.modify.data = text("[][][]", copytext(src.modify.data, 1, d), t, (length(src.modify.data) > length(t) + d ? copytext(src.modify.data, length(t) + d, length(src.modify.data) + 1) : null))
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot examine data! (Null or wrong format)"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("dna_seq")
|
||||
src.temp = "<TT>DNA Systems Help:\nHuman DNA sequences: (Compressed in *.dna format version 10.76)\n\tSpecies Identification Marker: (28 chromosomes)\n\t\t5BDFE293BA5500F9FFFD500AAFFE\n\tStructural Enzymes:\n\t\tCDE375C9A6C25A7DBDA50EC05AC6CEB63\n\t\tNote: The first id set is used for DNA clean up operations.\n\tUsed Enzymes:\n\t\t493DB249EB6D13236100A37000800AB71\n\tSpecies/Genus Classification: <I>Homo Sapien</I>\n\nMonkey DNA sequences: (Compressed in *.dna format version 10.76)\n\tSpecies Identification Marker: (16 chromosomes)\n\t\t2B6696D2B127E5A4\n\tStructural Enzymes:\n\t\tCDEAF5B90AADBC6BA8033DB0A7FD613FA\n\t\tNote: The first id set is used for DNA clean up operations.\n\tUsed Enzymes:\n\t\tC8FFFE7EC09D80AEDEDB9A5A0B4085B61\n\tSpecies/Genus Classification: Generic Monkey\n</TT>>"
|
||||
if("dna_help")
|
||||
src.temp = "<TT>DNA Systems Help:\nThe DNA systems consists 3 systems.\nI. DNA Scanner/Implanter - This system is slightly advanced to use. It accepts\n\t1 disk. Before you wish to run a function/program you must implant the\n\tdisk data into the temporary memory. Note that once this is done the disk can\n\tbe removed to place a data disk in.\nII. DNA computer - This is a simple yet fast computer that basically operates on data.\nIII. Restructurer - This device reorganizes the anatomical structure of the subject\n\taccording to the DNA sequences. Please note that it is illegal to perform a\n\ttransfer from one species to or from the <I>Homo sapiens</I> species but\n\thuman to human is acceptable under UNSD guidlines.\n\tNote: This machine is programmed to operate on specific preprogrammed species with\n\tspecialized anatomical blueprints hard coded into its databanks. It cannot operate\n\ton other species. (Current: Human, Monkey)\n\nData Disks:\n\tThese run on 2 (or 3) types: DNA scanner program disks and data modification\nfunctions (and disk modification functions)\n\nDisk-Copy\n\tThis erases the target disk and completely copies the data from the aux. disk.\nDisk-Erase\n\tThis erases everything on the target disk.\nData-Clear\n\tThis erases (clears) only the data.\n\nData-Trunicate\n\tThis removes data from the target disk (parameters gathered from data slot on target\n\tdisk). This fuction has 4 modes (a,b,c,default) defined by this way. (mode id)(#)\n\ta - This cuts # data from the end. (ex a1 on ABCD = ABC)\n\tb - This cuts # data from the beginning. (ex b1 on ABCD = BCD)\n\tc - This limits the data from the end. (ex c1 on ABCD = A)\n\tdefault - This limits the data from the end. (ex 1 on ABCD = D)\nData-Add\n\tThis adds thedata on the aux. disk to the data on the target disk.\nData-Sramble\n\tThis scrambles the data on the target disk. The length is equal to\n\tthe length of the original data.\nData-Input\n\tThis lets you input data into the data slot of any data disk.\n\tNote: This doesn't work only on storage.\nData-Mutate\n\tThis basically inserts text. You follow this format:\n\tpos-text (or just text for automatic pos 1)\n\tie 2-IVE on FOUR yields FIVE\n</TT>"
|
||||
if("data_add")
|
||||
if (src.modify)
|
||||
if (src.modify2)
|
||||
if ((src.modify.data && src.modify2.data))
|
||||
src.modify.data += src.modify2.data
|
||||
src.temp = text("Done!<BR>New Data:<BR>[]", src.modify.data)
|
||||
else
|
||||
src.temp = "Cannot read data! (may be null)"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read aux. data disk!"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("data_scramble")
|
||||
if (src.modify)
|
||||
if (length(text("[]", src.modify.data)) >= 1)
|
||||
src.modify.data = scram(length(text("[]", src.modify.data)))
|
||||
src.temp = text("Data scrambled: []", src.modify.data)
|
||||
else
|
||||
src.temp = "No data to scramble"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("data_input")
|
||||
if (src.modify)
|
||||
var/dat = input(usr, ">", text("[]", src.name), null) as text
|
||||
var/s = src.scan
|
||||
var/m = src.modify
|
||||
if ((usr.stat || usr.restrained() || src.modify != m || src.scan != s))
|
||||
return
|
||||
if (((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)))
|
||||
src.modify.data = dat
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("disk_copy")
|
||||
if (src.modify)
|
||||
if (src.modify2)
|
||||
src.modify.function = src.modify2.function
|
||||
src.modify.data = src.modify2.data
|
||||
src.modify.special = src.modify2.special
|
||||
src.temp = "All disk data/programs copied."
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read aux. data disk!"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("disk_dis")
|
||||
if (src.modify)
|
||||
src.temp = text("Function: [][]<BR>Data: []", src.modify.function, (src.modify.special ? text("-[]", src.modify.special) : null), src.modify.data)
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("disk_erase")
|
||||
if (src.modify)
|
||||
src.modify.data = null
|
||||
src.modify.function = "storage"
|
||||
src.modify.special = null
|
||||
src.temp = "All Disk contents deleted."
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("data_clear")
|
||||
if (src.modify)
|
||||
src.modify.data = null
|
||||
src.temp = "Disk data cleared."
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
if("data_trun")
|
||||
if (src.modify)
|
||||
if ((src.modify.data && src.scan.data))
|
||||
var/l1 = length(src.modify.data)
|
||||
var/l2 = max(round(text2num(src.scan.data)), 1)
|
||||
switch(copytext(src.modify.data, 1, 2))
|
||||
if("a")
|
||||
if (l1 > l2)
|
||||
src.modify.data = copytext(src.modify.data, 1, (l1 - l2) + 1)
|
||||
else
|
||||
src.modify.data = ""
|
||||
src.temp = text("Done!<BR>New Data:<BR>[]", src.modify.data)
|
||||
if("b")
|
||||
if (l1 > l2)
|
||||
src.modify.data = copytext(src.modify.data, l2, l1 + 1)
|
||||
else
|
||||
src.modify.data = ""
|
||||
src.temp = text("Done!<BR>New Data:<BR>[]", src.modify.data)
|
||||
if("c")
|
||||
if (l1 >= l2)
|
||||
src.modify.data = copytext(src.modify.data, l1 - l2, l1 + 1)
|
||||
src.temp = text("Done!<BR>New Data:<BR>[]", src.modify.data)
|
||||
else
|
||||
if (l1 >= l2)
|
||||
src.modify.data = copytext(src.modify.data, 1, l2 + 1)
|
||||
src.temp = text("Done!<BR>New Data:<BR>[]", src.modify.data)
|
||||
else
|
||||
src.temp = "Cannot read data! (may be null and note that function data slot is used instead of aux disk!!)"
|
||||
else
|
||||
src.temp = "Disk Failure: Cannot read target disk!"
|
||||
else
|
||||
else
|
||||
src.temp = "System Failure: Cannot read disk function!"
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/dna/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/allow_drop()
|
||||
return 0
|
||||
|
||||
/obj/machinery/dna_scanner/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/verb/eject()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/verb/move_inside()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
usr.stop_pulling()
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "scanner_1"
|
||||
for(var/obj/O in src)
|
||||
//O = null
|
||||
del(O)
|
||||
//Foreach goto(124)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/attackby(obj/item/weapon/grab/G as obj, user as mob)
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "scanner_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(30)
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
src.icon_state = "scanner_0"
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scanner/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(35)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(108)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(181)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/dna_scanner/blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/scan_console/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/scan_console/blob_act()
|
||||
|
||||
if(prob(75))
|
||||
del(src)
|
||||
|
||||
/obj/machinery/scan_console/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
|
||||
|
||||
/obj/machinery/scan_console/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
src.connected = locate(/obj/machinery/dna_scanner, get_step(src, WEST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/scan_console/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
var/mob/M
|
||||
if (!( src.status ))
|
||||
return
|
||||
if (!( src.func ))
|
||||
src.temp = "No function loaded into memory core!"
|
||||
src.status = null
|
||||
if ((src.connected && src.connected.occupant))
|
||||
M = src.connected.occupant
|
||||
if (src.status == "load")
|
||||
src.prog_p1 = null
|
||||
src.prog_p2 = null
|
||||
src.prog_p3 = null
|
||||
src.prog_p4 = null
|
||||
switch(src.func)
|
||||
if("dna_trun")
|
||||
if (src.data)
|
||||
src.prog_p1 = copytext(src.data, 1, 2)
|
||||
src.prog_p2 = text2num(src.data)
|
||||
src.prog_p3 = src.special
|
||||
src.status = "dna_trun"
|
||||
src.temp = "Executing trunication function on occupant."
|
||||
else
|
||||
src.temp = "No data implanted in core memory."
|
||||
src.status = null
|
||||
if("dna_scan")
|
||||
if (src.special)
|
||||
if (src.scan)
|
||||
if (istype(M, /mob))
|
||||
switch(src.special)
|
||||
if("UI")
|
||||
src.temp = text("Scan Complete:<BR>Data downloaded to disk!<BR>Unique Identifier: []", M.primary.uni_identity)
|
||||
src.scan.data = M.primary.uni_identity
|
||||
if("SE")
|
||||
src.temp = text("Scan Complete:<BR>Data downloaded to disk!<BR>Structural Enzymes: []", M.primary.struc_enzyme)
|
||||
src.scan.data = M.primary.struc_enzyme
|
||||
if("UE")
|
||||
src.temp = text("Scan Complete:<BR>Data downloaded to disk!<BR>Used Enzynmes: []", M.primary.use_enzyme)
|
||||
src.scan.data = M.primary.use_enzyme
|
||||
if("SI")
|
||||
src.temp = text("Scan Complete:<BR>Data downloaded to disk!<BR>Species Identifier: []", M.primary.spec_identity)
|
||||
src.scan.data = M.primary.spec_identity
|
||||
else
|
||||
else
|
||||
src.temp = "No occupant to scan!"
|
||||
else
|
||||
src.temp = "Error: No disk to upload data to."
|
||||
else
|
||||
src.temp = "Error: Function program errors."
|
||||
src.status = null
|
||||
if("dna_replace")
|
||||
if ((src.data && src.special))
|
||||
src.prog_p1 = src.special
|
||||
src.prog_p2 = src.data
|
||||
src.status = "dna_replace"
|
||||
src.temp = "Executing repalcement function on occupant."
|
||||
else
|
||||
src.temp = "Error: No DNA data loaded into core or function program errors."
|
||||
src.status = null
|
||||
if("dna_add")
|
||||
if ((src.data && src.special))
|
||||
src.prog_p1 = src.special
|
||||
src.prog_p2 = src.data
|
||||
src.status = "dna_add"
|
||||
src.temp = "Executing addition function on occupant."
|
||||
else
|
||||
src.temp = "Error: No DNA data loaded into core or function program errors."
|
||||
src.status = null
|
||||
else
|
||||
src.temp = "Cannot execute program!"
|
||||
src.status = null
|
||||
else
|
||||
if (src.status == "dna_trun")
|
||||
if (istype(M, /mob))
|
||||
var/t = null
|
||||
switch(src.prog_p3)
|
||||
if("UI")
|
||||
t = M.primary.uni_identity
|
||||
if("SE")
|
||||
t = M.primary.struc_enzyme
|
||||
if("UE")
|
||||
t = M.primary.use_enzyme
|
||||
if("SI")
|
||||
t = M.primary.spec_identity
|
||||
else
|
||||
if (!( src.prog_p4 ))
|
||||
switch(src.prog_p1)
|
||||
if("a")
|
||||
src.prog_p4 = length(t)
|
||||
if("b")
|
||||
src.prog_p4 = 1
|
||||
else
|
||||
else
|
||||
if (src.prog_p1 == "a")
|
||||
src.prog_p4--
|
||||
else
|
||||
if (src.prog_p1 == "b")
|
||||
src.prog_p4--
|
||||
switch(src.prog_p1)
|
||||
if("a")
|
||||
if (src.prog_p4 <= 0)
|
||||
src.temp = "Trunication complete"
|
||||
src.status = null
|
||||
else
|
||||
t = copytext(t, 1, length(t))
|
||||
src.temp = text("Trunicating []'s DNA sequence...<BR>[]<BR>Status: [] units left.<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, src.prog_p4, src)
|
||||
if("b")
|
||||
if (src.prog_p4 <= 0)
|
||||
src.temp = "Trunication complete"
|
||||
src.status = null
|
||||
else
|
||||
t = copytext(t, 2, length(t) + 1)
|
||||
src.temp = text("Trunicating []'s DNA sequence...<BR>[]<BR>Status: [] units left.<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, src.prog_p4, src)
|
||||
if("c")
|
||||
if (length(t) <= src.prog_p2)
|
||||
src.temp = "Limitation complete"
|
||||
src.status = null
|
||||
else
|
||||
t = copytext(t, 1, length(t))
|
||||
src.temp = text("Limiting []'s DNA sequence...<BR>[]<BR>Status: [] units converting to [] units.<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, length(t), src.prog_p2, src)
|
||||
else
|
||||
if (length(t) <= src.prog_p2)
|
||||
src.temp = "Limitation complete"
|
||||
src.status = null
|
||||
else
|
||||
t = copytext(t, 2, length(t) + 1)
|
||||
src.temp = text("Limiting []'s DNA sequence...<BR>[]<BR>Status: [] units converting to [] units.<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, length(t), src.prog_p2, src)
|
||||
switch(src.prog_p3)
|
||||
if("UI")
|
||||
M.primary.uni_identity = t
|
||||
if("SE")
|
||||
M.primary.struc_enzyme = t
|
||||
if("UE")
|
||||
M.primary.use_enzyme = t
|
||||
if("SI")
|
||||
M.primary.spec_identity = t
|
||||
else
|
||||
else
|
||||
src.temp = "Process terminated due to lack of occupant in DNA chamber."
|
||||
src.status = null
|
||||
else
|
||||
if (src.status == "dna_replace")
|
||||
if (istype(M, /mob))
|
||||
var/t = null
|
||||
switch(src.prog_p1)
|
||||
if("UI")
|
||||
t = M.primary.uni_identity
|
||||
if("SE")
|
||||
t = M.primary.struc_enzyme
|
||||
if("UE")
|
||||
t = M.primary.use_enzyme
|
||||
if("SI")
|
||||
t = M.primary.spec_identity
|
||||
else
|
||||
if (!( src.prog_p4 ))
|
||||
src.prog_p4 = 1
|
||||
else
|
||||
src.prog_p4++
|
||||
if ((src.prog_p4 > length(t) || src.prog_p4 > length(src.prog_p2)))
|
||||
src.temp = "Replacement complete"
|
||||
src.status = null
|
||||
else
|
||||
t = text("[][][]", copytext(t, 1, src.prog_p4), copytext(src.prog_p2, src.prog_p4, src.prog_p4 + 1), (src.prog_p4 < length(t) ? copytext(t, src.prog_p4 + 1, length(t) + 1) : null))
|
||||
src.temp = text("Replacing []'s DNA sequence...<BR>[]<BR>Target: []<BR>Status: At position []<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, src.prog_p2, src.prog_p4, src)
|
||||
switch(src.prog_p1)
|
||||
if("UI")
|
||||
M.primary.uni_identity = t
|
||||
if("SE")
|
||||
M.primary.struc_enzyme = t
|
||||
if("UE")
|
||||
M.primary.use_enzyme = t
|
||||
if("SI")
|
||||
M.primary.spec_identity = t
|
||||
else
|
||||
else
|
||||
src.temp = "Process terminated due to lack of occupant in DNA chamber."
|
||||
src.status = null
|
||||
else
|
||||
if (src.status == "dna_add")
|
||||
if (istype(M, /mob))
|
||||
var/t = null
|
||||
switch(src.prog_p1)
|
||||
if("UI")
|
||||
t = M.primary.uni_identity
|
||||
if("SE")
|
||||
t = M.primary.struc_enzyme
|
||||
if("UE")
|
||||
t = M.primary.use_enzyme
|
||||
if("SI")
|
||||
t = M.primary.spec_identity
|
||||
else
|
||||
if (!( src.prog_p4 ))
|
||||
src.prog_p4 = 1
|
||||
else
|
||||
src.prog_p4++
|
||||
if (src.prog_p4 > length(src.prog_p2))
|
||||
src.temp = "Addition complete"
|
||||
src.status = null
|
||||
else
|
||||
t = text("[][]", t, copytext(src.prog_p2, src.prog_p4, src.prog_p4 + 1))
|
||||
src.temp = text("Adding to []'s DNA sequence...<BR>[]<BR>Adding: []<BR>Position: []<BR><BR><A href='?src=\ref[];abort=1'>Emergency Abort</A>", M.name, t, src.prog_p2, src.prog_p4, src)
|
||||
switch(src.prog_p1)
|
||||
if("UI")
|
||||
M.primary.uni_identity = t
|
||||
if("SE")
|
||||
M.primary.struc_enzyme = t
|
||||
if("UE")
|
||||
M.primary.use_enzyme = t
|
||||
if("SI")
|
||||
M.primary.spec_identity = t
|
||||
else
|
||||
else
|
||||
src.temp = "Process terminated due to lack of occupant in DNA chamber."
|
||||
src.status = null
|
||||
else
|
||||
src.status = null
|
||||
src.temp = "Unknown system error."
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/scan_console/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/scan_console/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/scan_console/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Clear Message</A>", src.temp, src)
|
||||
else
|
||||
if (src.connected)
|
||||
var/mob/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
if (occupant)
|
||||
var/t1
|
||||
switch(occupant.stat)
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
else
|
||||
dat += "The scanner is empty.<BR>"
|
||||
if (!( src.connected.locked ))
|
||||
dat += text("<A href='?src=\ref[];locked=1'>Lock (Unlocked)</A><BR>", src)
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];locked=1'>Unlock (Locked)</A><BR>", src)
|
||||
dat += text("Disk: <A href='?src=\ref[];scan=1'>[]</A><BR>\n[]<BR>\n[]<BR>", src,
|
||||
(src.scan ? text("[]", src.scan.name) : "----------"),
|
||||
(src.scan ? text("<A href='?src=\ref[];u_dat=1'>Upload Data</A>", src) : "No disk to upload"),
|
||||
((src.data || src.func || src.special) ? text("<A href='?src=\ref[];c_dat=1'>Clear Data</A><BR><A href='?src=\ref[];e_dat=1'>Execute Data</A><BR>Function Type: [][]<BR>Data: []", src, src, src.func, (src.special ? text("-[]", src.special) : null), src.data) : "No data uploaded"))
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=scanner'>Close</A>", user)
|
||||
user << browse(dat, "window=scanner;size=400x500")
|
||||
onclose(user, "scanner")
|
||||
return
|
||||
|
||||
/obj/machinery/scan_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["locked"])
|
||||
if ((src.connected && src.connected.occupant))
|
||||
src.connected.locked = !( src.connected.locked )
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/data))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
if (href_list["u_dat"])
|
||||
if ((src.scan && !( src.status )))
|
||||
if ((src.scan.function && src.scan.function != "storage"))
|
||||
src.func = src.scan.function
|
||||
src.special = src.scan.special
|
||||
if (src.scan.data)
|
||||
src.data = src.scan.data
|
||||
else
|
||||
src.temp = "No disk found or core data access lock out!"
|
||||
if (href_list["c_dat"])
|
||||
if (!src.status)
|
||||
src.func = null
|
||||
src.data = null
|
||||
src.special = null
|
||||
else
|
||||
src.temp = "No disk found or core data access lock out!"
|
||||
if (href_list["clear"])
|
||||
src.temp = null
|
||||
if (href_list["abort"])
|
||||
src.status = null
|
||||
if (href_list["e_dat"])
|
||||
if (!( src.status ))
|
||||
src.status = "load"
|
||||
src.temp = "Loading..."
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/allow_drop()
|
||||
return 0
|
||||
|
||||
/obj/machinery/restruct/verb/eject()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/verb/operate()
|
||||
set src in oview(1)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if ((src.occupant && src.occupant.primary))
|
||||
switch(src.occupant.primary.spec_identity)
|
||||
if("5BDFE293BA5500F9FFFD500AAFFE")
|
||||
if (!istype(src.occupant, /mob/living/carbon/human))
|
||||
for(var/obj/O in src.occupant)
|
||||
del(O)
|
||||
|
||||
var/mob/living/carbon/human/O = new /mob/living/carbon/human( src )
|
||||
if(ticker.killer == src.occupant)
|
||||
O.memory = src.occupant.memory
|
||||
ticker.killer = O
|
||||
var/mob/M = src.occupant
|
||||
O.start = 1
|
||||
O.primary = M.primary
|
||||
M.primary = null
|
||||
var/t1 = hex2num(copytext(O.primary.uni_identity, 25, 28))
|
||||
if (t1 < 125)
|
||||
O.gender = MALE
|
||||
else
|
||||
O.gender = FEMALE
|
||||
M << "Genetic Transversal Complete!"
|
||||
if (M.client)
|
||||
M << "Transferring..."
|
||||
M.client.mob = O
|
||||
O << "Neural Sequencing Complete!"
|
||||
O.loc = src
|
||||
src.occupant = O
|
||||
//M = null
|
||||
del(M)
|
||||
src.occupant = O
|
||||
src.occupant << "Done!"
|
||||
if("2B6696D2B127E5A4")
|
||||
if (!istype(src.occupant, /mob/living/carbon/monkey))
|
||||
for(var/obj/O in src.occupant)
|
||||
del(O)
|
||||
var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey(src)
|
||||
if(ticker.killer == src.occupant)
|
||||
O.memory = src.occupant.memory
|
||||
ticker.killer = O
|
||||
var/mob/M = src.occupant
|
||||
O.start = 1
|
||||
O.primary = M.primary
|
||||
M.primary = null
|
||||
M << "Genetic Transversal Complete!"
|
||||
if (M.client)
|
||||
M << "Transferring..."
|
||||
M.client.mob = O
|
||||
O << "Neural Sequencing Complete!"
|
||||
O.loc = src
|
||||
O << "Genetic Transversal Complete!"
|
||||
src.occupant = O
|
||||
del(M)
|
||||
O.name = text("monkey ([])", copytext(md5(src.occupant.primary.uni_identity), 2, 6))
|
||||
src.occupant << "Done!"
|
||||
else
|
||||
if (istype(src.occupant, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src.occupant
|
||||
|
||||
var/speak = (length(H.primary.struc_enzyme) >= 25 ? hex2num(copytext(H.primary.struc_enzyme, 22, 25)) : 9999)
|
||||
var/ears = (length(H.primary.struc_enzyme) >= 10 ? hex2num(copytext(H.primary.struc_enzyme, 7, 10)) : 9999)
|
||||
var/vision = (length(H.primary.struc_enzyme) >= 16 ? hex2num(copytext(H.primary.struc_enzyme, 13, 16)) : 1)
|
||||
var/mental1 = (length(H.primary.struc_enzyme) >= 31 ? hex2num(copytext(H.primary.struc_enzyme, 28, 31)) : 1)
|
||||
var/mental2 = (length(H.primary.struc_enzyme) >= 28 ? hex2num(copytext(H.primary.struc_enzyme, 25, 28)) : 1)
|
||||
var/speak2 = (length(H.primary.struc_enzyme) >= 22 ? hex2num(copytext(H.primary.struc_enzyme, 19, 22)) : 1)
|
||||
H.sdisabilities = 0
|
||||
H.disabilities = 0
|
||||
if (speak < 3776)
|
||||
H.disabilities = H.disabilities | 4
|
||||
else
|
||||
if (speak > 3776)
|
||||
H.sdisabilities = H.sdisabilities | 2
|
||||
if (speak2 < 2640)
|
||||
H.disabilities = H.disabilities | 16
|
||||
if (ears > 3226)
|
||||
H.sdisabilities = H.sdisabilities | 4
|
||||
if (vision < 1447)
|
||||
H.sdisabilities = H.sdisabilities | 1
|
||||
else
|
||||
if (vision > 1447)
|
||||
H.disabilities = H.disabilities | 1
|
||||
if (mental1 < 1742)
|
||||
H.disabilities = H.disabilities | 2
|
||||
if (mental2 < 1452)
|
||||
H.disabilities = H.disabilities | 8
|
||||
var/t1 = null
|
||||
if (length(H.primary.uni_identity) >= 20)
|
||||
t1 = copytext(H.primary.uni_identity, 19, 21)
|
||||
if (hex2num(t1) > 127)
|
||||
H.gender = FEMALE
|
||||
else
|
||||
H.gender = MALE
|
||||
else
|
||||
H.gender = NEUTER
|
||||
if (length(H.primary.uni_identity) >= 18)
|
||||
t1 = copytext(H.primary.uni_identity, 17, 19)
|
||||
H.ns_tone = hex2num(t1)
|
||||
H.ns_tone = -H.ns_tone + 35
|
||||
else
|
||||
H.ns_tone = 1
|
||||
H.ns_tone = -H.ns_tone + 35
|
||||
if (length(H.primary.uni_identity) >= 16)
|
||||
t1 = copytext(H.primary.uni_identity, 15, 17)
|
||||
H.b_eyes = hex2num(t1)
|
||||
else
|
||||
H.b_eyes = 255
|
||||
if (length(H.primary.uni_identity) >= 14)
|
||||
t1 = copytext(H.primary.uni_identity, 13, 15)
|
||||
H.g_eyes = hex2num(t1)
|
||||
else
|
||||
H.g_eyes = 255
|
||||
if (length(H.primary.uni_identity) >= 12)
|
||||
t1 = copytext(H.primary.uni_identity, 11, 13)
|
||||
H.r_eyes = hex2num(t1)
|
||||
else
|
||||
H.r_eyes = 255
|
||||
if (length(H.primary.uni_identity) >= 10)
|
||||
t1 = copytext(H.primary.uni_identity, 9, 11)
|
||||
H.nb_hair = hex2num(t1)
|
||||
else
|
||||
H.nb_hair = 255
|
||||
if (length(H.primary.uni_identity) >= 8)
|
||||
t1 = copytext(H.primary.uni_identity, 7, 9)
|
||||
H.ng_hair = hex2num(t1)
|
||||
else
|
||||
H.ng_hair = 255
|
||||
if (length(H.primary.uni_identity) >= 6)
|
||||
t1 = copytext(H.primary.uni_identity, 5, 7)
|
||||
H.nr_hair = hex2num(t1)
|
||||
else
|
||||
H.nr_hair = 255
|
||||
H.r_hair = H.nr_hair
|
||||
H.g_hair = H.ng_hair
|
||||
H.b_hair = H.nb_hair
|
||||
H.s_tone = H.ns_tone
|
||||
H.update_face()
|
||||
H.update_body()
|
||||
|
||||
if (reg_dna[H.primary.uni_identity])
|
||||
H.real_name = reg_dna[H.primary.uni_identity]
|
||||
else
|
||||
var/i
|
||||
while (!i)
|
||||
var/randomname
|
||||
if (src.gender == MALE)
|
||||
randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names)))
|
||||
else
|
||||
randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names)))
|
||||
if (findname(randomname))
|
||||
continue
|
||||
else
|
||||
H.real_name = randomname
|
||||
i++
|
||||
reg_dna[H.primary.uni_identity] = H.real_name
|
||||
H << text("\red <B>Your name is now [].</B>", H.real_name)
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/verb/move_inside()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
usr.stop_pulling()
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "restruct_1"
|
||||
for(var/obj/O in src)
|
||||
//O = null
|
||||
del(O)
|
||||
//Foreach goto(124)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/attackby(obj/item/weapon/grab/G as obj, user as mob)
|
||||
if(..())
|
||||
return
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The machine is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "restruct_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(30)
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
src.icon_state = "restruct_0"
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/restruct/blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
|
||||
/* NOTES:
|
||||
|
||||
This system could be expanded to migrate all of our current mutations to. Maybe.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* /datum/mutations :
|
||||
*
|
||||
* A /datum representation of "hidden" mutations.
|
||||
*
|
||||
*/
|
||||
/datum/mutations
|
||||
|
||||
var/list/requirements = list() // list of randomly-genned requirements
|
||||
var/required = 1 // the number of requirements to generate
|
||||
|
||||
var/list/races = list("Human") // list of races the mutation effect
|
||||
|
||||
proc/get_mutation(var/mob/living/carbon/M) // Called when check_mutation() is successful
|
||||
..()
|
||||
|
||||
proc/check_mutation(var/mob/living/carbon/M) // Called in dna.dm, when a target's SE is modified
|
||||
|
||||
if(! ("all" in races)) // "all" means it affects everyone!
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(! ("Human" in races))
|
||||
return
|
||||
if(istype(M, /mob/living/carbon/monkey))
|
||||
if(! ("monkey" in races))
|
||||
return
|
||||
// TODO: add more races maybe??
|
||||
|
||||
|
||||
var/passes = 0
|
||||
for(var/datum/mutationreq/require in requirements)
|
||||
|
||||
var/se_block[] = getblockbuffer(M.dna.struc_enzymes, require.block, 3) // focus onto the block
|
||||
if(se_block.len == 3) // we want to make sure there are exactly 3 entries
|
||||
|
||||
if(se_block[require.subblock] == require.reqID)
|
||||
|
||||
passes++
|
||||
|
||||
if(passes == required) // all requirements met
|
||||
get_mutation(M)
|
||||
|
||||
|
||||
Lasereyes
|
||||
/*
|
||||
Lets you shoot laser beams through your eyes. Fancy!
|
||||
*/
|
||||
required = 2
|
||||
|
||||
get_mutation(var/mob/living/carbon/M)
|
||||
M << "\blue You feel a searing heat inside your eyes!"
|
||||
M.mutations.Add(LASER)
|
||||
|
||||
Healing
|
||||
/*
|
||||
Lets you heal other people, and yourself. But it doesn't let you heal dead people.
|
||||
*/
|
||||
required = 2
|
||||
|
||||
get_mutation(var/mob/living/carbon/M)
|
||||
M << "\blue You feel a pleasant warmth pulse throughout your body..."
|
||||
M.mutations.Add(HEAL)
|
||||
|
||||
/* /datum/mutationreq :
|
||||
*
|
||||
* A /datum representation of a requirement in order for a mutation to happen.
|
||||
*
|
||||
*/
|
||||
|
||||
/datum/mutationreq
|
||||
var/block // The block to read
|
||||
var/subblock // The sub-block to read
|
||||
var/reqID // The required hexadecimal identifier to be equal to the sub-block being read.
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
HEY: If you want to be able to get superpowers easily just uncomment this shit.
|
||||
mob/verb/checkmuts()
|
||||
for(var/datum/mutations/mut in global_mutations)
|
||||
|
||||
for(var/datum/mutationreq/R in mut.requirements)
|
||||
src << "Block: [R.block]"
|
||||
src << "Sub-Block: [R.subblock]"
|
||||
src << "Required ID: [R.reqID]"
|
||||
src << ""
|
||||
|
||||
mob/verb/editSE(t as text)
|
||||
src:dna:struc_enzymes = t
|
||||
domutcheck(src)
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,162 @@
|
||||
// Currently only used to control /obj/machinery/inlet/filter
|
||||
// todo: expand to vent control as well?
|
||||
|
||||
/obj/machinery/filter_control/New()
|
||||
..()
|
||||
spawn(5) //wait for world
|
||||
for(var/obj/machinery/inlet/filter/F in machines)
|
||||
if(F.control == src.control)
|
||||
F.f_mask = src.f_mask
|
||||
desc = "A remote control for a filter: [control]"
|
||||
|
||||
/obj/machinery/filter_control/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/filter_control/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/filter_control/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/detective_scanner))
|
||||
return ..()
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
src.add_fingerprint(user)
|
||||
user.show_message(text("\red Now [] the panel...", (src.locked) ? "unscrewing" : "reattaching"), 1)
|
||||
sleep(30)
|
||||
src.locked =! src.locked
|
||||
src.updateicon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wirecutters) && !src.locked)
|
||||
stat ^= BROKEN
|
||||
src.add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] has []activated []!", user, (stat&BROKEN) ? "de" : "re", src), 1)
|
||||
src.updateicon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
emagged++
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] has shorted out the []'s access system with an electromagnetic card!", user, src), 1)
|
||||
src.updateicon()
|
||||
return src.attack_hand(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/filter_control/process()
|
||||
if(!(stat & NOPOWER))
|
||||
use_power(5,ENVIRON)
|
||||
AutoUpdateAI(src)
|
||||
src.updateUsrDialog()
|
||||
src.updateicon()
|
||||
|
||||
/obj/machinery/filter_control/attack_hand(mob/user as mob)
|
||||
if(stat & NOPOWER)
|
||||
user << browse(null, "window=filter_control")
|
||||
user.machine = null
|
||||
return
|
||||
if(user.stat || user.lying)
|
||||
return
|
||||
if ((get_dist(src, user) > 1 || !istype(src.loc, /turf)) && !istype(user, /mob/living/silicon/ai))
|
||||
return 0
|
||||
|
||||
var/list/gases = list("O2", "N2", "Plasma", "CO2", "N2O")
|
||||
var/dat
|
||||
user.machine = src
|
||||
|
||||
var/IGoodConnection = 0
|
||||
var/IBadConnection = 0
|
||||
|
||||
for(var/obj/machinery/inlet/filter/F in machines)
|
||||
if((F.control == src.control) && !(F.stat && (NOPOWER|BROKEN)))
|
||||
IGoodConnection++
|
||||
else if(F.control == src.control)
|
||||
IBadConnection++
|
||||
var/ITotalConnections = IGoodConnection+IBadConnection
|
||||
|
||||
if(ITotalConnections && !(stat & BROKEN)) //ugly
|
||||
dat += "Connection status: Inlets:[ITotalConnections]/[IGoodConnection]<BR>\n Control ID: [control]<BR><BR>\n"
|
||||
else
|
||||
dat += "<font color=red>No Connections Detected!</font><BR>\n Control ID: [control]<BR>\n"
|
||||
if(!stat & BROKEN)
|
||||
for (var/i = 1; i <= gases.len; i++)
|
||||
dat += "[gases[i]]: <A HREF='?src=\ref[src];tg=[1 << (i - 1)]'>[(src.f_mask & 1 << (i - 1)) ? "Siphoning" : "Passing"]</A><BR>\n"
|
||||
else
|
||||
dat += "<big><font color='red'>Warning! Severe Internal Memory Corruption!</big><BR>\n<BR>\nConsult a qualified station technician immediately!</font><BR>\n"
|
||||
dat += "<BR>\n<small>Error codes: 0x0000001E 0x0000007B</small><BR>\n"
|
||||
|
||||
dat += "<BR>\n<A href='?src=\ref[src];close=1'>Close</A><BR>\n"
|
||||
user << browse(dat, "window=filter_control;size=300x225")
|
||||
onclose(user, "filter_control")
|
||||
/obj/machinery/filter_control/Topic(href, href_list)
|
||||
if (href_list["close"])
|
||||
usr << browse(null, "window=filter_control;")
|
||||
usr.machine = null
|
||||
return //Who cares if we're dead or whatever let us close the fucking window
|
||||
if(..())
|
||||
return
|
||||
if ((((get_dist(src, usr) <= 1 || usr.telekinesis == 1) || istype(usr, /mob/living/silicon/ai)) && istype(src.loc, /turf)))
|
||||
usr.machine = src
|
||||
if (src.allowed(usr) || src.emagged && !(stat & BROKEN))
|
||||
if (href_list["tg"]) //someone modified the html so I added a check here
|
||||
// toggle gas
|
||||
src.f_mask ^= text2num(href_list["tg"])
|
||||
for(var/obj/machinery/inlet/filter/FI in machines)
|
||||
if(FI.control == src.control)
|
||||
FI.f_mask ^= text2num(href_list["tg"])
|
||||
else
|
||||
usr.see("\red Access Denied ([src.name] operation restricted to authorized atmospheric technicians.)")
|
||||
AutoUpdateAI(src)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=filter_control")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
/obj/machinery/filter_control/proc/updateicon()
|
||||
overlays.Cut()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "filter_control-nopower"
|
||||
return
|
||||
icon_state = "filter_control"
|
||||
if(src.locked && (stat & BROKEN))
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control00")
|
||||
return
|
||||
else if(!src.locked)
|
||||
icon_state = "filter_control-unlocked"
|
||||
if(stat & BROKEN)
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control-wirecut")
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control00")
|
||||
return
|
||||
|
||||
var/GoodConnection = 0
|
||||
for(var/obj/machinery/inlet/filter/F in machines)
|
||||
if((F.control == src.control) && !(F.stat && (NOPOWER|BROKEN)))
|
||||
GoodConnection++
|
||||
break
|
||||
|
||||
if(GoodConnection && src.f_mask)
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control1")
|
||||
else if(GoodConnection)
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control10")
|
||||
else if(src.f_mask)
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control0")
|
||||
else
|
||||
overlays += image('icons/obj/stationobjs.dmi', "filter_control00")
|
||||
|
||||
if (src.f_mask & (GAS_N2O|GAS_PL))
|
||||
src.overlays += image('icons/obj/stationobjs.dmi', "filter_control-tox")
|
||||
if (src.f_mask & GAS_O2)
|
||||
src.overlays += image('icons/obj/stationobjs.dmi', "filter_control-o2")
|
||||
if (src.f_mask & GAS_N2)
|
||||
src.overlays += image('icons/obj/stationobjs.dmi', "filter_control-n2")
|
||||
if (src.f_mask & GAS_CO2)
|
||||
src.overlays += image('icons/obj/stationobjs.dmi', "filter_control-co2")
|
||||
return
|
||||
|
||||
/obj/machinery/filter_control/power_change()
|
||||
if(powered(ENVIRON))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
spawn(rand(1,15))
|
||||
src.updateicon()
|
||||
return
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
THAT STUPID GAME KIT
|
||||
Which I am commenting out /N
|
||||
*/
|
||||
/*
|
||||
/obj/item/weapon/game_kit/New()
|
||||
src.board_stat = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
|
||||
src.selected = "CR"
|
||||
|
||||
/obj/item/weapon/game_kit/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/weapon/game_kit/MouseDrop(mob/user as mob)
|
||||
if (user == usr && !usr.restrained() && !usr.stat && (usr.contents.Find(src) || in_range(src, usr)))
|
||||
if (usr.hand)
|
||||
if (!usr.l_hand)
|
||||
spawn (0)
|
||||
src.attack_hand(usr, 1, 1)
|
||||
else
|
||||
if (!usr.r_hand)
|
||||
spawn (0)
|
||||
src.attack_hand(usr, 0, 1)
|
||||
|
||||
/obj/item/weapon/game_kit/proc/update()
|
||||
var/dat = text("<CENTER><B>Game Board</B></CENTER><BR><a href='?src=\ref[];mode=hia'>[]</a> <a href='?src=\ref[];mode=remove'>remove</a><HR><table width= 256 border= 0 height= 256 cellspacing= 0 cellpadding= 0 >", src, (src.selected ? text("Selected: []", src.selected) : "Nothing Selected"), src)
|
||||
for (var/y = 1 to 8)
|
||||
dat += "<tr>"
|
||||
|
||||
for (var/x = 1 to 8)
|
||||
var/color = (y + x) % 2 ? "#ffffff" : "#999999"
|
||||
var/piece = copytext(src.board_stat, ((y - 1) * 8 + x) * 2 - 1, ((y - 1) * 8 + x) * 2 + 1)
|
||||
|
||||
dat += "<td>"
|
||||
dat += "<td style='background-color:[color]' width=32 height=32>"
|
||||
if (piece != "BB")
|
||||
dat += "<a href='?src=\ref[src];s_board=[x] [y]'><img src='[src.base_url]/board_[piece].png' width=32 height=32 border=0>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];s_board=[x] [y]'><img src='[src.base_url]/board_none.png' width=32 height=32 border=0>"
|
||||
dat += "</td>"
|
||||
|
||||
dat += "</tr>"
|
||||
|
||||
dat += "</table><HR><B>Chips:</B><BR>"
|
||||
for (var/piece in list("CB", "CR"))
|
||||
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[src.base_url]/board_[piece].png' width=32 height=32 border=0></a>"
|
||||
|
||||
dat += "<HR><B>Chess pieces:</B><BR>"
|
||||
for (var/piece in list("WP", "WK", "WQ", "WI", "WN", "WR"))
|
||||
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[src.base_url]/board_[piece].png' width=32 height=32 border=0></a>"
|
||||
dat += "<br>"
|
||||
for (var/piece in list("BP", "BK", "BQ", "BI", "BN", "BR"))
|
||||
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[src.base_url]/board_[piece].png' width=32 height=32 border=0></a>"
|
||||
src.data = dat
|
||||
|
||||
/obj/item/weapon/game_kit/attack_hand(mob/user as mob, unused, flag)
|
||||
|
||||
if (flag)
|
||||
return ..()
|
||||
else
|
||||
user.machine = src
|
||||
if (!( src.data ))
|
||||
update()
|
||||
user << browse(src.data, "window=game_kit")
|
||||
onclose(user, "game_kit")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/game_kit/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
|
||||
if (usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))
|
||||
if (href_list["s_piece"])
|
||||
src.selected = href_list["s_piece"]
|
||||
else if (href_list["mode"])
|
||||
if (href_list["mode"] == "remove")
|
||||
src.selected = "remove"
|
||||
else
|
||||
src.selected = null
|
||||
else if (href_list["s_board"])
|
||||
if (!( src.selected ))
|
||||
src.selected = href_list["s_board"]
|
||||
else
|
||||
var/tx = text2num(copytext(href_list["s_board"], 1, 2))
|
||||
var/ty = text2num(copytext(href_list["s_board"], 3, 4))
|
||||
if ((copytext(src.selected, 2, 3) == " " && length(src.selected) == 3))
|
||||
var/sx = text2num(copytext(src.selected, 1, 2))
|
||||
var/sy = text2num(copytext(src.selected, 3, 4))
|
||||
var/place = ((sy - 1) * 8 + sx) * 2 - 1
|
||||
src.selected = copytext(src.board_stat, place, place + 2)
|
||||
if (place == 1)
|
||||
src.board_stat = text("BB[]", copytext(src.board_stat, 3, 129))
|
||||
else
|
||||
if (place == 127)
|
||||
src.board_stat = text("[]BB", copytext(src.board_stat, 1, 127))
|
||||
else
|
||||
if (place)
|
||||
src.board_stat = text("[]BB[]", copytext(src.board_stat, 1, place), copytext(src.board_stat, place + 2, 129))
|
||||
place = ((ty - 1) * 8 + tx) * 2 - 1
|
||||
if (place == 1)
|
||||
src.board_stat = text("[][]", src.selected, copytext(src.board_stat, 3, 129))
|
||||
else
|
||||
if (place == 127)
|
||||
src.board_stat = text("[][]", copytext(src.board_stat, 1, 127), src.selected)
|
||||
else
|
||||
if (place)
|
||||
src.board_stat = text("[][][]", copytext(src.board_stat, 1, place), src.selected, copytext(src.board_stat, place + 2, 129))
|
||||
src.selected = null
|
||||
else
|
||||
if (src.selected == "remove")
|
||||
var/place = ((ty - 1) * 8 + tx) * 2 - 1
|
||||
if (place == 1)
|
||||
src.board_stat = text("BB[]", copytext(src.board_stat, 3, 129))
|
||||
else
|
||||
if (place == 127)
|
||||
src.board_stat = text("[]BB", copytext(src.board_stat, 1, 127))
|
||||
else
|
||||
if (place)
|
||||
src.board_stat = text("[]BB[]", copytext(src.board_stat, 1, place), copytext(src.board_stat, place + 2, 129))
|
||||
else
|
||||
if (length(src.selected) == 2)
|
||||
var/place = ((ty - 1) * 8 + tx) * 2 - 1
|
||||
if (place == 1)
|
||||
src.board_stat = text("[][]", src.selected, copytext(src.board_stat, 3, 129))
|
||||
else
|
||||
if (place == 127)
|
||||
src.board_stat = text("[][]", copytext(src.board_stat, 1, 127), src.selected)
|
||||
else
|
||||
if (place)
|
||||
src.board_stat = text("[][][]", copytext(src.board_stat, 1, place), src.selected, copytext(src.board_stat, place + 2, 129))
|
||||
src.add_fingerprint(usr)
|
||||
update()
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
*/
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
/datum/game_mode/ctf
|
||||
name = "ctf"
|
||||
config_tag = "ctf"
|
||||
|
||||
/datum/game_mode/ctf/announce()
|
||||
world << "<B>The current game mode is - Capture the Flag!</B>"
|
||||
world << "<B>Capture the other teams flag and bring it back to your base!</B>"
|
||||
world << "Respawn is on"
|
||||
|
||||
/datum/game_mode/ctf/pre_setup()
|
||||
|
||||
config.allow_ai = 0
|
||||
var/list/mobs = list()
|
||||
var/total_mobs
|
||||
for(var/mob/living/carbon/human/M in world)
|
||||
if (M.client)
|
||||
mobs += M
|
||||
total_mobs++
|
||||
|
||||
var/obj/R = locate("landmark*Red-Spawn")
|
||||
var/obj/G = locate("landmark*Green-Spawn")
|
||||
|
||||
var/mob_check
|
||||
for(var/mob/living/carbon/human/M in mobs)
|
||||
if(!M)
|
||||
continue
|
||||
mob_check++
|
||||
if(mob_check <= total_mobs/2) //add to red team else to green
|
||||
spawn()
|
||||
if(M.client)
|
||||
M << "You are in the Red Team!"
|
||||
del(M.wear_suit)
|
||||
M.w_uniform = new /obj/item/clothing/under/color/red(M)
|
||||
M.w_uniform.layer = 20
|
||||
del(M.shoes)
|
||||
M.wear_suit = new /obj/item/clothing/suit/armor/tdome/red(M)
|
||||
M.wear_suit.layer = 20
|
||||
M.shoes = new /obj/item/clothing/shoes/black(M)
|
||||
M.shoes.layer = 20
|
||||
M.wear_mask = new /obj/item/clothing/mask/gas/emergency(M)
|
||||
M.wear_mask.layer = 20
|
||||
M.gloves = new /obj/item/clothing/gloves/swat(M)
|
||||
M.gloves.layer = 20
|
||||
M.glasses = new /obj/item/clothing/glasses/thermal(M)
|
||||
M.glasses.layer = 20
|
||||
var/obj/item/device/radio/headset/H = new /obj/item/device/radio/headset(M)
|
||||
H.set_frequency(1465)
|
||||
M.w_radio = H
|
||||
M.w_radio.layer = 20
|
||||
var/obj/item/weapon/tank/air/O = new /obj/item/weapon/tank/air(M)
|
||||
M.back = O
|
||||
M.back.layer = 20
|
||||
M.internal = O
|
||||
|
||||
del(M.wear_id)
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID card (Red Team)"
|
||||
W.access = access_red
|
||||
W.assignment = "Red Team"
|
||||
W.registered_name = M.real_name
|
||||
M.wear_id = W
|
||||
M.wear_id.layer = 20
|
||||
if(R)
|
||||
M.loc = R.loc
|
||||
else
|
||||
world << "No red team spawn point detected"
|
||||
M.client.team = "Red"
|
||||
else
|
||||
spawn()
|
||||
if(M.client)
|
||||
M << "You are in the Green Team!"
|
||||
del(M.wear_suit)
|
||||
M.w_uniform = new /obj/item/clothing/under/color/green(M)
|
||||
M.w_uniform.layer = 20
|
||||
del(M.shoes)
|
||||
M.wear_suit = new /obj/item/clothing/suit/armor/tdome/green(M)
|
||||
M.wear_suit.layer = 20
|
||||
M.shoes = new /obj/item/clothing/shoes/black(M)
|
||||
M.shoes.layer = 20
|
||||
M.wear_mask = new /obj/item/clothing/mask/gas/emergency(M)
|
||||
M.wear_mask.layer = 20
|
||||
M.gloves = new /obj/item/clothing/gloves/swat(M)
|
||||
M.gloves.layer = 20
|
||||
M.glasses = new /obj/item/clothing/glasses/thermal(M)
|
||||
M.glasses.layer = 20
|
||||
var/obj/item/device/radio/headset/H = new /obj/item/device/radio/headset(M)
|
||||
H.set_frequency(1449)
|
||||
M.w_radio = H
|
||||
M.w_radio.layer = 20
|
||||
var/obj/item/weapon/tank/air/O = new /obj/item/weapon/tank/air(M)
|
||||
M.back = O
|
||||
M.back.layer = 20
|
||||
M.internal = O
|
||||
|
||||
del(M.wear_id)
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID card (Green Team)"
|
||||
W.access = access_green
|
||||
W.assignment = "Green Team"
|
||||
W.registered_name = M.real_name
|
||||
M.wear_id = W
|
||||
M.wear_id.layer = 20
|
||||
if(G)
|
||||
M.loc = G.loc
|
||||
else
|
||||
world << "No green team spawn point detected"
|
||||
M.client.team = "Green"
|
||||
|
||||
|
||||
/datum/game_mode/ctf/post_setup()
|
||||
abandon_allowed = 1
|
||||
setup_game()
|
||||
|
||||
spawn (50)
|
||||
var/obj/L = locate("landmark*Red-Flag")
|
||||
if (L)
|
||||
new /obj/item/weapon/ctf_flag/red(L.loc)
|
||||
else
|
||||
world << "No red flag spawn point detected"
|
||||
|
||||
L = locate("landmark*Green-Flag")
|
||||
if (L)
|
||||
new /obj/item/weapon/ctf_flag/green(L.loc)
|
||||
else
|
||||
world << "No green flag spawn point detected"
|
||||
|
||||
L = locate("landmark*The-Red-Team")
|
||||
if (L)
|
||||
new /obj/machinery/red_injector(L.loc)
|
||||
else
|
||||
world << "No red team spawn injector point detected"
|
||||
|
||||
L = locate("landmark*The-Green-Team")
|
||||
if (L)
|
||||
new /obj/machinery/green_injector(L.loc)
|
||||
else
|
||||
world << "No green team injector spawn point detected"
|
||||
..()
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,139 @@
|
||||
/obj/item/weapon/ctf_flag
|
||||
name = "Flag"
|
||||
desc = "Its a flag"
|
||||
w_class = 5
|
||||
icon = 'flags.dmi'
|
||||
icon_state = "flag_neutral"
|
||||
item_state = "paper"
|
||||
|
||||
/obj/item/weapon/ctf_flag/red
|
||||
name = "The Red Flag"
|
||||
desc = "Catch dat fukken flag"
|
||||
icon_state = "flag_red"
|
||||
|
||||
/obj/item/weapon/ctf_flag/green
|
||||
name = "The Green Flag"
|
||||
desc = "Catch dat fukken flag"
|
||||
icon_state = "flag_green"
|
||||
|
||||
/obj/item/weapon/ctf_flag/New()
|
||||
..()
|
||||
spawn(200)
|
||||
process()
|
||||
return
|
||||
|
||||
/obj/item/weapon/ctf_flag/process()
|
||||
if(istype(src, /obj/item/weapon/ctf_flag/green))
|
||||
var/obj/L = locate("landmark*Green-Flag")
|
||||
if(locate("landmark*Green-Flag", src))
|
||||
spawn(200)
|
||||
process()
|
||||
return
|
||||
else if(!src.check_if_equipped() && L)
|
||||
new /obj/item/weapon/ctf_flag/green(L.loc)
|
||||
del(src)
|
||||
if(istype(src, /obj/item/weapon/ctf_flag/red))
|
||||
var/obj/L = locate("landmark*Red-Flag")
|
||||
if(locate("landmark*Red-Flag", src))
|
||||
spawn(200)
|
||||
process()
|
||||
return
|
||||
else if(!src.check_if_equipped() && L)
|
||||
new /obj/item/weapon/ctf_flag/red(L.loc)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/ctf_flag/proc/check_if_equipped()
|
||||
var/equipped = 0
|
||||
for(var/mob/M in living_mob_list)
|
||||
if(M &&!M.stat)
|
||||
var/list/L = M.get_contents()
|
||||
if(src in L)
|
||||
equipped = 1
|
||||
break
|
||||
return equipped
|
||||
|
||||
/obj/machinery/red_injector
|
||||
name = "Red Team Flag Injector"
|
||||
desc = "Insert flag here"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/score = 0
|
||||
var/operating = 0
|
||||
icon = 'flags.dmi'
|
||||
icon_state = "red_injector"
|
||||
/*
|
||||
/obj/machinery/red_injector/ex_act(severity)
|
||||
return
|
||||
|
||||
/obj/machinery/red_injector/attackby(var/obj/item/weapon/ctf_flag/C, mob/user)
|
||||
if(src.operating)
|
||||
user << "Cannot put a flag in right now"
|
||||
return
|
||||
src.operating = 1
|
||||
if(istype(C, /obj/item/weapon/ctf_flag/green))
|
||||
if(locate("landmark*Red-Flag", /obj/item/weapon/ctf_flag/red))
|
||||
src.score++
|
||||
world << "<B>[user.real_name] has scored for the red team!</B>"
|
||||
if(ticker.mode.name == "ctf")
|
||||
ticker.red_score++
|
||||
var/obj/L = locate("landmark*Green-Flag")
|
||||
if (L)
|
||||
del(C)
|
||||
new /obj/item/weapon/ctf_flag/green(L.loc)
|
||||
else
|
||||
world << "No green flag spawn point detected"
|
||||
if(src.score >= 15)
|
||||
world << "<FONT size = 3><B>The Red Team has won!</B></FONT>"
|
||||
world << "<B>They have scored [score] times with the flag!</B>"
|
||||
sleep(300)
|
||||
world.Reboot()
|
||||
else
|
||||
user << "\red You need to have your flag in the beginning position!"
|
||||
else if(istype(C, /obj/item/weapon/ctf_flag/red))
|
||||
world << "<B>[user.real_name] has tried to score with their own flag! Idiot!</B>"
|
||||
src.operating = 0
|
||||
return
|
||||
*/
|
||||
/obj/machinery/green_injector
|
||||
name = "Green Team Flag Injector"
|
||||
desc = "Insert flag here"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/operating = 0
|
||||
var/score = 0
|
||||
icon = 'flags.dmi'
|
||||
icon_state = "green_injector"
|
||||
|
||||
/obj/machinery/green_injector/ex_act(severity)
|
||||
return
|
||||
/*
|
||||
/obj/machinery/green_injector/attackby(var/obj/item/weapon/ctf_flag/C, mob/user)
|
||||
if(src.operating)
|
||||
user << "Cannot put a flag in right now"
|
||||
return
|
||||
src.operating = 1
|
||||
if(istype(C, /obj/item/weapon/ctf_flag/red))
|
||||
if(locate("landmark*Green-Flag", /obj/item/weapon/ctf_flag/green))
|
||||
src.score++
|
||||
world << "<B>[user.real_name] has scored for the green team!</B>"
|
||||
if(ticker.mode.name == "ctf")
|
||||
ticker.green_score++
|
||||
var/obj/L = locate("landmark*Red-Flag")
|
||||
if (L)
|
||||
del(C)
|
||||
new /obj/item/weapon/ctf_flag/red(L.loc)
|
||||
else
|
||||
world << "No red flag spawn point detected"
|
||||
if(src.score >= 15)
|
||||
world << "<FONT size = 3><B>The Green Team has won!</B></FONT>"
|
||||
world << "<B>They have scored [score] times with the flag!</B>"
|
||||
sleep(300)
|
||||
world.Reboot()
|
||||
else
|
||||
user << "\red You need to have your flag in the beginning position!"
|
||||
else if(istype(C, /obj/item/weapon/ctf_flag/green))
|
||||
world << "<B>[user.real_name] has tried to score with their own flag! Idiot!</B>"
|
||||
src.operating = 0
|
||||
return
|
||||
*/
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
/datum/game_mode/deathmatch
|
||||
name = "deathmatch"
|
||||
config_tag = "deathmatch"
|
||||
var/startedat
|
||||
var/const/gamelength = 15 * 600 // 1/10 second
|
||||
|
||||
announce()
|
||||
world << "<B>The current game mode is - Death Commando Deathmatch!</B>"
|
||||
world << "<B>Just kill everyone else. They're gonna try to kill you, after all. Respawning is enabled.</B>"
|
||||
|
||||
post_setup()
|
||||
startedat = world.realtime
|
||||
abandon_allowed = 1
|
||||
setup_game()
|
||||
|
||||
// TODO: DEFERRED Make this massively cleaner. It should hook before spawning, not after.
|
||||
var/list/mobs = list()
|
||||
for(var/mob/living/carbon/human/M in world)
|
||||
if (M.client)
|
||||
mobs += M
|
||||
for(var/mob/living/carbon/human/M in mobs)
|
||||
spawn()
|
||||
if(M.client)
|
||||
for(var/obj/item/weapon/W in list(M.wear_suit, M.w_uniform, M.r_store, M.l_store, M.wear_id, M.belt,
|
||||
M.gloves, M.glasses, M.head, M.ears, M.shoes, M.wear_mask, M.back,
|
||||
M.handcuffed, M.r_hand, M.l_hand))
|
||||
M.u_equip(W)
|
||||
del(W)
|
||||
|
||||
var/randomname = "Killiam Shakespeare"
|
||||
if(commando_names.len)
|
||||
randomname = pick(commando_names)
|
||||
commando_names -= randomname
|
||||
var/newname = input(M,"You are a death commando. Would you like to change your name?", "Character Creation", randomname)
|
||||
if(!length(newname))
|
||||
newname = randomname
|
||||
newname = strip_html(newname,40)
|
||||
|
||||
M.real_name = newname
|
||||
M.name = newname // there are WAY more things than this to change, I'm almost certain
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/suit/swat_suit/death_commando(M), slot_wear_suit)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/death_commando(M), slot_wear_mask)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(M), slot_gloves)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(M), slot_glasses)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(M), slot_l_hand)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/m_pill/cyanide(M), slot_l_store)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/flashbang(M), slot_r_store)
|
||||
|
||||
var/obj/item/weapon/tank/air/O = new(M)
|
||||
M.equip_to_slot_or_del(O, slot_back)
|
||||
M.internal = O
|
||||
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.access = get_all_accesses()
|
||||
W.name = "[newname]'s ID card (Death Commando)"
|
||||
W.assignment = "Death Commando"
|
||||
W.registered_name = newname
|
||||
M.equip_to_slot_or_del(W, slot_wear_id)
|
||||
..()
|
||||
|
||||
check_win()
|
||||
return 1
|
||||
*/
|
||||
@@ -0,0 +1,131 @@
|
||||
#define MONKEY_MODE_RUNNING 0
|
||||
#define MONKEY_MODE_NO_RABID_LEFT 1
|
||||
#define MONKEY_MODE_SHUTTLE_CAPTURED 2
|
||||
#define MONKEY_MODE_SHUTTLE_WITH_HUMANS 3
|
||||
|
||||
#define MONKEY_MODE_MONKEYS 4
|
||||
|
||||
/datum/game_mode/monkey
|
||||
name = "monkey"
|
||||
config_tag = "monkey"
|
||||
var/state = MONKEY_MODE_RUNNING
|
||||
var/list/datum/mind/initial_monkeys = new
|
||||
|
||||
/datum/game_mode/monkey/announce()
|
||||
world << "<B>The current game mode is - Monkey!</B>"
|
||||
world << "<B>Some of your crew members have been infected by a mutageous virus!</B>"
|
||||
world << "<B>Escape on the shuttle but the humans have precedence!</B>"
|
||||
|
||||
/datum/game_mode/monkey/can_start()
|
||||
if (num_players()<2)
|
||||
return 0
|
||||
for(var/mob/new_player/P in player_list)
|
||||
if(P.client && P.ready && !jobban_isbanned(P, "Syndicate"))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/game_mode/monkey/pre_setup()
|
||||
var/list/possible_monkeys = get_players_for_role(BE_MONKEY)
|
||||
|
||||
// stop setup if no possible monkeys
|
||||
if(!possible_monkeys.len)
|
||||
return 0
|
||||
|
||||
var/num_monkeys = MONKEY_MODE_MONKEYS
|
||||
var/num_players = num_players()
|
||||
|
||||
if (num_players<=num_monkeys)
|
||||
num_monkeys = round(num_players/2)
|
||||
|
||||
for(var/j = 1 to num_monkeys)
|
||||
if (!possible_monkeys.len)
|
||||
break
|
||||
var/datum/mind/monkey = pick(possible_monkeys)
|
||||
possible_monkeys-=monkey
|
||||
initial_monkeys += monkey
|
||||
monkey.special_role = "monkey"
|
||||
|
||||
if(!initial_monkeys.len)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/game_mode/monkey/post_setup()
|
||||
spawn (50)
|
||||
for (var/datum/mind/monkey in initial_monkeys)
|
||||
var/mob/living/carbon/human/H = monkey.current
|
||||
var/mob/living/carbon/monkey/new_monkey = H.monkeyize()
|
||||
new_monkey << "<B>Your goal is to capture the entire human civilization and your first target is Centcom. Hijack the shuttle without humans aboard!</B>"
|
||||
|
||||
for (var/mob/living/carbon/monkey/rabid_monkey in mob_list)
|
||||
if (!(rabid_monkey.mind in initial_monkeys) && (!isturf(rabid_monkey.loc) || rabid_monkey.z!=1))
|
||||
continue
|
||||
rabid_monkey.contract_disease(new /datum/disease/jungle_fever,1,0)
|
||||
del(initial_monkeys)
|
||||
..()
|
||||
|
||||
/datum/game_mode/monkey/proc/is_important_monkey(var/mob/living/carbon/monkey/M as mob)
|
||||
var/turf/T = get_turf(M)
|
||||
var/area/A = get_area(M)
|
||||
if(M.stat!=2)
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(istype(D, /datum/disease/jungle_fever) && ( T.z==1 || is_type_in_list(A, centcom_areas)))
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/monkey/check_win()
|
||||
if (state==MONKEY_MODE_SHUTTLE_CAPTURED || state==MONKEY_MODE_SHUTTLE_WITH_HUMANS)
|
||||
return
|
||||
var/infected_count = 0
|
||||
for (var/mob/living/carbon/monkey/rabid_monkey in mob_list)
|
||||
if (is_important_monkey(rabid_monkey))
|
||||
infected_count++
|
||||
if (infected_count==0)
|
||||
state = MONKEY_MODE_NO_RABID_LEFT
|
||||
|
||||
/datum/game_mode/monkey/check_finished()
|
||||
return (emergency_shuttle.location==2) || (state>0)
|
||||
|
||||
/datum/game_mode/monkey/declare_completion()
|
||||
var/monkeywin = 0
|
||||
if (state != MONKEY_MODE_NO_RABID_LEFT)
|
||||
for(var/mob/living/carbon/monkey/monkey_player in mob_list)
|
||||
if (is_important_monkey(monkey_player))
|
||||
var/area/A = get_area(monkey_player)
|
||||
if ( is_type_in_list(A, centcom_areas))
|
||||
monkeywin = 1
|
||||
break
|
||||
|
||||
if(monkeywin)
|
||||
for(var/mob/living/carbon/human/human_player in mob_list)
|
||||
if (human_player.stat != 2)
|
||||
var/area/A = get_area(human_player)
|
||||
if (istype(A, /area/shuttle/escape/centcom))
|
||||
monkeywin = 0
|
||||
break
|
||||
|
||||
if (monkeywin)
|
||||
feedback_set_details("round_end_result","win - monkey win")
|
||||
world << "<FONT size=3 color=red><B>The monkeys have won! Humanity is doomed!</B></FONT>"
|
||||
for (var/mob/living/carbon/human/player in player_list)
|
||||
spawn(rand(0,150))
|
||||
player.monkeyize()
|
||||
sleep(200)
|
||||
else
|
||||
feedback_set_details("round_end_result","loss - crew win")
|
||||
world << "<FONT size=3 color=red><B>The Research Staff has stopped the monkey invasion!</B></FONT>"
|
||||
..()
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/proc/auto_declare_completion_monkey()
|
||||
for(var/mob/living/carbon/monkey/monkey_player in mob_list)
|
||||
for(var/datum/disease/D in monkey_player.viruses)
|
||||
if (istype(D, /datum/disease/jungle_fever) && monkey_player.ckey)
|
||||
world << "<B>[monkey_player.ckey] was played infested [monkey_player]. [monkey_player.stat == 2 ? "(DEAD)" : ""]</B>"
|
||||
return 1
|
||||
|
||||
#undef MONKEY_MODE_RUNNING
|
||||
#undef MONKEY_MODE_NO_RABID_LEFT
|
||||
#undef MONKEY_MODE_SHUTTLE_CAPTURED
|
||||
#undef MONKEY_MODE_SHUTTLE_WITH_HUMANS
|
||||
@@ -0,0 +1,77 @@
|
||||
/datum/game_mode/restructuring
|
||||
name = "Corporate Restructuring"
|
||||
config_tag = "restructuring"
|
||||
/*
|
||||
/datum/game_mode/restructuring/announce()
|
||||
world << "\red <B>GLOBAL TRANSMISSION FROM HEAD OFFICE: A CORPORATE RESTRUCTURING IS TO TAKE PLACE</B>"
|
||||
world << "\red <B>Stay tuned for further news; note that we do care for our employees and any layoffs will be dealt with discretion and compassion</B>"
|
||||
|
||||
|
||||
/datum/game_mode/restructuring/post_setup()
|
||||
setup_game()
|
||||
var/list/mobs = get_mob_list()
|
||||
while (mobs.len == 0)
|
||||
sleep 30
|
||||
mobs = get_mob_list()
|
||||
spawn (120)
|
||||
pick_target()
|
||||
..()
|
||||
|
||||
/datum/game_mode/restructuring/proc/pick_target(who)
|
||||
var/mob/target
|
||||
var/mob/target_desc
|
||||
|
||||
if (!who)
|
||||
target = pick(get_mob_list())
|
||||
target_desc = get_target_desc(target)
|
||||
world << "\red <B>HEAD OFFICE: [target_desc] is accused of attempting to start a Union and is now considered a threat to the station. Terminate the employee immediately.</b>"
|
||||
else
|
||||
target = who
|
||||
target_desc = get_target_desc(target)
|
||||
world << "\red <B>HEAD OFFICE: [target_desc] is accused of fornicating with staff of the same sex. Terminate the employee immediately.</b>"
|
||||
ticker.target = target
|
||||
|
||||
target.store_memory("Head office has ordered your downsizing. Ruh roh", 0)
|
||||
|
||||
for(var/mob/living/silicon/ai/M in world)
|
||||
M << "These are your laws now:"
|
||||
M.set_zeroth_law("[target_desc] is not human.")
|
||||
M.show_laws()
|
||||
|
||||
/datum/game_mode/restructuring/check_win()
|
||||
var/list/left_alive = get_mob_list()
|
||||
if (left_alive.len == 1)
|
||||
var/thewinner = the_winner()
|
||||
world << "\red <B>HEAD OFFICE: Thanks to his superior brown-nosing abilities, [thewinner] has been promoted to senior management! Congratulations!"
|
||||
return 1
|
||||
else if (left_alive.len == 0)
|
||||
world << "\red <B>HEAD OFFICE: Cost cutting measures have achieved 100% efficiency. Thank you for understanding our position during this volatile economic downturn."
|
||||
return 1
|
||||
else
|
||||
if(ticker.target.stat != 2)
|
||||
return 0
|
||||
world << "\red <B>HEAD OFFICE: It seems we have made a mistake in our paperwork. The previous target for termination was chosen based on race, sex, and/or religious beliefs, which is against company policy. Please cancel previous termination request."
|
||||
pick_target()
|
||||
return 0
|
||||
|
||||
/datum/game_mode/restructuring/proc/get_mob_list()
|
||||
var/list/mobs = list()
|
||||
for(var/mob/M in world)
|
||||
if (M.stat<2 && M.client && istype(M, /mob/living/carbon/human))
|
||||
mobs += M
|
||||
return mobs
|
||||
|
||||
/datum/game_mode/restructuring/proc/the_winner()
|
||||
for(var/mob/M in world)
|
||||
if (M.stat<2 && M.client && istype(M, /mob/living/carbon/human))
|
||||
return M.name
|
||||
|
||||
/datum/game_mode/restructuring/proc/get_target_desc(mob/target) //return a useful string describing the target
|
||||
var/targetrank = null
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if (R.fields["name"] == target.real_name)
|
||||
targetrank = R.fields["rank"]
|
||||
if(!targetrank)
|
||||
return "[target.name]"
|
||||
return "[target.name] the [targetrank]"
|
||||
*/
|
||||
@@ -0,0 +1,289 @@
|
||||
// RUBY MODE
|
||||
// There is a weapon of some sort that spawns on the station
|
||||
// It calls out to crew members in an effort to find a wielder
|
||||
// The wielder is made an abomination - they're given a grotesque mask and special powers
|
||||
// The Abomination wins by murdering the entire crew, then himself
|
||||
// The crew wins by destroying the weapon
|
||||
|
||||
|
||||
/datum/game_mode/ruby
|
||||
name = "ruby"
|
||||
config_tag = "ruby"
|
||||
|
||||
var/datum/mind/abomination
|
||||
var/finished = 0
|
||||
var/abominationwins = 0
|
||||
var/winnerkey
|
||||
var/obj/macguffin
|
||||
var/list/killed = list()
|
||||
var/respawns = 0
|
||||
|
||||
|
||||
|
||||
/datum/game_mode/ruby/post_setup()
|
||||
var/list/possible_abominations = get_possible_abominations()
|
||||
|
||||
if(possible_abominations.len>0)
|
||||
abomination = pick(possible_abominations)
|
||||
/*
|
||||
if(istype(ruby))
|
||||
abomination.special_role = "abomination"
|
||||
if(wizardstart.len == 0)
|
||||
wizard.current << "<B>\red A starting location for you could not be found, please report this bug!</B>"
|
||||
else
|
||||
var/starting_loc = pick(wizardstart)
|
||||
wizard.current.loc = starting_loc
|
||||
|
||||
for (var/obj/effect/landmark/A in world)
|
||||
if (A.name == "Teleport-Scroll")
|
||||
new /obj/item/weapon/teleportation_scroll(A.loc)
|
||||
del(A)
|
||||
continue
|
||||
*/
|
||||
..()
|
||||
|
||||
/datum/game_mode/ruby/check_finished()
|
||||
if(!macguffin || abominationwins)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/game_mode/ruby/declare_completion()
|
||||
if(abominationwins)
|
||||
feedback_set_details("round_end_result","win - abomination win")
|
||||
world << "<B>The Abomination has murdered the station and sacrificed himself to Cjopaze!</B> (played by [winnerkey])"
|
||||
else
|
||||
feedback_set_details("round_end_result","loss - abomination killed")
|
||||
world << "<B>The Abomination has been stopped and Cjopaze's influence resisted! The station lives another day,</B>"
|
||||
if(killed.len > 0)
|
||||
world << "Those who were sacrificed shall be remembered: "
|
||||
for(var/mob/M in killed)
|
||||
if(M)
|
||||
world << "[M.real_name]"
|
||||
/*
|
||||
for(var/datum/mind/traitor in traitors)
|
||||
var/traitorwin = 1
|
||||
var/traitor_name
|
||||
|
||||
if(traitor.current)
|
||||
traitor_name = "[traitor.current.real_name] (played by [traitor.key])"
|
||||
else
|
||||
traitor_name = "[traitor.key] (character destroyed)"
|
||||
|
||||
world << "<B>The syndicate traitor was [traitor_name]</B>"
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in traitor.objectives)
|
||||
if(objective.check_completion())
|
||||
world << "<B>Objective #[count]</B>: [objective.explanation_text] \green <B>Success</B>"
|
||||
else
|
||||
world << "<B>Objective #[count]</B>: [objective.explanation_text] \red Failed"
|
||||
traitorwin = 0
|
||||
count++
|
||||
|
||||
if(traitorwin)
|
||||
world << "<B>The traitor was successful!<B>"
|
||||
else
|
||||
world << "<B>The traitor has failed!<B>"
|
||||
*/
|
||||
..()
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/ruby/proc/spawn_macguffin()
|
||||
|
||||
/datum/game_mode/ruby/proc/get_possible_abominations()
|
||||
|
||||
|
||||
/mob/proc/make_abomination()
|
||||
src.see_in_dark = 20
|
||||
src.verbs += /client/proc/planar_shift
|
||||
src.verbs += /client/proc/vile_ressurection
|
||||
src.verbs += /client/proc/defile_corpse
|
||||
src.verbs += /client/proc/summon_weapon
|
||||
src.verbs += /client/proc/sacrifice_self
|
||||
src.verbs += /client/proc/hunt
|
||||
src.verbs += /client/proc/howl
|
||||
var/datum/game_mode/ruby/rmode = ticker.mode
|
||||
rmode.abomination = src.mind
|
||||
return
|
||||
|
||||
|
||||
/client/proc/planar_shift()
|
||||
set name = "Planar Shift"
|
||||
set category = "Abomination"
|
||||
// This is a pretty shitty way to do this. Should use the spell_holder method from Wizard mode
|
||||
/*
|
||||
if(!usr.incorporeal_move)
|
||||
usr.sight |= SEE_MOBS
|
||||
usr.sight |= SEE_OBJS
|
||||
usr.sight |= SEE_TURFS
|
||||
//usr.density = 0
|
||||
usr.incorporeal_move = 1
|
||||
else
|
||||
usr.sight &= ~SEE_MOBS
|
||||
usr.sight &= ~SEE_TURFS
|
||||
usr.sight &= ~SEE_OBJS
|
||||
usr.density = 1
|
||||
usr.incorporeal_move = 0
|
||||
src.verbs -= /client/proc/planar_shift
|
||||
spawn(300) src.verbs += /client/proc/planar_shift
|
||||
*/
|
||||
|
||||
/client/proc/vile_ressurection()
|
||||
set name = "Vile Ressurection"
|
||||
set category = "Abomination"
|
||||
if(src.mob.stat != 2 || !src.mob)
|
||||
return
|
||||
if(ticker.mode:respawns > 0)
|
||||
// spawn a new body
|
||||
ticker.mode:respawns -= 1
|
||||
else
|
||||
// nope
|
||||
|
||||
/client/proc/defile_corpse(var/mob/living/carbon/human/H in view())
|
||||
set name = "Defile Corpse"
|
||||
set category = "Abomination"
|
||||
if(istype(H, /mob/living/carbon/human))
|
||||
var/datum/game_mode/ruby/rmode = ticker.mode
|
||||
rmode.killed.Add(H)
|
||||
ticker.mode:respawns += 1
|
||||
var/fluffmessage = pick("\red <B>[usr] rips the flesh from [H]'s corpse and plucks their eyes from their sockets!</B>", "\red <B>[usr] does unspeakable things to [H]'s corpse!</B>", "\red <B>[usr] binds [H]'s corpse with their own entrails!</B>")
|
||||
usr.visible_message(fluffmessage)
|
||||
// play sound
|
||||
|
||||
/client/proc/summon_weapon()
|
||||
set name = "Summon Weapon"
|
||||
set category = "Abomination"
|
||||
|
||||
for(var/obj/item/weapon/rubyweapon/w in world)
|
||||
if(istype(w, /obj/item/weapon/rubyweapon))
|
||||
if(istype(w.loc, /mob))
|
||||
var/mob/M = w.loc
|
||||
M.drop_item()
|
||||
w.loc = usr.loc
|
||||
else
|
||||
w.loc = usr.loc
|
||||
src.verbs -= /client/proc/summon_weapon
|
||||
spawn(300) src.verbs += /client/proc/summon_weapon
|
||||
return
|
||||
|
||||
/client/proc/sacrifice_self()
|
||||
set name = "Sacrifice Self"
|
||||
set category = "Abomination"
|
||||
set desc = "Everything must come to an end. After you have freed them, you must free yourself."
|
||||
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if(!H.client || H.client == src)
|
||||
continue
|
||||
src << "Your work is not done. You will not find release until they are all free."
|
||||
return
|
||||
usr.gib(1)
|
||||
ticker.mode:abominationwins = 1
|
||||
|
||||
/client/proc/hunt()
|
||||
set name = "Hunt"
|
||||
set category = "Abomination"
|
||||
set desc = ""
|
||||
|
||||
var/list/candidates = list()
|
||||
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if(!H.client || H.client == src) continue
|
||||
//if(!H.client) continue
|
||||
candidates.Add(H)
|
||||
|
||||
usr.visible_message(text("\red <B>[usr]'s flesh ripples and parts, revealing dozens of eyes poking from its surface. They all glance wildly around for a few moments before receding again.</B>"))
|
||||
|
||||
var/mob/living/carbon/human/H = pick(candidates)
|
||||
|
||||
if(!H) return
|
||||
|
||||
var/filename="crmap[ckey].tmp"
|
||||
var/html="<html><body bgcolor=black><table border=0 cellspacing=0 cellpadding=0>"
|
||||
var/denytypes[0]
|
||||
var/tilesizex=32
|
||||
var/tilesizey=32
|
||||
//If the temp. file exists, delete it
|
||||
src << browse("<h2>Sensing prey...</h2>", "window=hunt")
|
||||
if (fexists(filename)) fdel(filename)
|
||||
|
||||
//Display everything in the world
|
||||
for (var/y=H.y-3,y<=H.y+3,y++)
|
||||
html+="</tr><tr>"
|
||||
text2file(html,filename)
|
||||
html=""
|
||||
sleep(-1)
|
||||
//for (var/x=H.x-5,x<=H.x+5,x++)
|
||||
for(var/x=H.x-3, x<=H.x+3, x++)
|
||||
//Turfs
|
||||
var/turf/T=locate(x,y,H.z)
|
||||
if (!T) continue
|
||||
var/icon/I=icon(T.icon,T.icon_state)
|
||||
var/imgstring=replacetext("[T.type]-[T.icon_state]","/","_")
|
||||
|
||||
//Movable atoms
|
||||
for (var/atom/movable/A in T)
|
||||
//Make sure it's allowed to be displayed
|
||||
var/allowed=1
|
||||
for (var/X in denytypes)
|
||||
if (istype(A,X))
|
||||
allowed=0
|
||||
break
|
||||
if (!allowed) continue
|
||||
|
||||
if (A.icon) I.Blend(icon(A.icon,A.icon_state,A.dir),ICON_OVERLAY)
|
||||
imgstring+=replacetext("__[A.type]_[A.icon_state]","/","_")
|
||||
|
||||
//Output it
|
||||
src << browse_rsc(I,"[imgstring].dmi")
|
||||
html+="<td><img src=\"[imgstring].dmi\" width=[tilesizex] height=[tilesizey]></td>"
|
||||
|
||||
text2file("</table></body></html>",filename)
|
||||
|
||||
//Display it
|
||||
src << browse(file(filename),"window=hunt")
|
||||
|
||||
|
||||
|
||||
/client/proc/howl() // This is just a way for the Abomination to make the game more atmospheric periodically.
|
||||
set name = "Howl"
|
||||
set category = "Abomination"
|
||||
set desc = ""
|
||||
|
||||
usr.visible_message(text("\red <B>[usr]'s form warbles and distorts before settling back into its grotesque shape once more.</B>"))
|
||||
// Play a random spooky sound - maybe cause some visual, non-mechanical effects to appear at random for a few seconds.
|
||||
|
||||
src.verbs -= /client/proc/howl
|
||||
spawn(rand(300,1800)) src.verbs += /client/proc/howl
|
||||
|
||||
/obj/item/weapon/rubyweapon
|
||||
desc = ""
|
||||
name = "wepon"
|
||||
icon_state = "wepon"
|
||||
w_class = 3.0
|
||||
throwforce = 60.0
|
||||
throw_speed = 2
|
||||
throw_range = 20
|
||||
force = 24.0
|
||||
var/mob/owner
|
||||
|
||||
proc/check_owner()
|
||||
if(!owner)
|
||||
sleep(300)
|
||||
if(!owner)
|
||||
spawn() search_for_new_owner()
|
||||
else
|
||||
spawn(1800) check_owner()
|
||||
|
||||
proc/search_for_new_owner()
|
||||
var/list/possible_owners = list()
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
possible_owners.Add(H)
|
||||
|
||||
var/mob/living/carbon/human/H = pick(possible_owners)
|
||||
// Send message to H
|
||||
// Take a snapshot of the item's location, browse it to H
|
||||
spawn(rand(600,1800)) search_for_new_owner()
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
// Blow all lights nearby
|
||||
@@ -0,0 +1,201 @@
|
||||
/obj/machinery/atmoalter/heater/proc/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "heater-p"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "heater1-h"
|
||||
else
|
||||
src.icon_state = "heater1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/process()
|
||||
/*
|
||||
if(stat & NOPOWER) return
|
||||
use_power(5)
|
||||
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
else
|
||||
T = null
|
||||
if (src.h_status)
|
||||
var/t1 = src.gas.total_moles()
|
||||
if ((t1 > 0 && src.gas.temperature < (src.h_tar+T0C)))
|
||||
var/increase = src.heatrate / t1
|
||||
var/n_temp = src.gas.temperature + increase
|
||||
src.gas.temperature = min(n_temp, (src.h_tar+T0C))
|
||||
use_power( src.h_tar*8)
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
src.t_status = 3
|
||||
if(2.0)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
src.t_status = 3
|
||||
else
|
||||
|
||||
src.updateDialog()
|
||||
src.setstate()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/machinery/atmoalter/heater/New()
|
||||
..()
|
||||
src.gas = new /datum/gas_mixture()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmoalter/heater/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmoalter/heater/attack_hand(var/mob/user as mob)
|
||||
/*
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/tt
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
tt = text("Releasing <A href='?src=\ref[];t=2'>Siphon</A> <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> Siphoning<A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> <A href='?src=\ref[];t=2'>Siphon</A> Stopped", src, src)
|
||||
else
|
||||
var/ht = null
|
||||
if (src.h_status)
|
||||
ht = text("Heating <A href='?src=\ref[];h=2'>Stop</A>", src)
|
||||
else
|
||||
ht = text("<A href='?src=\ref[];h=1'>Heat</A> Stopped", src)
|
||||
var/ct = null
|
||||
switch(src.c_status)
|
||||
if(1.0)
|
||||
ct = text("Releasing <A href='?src=\ref[];c=2'>Accept</A> <A href='?src=\ref[];ct=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> Accepting <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> <A href='?src=\ref[];c=2'>Accept</A> Stopped", src, src)
|
||||
else
|
||||
ct = "Disconnected"
|
||||
var/dat = text("<TT><B>Canister Valves</B><BR>\n<FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR>\nUpper Valve Status: [][]<BR>\n\t<A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR>\nHeater Status: [] - []<BR>\n\tTrg Tmp: <A href='?src=\ref[];ht=-50'>-</A> <A href='?src=\ref[];ht=-5'>-</A> <A href='?src=\ref[];ht=-1'>-</A> [] <A href='?src=\ref[];ht=1'>+</A> <A href='?src=\ref[];ht=5'>+</A> <A href='?src=\ref[];ht=50'>+</A><BR>\n<BR>\nPipe Valve Status: []<BR>\n\t<A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR>\n<BR>\n<A href='?src=\ref[];mach_close=canister'>Close</A><BR>\n</TT>", src.gas.total_moles(), src.maximum, tt, (src.holding ? text("<BR><A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.gas.total_moles()) : null), src, num2text(1000000.0, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(1000000.0, 7), ht, (src.gas.total_moles() ? (src.gas.temperature-T0C) : 20), src, src, src, src.h_tar, src, src, src, ct, src, num2text(1000000.0, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(1000000.0, 7), user)
|
||||
user << browse(dat, "window=canister;size=600x300")
|
||||
onclose(user, "canister")
|
||||
return */ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/heater/Topic(href, href_list)
|
||||
..()
|
||||
if (stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if (((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["c"])
|
||||
var/c = text2num(href_list["c"])
|
||||
switch(c)
|
||||
if(1.0)
|
||||
src.c_status = 1
|
||||
if(2.0)
|
||||
src.c_status = 2
|
||||
if(3.0)
|
||||
src.c_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["t"])
|
||||
var/t = text2num(href_list["t"])
|
||||
if (src.t_status == 0)
|
||||
return
|
||||
switch(t)
|
||||
if(1.0)
|
||||
src.t_status = 1
|
||||
if(2.0)
|
||||
src.t_status = 2
|
||||
if(3.0)
|
||||
src.t_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["h"])
|
||||
var/h = text2num(href_list["h"])
|
||||
if (h == 1)
|
||||
src.h_status = 1
|
||||
else
|
||||
src.h_status = null
|
||||
else
|
||||
if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.t_per += tp
|
||||
src.t_per = min(max(round(src.t_per), 0), 1000000.0)
|
||||
else
|
||||
if (href_list["cp"])
|
||||
var/cp = text2num(href_list["cp"])
|
||||
src.c_per += cp
|
||||
src.c_per = min(max(round(src.c_per), 0), 1000000.0)
|
||||
else
|
||||
if (href_list["ht"])
|
||||
var/cp = text2num(href_list["ht"])
|
||||
src.h_tar += cp
|
||||
src.h_tar = min(max(round(src.h_tar), 0), 500)
|
||||
else
|
||||
if (href_list["tank"])
|
||||
var/cp = text2num(href_list["tank"])
|
||||
if ((cp == 1 && src.holding))
|
||||
src.holding.loc = src.loc
|
||||
src.holding = null
|
||||
if (src.t_status == 2)
|
||||
src.t_status = 3
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=canister")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/attackby(var/obj/W as obj, var/mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/tank))
|
||||
if (src.holding)
|
||||
return
|
||||
var/obj/item/weapon/tank/T = W
|
||||
user.drop_item()
|
||||
T.loc = src
|
||||
src.holding = T
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
var/obj/machinery/connector/con = locate(/obj/machinery/connector, src.loc)
|
||||
|
||||
if (src.c_status)
|
||||
src.anchored = initial(src.anchored)
|
||||
src.c_status = 0
|
||||
user.show_message("\blue You have disconnected the heater.", 1)
|
||||
if(con)
|
||||
con.connected = null
|
||||
else
|
||||
if (con && !con.connected)
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
user.show_message("\blue You have connected the heater.", 1)
|
||||
con.connected = src
|
||||
else
|
||||
user.show_message("\blue There is no connector here to attach the heater to.", 1)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/mob/living/silicon/hivebot/death(gibbed)
|
||||
if(src.mainframe)
|
||||
src.mainframe.return_to(src)
|
||||
src.stat = 2
|
||||
src.canmove = 0
|
||||
|
||||
if(src.blind)
|
||||
src.blind.layer = 0
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
src.updateicon()
|
||||
|
||||
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
|
||||
store_memory("Time of death: [tod]", 0)
|
||||
|
||||
if (src.key)
|
||||
spawn(50)
|
||||
if(src.key && src.stat == 2)
|
||||
src.verbs += /client/proc/ghost
|
||||
return ..(gibbed)
|
||||
@@ -0,0 +1,140 @@
|
||||
/mob/living/silicon/hivebot/emote(var/act)
|
||||
var/param = null
|
||||
if (findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
param = copytext(act, t1 + 1, length(act) + 1)
|
||||
act = copytext(act, 1, t1)
|
||||
var/m_type = 1
|
||||
var/message
|
||||
|
||||
switch(act)
|
||||
if ("salute")
|
||||
if (!src.buckled)
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> salutes to [param]."
|
||||
else
|
||||
message = "<B>[src]</b> salutes."
|
||||
m_type = 1
|
||||
if ("bow")
|
||||
if (!src.buckled)
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> bows to [param]."
|
||||
else
|
||||
message = "<B>[src]</B> bows."
|
||||
m_type = 1
|
||||
|
||||
if ("clap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> claps."
|
||||
m_type = 2
|
||||
if ("flap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> flaps his wings."
|
||||
m_type = 2
|
||||
|
||||
if ("aflap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> flaps his wings ANGRILY!"
|
||||
m_type = 2
|
||||
|
||||
if ("custom")
|
||||
var/input = input("Choose an emote to display.") as text|null
|
||||
if (!input)
|
||||
return
|
||||
input = sanitize(input)
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
if (input2 == "Visible")
|
||||
m_type = 1
|
||||
else if (input2 == "Hearable")
|
||||
m_type = 2
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = "<B>[src]</B> [input]"
|
||||
|
||||
if ("twitch")
|
||||
message = "<B>[src]</B> twitches violently."
|
||||
m_type = 1
|
||||
|
||||
if ("twitch_s")
|
||||
message = "<B>[src]</B> twitches."
|
||||
m_type = 1
|
||||
|
||||
if ("nod")
|
||||
message = "<B>[src]</B> nods."
|
||||
m_type = 1
|
||||
|
||||
if ("glare")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> glares at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> glares."
|
||||
|
||||
if ("stare")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> stares at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> stares."
|
||||
|
||||
if ("look")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> looks at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> looks."
|
||||
m_type = 1
|
||||
else
|
||||
src << text("Invalid Emote: []", act)
|
||||
if ((message && src.stat == 0))
|
||||
if (m_type & 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
return
|
||||
@@ -0,0 +1,20 @@
|
||||
/mob/living/silicon/hivebot/examine()
|
||||
set src in oview()
|
||||
|
||||
usr << "\blue *---------*"
|
||||
usr << text("\blue This is \icon[src] <B>[src.name]</B>!")
|
||||
if (src.stat == 2)
|
||||
usr << text("\red [src.name] is powered-down.")
|
||||
if (src.getBruteLoss())
|
||||
if (src.getBruteLoss() < 75)
|
||||
usr << text("\red [src.name] looks slightly dented")
|
||||
else
|
||||
usr << text("\red <B>[src.name] looks severely dented!</B>")
|
||||
if (src.getFireLoss())
|
||||
if (src.getFireLoss() < 75)
|
||||
usr << text("\red [src.name] looks slightly burnt!")
|
||||
else
|
||||
usr << text("\red <B>[src.name] looks severely burnt!</B>")
|
||||
if (src.stat == 1)
|
||||
usr << text("\red [src.name] doesn't seem to be responding.")
|
||||
return
|
||||
@@ -0,0 +1,57 @@
|
||||
/obj/item/weapon/hive_module
|
||||
name = "hive robot module"
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "std_module"
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT|TABLEPASS | CONDUCT
|
||||
var/list/modules = list()
|
||||
|
||||
/obj/item/weapon/hive_module/standard
|
||||
name = "give standard robot module"
|
||||
|
||||
/obj/item/weapon/hive_module/engineering
|
||||
name = "HiveBot engineering robot module"
|
||||
|
||||
/obj/item/weapon/hive_module/New()//Shit all the mods have
|
||||
src.modules += new /obj/item/device/flash(src)
|
||||
|
||||
|
||||
/obj/item/weapon/hive_module/standard/New()
|
||||
..()
|
||||
src.modules += new /obj/item/weapon/melee/baton(src)
|
||||
src.modules += new /obj/item/weapon/extinguisher(src)
|
||||
//var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
|
||||
//M.weapon_lock = 0
|
||||
//src.modules += M
|
||||
|
||||
|
||||
/obj/item/weapon/hive_module/engineering/New()
|
||||
|
||||
src.modules += new /obj/item/weapon/extinguisher(src)
|
||||
src.modules += new /obj/item/weapon/screwdriver(src)
|
||||
src.modules += new /obj/item/weapon/weldingtool(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src)
|
||||
src.modules += new /obj/item/device/analyzer(src)
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
|
||||
var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
|
||||
R.matter = 30
|
||||
src.modules += R
|
||||
|
||||
src.modules += new /obj/item/device/t_scanner(src)
|
||||
src.modules += new /obj/item/weapon/crowbar(src)
|
||||
src.modules += new /obj/item/weapon/wirecutters(src)
|
||||
src.modules += new /obj/item/device/multitool(src)
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
|
||||
M.amount = 50
|
||||
src.modules += M
|
||||
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
|
||||
G.amount = 50
|
||||
src.modules += G
|
||||
|
||||
var/obj/item/weapon/cable_coil/W = new /obj/item/weapon/cable_coil(src)
|
||||
W.amount = 50
|
||||
src.modules += W
|
||||
@@ -0,0 +1,503 @@
|
||||
/mob/living/silicon/hivebot/New(loc,mainframe)
|
||||
src << "\blue Your icons have been generated!"
|
||||
updateicon()
|
||||
|
||||
if(mainframe)
|
||||
dependent = 1
|
||||
src.real_name = mainframe:name
|
||||
src.name = src.real_name
|
||||
else
|
||||
src.real_name = "Robot [pick(rand(1, 999))]"
|
||||
src.name = src.real_name
|
||||
|
||||
src.radio = new /obj/item/device/radio(src)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/pick_module()
|
||||
if(src.module)
|
||||
return
|
||||
var/mod = input("Please, select a module!", "Robot", null, null) in list("Combat", "Engineering")
|
||||
if(src.module)
|
||||
return
|
||||
switch(mod)
|
||||
if("Combat")
|
||||
src.module = new /obj/item/weapon/hive_module/standard(src)
|
||||
|
||||
if("Engineering")
|
||||
src.module = new /obj/item/weapon/hive_module/engineering(src)
|
||||
|
||||
|
||||
src.hands.icon_state = "malf"
|
||||
updateicon()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/blob_act()
|
||||
if (src.stat != 2)
|
||||
src.adjustBruteLoss(60)
|
||||
src.updatehealth()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
if (src.client.statpanel == "Status")
|
||||
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(ticker.mode.name == "AI malfunction")
|
||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||
*/
|
||||
|
||||
stat(null, text("Charge Left: [src.energy]/[src.energy_max]"))
|
||||
|
||||
/mob/living/silicon/hivebot/restrained()
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/ex_act(severity)
|
||||
if(!blinded)
|
||||
flick("flash", src.flash)
|
||||
|
||||
if (src.stat == 2 && src.client)
|
||||
src.gib(1)
|
||||
return
|
||||
|
||||
else if (src.stat == 2 && !src.client)
|
||||
del(src)
|
||||
return
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(100)
|
||||
adjustFireLoss(100)
|
||||
src.gib(1)
|
||||
return
|
||||
if(2.0)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3.0)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
/mob/living/silicon/hivebot/meteorhit(obj/O as obj)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
M.show_message(text("\red [src] has been hit by [O]"), 1)
|
||||
//Foreach goto(19)
|
||||
if (src.health > 0)
|
||||
src.adjustBruteLoss(30)
|
||||
if ((O.icon_state == "flaming"))
|
||||
src.adjustFireLoss(40)
|
||||
src.updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/bullet_act(flag)
|
||||
/*
|
||||
if (flag == PROJECTILE_BULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 60
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_MEDBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 30
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_WEAKBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 15
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_MPBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 20
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_SLUG)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 40
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_BAG)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 2
|
||||
src.updatehealth()
|
||||
|
||||
|
||||
else if (flag == PROJECTILE_TASER)
|
||||
return
|
||||
|
||||
else if (flag == PROJECTILE_WAVE)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 25
|
||||
src.updatehealth()
|
||||
return
|
||||
|
||||
else if(flag == PROJECTILE_LASER)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 20
|
||||
src.updatehealth()
|
||||
else if(flag == PROJECTILE_PULSE)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 40
|
||||
src.updatehealth()
|
||||
*/
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Bump(atom/movable/AM as mob|obj, yes)
|
||||
spawn( 0 )
|
||||
if ((!( yes ) || src.now_pushing))
|
||||
return
|
||||
src.now_pushing = 1
|
||||
if(ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
/*if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations))
|
||||
if(prob(20))
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M << M << "\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>"
|
||||
src.now_pushing = 0
|
||||
//src.unlock_medal("That's No Moon, That's A Gourmand!", 1)
|
||||
return*/
|
||||
src.now_pushing = 0
|
||||
..()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
if (!src.now_pushing)
|
||||
src.now_pushing = 1
|
||||
if (!AM.anchored)
|
||||
var/t = get_dir(src, AM)
|
||||
step(AM, t)
|
||||
src.now_pushing = null
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
|
||||
if (W:remove_fuel(0))
|
||||
src.adjustBruteLoss(-30)
|
||||
src.updatehealth()
|
||||
src.add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
|
||||
else
|
||||
user << "Need more welding fuel!"
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
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
|
||||
src.grabbed_by += G
|
||||
G.synch()
|
||||
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
else if (M.a_intent == "hurt")
|
||||
var/damage = rand(5, 10)
|
||||
if (prob(90))
|
||||
/*
|
||||
if (M.class == "combat")
|
||||
damage += 15
|
||||
if(prob(20))
|
||||
src.weakened = max(src.weakened,4)
|
||||
src.stunned = max(src.stunned,4)
|
||||
*/
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
|
||||
if(prob(8))
|
||||
flick("noise", src.flash)
|
||||
src.adjustBruteLoss(damage)
|
||||
src.updatehealth()
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] took a swipe at []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
else if (M.a_intent == "disarm")
|
||||
if(!(src.lying))
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 40)
|
||||
src.stunned = 5
|
||||
step(src,get_dir(M,src))
|
||||
spawn(5) step(src,get_dir(M,src))
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has pushed back []!</B>", M, src), 1)
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] attempted to push back []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/attack_hand(mob/user)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
if(src.check_access(null))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/proc/check_access(obj/item/weapon/card/id/I)
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
var/list/L = src.req_access
|
||||
if(!L.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
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/hivebot/proc/updateicon()
|
||||
|
||||
src.overlays.Cut()
|
||||
|
||||
if(src.stat == 0)
|
||||
src.overlays += "eyes"
|
||||
else
|
||||
src.overlays -= "eyes"
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/installed_modules()
|
||||
|
||||
if(!src.module)
|
||||
src.pick_module()
|
||||
return
|
||||
var/dat = "<HEAD><TITLE>Modules</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += {"<A HREF='?src=\ref[src];mach_close=robotmod'>Close</A>
|
||||
<BR>
|
||||
<BR>
|
||||
<B>Activated Modules</B>
|
||||
<BR>
|
||||
Module 1: [module_state_1 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_1]>[module_state_1]<A>" : "No Module"]<BR>
|
||||
Module 2: [module_state_2 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_2]>[module_state_2]<A>" : "No Module"]<BR>
|
||||
Module 3: [module_state_3 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_3]>[module_state_3]<A>" : "No Module"]<BR>
|
||||
<BR>
|
||||
<B>Installed Modules</B><BR><BR>"}
|
||||
|
||||
for (var/obj in src.module.modules)
|
||||
if(src.activated(obj))
|
||||
dat += text("[obj]: <B>Activated</B><BR>")
|
||||
else
|
||||
dat += text("[obj]: <A HREF=?src=\ref[src];act=\ref[obj]>Activate</A><BR>")
|
||||
/*
|
||||
if(src.activated(obj))
|
||||
dat += text("[obj]: \[<B>Activated</B> | <A HREF=?src=\ref[src];deact=\ref[obj]>Deactivate</A>\]<BR>")
|
||||
else
|
||||
dat += text("[obj]: \[<A HREF=?src=\ref[src];act=\ref[obj]>Activate</A> | <B>Deactivated</B>\]<BR>")
|
||||
*/
|
||||
src << browse(dat, "window=robotmod&can_close=0")
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[href_list["mach_close"]]")
|
||||
src.machine = null
|
||||
src << browse(null, t1)
|
||||
return
|
||||
|
||||
if (href_list["mod"])
|
||||
var/obj/item/O = locate(href_list["mod"])
|
||||
O.attack_self(src)
|
||||
|
||||
if (href_list["act"])
|
||||
var/obj/item/O = locate(href_list["act"])
|
||||
if(activated(O))
|
||||
src << "Already activated"
|
||||
return
|
||||
if(!src.module_state_1)
|
||||
src.module_state_1 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else if(!src.module_state_2)
|
||||
src.module_state_2 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else if(!src.module_state_3)
|
||||
src.module_state_3 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else
|
||||
src << "You need to disable a module first!"
|
||||
src.installed_modules()
|
||||
|
||||
if (href_list["deact"])
|
||||
var/obj/item/O = locate(href_list["deact"])
|
||||
if(activated(O))
|
||||
if(src.module_state_1 == O)
|
||||
src.module_state_1 = null
|
||||
src.contents -= O
|
||||
else if(src.module_state_2 == O)
|
||||
src.module_state_2 = null
|
||||
src.contents -= O
|
||||
else if(src.module_state_3 == O)
|
||||
src.module_state_3 = null
|
||||
src.contents -= O
|
||||
else
|
||||
src << "Module isn't activated."
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
src.installed_modules()
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/proc/uneq_active()
|
||||
if(isnull(src.module_active))
|
||||
return
|
||||
if(src.module_state_1 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_1
|
||||
src.contents -= module_state_1
|
||||
src.module_active = null
|
||||
src.module_state_1 = null
|
||||
src.inv1.icon_state = "inv1"
|
||||
else if(src.module_state_2 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_2
|
||||
src.contents -= module_state_2
|
||||
src.module_active = null
|
||||
src.module_state_2 = null
|
||||
src.inv2.icon_state = "inv2"
|
||||
else if(src.module_state_3 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_3
|
||||
src.contents -= module_state_3
|
||||
src.module_active = null
|
||||
src.module_state_3 = null
|
||||
src.inv3.icon_state = "inv3"
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/activated(obj/item/O)
|
||||
if(src.module_state_1 == O)
|
||||
return 1
|
||||
else if(src.module_state_2 == O)
|
||||
return 1
|
||||
else if(src.module_state_3 == O)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/proc/radio_menu()
|
||||
var/dat = {"
|
||||
<TT>
|
||||
Microphone: [src.radio.broadcasting ? "<A href='byond://?src=\ref[src.radio];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];talk=1'>Disengaged</A>"]<BR>
|
||||
Speaker: [src.radio.listening ? "<A href='byond://?src=\ref[src.radio];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];listen=1'>Disengaged</A>"]<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[src.radio];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[src.radio];freq=-2'>-</A>
|
||||
[format_frequency(src.radio.frequency)]
|
||||
<A href='byond://?src=\ref[src.radio];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src.radio];freq=10'>+</A><BR>
|
||||
-------
|
||||
</TT>"}
|
||||
src << browse(dat, "window=radio")
|
||||
onclose(src, "radio")
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Move(a, b, flag)
|
||||
|
||||
if (src.buckled)
|
||||
return
|
||||
|
||||
if (src.restrained())
|
||||
src.stop_pulling()
|
||||
|
||||
var/t7 = 1
|
||||
if (src.restrained())
|
||||
for(var/mob/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving)))))
|
||||
var/turf/T = src.loc
|
||||
. = ..()
|
||||
|
||||
if (src.pulling && src.pulling.loc)
|
||||
if(!( isturf(src.pulling.loc) ))
|
||||
src.stop_pulling()
|
||||
return
|
||||
else
|
||||
if(Debug)
|
||||
diary <<"src.pulling disappeared? at [__LINE__] in mob.dm - src.pulling = [src.pulling]"
|
||||
diary <<"REPORT THIS"
|
||||
|
||||
/////
|
||||
if(src.pulling && src.pulling.anchored)
|
||||
src.stop_pulling()
|
||||
return
|
||||
|
||||
if (!src.restrained())
|
||||
var/diag = get_dir(src, src.pulling)
|
||||
if ((diag - 1) & diag)
|
||||
else
|
||||
diag = null
|
||||
if ((get_dist(src, src.pulling) > 1 || diag))
|
||||
if (ismob(src.pulling))
|
||||
var/mob/M = src.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 [G.affecting] has been pulled from [G.assailant]'s grip by [src]"), 1)
|
||||
del(G)
|
||||
else
|
||||
ok = 0
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
|
||||
ok = 0
|
||||
if (ok)
|
||||
var/atom/movable/t = M.pulling
|
||||
M.stop_pulling()
|
||||
step(src.pulling, get_dir(src.pulling.loc, T))
|
||||
M.start_pulling(t)
|
||||
else
|
||||
if (src.pulling)
|
||||
step(src.pulling, get_dir(src.pulling.loc, T))
|
||||
else
|
||||
src.stop_pulling()
|
||||
. = ..()
|
||||
if ((src.s_active && !( s_active in src.contents ) ))
|
||||
src.s_active.close(src)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/verb/cmd_return_mainframe()
|
||||
set category = "Robot Commands"
|
||||
set name = "Recall to Mainframe."
|
||||
return_mainframe()
|
||||
|
||||
/mob/living/silicon/hivebot/proc/return_mainframe()
|
||||
if(mainframe)
|
||||
mainframe.return_to(src)
|
||||
else
|
||||
src << "\red You lack a dedicated mainframe!"
|
||||
return
|
||||
@@ -0,0 +1,46 @@
|
||||
/mob/living/silicon/hivebot
|
||||
name = "Robot"
|
||||
icon = 'icons/mob/hivebot.dmi'
|
||||
icon_state = "basic"
|
||||
health = 80
|
||||
var/health_max = 80
|
||||
robot_talk_understand = 2
|
||||
|
||||
//HUD
|
||||
var/obj/screen/cells = null
|
||||
var/obj/screen/inv1 = null
|
||||
var/obj/screen/inv2 = null
|
||||
var/obj/screen/inv3 = null
|
||||
|
||||
//3 Modules can be activated at any one time.
|
||||
var/obj/item/weapon/robot_module/module = null
|
||||
var/module_active = null
|
||||
var/module_state_1 = null
|
||||
var/module_state_2 = null
|
||||
var/module_state_3 = null
|
||||
|
||||
var/obj/item/device/radio/radio = null
|
||||
|
||||
var/list/req_access = list(ACCESS_ROBOTICS)
|
||||
var/energy = 4000
|
||||
var/energy_max = 4000
|
||||
var/jetpack = 0
|
||||
|
||||
var/mob/living/silicon/hive_mainframe/mainframe = null
|
||||
var/dependent = 0
|
||||
var/shell = 1
|
||||
|
||||
/mob/living/silicon/hive_mainframe
|
||||
name = "Robot Mainframe"
|
||||
voice_name = "synthesized voice"
|
||||
|
||||
icon_state = "hive_main"
|
||||
health = 200
|
||||
var/health_max = 200
|
||||
robot_talk_understand = 2
|
||||
|
||||
anchored = 1
|
||||
var/online = 1
|
||||
var/mob/living/silicon/hivebot = null
|
||||
var/hivebot_name = null
|
||||
var/force_mind = 0
|
||||
@@ -0,0 +1,251 @@
|
||||
|
||||
/obj/hud/proc/hivebot_hud()
|
||||
|
||||
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.g_dither = new src.h_type( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new src.h_type(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new src.h_type( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new src.h_type( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'icons/effects/station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
|
||||
//Radio
|
||||
using = new src.h_type( src )
|
||||
using.name = "radio"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "radio"
|
||||
using.screen_loc = ui_movi_old
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
|
||||
//Generic overlays
|
||||
|
||||
using = new src.h_type(src) //Right hud bar
|
||||
using.dir = SOUTH
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type(src) //Lower hud bar
|
||||
using.dir = EAST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type(src) //Corner Button
|
||||
using.dir = NORTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.screen_loc = "EAST+1,SOUTH-1"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
|
||||
//Module select
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module1"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "inv1"
|
||||
using.screen_loc = ui_inv1
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv1 = using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module2"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "inv2"
|
||||
using.screen_loc = ui_inv2
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv2 = using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module3"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "inv3"
|
||||
using.screen_loc = ui_inv3
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv3 = using
|
||||
|
||||
//End of module select
|
||||
|
||||
//Intent
|
||||
using = new src.h_type( src )
|
||||
using.name = "act_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
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
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "arrowleft"
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "s_arrow"
|
||||
using.dir = WEST
|
||||
using.screen_loc = ui_iarrowleft
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "arrowright"
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "s_arrow"
|
||||
using.dir = EAST
|
||||
using.screen_loc = ui_iarrowright
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
//End of Intent
|
||||
|
||||
//Cell
|
||||
mymob:cells = new /obj/screen( null )
|
||||
mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob:cells.icon_state = "charge-empty"
|
||||
mymob:cells.name = "cell"
|
||||
mymob:cells.screen_loc = ui_toxin
|
||||
|
||||
//Health
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
//Installed Module
|
||||
mymob.hands = new /obj/screen( null )
|
||||
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.hands.icon_state = "nomod"
|
||||
mymob.hands.name = "module"
|
||||
mymob.hands.screen_loc = ui_dropbutton
|
||||
|
||||
//Module Panel
|
||||
using = new src.h_type( src )
|
||||
using.name = "panel"
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = "panel"
|
||||
using.screen_loc = ui_throw
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
//Store
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.throw_icon.icon_state = "store"
|
||||
mymob.throw_icon.name = "store"
|
||||
mymob.throw_icon.screen_loc = ui_hand
|
||||
|
||||
//Temp
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon_state = "temp0"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
//does nothing (fire and oxy)
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = 'icons/mob/screen1_full.dmi''
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.sleep = new /obj/screen( null )
|
||||
mymob.sleep.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.sleep.icon_state = "sleep0"
|
||||
mymob.sleep.name = "sleep"
|
||||
mymob.sleep.screen_loc = ui_sleep
|
||||
|
||||
mymob.rest = new /obj/screen( null )
|
||||
mymob.rest.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.rest.icon_state = "rest0"
|
||||
mymob.rest.name = "rest"
|
||||
mymob.rest.screen_loc = ui_rest
|
||||
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
return
|
||||
@@ -0,0 +1,227 @@
|
||||
/mob/living/silicon/hivebot/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
if (src.stat != 2)
|
||||
use_power()
|
||||
|
||||
src.blinded = null
|
||||
|
||||
clamp_values()
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
if(client)
|
||||
src.shell = 0
|
||||
handle_regular_hud_updates()
|
||||
update_items()
|
||||
if(dependent)
|
||||
mainframe_check()
|
||||
|
||||
update_canmove()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot
|
||||
proc
|
||||
clamp_values()
|
||||
|
||||
stunned = max(min(stunned, 10),0)
|
||||
paralysis = max(min(paralysis, 1), 0)
|
||||
weakened = max(min(weakened, 15), 0)
|
||||
sleeping = max(min(sleeping, 1), 0)
|
||||
setToxLoss(0)
|
||||
setOxyLoss(0)
|
||||
|
||||
use_power()
|
||||
|
||||
if (src.energy)
|
||||
if(src.energy <= 0)
|
||||
death()
|
||||
|
||||
else if (src.energy <= 10)
|
||||
src.module_active = null
|
||||
src.module_state_1 = null
|
||||
src.module_state_2 = null
|
||||
src.module_state_3 = null
|
||||
src.energy -=1
|
||||
else
|
||||
if(src.module_state_1)
|
||||
src.energy -=1
|
||||
if(src.module_state_2)
|
||||
src.energy -=1
|
||||
if(src.module_state_3)
|
||||
src.energy -=1
|
||||
src.energy -=1
|
||||
src.blinded = 0
|
||||
src.stat = 0
|
||||
else
|
||||
src.blinded = 1
|
||||
src.stat = 1
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = src.health_max - (getFireLoss() + getBruteLoss())
|
||||
|
||||
if(health <= 0)
|
||||
death()
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
src.stunned--
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
src.weakened--
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
src.paralysis--
|
||||
src.blinded = 0
|
||||
src.lying = 0
|
||||
src.stat = 1
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if ((src.sdisabilities & 1))
|
||||
src.blinded = 1
|
||||
if ((src.sdisabilities & 4))
|
||||
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 src.mutations)
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
else if (src.stat != 2)
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(health_max to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(src.health_max*0.80 to src.health_max)
|
||||
src.healths.icon_state = "health1"
|
||||
if(src.health_max*0.60 to src.health_max*0.80)
|
||||
src.healths.icon_state = "health2"
|
||||
if(src.health_max*0.40 to src.health_max*0.60)
|
||||
src.healths.icon_state = "health3"
|
||||
if(src.health_max*0.20 to src.health_max*0.40)
|
||||
src.healths.icon_state = "health4"
|
||||
if(0 to health_max*0.20)
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
else
|
||||
src.healths.icon_state = "health7"
|
||||
|
||||
if (src.cells)
|
||||
switch(src.energy)
|
||||
if(src.energy_max*0.75 to INFINITY)
|
||||
src.cells.icon_state = "charge4"
|
||||
if(0.5*src.energy_max to 0.75*src.energy_max)
|
||||
src.cells.icon_state = "charge3"
|
||||
if(0.25*src.energy_max to 0.5*src.energy_max)
|
||||
src.cells.icon_state = "charge2"
|
||||
if(0 to 0.25*src.energy_max)
|
||||
src.cells.icon_state = "charge1"
|
||||
else
|
||||
src.cells.icon_state = "charge0"
|
||||
|
||||
switch(src.bodytemperature) //310.055 optimal body temp
|
||||
|
||||
if(335 to INFINITY)
|
||||
src.bodytemp.icon_state = "temp2"
|
||||
if(320 to 335)
|
||||
src.bodytemp.icon_state = "temp1"
|
||||
if(300 to 320)
|
||||
src.bodytemp.icon_state = "temp0"
|
||||
if(260 to 300)
|
||||
src.bodytemp.icon_state = "temp-1"
|
||||
else
|
||||
src.bodytemp.icon_state = "temp-2"
|
||||
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
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
|
||||
|
||||
|
||||
update_items()
|
||||
if (src.client)
|
||||
src.client.screen -= src.contents
|
||||
src.client.screen += src.contents
|
||||
if(src.module_state_1)
|
||||
src.module_state_1:screen_loc = ui_inv1
|
||||
if(src.module_state_2)
|
||||
src.module_state_2:screen_loc = ui_inv2
|
||||
if(src.module_state_3)
|
||||
src.module_state_3:screen_loc = ui_inv3
|
||||
|
||||
mainframe_check()
|
||||
if(mainframe)
|
||||
if(mainframe.stat == 2)
|
||||
mainframe.return_to(src)
|
||||
else
|
||||
death()
|
||||
@@ -0,0 +1,15 @@
|
||||
/mob/living/silicon/hivebot/Login()
|
||||
..()
|
||||
|
||||
update_clothing()
|
||||
|
||||
if (!isturf(src.loc))
|
||||
src.client.eye = src.loc
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
if (src.stat == 2)
|
||||
src.verbs += /client/proc/ghost
|
||||
if(src.real_name == "Hiveborg")
|
||||
src.real_name += " "
|
||||
src.real_name += "-[rand(1, 999)]"
|
||||
src.name = src.real_name
|
||||
return
|
||||
@@ -0,0 +1,180 @@
|
||||
/mob/living/silicon/hive_mainframe/New()
|
||||
Namepick()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Life()
|
||||
if (src.stat == 2)
|
||||
return
|
||||
else
|
||||
src.updatehealth()
|
||||
|
||||
if (src.health <= 0)
|
||||
death()
|
||||
return
|
||||
|
||||
if(src.force_mind)
|
||||
if(!src.mind)
|
||||
if(src.client)
|
||||
src.mind = new
|
||||
src.mind.key = src.key
|
||||
src.mind.current = src
|
||||
src.force_mind = 0
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
if (src.client.statpanel == "Status")
|
||||
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(ticker.mode.name == "AI malfunction")
|
||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||
*/
|
||||
|
||||
/mob/living/silicon/hive_mainframe/updatehealth()
|
||||
if (src.nodamage == 0)
|
||||
src.health = 100 - src.getFireLoss() - src.getBruteLoss()
|
||||
else
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
|
||||
/mob/living/silicon/hive_mainframe/death(gibbed)
|
||||
src.stat = 2
|
||||
src.canmove = 0
|
||||
if(src.blind)
|
||||
src.blind.layer = 0
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
src.lying = 1
|
||||
src.icon_state = "hive_main-crash"
|
||||
|
||||
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
|
||||
mind.store_memory("Time of death: [tod]", 0)
|
||||
|
||||
if (src.key)
|
||||
spawn(50)
|
||||
if(src.key && src.stat == 2)
|
||||
src.verbs += /client/proc/ghost
|
||||
return ..(gibbed)
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_understands(var/other)
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/hivebot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/ai))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/human/tajaran))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "queries, \"[text]\"";
|
||||
else if (ending == "!")
|
||||
return "declares, \"[copytext(text, 1, length(text))]\"";
|
||||
|
||||
return "states, \"[text]\"";
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/proc/return_to(var/mob/user)
|
||||
if(user.mind)
|
||||
user.mind.transfer_to(src)
|
||||
spawn(20)
|
||||
user:shell = 1
|
||||
user:real_name = "Robot [pick(rand(1, 999))]"
|
||||
user:name = user:real_name
|
||||
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/hive_mainframe/verb/cmd_deploy_to()
|
||||
set category = "Mainframe Commands"
|
||||
set name = "Deploy to shell."
|
||||
deploy_to()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/verb/deploy_to()
|
||||
|
||||
if(usr.stat == 2)
|
||||
usr << "You can't deploy because you are dead!"
|
||||
return
|
||||
|
||||
var/list/bodies = new/list()
|
||||
|
||||
for(var/mob/living/silicon/hivebot/H in mob_list)
|
||||
if(H.z == src.z)
|
||||
if(H.shell)
|
||||
if(!H.stat)
|
||||
bodies += H
|
||||
|
||||
var/target_shell = input(usr, "Which body to control?") as null|anything in bodies
|
||||
|
||||
if (!target_shell)
|
||||
return
|
||||
|
||||
else if(src.mind)
|
||||
spawn(30)
|
||||
target_shell:mainframe = src
|
||||
target_shell:dependent = 1
|
||||
target_shell:real_name = src.name
|
||||
target_shell:name = target_shell:real_name
|
||||
src.mind.transfer_to(target_shell)
|
||||
return
|
||||
|
||||
|
||||
/client/proc/MainframeMove(n,direct,var/mob/living/silicon/hive_mainframe/user)
|
||||
return
|
||||
/obj/hud/proc/hive_mainframe_hud()
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Login()
|
||||
..()
|
||||
update_clothing()
|
||||
for(var/S in src.client.screen)
|
||||
del(S)
|
||||
src.flash = new /obj/screen( null )
|
||||
src.flash.icon_state = "blank"
|
||||
src.flash.name = "flash"
|
||||
src.flash.screen_loc = "1,1 to 15,15"
|
||||
src.flash.layer = 17
|
||||
src.blind = new /obj/screen( null )
|
||||
src.blind.icon_state = "black"
|
||||
src.blind.name = " "
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
src.blind.layer = 0
|
||||
src.client.screen += list( src.blind, src.flash )
|
||||
if(!isturf(src.loc))
|
||||
src.client.eye = src.loc
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
if (src.stat == 2)
|
||||
src.verbs += /client/proc/ghost
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/proc/Namepick()
|
||||
var/randomname = pick(ai_names)
|
||||
var/newname = input(src,"You are the a Mainframe Unit. Would you like to change your name to something else?", "Name change",randomname)
|
||||
|
||||
if (length(newname) == 0)
|
||||
newname = randomname
|
||||
|
||||
if (newname)
|
||||
if (length(newname) >= 26)
|
||||
newname = copytext(newname, 1, 26)
|
||||
newname = replacetext(newname, ">", "'")
|
||||
src.real_name = newname
|
||||
src.name = newname
|
||||
@@ -0,0 +1,291 @@
|
||||
//WORK IN PROGRESS CONTENT
|
||||
|
||||
//Project coder: Errorage
|
||||
|
||||
//Readme: As part of the UI upgrade project, the intention here is for each job to have
|
||||
//somewhat customizable loadouts. Players will be able to pick between jumpsuits, shoes,
|
||||
//and other items. This datum will be used for all jobs and code will reference it.
|
||||
//adding new jobs will be a matter of adding this datum.to a list of jobs.
|
||||
|
||||
#define VITAL_PRIORITY_JOB 5
|
||||
#define HIGH_PRIORITY_JOB 4
|
||||
#define PRIORITY_JOB 3
|
||||
#define LOW_PRIORITY_JOB 2
|
||||
#define ASSISTANT_PRIORITY_JOB 1
|
||||
#define NO_PRIORITY_JOB 0
|
||||
|
||||
/datum/job
|
||||
//Basic information
|
||||
var/title = "Untitled" //The main (default) job title/name
|
||||
var/list/alternative_titles = list() //Alternative job titles/names (alias)
|
||||
var/job_number_at_round_start = 0 //Number of jobs that can be assigned at round start
|
||||
var/job_number_total = 0 //Number of jobs that can be assigned total
|
||||
var/list/bosses = list() //List of jobs which have authority over this job by default.
|
||||
var/admin_only = 0 //If this is set to 1, the job is not available on the spawn screen
|
||||
var/description = "" //A description of the job to be displayed when requested on the spawn screen
|
||||
var/guides = "" //A string with links to relevent guides (likely the wiki)
|
||||
var/department = "" //This is used to group jobs into departments, which means that if you don't get your desired jobs, you get another job from the same department
|
||||
var/job_type = "SS13" //SS13, NT or ANTAGONIST
|
||||
var/can_be_traitor = 1
|
||||
var/can_be_changeling = 1
|
||||
var/can_be_wizard = 1
|
||||
var/can_be_cultist = 1
|
||||
var/can_be_rev_head = 1
|
||||
var/is_head_position = 0
|
||||
|
||||
//Job conditions
|
||||
var/change_to_mob = "Human" //The type of mob which this job will change you to (alien,cyborg,human...)
|
||||
var/change_to_mutantrace = "" //What mutantrace you will be once you get this job
|
||||
|
||||
//Random job assignment priority
|
||||
var/assignment_priority = NO_PRIORITY_JOB //This variable determins the priority of assignment
|
||||
//VITAL_PRIORITY_JOB = Absolutely vital (Someone will get assigned every round) - Use VERY, VERY lightly
|
||||
//HIGH_PRIORITY_JOB = High priority - Assibned before the other jobs, candidates compete on equal terms
|
||||
//PRIORITY_JOB = Priorized (Standard priority) - Candidates compete by virtue of priority (choice 1 > choice 2 > choice 3...)
|
||||
//LOW_PRIORITY_JOB = Low priority (Low-priority (librarian))
|
||||
//ASSISTANT_PRIORITY_JOB = Assistant-level (Only filled when all the other jobs have been assigned)
|
||||
//NO_PRIORITY_JOB = Skipped om assignment (Admin-only jobs should have this level)
|
||||
|
||||
|
||||
|
||||
//Available equipment - The first thing listed is understood as the default setup.
|
||||
var/list/equipment_ears = list() //list of possible ear-wear items
|
||||
var/list/equipment_glasses = list() //list of possible glasses
|
||||
var/list/equipment_gloves = list() //list of possible gloves
|
||||
var/list/equipment_head = list() //list of possible headgear/helmets/hats
|
||||
var/list/equipment_mask = list() //list of possible masks
|
||||
var/list/equipment_shoes = list() //list of possible shoes
|
||||
var/list/equipment_suit = list() //list of possible suits
|
||||
var/list/equipment_under = list() //list of possible jumpsuits
|
||||
var/list/equipment_belt = list() //list of possible belt-slot items
|
||||
var/list/equipment_back = list() //list of possible back-slot items
|
||||
var/obj/equipment_pda //default pda type
|
||||
var/obj/equipment_id //default id type
|
||||
|
||||
New(var/param_title, var/list/param_alternative_titles = list(), var/param_jobs_at_round_start = 0, var/param_global_max = 0, var/list/param_bosses = list(), var/param_admin_only = 0)
|
||||
title = param_title
|
||||
alternative_titles = param_alternative_titles
|
||||
job_number_at_round_start = param_jobs_at_round_start
|
||||
job_number_total = param_global_max
|
||||
bosses = param_bosses
|
||||
admin_only = param_admin_only
|
||||
|
||||
//This proc tests to see if the given alias (job title/alternative job title) corresponds to this job.
|
||||
//Returns 1 if it is, else returns 0
|
||||
proc/is_job_alias(var/alias)
|
||||
if(alias == title)
|
||||
return 1
|
||||
if(alias in alternative_titles)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/jobs
|
||||
var/list/datum/job/all_jobs = list()
|
||||
|
||||
proc/get_all_jobs()
|
||||
return all_jobs
|
||||
|
||||
//This proc returns all the jobs which are NOT admin only
|
||||
proc/get_normal_jobs()
|
||||
var/list/datum/job/normal_jobs = list()
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(!J.admin_only)
|
||||
normal_jobs += J
|
||||
return normal_jobs
|
||||
|
||||
//This proc returns all the jobs which are admin only
|
||||
proc/get_admin_jobs()
|
||||
var/list/datum/job/admin_jobs = list()
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.admin_only)
|
||||
admin_jobs += J
|
||||
return admin_jobs
|
||||
|
||||
//This proc returns the job datum of the job with the alias or job title given as the argument. Returns an empty string otherwise.
|
||||
proc/get_job(var/alias)
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.is_job_alias(alias))
|
||||
return J
|
||||
return ""
|
||||
|
||||
//This proc returns a string with the default job title for the job with the given alias. Returns an empty string otherwise.
|
||||
proc/get_job_title(var/alias)
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.is_job_alias(alias))
|
||||
return J.title
|
||||
return ""
|
||||
|
||||
//This proc returns all the job datums of the workers whose boss has the alias provided. (IE Engineer under Chief Engineer, etc.)
|
||||
proc/get_jobs_under(var/boss_alias)
|
||||
var/boss_title = get_job_title(boss_alias)
|
||||
var/list/datum/job/employees = list()
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(boss_title in J.bosses)
|
||||
employees += J
|
||||
return employees
|
||||
|
||||
//This proc returns the chosen vital and high priority jobs that the person selected. It goes from top to bottom of the list, until it finds a job which does not have such priority.
|
||||
//Example: Choosing (in this order): CE, Captain, Engineer, RD will only return CE and Captain, as RD is assumed as being an unwanted choice.
|
||||
//This proc is used in the allocation algorithm when deciding vital and high priority jobs.
|
||||
proc/get_prefered_high_priority_jobs()
|
||||
var/list/datum/job/hp_jobs = list()
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.assignment_priority == HIGH_PRIORITY_JOB || J.assignment_priority == VITAL_PRIORITY_JOB)
|
||||
hp_jobs += J
|
||||
else
|
||||
break
|
||||
return hp_jobs
|
||||
|
||||
//If only priority is given, it will return the jobs of only that priority, if end_priority is set it will return the jobs with their priority higher or equal to var/priority and lower or equal to end_priority. end_priority must be higher than 0.
|
||||
proc/get_jobs_by_priority(var/priority, var/end_priority = 0)
|
||||
var/list/datum/job/priority_jobs = list()
|
||||
if(end_priority)
|
||||
if(end_priority < priority)
|
||||
return
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.assignment_priority >= priority && J.assignment_priority <= end_priority)
|
||||
priority_jobs += J
|
||||
else
|
||||
for(var/datum/job/J in all_jobs)
|
||||
if(J.assignment_priority == priority)
|
||||
priority_jobs += J
|
||||
return priority_jobs
|
||||
|
||||
//This datum is used in the plb allocation algorithm to make life easier, not used anywhere else.
|
||||
/datum/player_jobs
|
||||
var/mob/new_player/player
|
||||
var/datum/jobs/selected_jobs
|
||||
|
||||
var/datum/jobs/jobs = new/datum/jobs()
|
||||
|
||||
proc/setup_jobs()
|
||||
var/datum/job/JOB
|
||||
|
||||
JOB = new/datum/job("Station Engineer")
|
||||
JOB.alternative_titles = list("Structural Engineer","Engineer","Student of Engineering")
|
||||
JOB.job_number_at_round_start = 5
|
||||
JOB.job_number_total = 5
|
||||
JOB.bosses = list("Chief Engineer")
|
||||
JOB.admin_only = 0
|
||||
JOB.description = "Engineers are tasked with the maintenance of the station. Be it maintaining the power grid or rebuilding damaged sections."
|
||||
JOB.guides = ""
|
||||
JOB.equipment_ears = list(/obj/item/device/radio/headset/headset_eng)
|
||||
JOB.equipment_glasses = list()
|
||||
JOB.equipment_gloves = list()
|
||||
JOB.equipment_head = list(/obj/item/clothing/head/helmet/hardhat)
|
||||
JOB.equipment_mask = list()
|
||||
JOB.equipment_shoes = list(/obj/item/clothing/shoes/orange,/obj/item/clothing/shoes/brown,/obj/item/clothing/shoes/black)
|
||||
JOB.equipment_suit = list(/obj/item/clothing/suit/storage/hazardvest)
|
||||
JOB.equipment_under = list(/obj/item/clothing/under/rank/engineer,/obj/item/clothing/under/color/yellow)
|
||||
JOB.equipment_belt = list(/obj/item/weapon/storage/belt/utility/full)
|
||||
JOB.equipment_back = list(/obj/item/weapon/storage/backpack/industrial,/obj/item/weapon/storage/backpack)
|
||||
JOB.equipment_pda = /obj/item/device/pda/engineering
|
||||
JOB.equipment_id = /obj/item/weapon/card/id
|
||||
|
||||
jobs.all_jobs += JOB
|
||||
|
||||
//This proc will dress the mob (employee) in the default way for the specified job title/job alias
|
||||
proc/dress_for_job_default(var/mob/living/carbon/human/employee as mob, var/job_alias)
|
||||
if(!ishuman(employee))
|
||||
return
|
||||
|
||||
//TODO ERRORAGE - UNFINISHED
|
||||
var/datum/job/JOB = jobs.get_job(job_alias)
|
||||
if(JOB)
|
||||
var/item = JOB.equipment_ears[1]
|
||||
employee.equip_to_slot_or_del(new item(employee), employee.slot_ears)
|
||||
item = JOB.equipment_under[1]
|
||||
employee.equip_to_slot_or_del(new item(employee), employee.slot_w_uniform)
|
||||
|
||||
|
||||
/*
|
||||
src.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (src), slot_back)
|
||||
src.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(src), slot_in_backpack)
|
||||
src.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng (src), slot_ears) // -- TLE
|
||||
src.equip_to_slot_or_del(new /obj/item/device/pda/engineering(src), slot_belt)
|
||||
src.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(src), slot_w_uniform)
|
||||
src.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(src), slot_shoes)
|
||||
src.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(src), slot_head)
|
||||
src.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt/full(src), slot_l_hand) //currently spawns in hand due to traitor assignment requiring a PDA to be on the belt. --Errorage
|
||||
//src.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(src), slot_gloves) removed as part of Dangercon 2011, approved by Urist_McDorf --Errorage
|
||||
src.equip_to_slot_or_del(new /obj/item/device/t_scanner(src), slot_r_store)
|
||||
*/
|
||||
|
||||
|
||||
//This algorithm works in 5 steps:
|
||||
//1: Assignment of wizard / nuke members (if appropriate game mode)
|
||||
//2: Assignment of jobs based on preferenes
|
||||
// 2.1: Assignment of vital and high priority jobs. Candidates compete on equal terms. If the vital jobs are not filled, a random candidate is chosen to fill them,
|
||||
// 2.2: Assignment of the rest of the jobs based on player preference,
|
||||
//3: Assignment of remaining jobs for remaining players based on chosen departments
|
||||
//4: Random assignment of remaining jobs for remaining players based on assignment priority
|
||||
//5: Assignment of traitor / changeling to assigned roles (if appropriate game mode)
|
||||
proc/assignment_algorithm(var/list/mob/new_player/players)
|
||||
for(var/mob/new_player/PLAYER in players)
|
||||
if(!PLAYER.client)
|
||||
players -= PLAYER
|
||||
continue
|
||||
if(!PLAYER.ready)
|
||||
players -= PLAYER
|
||||
continue
|
||||
|
||||
var/list/datum/job/vital_jobs = list()
|
||||
var/list/datum/job/high_priority_jobs = list()
|
||||
var/list/datum/job/priority_jobs = list()
|
||||
var/list/datum/job/low_priority_jobs = list()
|
||||
var/list/datum/job/assistant_jobs = list()
|
||||
var/list/datum/job/not_assigned_jobs = list()
|
||||
|
||||
for(var/datum/job/J in jobs)
|
||||
switch(J.assignment_priority)
|
||||
if(5)
|
||||
vital_jobs += J
|
||||
if(4)
|
||||
high_priority_jobs += J
|
||||
if(3)
|
||||
priority_jobs += J
|
||||
if(2)
|
||||
low_priority_jobs += J
|
||||
if(1)
|
||||
assistant_jobs += J
|
||||
if(0)
|
||||
not_assigned_jobs += J
|
||||
|
||||
var/list/datum/player_jobs/player_jobs = list() //This datum only holds a mob/new_player and a datum/jobs. The first is the player, the 2nd is the player's selected jobs, from the preferences datum.
|
||||
|
||||
for(var/mob/new_player/NP in players)
|
||||
var/datum/player_jobs/PJ = new/datum/player_jobs
|
||||
PJ.player = NP
|
||||
PJ.selected_jobs = NP.preferences.wanted_jobs
|
||||
player_jobs += PJ
|
||||
|
||||
//At this point we have the player_jobs list filled. Next up we have to assign all vital and high priority positions.
|
||||
|
||||
var/list/datum/job/hp_jobs = jobs.get_jobs_by_priority( HIGH_PRIORITY_JOB, VITAL_PRIORITY_JOB )
|
||||
|
||||
for(var/datum/job/J in hp_jobs)
|
||||
var/list/mob/new_player/candidates = list()
|
||||
for(var/datum/player_jobs/PJ in player_jobs)
|
||||
if(J in PJ.selected_jobs)
|
||||
candidates += PJ.player
|
||||
var/mob/new_player/chosen_player
|
||||
if(candidates)
|
||||
chosen_player = pick(candidates)
|
||||
else
|
||||
if(J.assignment_priority == VITAL_PRIORITY_JOB)
|
||||
if(players) //Just in case there are more vital jobs than there are players.
|
||||
chosen_player = pick(players)
|
||||
if(chosen_player)
|
||||
chosen_player.mind.assigned_job = J
|
||||
players -= chosen_player
|
||||
//TODO ERRORAGE - add capability for hp jobs with more than one slots.
|
||||
|
||||
|
||||
|
||||
|
||||
//1: vital and high priority jobs, assigned on equal terms
|
||||
|
||||
//TODO ERRORAGE - UNFINISHED
|
||||
|
||||
|
||||
//END OF WORK IN PROGRESS CONTENT
|
||||
@@ -0,0 +1,23 @@
|
||||
/**********************Ore to material recipes datum**************************/
|
||||
|
||||
var/list/AVAILABLE_ORES = typesof(/obj/item/weapon/ore)
|
||||
|
||||
/datum/material_recipe
|
||||
var/name
|
||||
var/list/obj/item/weapon/ore/recipe
|
||||
var/obj/prod_type //produced material/object type
|
||||
|
||||
New(var/param_name, var/param_recipe, var/param_prod_type)
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
prod_type = param_prod_type
|
||||
|
||||
var/list/datum/material_recipe/MATERIAL_RECIPES = list(
|
||||
new/datum/material_recipe("Metal",list(/obj/item/weapon/ore/iron),/obj/item/stack/sheet/metal),
|
||||
new/datum/material_recipe("Glass",list(/obj/item/weapon/ore/glass),/obj/item/stack/sheet/glass),
|
||||
new/datum/material_recipe("Gold",list(/obj/item/weapon/ore/gold),/obj/item/stack/sheet/mineral/gold),
|
||||
new/datum/material_recipe("Silver",list(/obj/item/weapon/ore/silver),/obj/item/stack/sheet/mineral/silver),
|
||||
new/datum/material_recipe("Diamond",list(/obj/item/weapon/ore/diamond),/obj/item/stack/sheet/mineral/diamond),
|
||||
new/datum/material_recipe("Plasma",list(/obj/item/weapon/ore/plasma),/obj/item/stack/sheet/mineral/plasma),
|
||||
new/datum/material_recipe("Bananium",list(/obj/item/weapon/ore/clown),/obj/item/stack/sheet/mineral/clown),
|
||||
)
|
||||
@@ -0,0 +1,235 @@
|
||||
/*********************NEW AUTOLATHE / CRAFT LATHE***********************/
|
||||
|
||||
var/list/datum/craftlathe_item/CRAFT_ITEMS = list()
|
||||
var/CRAFT_ITEMS_SETUP = 1 //this should probably be a pre-game thing, but i'll do it so the first lathe2 that's created will set-up the recipes.
|
||||
|
||||
proc/check_craftlathe_recipe(var/list/param_recipe)
|
||||
if(param_recipe.len != 9)
|
||||
return
|
||||
var/i
|
||||
var/match = 0 //this one counts if there is at least one non-"" ingredient.
|
||||
for(var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
match = 0
|
||||
for(i = 1; i <= 9; i++)
|
||||
if(CI.recipe[i] != param_recipe[i])
|
||||
match = 0 //use this so it passes by the match > 0 check below, otherwise i'd need a new variable to tell the return CI below that the check failed
|
||||
break
|
||||
if(CI.recipe[i] != "")
|
||||
match++
|
||||
if(match > 0)
|
||||
return CI
|
||||
return 0
|
||||
|
||||
/datum/craftlathe_item
|
||||
var/id = "" //must be unique for each item type. used to create recipes
|
||||
var/name = "unknown" //what the lathe will show as it's contents
|
||||
var/list/recipe = list("","","","","","","","","") //the 9 items here represent what items need to be placed in the lathe to produce this item.
|
||||
var/item_type = null //this is used on items like sheets which are added when inserted into the lathe.
|
||||
var/amount = 1
|
||||
var/amount_attackby = 1
|
||||
|
||||
/datum/craftlathe_item/New(var/param_id,var/param_name,var/param_amount,var/param_ammount_per_attackby,var/list/param_recipe,var/param_type = null)
|
||||
..()
|
||||
id = param_id
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
item_type = param_type
|
||||
amount = param_amount;
|
||||
amount_attackby = param_ammount_per_attackby
|
||||
return
|
||||
|
||||
//this proc checks the recipe you give in it's parameter with the entire list of available items. If any match, it returns the item from CRAFT_ITEMS. the returned item should not be changed!!
|
||||
|
||||
/obj/machinery/autolathe2
|
||||
name = "Craft lathe"
|
||||
icon_state = "autolathe"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/datum/craftlathe_item/selected = null
|
||||
var/datum/craftlathe_item/make = null
|
||||
var/list/datum/craftlathe_item/craft_contents = list()
|
||||
var/list/current_recipe = list("","","","","","","","","")
|
||||
|
||||
/obj/machinery/autolathe2/New()
|
||||
..()
|
||||
if(CRAFT_ITEMS_SETUP)
|
||||
CRAFT_ITEMS_SETUP = 0
|
||||
build_recipes()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/attack_hand(mob/user as mob)
|
||||
var/dat
|
||||
dat = text("<h3>Craft Lathe</h3>")
|
||||
dat += text("<table><tr><td valign='top'>")
|
||||
|
||||
dat += text("<b>Materials</b><p>")
|
||||
var/datum/craftlathe_item/CI
|
||||
var/i
|
||||
for(i = 1; i <= craft_contents.len; i++)
|
||||
CI = craft_contents[i]
|
||||
if (CI == selected)
|
||||
dat += text("[CI.name] ([CI.amount])<br>")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];select=[i]'>[CI.name]</a> ([CI.amount])<br>")
|
||||
|
||||
dat += text("</td><td valign='top'>")
|
||||
|
||||
dat += text("<b>Crafting Table</b><p>")
|
||||
|
||||
dat += text(" <table bgcolor='#cccccc' cellpadding='4' cellspacing='0'>")
|
||||
|
||||
var/j = 0
|
||||
var/k = 0
|
||||
for (i = 0; i < 3; i++)
|
||||
dat += text(" <tr>")
|
||||
for (j = 1; j <= 3; j++)
|
||||
k = i * 3 + j
|
||||
if (current_recipe[k])
|
||||
dat += text(" <td><A href='?src=\ref[src];remove=[k]'>[current_recipe[k]]</a></td>")
|
||||
else
|
||||
dat += text(" <td><A href='?src=\ref[src];add=[k]'>----</a></td>")
|
||||
dat += text(" </tr>")
|
||||
dat += text(" </table>")
|
||||
|
||||
dat += text("<br><br>")
|
||||
dat += text("<b>Will make: </b>")
|
||||
if (make)
|
||||
dat += text("<A href='?src=\ref[src];make=[1]'>[make.name]</a>")
|
||||
else
|
||||
dat += text("nothing useful")
|
||||
|
||||
dat += text("</td></tr></table>")
|
||||
user << browse("[dat]", "window=craft")
|
||||
|
||||
/obj/machinery/autolathe2/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/n = text2num(href_list["remove"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
current_recipe[n] = ""
|
||||
if(href_list["select"])
|
||||
var/n = text2num(href_list["select"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
selected = craft_contents[n]
|
||||
if(href_list["add"])
|
||||
var/n = text2num(href_list["add"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
if(selected)
|
||||
current_recipe[n] = selected.id
|
||||
if(href_list["make"])
|
||||
var/datum/craftlathe_item/MAKE = check_craftlathe_recipe(src.current_recipe)
|
||||
if(MAKE)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.id == MAKE.id)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(MAKE.id,MAKE.name,MAKE.amount,MAKE.amount_attackby,MAKE.recipe,MAKE.item_type)
|
||||
var/datum/craftlathe_item/CI = check_craftlathe_recipe(src.current_recipe)
|
||||
if(CI)
|
||||
make = CI
|
||||
else
|
||||
make = null
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/autolathe2/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
for (var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
if(W.type == CI.item_type)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.item_type == W.type)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
rmv_item(W)
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(CI.id,CI.name,CI.amount,CI.amount_attackby,CI.recipe,CI.item_type)
|
||||
rmv_item(W)
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/proc/rmv_item(obj/item/W as obj)
|
||||
if(istype(W,/obj/item/stack))
|
||||
var/obj/item/stack/S = W
|
||||
S.amount--
|
||||
if (S.amount <= 0)
|
||||
del(S)
|
||||
else
|
||||
del(W)
|
||||
|
||||
/obj/machinery/autolathe2/proc/build_recipes()
|
||||
//Parameters: ID, Name, Amount, Amount_added_per_attackby, Recipe, Object type
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("METAL","Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R METAL","Reinforced Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/r_metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASS","Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/glass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R GLASS","Reinforced Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/rglass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GOLD","Gold",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/gold)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SILVER","Silver",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/silver)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("DIAMOND","Diamond",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/diamond)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PLASMA","Plasma",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/plasma)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("URANIUM","Uranium",1,1,list("","","","","","","","",""),/obj/item/weapon/ore/mineral/uranium)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CLOWN","Bananium",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/clown)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ADMAMANTINE","Adamantine",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/mineral/adamantine)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREWS","Screws",9,9,list("","","","","METAL","","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("COGS","Cogs",9,9,list("","METAL","","METAL","METAL","METAL","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWITCH","Switch",12,12,list("METAL","","METAL","METAL","METAL","","METAL","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("KEYBOARD","Keyboard",1,1,list("","","","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("M PANEL","Metal Panel",10,10,list("","","","","METAL","METAL","","METAL","METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CASE","Equipment Case",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("G PANEL","Glass Panel",10,10,list("","","","","GLASS","GLASS","","GLASS","GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREEN","Screen",1,1,list("","GLASS","","GLASS","PLASMA","GLASS","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL SILVER","Electronics Silver",30,30,list("","","","","SILVER","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL GOLD","Electronics Gold",6,6,list("","","","","GOLD","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TINTED GL","Tinted Glass",2,2,list("","METAL","","","GLASS","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TANK VALVE","Tank Transfer Valuve",1,1,list("","PIPE","","","PIPE","SWITCH","","PIPE",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PIPE","Pipe",1,1,list("","M PANEL","","","M PANEL","","","M PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CB FRAME","Circuitboard Frame",1,1,list("","","","M PANEL","G PANEL","M PANEL","G PANEL","M PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ROM","ROM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RAM","RAM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PROCESSOR","Processor",1,1,list("EL GOLD","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ANTENNA","Antenna",1,1,list("","","EL SILVER","","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("OP RECEPTOR","Optic Receptor",1,1,list("G PANEL","G PANEL","G PANEL","","EL GOLD","","G PANEL","G PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMAL OP R","Thermal Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","DIAMOND","DIAMOND","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASON OP R","Mason Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","EL SILVER","EL SILVER","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EAR FRAME","Earpiece Frame",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RADIO M","Radio Module",1,1,list("","ANTENNA","","","ROM","","CB FRAME","CB FRAME","CB FRAME"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARPIECE","Radio Earpiece",1,1,list("","","","","RADIO M","","","EAR FRAME",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARMUFFS","Earmuffs",1,1,list("","M PANEL","","EAR FRAME","","EAR FRAME","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASSES FRAME","Glasses Frame",1,1,list("M PANEL","","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASONS","Mason Scanners",1,1,list("","","","MASON OP R","GLASSES FRAME","MASON OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMALS","Thermal Scanners",1,1,list("","","","THERMAL OP R","GLASSES FRAME","THERMAL OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SUNGLASSES","Sunglasses",1,1,list("","","","TINTED GL","GLASSES FRAME","TINTED GL","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET FR","Helmet Frame",1,1,list("METAL","METAL","METAL","METAL","","METAL","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET","Security Helmet",1,1,list("R METAL","R METAL","R METAL","R METAL","HELMET FR","R METAL","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS HELMET","HoS Helmet",1,1,list("SILVER","GOLD","SILVER","SILVER","HELMET","SILVER","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HARDHAT","Hardhat",1,1,list("","FLASHLIGHT","","","HELMET FR","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWAT HELMET","SWAT Helmet",1,1,list("","","","","HELMET","","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("WELDING HELM","Welding Helmet",1,1,list("","","","","HELMET FR","","TINTED GL","TINTED GL","TINTED GL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE HELMET","Space Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","HELMET FR","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG HELMET","RIG Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","SPACE HELMET","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GAS MASK","Gas Mask",1,1,list("","","","","HELMET FR","TANK VALVE","","G PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR FRAME","Armor Frame",1,1,list("R METAL","","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR","Armored Vest",1,1,list("R METAL","","R METAL","R METAL","ARMOR FRAME","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS ARMOR","HoS Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CAP ARMOR","Captain Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","HOS ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE S FR","Space Suit Frame",1,1,list("SILVER","","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE SUIT","Space Suit",1,1,list("SILVER","","SILVER","RAM","SPACE S FR","RADIO M","SILVER","SILVEr","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG SUIT","RIG Suit",1,1,list("SILVER","","SILVER","SILVER","SPACE SUIT","SILVER","SILVER","SILVER","SILVER"))
|
||||
//TODO: Flashlight, type paths
|
||||
return
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -0,0 +1,78 @@
|
||||
/**********************Gas extractor**************************/
|
||||
|
||||
/obj/machinery/mineral/gasextractor
|
||||
name = "Gas extractor"
|
||||
desc = "A machine which extracts gasses from ores"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/message = "";
|
||||
var/processing = 0
|
||||
var/newtoxins = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/gasextractor/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/gasextractor/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];extract=[input]'>Extract gas</A>")
|
||||
|
||||
dat += text("<br><br>Message: [message]")
|
||||
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/gasextractor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["extract"])
|
||||
if (src.output)
|
||||
if (locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
newtoxins = 0
|
||||
processing = 1
|
||||
var/obj/item/weapon/ore/O
|
||||
while(locate(/obj/item/weapon/ore/plasma, input.loc) && locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
O = locate(/obj/item/weapon/ore/plasma, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
var/obj/machinery/portable_atmospherics/canister/C
|
||||
C = locate(/obj/machinery/portable_atmospherics/canister,output.loc)
|
||||
C.air_contents.toxins += 100
|
||||
newtoxins += 100
|
||||
del(O)
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
message = "Canister filled with [newtoxins] units of toxins"
|
||||
else
|
||||
message = "No canister found"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,88 @@
|
||||
/**********************Mineral purifier (not used, replaced with mineral processing unit)**************************/
|
||||
|
||||
/obj/machinery/mineral/purifier
|
||||
name = "Ore Purifier"
|
||||
desc = "A machine which makes building material out of ores"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/processed = 0
|
||||
var/processing = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/purifier/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];purify=[input]'>Purify</A>")
|
||||
|
||||
dat += text("<br><br>found: <font color='green'><b>[processed]</b></font>")
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/purifier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["purify"])
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
var/obj/item/weapon/ore/O
|
||||
processed = 0;
|
||||
while(locate(/obj/item/weapon/ore, input.loc))
|
||||
O = locate(/obj/item/weapon/ore, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
new /obj/item/stack/sheet/mineral/diamond(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
new /obj/item/stack/sheet/mineral/plasma(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
new /obj/item/stack/sheet/mineral/gold(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
new /obj/item/stack/sheet/mineral/silver(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
new /obj/item/weapon/ore/mineral/uranium(output.loc)
|
||||
del(O)
|
||||
/*if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
new /obj/item/weapon/ore/adamantine(output.loc)
|
||||
del(O)*/ //Dunno what this area does so I'll keep it commented out for now -Durandan
|
||||
processed++
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/purifier/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
@@ -0,0 +1,174 @@
|
||||
/**********************Random mine generator************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/mine_generator
|
||||
name = "Random mine generator"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
var/turf/last_loc
|
||||
var/turf/target_loc
|
||||
var/turf/start_loc
|
||||
var/randXParam //the value of these two parameters are generated by the code itself and used to
|
||||
var/randYParam //determine the random XY parameters
|
||||
var/mineDirection = 3
|
||||
/*
|
||||
0 = none
|
||||
1 = N
|
||||
2 = NNW
|
||||
3 = NW
|
||||
4 = WNW
|
||||
5 = W
|
||||
6 = WSW
|
||||
7 = SW
|
||||
8 = SSW
|
||||
9 = S
|
||||
10 = SSE
|
||||
11 = SE
|
||||
12 = ESE
|
||||
13 = E
|
||||
14 = ENE
|
||||
15 = NE
|
||||
16 = NNE
|
||||
*/
|
||||
|
||||
/obj/effect/mine_generator/New()
|
||||
last_loc = src.loc
|
||||
var/i
|
||||
for(i = 0; i < 50; i++)
|
||||
gererateTargetLoc()
|
||||
//target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z)
|
||||
fillWithAsteroids()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end.
|
||||
switch(mineDirection)
|
||||
if(1)
|
||||
randXParam = 0
|
||||
randYParam = 4
|
||||
if(2)
|
||||
randXParam = 1
|
||||
randYParam = 3
|
||||
if(3)
|
||||
randXParam = 2
|
||||
randYParam = 2
|
||||
if(4)
|
||||
randXParam = 3
|
||||
randYParam = 1
|
||||
if(5)
|
||||
randXParam = 4
|
||||
randYParam = 0
|
||||
if(6)
|
||||
randXParam = 3
|
||||
randYParam = -1
|
||||
if(7)
|
||||
randXParam = 2
|
||||
randYParam = -2
|
||||
if(8)
|
||||
randXParam = 1
|
||||
randYParam = -3
|
||||
if(9)
|
||||
randXParam = 0
|
||||
randYParam = -4
|
||||
if(10)
|
||||
randXParam = -1
|
||||
randYParam = -3
|
||||
if(11)
|
||||
randXParam = -2
|
||||
randYParam = -2
|
||||
if(12)
|
||||
randXParam = -3
|
||||
randYParam = -1
|
||||
if(13)
|
||||
randXParam = -4
|
||||
randYParam = 0
|
||||
if(14)
|
||||
randXParam = -3
|
||||
randYParam = 1
|
||||
if(15)
|
||||
randXParam = -2
|
||||
randYParam = 2
|
||||
if(16)
|
||||
randXParam = -1
|
||||
randYParam = 3
|
||||
target_loc = last_loc
|
||||
if (randXParam > 0)
|
||||
target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z)
|
||||
if (randYParam > 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z)
|
||||
if (randXParam < 0)
|
||||
target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z)
|
||||
if (randYParam < 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z)
|
||||
if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly
|
||||
if(prob(50))
|
||||
mineDirection += 2
|
||||
else
|
||||
mineDirection -= 2
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
else
|
||||
if(prob(50))
|
||||
if(prob(50))
|
||||
mineDirection += 1
|
||||
else
|
||||
mineDirection -= 1
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/fillWithAsteroids()
|
||||
|
||||
if(last_loc)
|
||||
start_loc = last_loc
|
||||
|
||||
if(start_loc && target_loc)
|
||||
var/x1
|
||||
var/y1
|
||||
|
||||
var/turf/line_start = start_loc
|
||||
var/turf/column = line_start
|
||||
|
||||
if(start_loc.x <= target_loc.x)
|
||||
if(start_loc.y <= target_loc.y) //GOING NORTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING NORTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else
|
||||
if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING SOUTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
@@ -0,0 +1,338 @@
|
||||
/**********************Rail track**************************/
|
||||
|
||||
/obj/machinery/rail_track
|
||||
name = "Rail track"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
var/id = null //this is needed for switches to work Set to the same on the whole length of the track
|
||||
anchored = 1
|
||||
|
||||
/**********************Rail intersection**************************/
|
||||
|
||||
/obj/machinery/rail_track/intersections
|
||||
name = "Rail track intersection"
|
||||
icon_state = "rail_intersection"
|
||||
|
||||
/obj/machinery/rail_track/intersections/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (5) dir = 4
|
||||
if (4) dir = 9
|
||||
if (9) dir = 2
|
||||
if (2) dir = 10
|
||||
if (10) dir = 8
|
||||
if (8) dir = 6
|
||||
if (6) dir = 1
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSE"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (2) dir = 5
|
||||
if (5) dir = 9
|
||||
if (9) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_SEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (8) dir = 6
|
||||
if (4) dir = 6
|
||||
if (6) dir = 5
|
||||
if (5) dir = 8
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSW"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 10
|
||||
if (2) dir = 10
|
||||
if (10) dir = 6
|
||||
if (6) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (4) dir = 9
|
||||
if (8) dir = 9
|
||||
if (9) dir = 10
|
||||
if (10) dir = 8
|
||||
return
|
||||
|
||||
/**********************Rail switch**************************/
|
||||
|
||||
/obj/machinery/rail_switch
|
||||
name = "Rail switch"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "switch-off"
|
||||
var/obj/machinery/rail_track/track = null
|
||||
var/id //used for to change the track pieces
|
||||
|
||||
/obj/machinery/rail_switch/New()
|
||||
spawn(10)
|
||||
src.track = locate(/obj/machinery/rail_track, get_step(src, NORTH))
|
||||
if(track)
|
||||
id = track.id
|
||||
return
|
||||
|
||||
/obj/machinery/rail_switch/attack_hand(user as mob)
|
||||
user << "You switch the rail track's direction"
|
||||
for (var/obj/machinery/rail_track/T in world)
|
||||
if (T.id == src.id)
|
||||
var/obj/machinery/rail_car/C = locate(/obj/machinery/rail_car, T.loc)
|
||||
if (C)
|
||||
switch (T.dir)
|
||||
if(1)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(2)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(4)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(8)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(5)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(6)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(9)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "N"
|
||||
if("W") C.direction = "E"
|
||||
if(10)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "W"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "N"
|
||||
return
|
||||
|
||||
/**********************Rail car**************************/
|
||||
|
||||
/obj/machinery/rail_car
|
||||
name = "Rail car"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
var/direction = "S" //S = south, N = north, E = east, W = west. Determines whichw ay it'll look first
|
||||
var/moving = 0;
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/speed = 0
|
||||
var/slowing = 0
|
||||
var/atom/movable/load = null //what it's carrying
|
||||
|
||||
/obj/machinery/rail_car/attack_hand(user as mob)
|
||||
if (moving == 0)
|
||||
processing_items.Add(src)
|
||||
moving = 1
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
|
||||
/*
|
||||
for (var/client/C)
|
||||
C << "Dela."
|
||||
*/
|
||||
|
||||
/obj/machinery/rail_car/MouseDrop_T(var/atom/movable/C, mob/user)
|
||||
|
||||
if(user.stat)
|
||||
return
|
||||
|
||||
if (!istype(C) || C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 )
|
||||
return
|
||||
|
||||
if(ismob(C))
|
||||
load(C)
|
||||
|
||||
|
||||
/obj/machinery/rail_car/proc/load(var/atom/movable/C)
|
||||
|
||||
if(get_dist(C, src) > 1)
|
||||
return
|
||||
//mode = 1
|
||||
|
||||
C.loc = src.loc
|
||||
sleep(2)
|
||||
C.loc = src
|
||||
load = C
|
||||
|
||||
C.pixel_y += 9
|
||||
if(C.layer < layer)
|
||||
C.layer = layer + 0.1
|
||||
overlays += C
|
||||
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
//mode = 0
|
||||
//send_status()
|
||||
|
||||
/obj/machinery/rail_car/proc/unload(var/dirn = 0)
|
||||
if(!load)
|
||||
return
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
load.loc = src.loc
|
||||
load.pixel_y -= 9
|
||||
load.layer = initial(load.layer)
|
||||
if(ismob(load))
|
||||
var/mob/M = load
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
|
||||
if(dirn)
|
||||
step(load, dirn)
|
||||
|
||||
load = null
|
||||
|
||||
// in case non-load items end up in contents, dump every else too
|
||||
// this seems to happen sometimes due to race conditions
|
||||
// with items dropping as mobs are loaded
|
||||
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.layer = initial(AM.layer)
|
||||
AM.pixel_y = initial(AM.pixel_y)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
/obj/machinery/rail_car/relaymove(var/mob/user)
|
||||
if(user.stat)
|
||||
return
|
||||
if(load == user)
|
||||
unload(0)
|
||||
return
|
||||
|
||||
/obj/machinery/rail_car/process()
|
||||
if (moving == 1)
|
||||
if (slowing == 1)
|
||||
if (speed > 0)
|
||||
speed--;
|
||||
if (speed == 0)
|
||||
slowing = 0
|
||||
else
|
||||
if (speed < 10)
|
||||
speed++;
|
||||
var/i = 0
|
||||
for (i = 0; i < speed; i++)
|
||||
if (moving == 1)
|
||||
switch (direction)
|
||||
if ("S")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y-1,src.z))
|
||||
if (R.dir == 10)
|
||||
direction = "W"
|
||||
if (R.dir == 9)
|
||||
direction = "E"
|
||||
if (R.dir == 2 || R.dir == 1 || R.dir == 10 || R.dir == 9)
|
||||
for (var/mob/living/M in locate(src.x,src.y-1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("N")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y+1,src.z))
|
||||
if (R.dir == 5)
|
||||
direction = "E"
|
||||
if (R.dir == 6)
|
||||
direction = "W"
|
||||
if (R.dir == 5 || R.dir == 1 || R.dir == 6 || R.dir == 2)
|
||||
for (var/mob/living/M in locate(src.x,src.y+1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("E")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x+1,src.y,src.z))
|
||||
if (R.dir == 6)
|
||||
direction = "S"
|
||||
if (R.dir == 10)
|
||||
direction = "N"
|
||||
if (R.dir == 4 || R.dir == 8 || R.dir == 10 || R.dir == 6)
|
||||
for (var/mob/living/M in locate(src.x+1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("W")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x-1,src.y,src.z))
|
||||
if (R.dir == 9)
|
||||
direction = "N"
|
||||
if (R.dir == 5)
|
||||
direction = "S"
|
||||
if (R.dir == 8 || R.dir == 9 || R.dir == 5 || R.dir == 4)
|
||||
for (var/mob/living/M in locate(src.x-1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
sleep(1)
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
@@ -0,0 +1,173 @@
|
||||
/**********************Spaceship builder area definitions**************************/
|
||||
|
||||
/area/shipbuilder
|
||||
requires_power = 0
|
||||
luminosity = 1
|
||||
sd_lighting = 0
|
||||
|
||||
/area/shipbuilder/station
|
||||
name = "shipbuilder station"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship1
|
||||
name = "shipbuilder ship1"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship2
|
||||
name = "shipbuilder ship2"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship3
|
||||
name = "shipbuilder ship3"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship4
|
||||
name = "shipbuilder ship4"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship5
|
||||
name = "shipbuilder ship5"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship6
|
||||
name = "shipbuilder ship6"
|
||||
icon_state = "teleporter"
|
||||
|
||||
|
||||
/**********************Spaceship builder**************************/
|
||||
|
||||
/obj/machinery/spaceship_builder
|
||||
name = "Robotic Fabricator"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "fab-idle"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/metal_amount = 0
|
||||
var/operating = 0
|
||||
var/area/currentShuttleArea = null
|
||||
var/currentShuttleName = null
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/buildShuttle(var/shuttle)
|
||||
|
||||
var/shuttleat = null
|
||||
var/shuttleto = "/area/shipbuilder/station"
|
||||
|
||||
var/req_metal = 0
|
||||
switch(shuttle)
|
||||
if("hopper")
|
||||
shuttleat = "/area/shipbuilder/ship1"
|
||||
currentShuttleName = "Planet hopper"
|
||||
req_metal = 25000
|
||||
if("bus")
|
||||
shuttleat = "/area/shipbuilder/ship2"
|
||||
currentShuttleName = "Blnder Bus"
|
||||
req_metal = 60000
|
||||
if("dinghy")
|
||||
shuttleat = "/area/shipbuilder/ship3"
|
||||
currentShuttleName = "Space dinghy"
|
||||
req_metal = 100000
|
||||
if("van")
|
||||
shuttleat = "/area/shipbuilder/ship4"
|
||||
currentShuttleName = "Boxvan MMDLVI"
|
||||
req_metal = 120000
|
||||
if("secvan")
|
||||
shuttleat = "/area/shipbuilder/ship5"
|
||||
currentShuttleName = "Boxvan MMDLVI - Security edition"
|
||||
req_metal = 125000
|
||||
if("station4")
|
||||
shuttleat = "/area/shipbuilder/ship6"
|
||||
currentShuttleName = "Space station 4"
|
||||
req_metal = 250000
|
||||
|
||||
if (metal_amount - req_metal < 0)
|
||||
return
|
||||
|
||||
if (!shuttleat)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = shuttleat
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/scrapShuttle()
|
||||
|
||||
var/shuttleat = "/area/shipbuilder/station"
|
||||
var/shuttleto = currentShuttleArea
|
||||
|
||||
if (!shuttleto)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = null
|
||||
currentShuttleName = null
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/stack/sheet/metal))
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = W
|
||||
user << "\blue You insert all the metal into the machine."
|
||||
metal_amount += M.amount * 100
|
||||
del(M)
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attack_hand(user as mob)
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("<b>Ship fabricator</b><br><br>")
|
||||
dat += text("Current ammount of <font color='gray'>Metal: <b>[metal_amount]</b></font><br><hr>")
|
||||
|
||||
if (currentShuttleArea)
|
||||
dat += text("<b>Currently building</b><br><br>[currentShuttleName]<br><br>")
|
||||
dat += text("<b>Build the shuttle to your liking.</b><br>This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.")
|
||||
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
|
||||
else
|
||||
dat += text("<b>Available ships to build:</b><br><br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
|
||||
|
||||
user << browse("[dat]", "window=shipbuilder")
|
||||
|
||||
|
||||
/obj/machinery/spaceship_builder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["ship"])
|
||||
buildShuttle(href_list["ship"])
|
||||
if(href_list["scrap"])
|
||||
scrapShuttle(href_list["ship"])
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,15 @@
|
||||
// this toggle doesn't save across rounds
|
||||
/mob/verb/musictoggle()
|
||||
set name = "Music Toggle"
|
||||
if(src.be_music == 0)
|
||||
src.be_music = 1
|
||||
src << "\blue Music toggled on!"
|
||||
return
|
||||
src.be_music = 0
|
||||
src << "\blue Music toggled off!"
|
||||
|
||||
// This checks a var on each area and plays that var
|
||||
/area/Entered(mob/A as mob)
|
||||
if (A && src.music != "" && A.client && A.be_music != 0 && (A.music_lastplayed != src.music))
|
||||
A.music_lastplayed = src.music
|
||||
A << sound(src.music, repeat = 0, wait = 0, volume = 20, channel = 1)
|
||||
@@ -0,0 +1,138 @@
|
||||
|
||||
/obj/effect/new_year_tree
|
||||
name = "The fir"
|
||||
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
|
||||
icon = 'icons/effects/160x160.dmi'
|
||||
icon_state = "new-year-tree"
|
||||
anchored = 1
|
||||
opacity = 1
|
||||
density = 1
|
||||
layer = 5
|
||||
pixel_x = -64
|
||||
//pixel_y = -64
|
||||
|
||||
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
return
|
||||
W.loc = src
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
user.u_equip(W)
|
||||
var/const/bottom_right_x = 115.0
|
||||
var/const/bottom_right_y = 150.0
|
||||
var/const/top_left_x = 15.0
|
||||
var/const/top_left_y = 15.0
|
||||
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
|
||||
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
|
||||
var/y = rand(top_left_y,bottom_right_y)
|
||||
/*
|
||||
y1=a*x1+b
|
||||
y2=a*x2+b b = y2-a*x2
|
||||
|
||||
y1=a*x1+ y2-a*x2
|
||||
a*(x1-x2)+y2-y1=0
|
||||
a = (y1-y2)/(x1-x2)
|
||||
*/
|
||||
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
|
||||
var/b = bottom_right_y-a*bottom_med_x
|
||||
|
||||
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
|
||||
x = bottom_med_x + x - top_left_x
|
||||
y = bottom_right_y - y + top_left_y
|
||||
var/image/I = image(W.icon, W, icon_state = W.icon_state)
|
||||
I.pixel_x = x
|
||||
I.pixel_y = y
|
||||
overlays += I
|
||||
/*
|
||||
/obj/item/weapon/firbang
|
||||
desc = "It is set to detonate in 10 seconds."
|
||||
name = "firbang"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "flashbang"
|
||||
var/state = null
|
||||
var/det_time = 100.0
|
||||
w_class = 2.0
|
||||
item_state = "flashbang"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
|
||||
if (user.get_active_hand() == src)
|
||||
if ((CLUMSY in usr.mutations) && prob(50))
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else if (!( src.state ))
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
user.dir = get_dir(user, target)
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
walk_towards(src, t, 3)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/weapon/firbang/attack_hand()
|
||||
walk(src, null, null)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/proc/prime()
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new
|
||||
smoke.set_up(3, 0, src.loc)
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
new /obj/effect/new_year_tree(T)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_self(mob/user as mob)
|
||||
if (!src.state)
|
||||
if (CLUMSY in user.mutations)
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
add_fingerprint(user)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
/datum/supply_packs/new_year
|
||||
name = "New Year Celebration Equipment"
|
||||
contains = list("/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper")
|
||||
cost = 20
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "New Year Celebration crate"
|
||||
*/
|
||||
@@ -0,0 +1,191 @@
|
||||
//It's not a very big change, but I think melee will benefit from it.
|
||||
//Currently will only be restricted to special training weapons to test the balancedness of the system.
|
||||
//1)Knockdown, stun and weaken chances are separate and dependant on the part of the body you're aiming at
|
||||
//eg a mop will be better applied to legs since it has a higher base knockdown chance than the other disabling states
|
||||
//while an energy gun would be better applied to the chest because of the stunning chance.
|
||||
//2)Weapons also have a parry chance which is checked every time the one wielding the weapon is attacked in melee
|
||||
//in the area is currently aiming at and is able to defend himself.
|
||||
//More ideas to come.
|
||||
|
||||
//NOTES: doesn't work with armor yet
|
||||
|
||||
/obj/item/weapon/training //subclass of weapons that is currently the only one that uses the alternate combat system
|
||||
name = "training weapon"
|
||||
desc = "A weapon for training the advanced fighting technicues"
|
||||
var/chance_parry = 0
|
||||
var/chance_weaken = 0
|
||||
var/chance_stun = 0
|
||||
var/chance_knockdown = 0
|
||||
var/chance_knockout = 0
|
||||
var/chance_disarm = 0
|
||||
|
||||
//chances - 5 is low, 10 is medium, 15 is good
|
||||
|
||||
/obj/item/weapon/training/axe //hard-hitting, but doesn't have much in terms of disabling people (except by killing)
|
||||
name = "training axe"
|
||||
icon_state = "training_axe"
|
||||
/*combat stats*/
|
||||
force = 15
|
||||
chance_parry = 5
|
||||
chance_weaken = 10
|
||||
chance_stun = 5
|
||||
chance_knockdown = 5
|
||||
chance_knockout = 5
|
||||
chance_disarm = 0
|
||||
|
||||
/obj/item/weapon/training/sword //not bad attack, good at parrying and disarming
|
||||
name = "training sword"
|
||||
icon_state = "training_sword"
|
||||
/*combat stats*/
|
||||
force = 10
|
||||
chance_parry = 15
|
||||
chance_weaken = 5
|
||||
chance_stun = 0
|
||||
chance_knockdown = 5
|
||||
chance_knockout = 0
|
||||
chance_disarm = 15
|
||||
|
||||
/obj/item/weapon/training/staff //not bad attack either, good at tripping and parrying
|
||||
name = "training staff"
|
||||
icon_state = "training_staff"
|
||||
/*combat stats*/
|
||||
force = 10
|
||||
chance_parry = 15
|
||||
chance_weaken = 5
|
||||
chance_stun = 0
|
||||
chance_knockdown = 15
|
||||
chance_knockout = 0
|
||||
chance_disarm = 5
|
||||
|
||||
/obj/item/weapon/training/mace //worst attack, but has a good chance of stun, knockout or weaken
|
||||
name = "training mace"
|
||||
icon_state = "training_mace"
|
||||
/*combat stats*/
|
||||
force = 5
|
||||
chance_parry = 0
|
||||
chance_weaken = 15
|
||||
chance_stun = 10
|
||||
chance_knockdown = 0
|
||||
chance_knockout = 10
|
||||
chance_disarm = 0
|
||||
|
||||
/obj/item/weapon/training/attack(target as mob, mob/user as mob)
|
||||
var/target_area = attack_location(user.zone_sel.selecting)
|
||||
for(var/mob/O in viewers(src,7))
|
||||
O << "\red \b [user.name] attacks [target.name] in the [target_area] with [src.name]!"
|
||||
if(!target.stat && target.zone_sel.selecting == target_area) //parrying occurs here
|
||||
if(istype(target.r_hand,/obj/item/weapon/training)
|
||||
if(prob(target.r_hand:chance_parry))
|
||||
for(var/mob/O in viewers(src,7))
|
||||
O << "\red \b [target.name] deftly parries the attack with [target.r_hand.name]!"
|
||||
return
|
||||
if(istype(target.l_hand,/obj/item/weapon/training)
|
||||
if(prob(target.l_hand:chance_parry))
|
||||
for(var/mob/O in viewers(src,7))
|
||||
O << "\red \b [target.name] deftly parries the attack with [target.l_hand.name]!"
|
||||
return
|
||||
target.adjustBruteLoss(-src.force)
|
||||
|
||||
var/modifier_knockdown = 1.0
|
||||
var/modifier_knockout = 1.0
|
||||
var/modifier_stun = 1.0
|
||||
var/modifier_weaken = 1.0
|
||||
var/modifier_disarm = 0.0
|
||||
|
||||
switch(target_area)
|
||||
if("eyes")
|
||||
modifier_weaken = 2.0
|
||||
modifier_stun = 0.5
|
||||
modifier_knockdown = 0.0
|
||||
if("head")
|
||||
modifier_stun = 0.8
|
||||
modifier_knockout = 1.5
|
||||
modifier_weaken = 1.2
|
||||
modifier_knockdown = 0.0
|
||||
if("chest")
|
||||
if("right arm","r_arm")
|
||||
if("left arm","l_arm")
|
||||
if("right hand","r_hand")
|
||||
if("left hand","l_hand")
|
||||
if("groin")
|
||||
if("right leg","r_leg")
|
||||
if("left leg","l_leg")
|
||||
if("right foot","r_foot")
|
||||
if("left foot","l_foot")
|
||||
|
||||
|
||||
/proc/attack_location(var/initloc = "chest") //proc to randomise actual hit loc based on where you're aiming at
|
||||
var/resultloc = "chest" //also forgot hands/feet. bleh
|
||||
var/percentage = rand(1,100)
|
||||
switch(initloc)
|
||||
if("eyes")
|
||||
switch(percentage)
|
||||
if(1 to 10)
|
||||
resultloc = "eyes"
|
||||
if(11 to 30)
|
||||
resultloc = "head"
|
||||
if(31 to 100)
|
||||
resultloc = "chest"
|
||||
if("head")
|
||||
switch(percentage)
|
||||
if(1 to 5)
|
||||
resultloc = "eyes"
|
||||
if(6 to 40)
|
||||
resultloc = "head"
|
||||
if(41 to 100)
|
||||
resultloc = "chest"
|
||||
if("chest")
|
||||
switch(percentage)
|
||||
if(1 to 80)
|
||||
resultloc = "chest"
|
||||
if(81 to 84)
|
||||
resultloc = "right arm"
|
||||
if(85 to 88)
|
||||
resultloc = "left arm"
|
||||
if(89 to 92)
|
||||
resultloc = "right leg"
|
||||
if(93 to 96)
|
||||
resultloc = "left leg"
|
||||
if(97 to 98)
|
||||
resultloc = "groin"
|
||||
if(99 to 100)
|
||||
resultloc = "head"
|
||||
if("l_arm")
|
||||
switch(percentage)
|
||||
if(1 to 60)
|
||||
resultloc = "left arm"
|
||||
if(61 to 100)
|
||||
resultloc = "chest"
|
||||
if("r_arm")
|
||||
switch(percentage)
|
||||
if(1 to 60)
|
||||
resultloc = "right arm"
|
||||
if(61 to 100)
|
||||
resultloc = "chest"
|
||||
if("groin")
|
||||
switch(percentage)
|
||||
if(1 to 35)
|
||||
resultloc = "groin"
|
||||
if(36 to 50)
|
||||
resultloc = "left leg"
|
||||
if(51 to 65)
|
||||
resultloc = "right leg"
|
||||
if(66 to 100)
|
||||
resultloc = "chest"
|
||||
if("l_leg")
|
||||
switch(percentage)
|
||||
if(1 to 60)
|
||||
resultloc = "left leg"
|
||||
if(61 to 70)
|
||||
resultloc = "groin"
|
||||
if(71 to 100)
|
||||
resultloc = "chest"
|
||||
if("r_leg")
|
||||
switch(percentage)
|
||||
if(1 to 60)
|
||||
resultloc = "right leg"
|
||||
if(61 to 70)
|
||||
resultloc = "groin"
|
||||
if(71 to 100)
|
||||
resultloc = "chest"
|
||||
return resultloc
|
||||
@@ -0,0 +1,178 @@
|
||||
// the laser beam
|
||||
|
||||
|
||||
/obj/effect/beam/laser
|
||||
name = "laser beam"
|
||||
icon = 'icons/effects/beam.dmi'
|
||||
icon_state = "full"
|
||||
density = 0
|
||||
mouse_opacity = 0
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
flags = TABLEPASS
|
||||
var/wavelength // the (vaccuum) wavelength of the beam
|
||||
var/width = 1 // 1=thin, 2=medium, 3=wide
|
||||
|
||||
var/obj/effect/beam/laser/next
|
||||
var/obj/effect/beam/laser/prev
|
||||
var/obj/master
|
||||
|
||||
New(var/atom/newloc, var/dirn, var/lambda, var/omega=1, var/half=0)
|
||||
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
//world << "creating beam at ([newloc.x],[newloc.y]) with [dirn] [lambda] [omega] [half]"
|
||||
|
||||
icon_state = "[omega]-[half ? "half" : "full"]"
|
||||
dir = dirn
|
||||
set_wavelength(lambda)
|
||||
..(newloc)
|
||||
spawn(0)
|
||||
src.propagate()
|
||||
src.verbs -= /atom/movable/verb/pull
|
||||
|
||||
|
||||
|
||||
proc/propagate()
|
||||
var/turf/T = get_step(src, dir)
|
||||
if(T)
|
||||
if(T.Enter(src))
|
||||
next = new(T, dir, wavelength, width, 0)
|
||||
next.prev = src
|
||||
next.master = src.master
|
||||
else
|
||||
spawn(5)
|
||||
propagate()
|
||||
|
||||
|
||||
proc/remove()
|
||||
if(next)
|
||||
next.remove()
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
proc/blocked(var/atom/A)
|
||||
return density || opacity
|
||||
/*
|
||||
/turf/Enter(atom/movable/mover as mob|obj)
|
||||
if (!mover || !isturf(mover.loc))
|
||||
return 1
|
||||
|
||||
|
||||
//First, check objects to block exit that are not on the border
|
||||
for(var/obj/obstacle in mover.loc)
|
||||
if((obstacle.flags & ~ON_BORDER) && (mover != obstacle) && (forget != obstacle))
|
||||
if(!obstacle.CheckExit(mover, src))
|
||||
mover.Bump(obstacle, 1)
|
||||
return 0
|
||||
|
||||
//Now, check objects to block exit that are on the border
|
||||
for(var/obj/border_obstacle in mover.loc)
|
||||
if((border_obstacle.flags & ON_BORDER) && (mover != border_obstacle) && (forget != border_obstacle))
|
||||
if(!border_obstacle.CheckExit(mover, src))
|
||||
mover.Bump(border_obstacle, 1)
|
||||
return 0
|
||||
|
||||
//Next, check objects to block entry that are on the border
|
||||
for(var/obj/border_obstacle in src)
|
||||
if(border_obstacle.flags & ON_BORDER)
|
||||
if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle))
|
||||
mover.Bump(border_obstacle, 1)
|
||||
return 0
|
||||
|
||||
//Then, check the turf itself
|
||||
if (!src.CanPass(mover, src))
|
||||
mover.Bump(src, 1)
|
||||
return 0
|
||||
|
||||
//Finally, check objects/mobs to block entry that are not on the border
|
||||
for(var/atom/movable/obstacle in src)
|
||||
if(obstacle.flags & ~ON_BORDER)
|
||||
if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle))
|
||||
mover.Bump(obstacle, 1)
|
||||
return 0
|
||||
return 1 //Nothing found to block so return success!
|
||||
*/
|
||||
|
||||
|
||||
HasEntered(var/atom/movable/AM)
|
||||
if(istype(AM, /obj/effect/beam))
|
||||
return
|
||||
if(blocked(AM))
|
||||
remove(src)
|
||||
if(prev)
|
||||
prev.propagate()
|
||||
else if(master)
|
||||
master:turn_on()
|
||||
|
||||
proc/set_wavelength(var/lambda)
|
||||
|
||||
var/w = round(lambda,1) // integer wavelength
|
||||
wavelength = lambda
|
||||
// first look for cached version of the icon at this wavelength
|
||||
var/icon/cached = beam_icons["[w]"]
|
||||
if(cached)
|
||||
icon = cached
|
||||
|
||||
return
|
||||
|
||||
// no cached version, so generate a new one
|
||||
|
||||
// this maps a wavelength in the range 380-780 nm to an R,G,B,A value
|
||||
var/red = 0
|
||||
var/green = 0
|
||||
var/blue = 0
|
||||
var/alpha = 0
|
||||
|
||||
switch(w)
|
||||
if(380 to 439)
|
||||
red = (440-w) / 60
|
||||
green = 0
|
||||
blue = 1
|
||||
if(440 to 489)
|
||||
red = 0
|
||||
green = (w-440) / 50
|
||||
blue = 1
|
||||
if(490 to 509)
|
||||
red = 0
|
||||
green = 1
|
||||
blue = (510 - w) / 20
|
||||
if(510 to 579)
|
||||
red = (w-510) / 70
|
||||
green = 1
|
||||
blue = 0
|
||||
if(580 to 644)
|
||||
red = 1
|
||||
green = (645-w) / 65
|
||||
blue = 0
|
||||
if(645 to 780)
|
||||
red = 1
|
||||
green = 0
|
||||
blue = 0
|
||||
|
||||
// colour is done, now calculate intensity
|
||||
switch(w)
|
||||
if(380 to 419)
|
||||
alpha = 0.75*(w-380)/40
|
||||
if(420 to 700)
|
||||
alpha = 0.75
|
||||
if(701 to 780)
|
||||
alpha = 0.75*(780-w)/80
|
||||
|
||||
// remap alpha by intensity gamma
|
||||
if(alpha != 0)
|
||||
alpha = alpha**0.80
|
||||
|
||||
var/icon/I = icon('icons/effects/beam.dmi')
|
||||
I.MapColors(red,0,0,0, 0,green,0,0, 0,0,blue,0, 0,0,0,alpha, 0,0,0,0)
|
||||
icon = I
|
||||
|
||||
beam_icons["[w]"] = I
|
||||
|
||||
|
||||
|
||||
// global cache of beam icons
|
||||
// this is an assoc list mapping (integer) wavelength to icons
|
||||
|
||||
var/list/beam_icons = new()
|
||||
@@ -0,0 +1,73 @@
|
||||
// A laser pointer. Emits a (tunable) low-power laser beam
|
||||
// Used for alignment and testing of the optics system
|
||||
|
||||
/obj/item/device/laser_pointer
|
||||
name = "laser pointer"
|
||||
desc = "A portable low-power laser used for optical system alignment. The label reads: 'Danger: Class IIIa laser device. Avoid direct eye exposure."
|
||||
icon = 'optics.dmi'
|
||||
icon_state = "pointer0"
|
||||
var/on = 0 // true if operating
|
||||
var/wavelength = 632 // operation wavelength (nm)
|
||||
|
||||
var/gain_peak = 632 // gain peak (nm)
|
||||
var/gain_width = 35 // gain bandwidth (nm)
|
||||
var/peak_output = 0.005 // max output 5 mW
|
||||
layer = OBJ_LAYER + 0.1
|
||||
|
||||
w_class = 4
|
||||
m_amt = 500
|
||||
g_amt = 100
|
||||
w_amt = 200
|
||||
|
||||
var/obj/effect/beam/laser/beam // the created beam
|
||||
|
||||
flags = FPRINT | CONDUCT | TABLEPASS
|
||||
|
||||
attack_ai()
|
||||
return
|
||||
|
||||
attack_paw()
|
||||
return
|
||||
|
||||
attack_self(var/mob/user)
|
||||
|
||||
|
||||
on = !on
|
||||
if(on)
|
||||
turn_on()
|
||||
else
|
||||
turn_off()
|
||||
|
||||
updateicon()
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set src in view(1)
|
||||
turn_off()
|
||||
dir = turn(dir, -90)
|
||||
if(on) turn_on()
|
||||
|
||||
Move(var/atom/newloc,var/newdir)
|
||||
. = ..(newloc,newdir)
|
||||
if(on && . && isturf(newloc))
|
||||
turn_off()
|
||||
turn_on()
|
||||
return .
|
||||
|
||||
proc/turn_on()
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
beam = new(loc, dir, wavelength, 1, 1)
|
||||
beam.master = src
|
||||
|
||||
proc/turn_off()
|
||||
if(beam)
|
||||
beam.remove()
|
||||
|
||||
dropped()
|
||||
turn_off()
|
||||
turn_on()
|
||||
|
||||
proc/updateicon()
|
||||
icon_state = "pointer[on]"
|
||||
@@ -0,0 +1,83 @@
|
||||
// Mirror object
|
||||
// Part of the optics system
|
||||
//
|
||||
// reflects laser beams
|
||||
// 16 directional states 0/22.5/45/67.5deg to allow for 0/45deg beam angles
|
||||
|
||||
|
||||
// ideas:
|
||||
// frame/stand icon w/ mirror directional overlay
|
||||
// two sets of overlay icons for 0/45 and 22.5/67.5 deg angles
|
||||
|
||||
// can rotate cw/acw - need screwdriver to loosen/tighten mirror
|
||||
// use wrench to anchor/unanchor frame
|
||||
// if touched, gets dirty - fingerprints, which reduce reflectivity
|
||||
// if dirty and hit with high-power beam, mirror may shatter
|
||||
// some kind of dust accumulation with HasProximity? Could check for mob w/o labcoat etc.
|
||||
// can clean with acetone+wipes
|
||||
|
||||
/obj/optical/mirror
|
||||
icon = 'optical.dmi'
|
||||
icon_state = "mirrorA"
|
||||
dir = 1
|
||||
desc = "A large, optical-grade mirror firmly mounted on a stand."
|
||||
flags = FPRINT
|
||||
anchored = 0
|
||||
var/rotatable = 0 // true if mirror can be rotated
|
||||
var/angle = 0 // normal of mirror, 0-15. 0=N, 1=NNE, 2=NE, 3=ENE, 4=E etc
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
set_angle()
|
||||
|
||||
|
||||
|
||||
//set the angle from icon_state and dir
|
||||
proc/set_angle()
|
||||
switch(dir)
|
||||
if(1)
|
||||
angle = 0
|
||||
if(5)
|
||||
angle = 2
|
||||
if(4)
|
||||
angle = 4
|
||||
if(6)
|
||||
angle = 6
|
||||
if(2)
|
||||
angle = 8
|
||||
if(10)
|
||||
angle = 10
|
||||
if(8)
|
||||
angle = 12
|
||||
if(9)
|
||||
angle = 14
|
||||
|
||||
if(icon_state == "mirrorB") // 22.5deg turned states
|
||||
angle++
|
||||
return
|
||||
|
||||
// set the dir and icon_state from the angle
|
||||
proc/set_dir()
|
||||
if(angle%2 == 1)
|
||||
icon_state = "mirrorB"
|
||||
else
|
||||
icon_state = "mirrorA"
|
||||
switch(round(angle/2)*2)
|
||||
if(0)
|
||||
dir = 1
|
||||
if(2)
|
||||
dir = 5
|
||||
if(4)
|
||||
dir = 4
|
||||
if(6)
|
||||
dir = 6
|
||||
if(8)
|
||||
dir = 2
|
||||
if(10)
|
||||
dir = 10
|
||||
if(12)
|
||||
dir = 8
|
||||
if(14)
|
||||
dir = 9
|
||||
return
|
||||
@@ -0,0 +1,446 @@
|
||||
/datum/computer/file/pda_program/os
|
||||
proc
|
||||
receive_os_command(list/command_list)
|
||||
if((!src.holder) || (!src.master) || (!command_list) || !(command_list["command"]))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
//Main os program: Provides old pda interface and four programs including file browser, notes, messenger, and atmos scan
|
||||
main_os
|
||||
name = "ThinkOS 7"
|
||||
size = 8.0
|
||||
var/mode = 0
|
||||
//Note vars
|
||||
var/note = "Congratulations, your station has chosen the Thinktronic 5150 Personal Data Assistant!"
|
||||
var/note_mode = 0 //0 For note editor, 1 for note browser
|
||||
var/datum/computer/file/text/note_file = null //If set, save to this file.
|
||||
//Messenger vars
|
||||
var/list/detected_pdas = list()
|
||||
var/message_on = 1
|
||||
var/message_silent = 0 //To beep or not to beep, that is the question
|
||||
var/message_mode = 0 //0 for pda list, 1 for messages
|
||||
var/message_tone = "beep" //Custom ringtone
|
||||
var/message_note = null //Current messages in memory (Store as separate file only later??)
|
||||
//File browser vars
|
||||
var/datum/computer/folder/browse_folder = null
|
||||
var/datum/computer/file/clipboard = null //Current file to copy
|
||||
|
||||
|
||||
|
||||
receive_os_command(list/command_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
//world << "[command_list["command"]]"
|
||||
return
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
switch(src.mode)
|
||||
if(0)
|
||||
dat += "<h2>PERSONAL DATA ASSISTANT</h2>"
|
||||
dat += "Owner: [src.master.owner]<br><br>"
|
||||
|
||||
dat += "<h4>General Functions</h4>"
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];mode=1'>Notekeeper</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];mode=2'>Messenger</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];mode=3'>File Browser</a></li>"
|
||||
dat += "</ul>"
|
||||
|
||||
dat += "<h4>Utilities</h4>"
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];mode=4'>Atmospheric Scan</a></li>"
|
||||
dat += "<li>Scanner: [src.master.scan_program ? "<a href='byond://?src=\ref[src];scanner=1'>[src.master.scan_program.name]</a>" : "None loaded"]</li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];flight=1'>[src.master.fon ? "Disable" : "Enable"] Flashlight</a></li>"
|
||||
|
||||
dat += "</ul>"
|
||||
|
||||
if(1)
|
||||
//Note Program. Can save/load note files.
|
||||
dat += "<h4>Notekeeper V2.5</h4>"
|
||||
|
||||
if(!src.note_mode)
|
||||
dat += "<a href='byond://?src=\ref[src];input=note'>Edit</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];note_func=new'>New File</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];note_func=save'>Save</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];note_func=switchmenu'>Load</a><br>"
|
||||
|
||||
dat += src.note
|
||||
else
|
||||
dat += " <a href='byond://?src=\ref[src];note_func=switchmenu'>Back</a>"
|
||||
dat += " | \[[src.holding_folder.holder.file_amount - src.holding_folder.holder.file_used]\] Free<br>"
|
||||
dat += "<table cellspacing=5>"
|
||||
|
||||
for(var/datum/computer/file/text/T in src.holding_folder.contents)
|
||||
dat += "<tr><td><a href='byond://?src=\ref[src];target=\ref[T];note_func=load'>[T.name]</a></td>"
|
||||
dat += "<td>[T.extension]</td>"
|
||||
dat += "<td>Length: [T.data ? (length(T.data)) : "0"]</td></tr>"
|
||||
|
||||
dat += "</table>"
|
||||
|
||||
if(2)
|
||||
//Messenger. Uses Radio. Is a messenger.
|
||||
//TO-DO: ~file sharing~
|
||||
src.master.overlays.Cut() //Remove existing alerts
|
||||
dat += "<h4>SpaceMessenger V4.0.5</h4>"
|
||||
|
||||
if (!src.message_mode)
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];message_func=ringer'>Ringer: [src.message_silent == 1 ? "Off" : "On"]</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];message_func=on'>Send / Receive: [src.message_on == 1 ? "On" : "Off"]</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];input=tone'>Set Ringtone</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];message_mode=1'>Messages</a><br>"
|
||||
|
||||
dat += "<font size=2><a href='byond://?src=\ref[src];message_func=scan'>Scan</a></font><br>"
|
||||
dat += "<b>Detected PDAs</b><br>"
|
||||
|
||||
dat += "<ul>"
|
||||
|
||||
var/count = 0
|
||||
|
||||
if (src.message_on)
|
||||
for (var/obj/item/device/pda2/P in src.detected_pdas)
|
||||
if (!P.owner)
|
||||
src.detected_pdas -= P
|
||||
continue
|
||||
else if (P == src) //I guess this can happen if somebody copies the system file.
|
||||
src.detected_pdas -= P
|
||||
continue
|
||||
|
||||
dat += "<li><a href='byond://?src=\ref[src];input=message;target=\ref[P]'>[P]</a>"
|
||||
|
||||
dat += "</li>"
|
||||
count++
|
||||
|
||||
dat += "</ul>"
|
||||
|
||||
if (count == 0)
|
||||
dat += "None detected.<br>"
|
||||
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];message_func=clear'>Clear</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];message_mode=0'>Back</a><br>"
|
||||
|
||||
dat += "<h4>Messages</h4>"
|
||||
|
||||
dat += src.message_note
|
||||
dat += "<br>"
|
||||
|
||||
if(3)
|
||||
//File Browser.
|
||||
//To-do(?): Setting "favorite" programs to access straight from main menu
|
||||
//Not sure how needed it is, not like they have to go through 500 subfolders or whatever
|
||||
if((!src.browse_folder) || !(src.browse_folder.holder in src.master))
|
||||
src.browse_folder = src.holding_folder
|
||||
|
||||
dat += " | <a href='byond://?src=\ref[src];target=\ref[src.browse_folder];browse_func=paste'>Paste</a>"
|
||||
dat += " | Drive: "
|
||||
dat += "\[<a href='byond://?src=\ref[src];browse_func=drive'>[src.browse_folder.holder == src.master.hd ? "MAIN" : "CART"]</a>\]<br>"
|
||||
|
||||
dat += "<b>Contents of [browse_folder] | Drive ID:\[[src.browse_folder.holder.title]]</b><br>"
|
||||
dat += "<b>Used: \[[src.browse_folder.holder.file_used]/[src.browse_folder.holder.file_amount]\]</b><hr>"
|
||||
|
||||
dat += "<table cellspacing=5>"
|
||||
for(var/datum/computer/file/F in browse_folder.contents)
|
||||
if(F == src)
|
||||
dat += "<tr><td>System</td><td>Size: [src.size]</td><td>SYSTEM</td></tr>"
|
||||
continue
|
||||
dat += "<tr><td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=open'>[F.name]</a></td>"
|
||||
dat += "<td>Size: [F.size]</td>"
|
||||
|
||||
dat += "<td>[F.extension]</td>"
|
||||
|
||||
dat += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=delete'>Del</a></td>"
|
||||
dat += "<td><a href='byond://?src=\ref[src];target=\ref[F];input=rename'>Rename</a></td>"
|
||||
|
||||
dat += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=copy'>Copy</a></td>"
|
||||
|
||||
dat += "</tr>"
|
||||
|
||||
dat += "</table>"
|
||||
|
||||
if(4)
|
||||
//Atmos Scanner
|
||||
dat += "<h4>Atmospheric Readings</h4>"
|
||||
|
||||
var/turf/T = get_turf_or_move(get_turf(src.master))
|
||||
if (isnull(T))
|
||||
dat += "Unable to obtain a reading.<br>"
|
||||
else
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
|
||||
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"
|
||||
|
||||
if (total_moles())
|
||||
var/o2_level = environment.oxygen/total_moles()
|
||||
var/n2_level = environment.nitrogen/total_moles()
|
||||
var/co2_level = environment.carbon_dioxide/total_moles()
|
||||
var/plasma_level = environment.toxins/total_moles()
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
|
||||
|
||||
dat += "Nitrogen: [round(n2_level*100)]%<br>"
|
||||
|
||||
dat += "Oxygen: [round(o2_level*100)]%<br>"
|
||||
|
||||
dat += "Carbon Dioxide: [round(co2_level*100)]%<br>"
|
||||
|
||||
dat += "Plasma: [round(plasma_level*100)]%<br>"
|
||||
|
||||
if(unknown_level > 0.01)
|
||||
dat += "OTHER: [round(unknown_level)]%<br>"
|
||||
|
||||
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["mode"])
|
||||
var/newmode = text2num(href_list["mode"])
|
||||
src.mode = max(newmode, 0)
|
||||
|
||||
else if(href_list["flight"])
|
||||
src.master.toggle_light()
|
||||
|
||||
else if(href_list["scanner"])
|
||||
if(src.master.scan_program)
|
||||
src.master.scan_program = null
|
||||
|
||||
else if(href_list["input"])
|
||||
switch(href_list["input"])
|
||||
if("tone")
|
||||
var/t = input(usr, "Please enter new ringtone", src.name, src.message_tone) as text
|
||||
if (!t)
|
||||
return
|
||||
|
||||
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
|
||||
return
|
||||
|
||||
if(!(src.holder in src.master))
|
||||
return
|
||||
|
||||
t = copytext(sanitize(t), 1, 20)
|
||||
src.message_tone = t
|
||||
|
||||
if("note")
|
||||
var/t = input(usr, "Please enter note", src.name, src.note) as message
|
||||
if (!t)
|
||||
return
|
||||
|
||||
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
|
||||
return
|
||||
|
||||
if(!(src.holder in src.master))
|
||||
return
|
||||
|
||||
t = copytext(adminscrub(t), 1, MAX_MESSAGE_LEN)
|
||||
src.note = t
|
||||
|
||||
|
||||
if("message")
|
||||
var/obj/item/device/pda2/P = locate(href_list["target"])
|
||||
if(!P || !istype(P))
|
||||
return
|
||||
|
||||
var/t = input(usr, "Please enter message", P.name, null) as text
|
||||
if (!t)
|
||||
return
|
||||
|
||||
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
|
||||
return
|
||||
|
||||
if(!(src.holder in src.master))
|
||||
return
|
||||
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.data["command"] = "text message"
|
||||
signal.data["message"] = t
|
||||
signal.data["sender"] = src.master.owner
|
||||
signal.data["tag"] = "\ref[P]"
|
||||
src.post_signal(signal)
|
||||
src.message_note += "<i><b>→ To [P.owner]:</b></i><br>[t]<br>"
|
||||
log_pda("[usr] sent [t] to [P.owner]")
|
||||
|
||||
if("rename")
|
||||
var/datum/computer/file/F = locate(href_list["target"])
|
||||
if(!F || !istype(F))
|
||||
return
|
||||
|
||||
var/t = input(usr, "Please enter new name", src.name, F.name) as text
|
||||
t = copytext(sanitize(t), 1, 16)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src.master, usr) || !(F.holder in src.master))
|
||||
return
|
||||
if(F.holder.read_only)
|
||||
return
|
||||
F.name = capitalize(lowertext(t))
|
||||
|
||||
|
||||
else if(href_list["message_func"]) //Messenger specific topic junk
|
||||
switch(href_list["message_func"])
|
||||
if("ringer")
|
||||
src.message_silent = !src.message_silent
|
||||
if("on")
|
||||
src.message_on = !src.message_on
|
||||
if("clear")
|
||||
src.message_note = null
|
||||
if("scan")
|
||||
if(src.message_on)
|
||||
src.detected_pdas = list()
|
||||
var/datum/signal/signal = new
|
||||
signal.data["command"] = "report pda"
|
||||
src.post_signal(signal)
|
||||
|
||||
else if(href_list["note_func"]) //Note program specific topic junk
|
||||
switch(href_list["note_func"])
|
||||
if("new")
|
||||
src.note_file = null
|
||||
src.note = null
|
||||
if("save")
|
||||
if(src.note_file && src.note_file.holder in src.master)
|
||||
src.note_file.data = src.note
|
||||
else
|
||||
var/datum/computer/file/text/F = new /datum/computer/file/text
|
||||
if(!src.holding_folder.add_file(F))
|
||||
del(F)
|
||||
else
|
||||
src.note_file = F
|
||||
F.data = src.note
|
||||
|
||||
if("load")
|
||||
var/datum/computer/file/text/T = locate(href_list["target"])
|
||||
if(!T || !istype(T))
|
||||
return
|
||||
|
||||
src.note_file = T
|
||||
src.note = note_file.data
|
||||
src.note_mode = 0
|
||||
|
||||
if("switchmenu")
|
||||
src.note_mode = !src.note_mode
|
||||
|
||||
else if(href_list["browse_func"]) //File browser specific topic junk
|
||||
var/datum/computer/target = locate(href_list["target"])
|
||||
switch(href_list["browse_func"])
|
||||
if("drive")
|
||||
if(src.browse_folder.holder == src.master.hd && src.master.cartridge && (src.master.cartridge.root))
|
||||
src.browse_folder = src.master.cartridge.root
|
||||
else
|
||||
src.browse_folder = src.holding_folder
|
||||
if("open")
|
||||
if(!target || !istype(target))
|
||||
return
|
||||
if(istype(target, /datum/computer/file/pda_program))
|
||||
if(istype(target,/datum/computer/file/pda_program/os) && (src.master.host_program))
|
||||
return
|
||||
else
|
||||
src.master.run_program(target)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
|
||||
if("delete")
|
||||
if(!target || !istype(target))
|
||||
return
|
||||
src.master.delete_file(target)
|
||||
|
||||
if("copy")
|
||||
if(istype(target,/datum/computer/file) && (!target.holder || (target.holder in src.master.contents)))
|
||||
src.clipboard = target
|
||||
|
||||
if("paste")
|
||||
if(istype(target,/datum/computer/folder))
|
||||
if(!src.clipboard || !src.clipboard.holder || !(src.clipboard.holder in src.master.contents))
|
||||
return
|
||||
|
||||
if(!istype(src.clipboard))
|
||||
return
|
||||
|
||||
src.clipboard.copy_file_to_folder(target)
|
||||
|
||||
|
||||
else if(href_list["message_mode"])
|
||||
var/newmode = text2num(href_list["message_mode"])
|
||||
src.message_mode = max(newmode, 0)
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("text message")
|
||||
if(!message_on || !signal.data["message"])
|
||||
return
|
||||
var/sender = signal.data["sender"]
|
||||
if(!sender)
|
||||
sender = "!Unknown!"
|
||||
|
||||
src.message_note += "<i><b>← From <a href='byond://?src=\ref[src];input=message;target=\ref[signal.source]'>[sender]</a>:</b></i><br>[signal.data["message"]]<br>"
|
||||
var/alert_beep = null //Don't beep if set to silent.
|
||||
if(!src.message_silent)
|
||||
alert_beep = src.message_tone
|
||||
|
||||
src.master.display_alert(alert_beep)
|
||||
src.master.updateSelfDialog()
|
||||
|
||||
if("report pda")
|
||||
if(!message_on)
|
||||
return
|
||||
|
||||
var/datum/signal/newsignal = new
|
||||
newsignal.data["command"] = "reporting pda"
|
||||
newsignal.data["tag"] = "\ref[signal.source]"
|
||||
src.post_signal(newsignal)
|
||||
|
||||
if("reporting pda")
|
||||
if(!detected_pdas)
|
||||
detected_pdas = new()
|
||||
|
||||
if(!(signal.source in detected_pdas))
|
||||
detected_pdas += signal.source
|
||||
|
||||
src.master.updateSelfDialog()
|
||||
|
||||
return
|
||||
|
||||
return_text_header()
|
||||
if(!src.master)
|
||||
return
|
||||
|
||||
var/dat
|
||||
|
||||
if(src.mode)
|
||||
dat += " | <a href='byond://?src=\ref[src];mode=0'>Main Menu</a>"
|
||||
|
||||
else if (!isnull(src.master.cartridge))
|
||||
dat += " | <a href='byond://?src=\ref[src.master];eject_cart=1'>Eject [src.master.cartridge]</a>"
|
||||
|
||||
dat += " | <a href='byond://?src=\ref[src.master];refresh=1'>Refresh</a>"
|
||||
|
||||
return dat
|
||||
@@ -0,0 +1,185 @@
|
||||
//Eventual plan: Convert all datum/data to datum/computer/file
|
||||
/datum/computer/file/text
|
||||
name = "text"
|
||||
extension = "TEXT"
|
||||
size = 2.0
|
||||
var/data = null
|
||||
|
||||
/datum/computer/file/record
|
||||
name = "record"
|
||||
extension = "REC"
|
||||
|
||||
var/list/fields = list( )
|
||||
|
||||
|
||||
//base pda program
|
||||
|
||||
/datum/computer/file/pda_program
|
||||
name = "blank program"
|
||||
extension = "PPROG"
|
||||
var/obj/item/device/pda2/master = null
|
||||
var/id_tag = null
|
||||
|
||||
os
|
||||
name = "blank system program"
|
||||
extension = "PSYS"
|
||||
|
||||
scan
|
||||
name = "blank scan program"
|
||||
extension = "PSCAN"
|
||||
|
||||
New(obj/holding as obj)
|
||||
if(holding)
|
||||
src.holder = holding
|
||||
|
||||
if(istype(src.holder.loc,/obj/item/device/pda2))
|
||||
src.master = src.holder.loc
|
||||
|
||||
proc
|
||||
return_text()
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
//world << "Holder [holder] not in [master] of prg:[src]"
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
if(!src.holder.root)
|
||||
src.holder.root = new /datum/computer/folder
|
||||
src.holder.root.holder = src
|
||||
src.holder.root.name = "root"
|
||||
|
||||
return 0
|
||||
|
||||
process() //This isn't actually used at the moment
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
if(!src.holder.root)
|
||||
src.holder.root = new /datum/computer/folder
|
||||
src.holder.root.holder = src
|
||||
src.holder.root.name = "root"
|
||||
|
||||
return 0
|
||||
|
||||
//maybe remove this, I haven't found a good use for it yet
|
||||
send_os_command(list/command_list)
|
||||
if(!src.master || !src.holder || src.master.host_program || !command_list)
|
||||
return 1
|
||||
|
||||
if(!istype(src.master.host_program) || src.master.host_program == src)
|
||||
return 1
|
||||
|
||||
src.master.host_program.receive_os_command()
|
||||
|
||||
return 0
|
||||
|
||||
return_text_header()
|
||||
if(!src.master || !src.holder)
|
||||
return
|
||||
|
||||
var/dat = " | <a href='byond://?src=\ref[src];quit=1'>Main Menu</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src.master];refresh=1'>Refresh</a>"
|
||||
|
||||
return dat
|
||||
|
||||
post_signal(datum/signal/signal, newfreq)
|
||||
if(master)
|
||||
master.post_signal(signal, newfreq)
|
||||
else
|
||||
del(signal)
|
||||
|
||||
transfer_holder(obj/item/weapon/disk/data/newholder,datum/computer/folder/newfolder)
|
||||
|
||||
if((newholder.file_used + src.size) > newholder.file_amount)
|
||||
return 0
|
||||
|
||||
if(!newholder.root)
|
||||
newholder.root = new /datum/computer/folder
|
||||
newholder.root.holder = newholder
|
||||
newholder.root.name = "root"
|
||||
|
||||
if(!newfolder)
|
||||
newfolder = newholder.root
|
||||
|
||||
if((src.holder && src.holder.read_only) || newholder.read_only)
|
||||
return 0
|
||||
|
||||
if((src.holder) && (src.holder.root))
|
||||
src.holder.root.remove_file(src)
|
||||
|
||||
newfolder.add_file(src)
|
||||
|
||||
if(istype(newholder.loc,/obj/item/device/pda2))
|
||||
src.master = newholder.loc
|
||||
|
||||
//world << "Setting [src.holder] to [newholder]"
|
||||
src.holder = newholder
|
||||
return 1
|
||||
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if((!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(src.master.active_program != src)
|
||||
return 1
|
||||
|
||||
if ((!usr.contents.Find(src.master) && (!in_range(src.master, usr) || !istype(src.master.loc, /turf))) && (!istype(usr, /mob/living/silicon)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.active_program == src)
|
||||
master.active_program = null
|
||||
return 1
|
||||
|
||||
usr.machine = src.master
|
||||
|
||||
if (href_list["close"])
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=pda2")
|
||||
return 0
|
||||
|
||||
if (href_list["quit"])
|
||||
// src.master.processing_programs.Remove(src)
|
||||
if(src.master.host_program && src.master.host_program.holder && (src.master.host_program.holder in src.master.contents))
|
||||
src.master.run_program(src.master.host_program)
|
||||
src.master.updateSelfDialog()
|
||||
return 1
|
||||
else
|
||||
src.master.active_program = null
|
||||
src.master.updateSelfDialog()
|
||||
return 1
|
||||
|
||||
return 0
|
||||
@@ -0,0 +1,298 @@
|
||||
//The advanced pea-green monochrome lcd of tomorrow.
|
||||
|
||||
|
||||
//TO-DO: rearrange all this disk/data stuff so that fixed disks are the parent type
|
||||
//because otherwise you have carts going into floppy drives and it's ALL MAD
|
||||
/obj/item/weapon/disk/data/cartridge
|
||||
name = "Cart 2.0"
|
||||
desc = "A data cartridge for portable microcomputers."
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "cart"
|
||||
item_state = "electronic"
|
||||
file_amount = 80.0
|
||||
title = "ROM Cart"
|
||||
|
||||
pda2test
|
||||
name = "Test Cart"
|
||||
New()
|
||||
..()
|
||||
src.root.add_file( new /datum/computer/file/computer_program/arcade(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
|
||||
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
|
||||
src.read_only = 1
|
||||
|
||||
|
||||
/obj/item/device/pda2
|
||||
name = "PDA"
|
||||
desc = "A portable microcomputer by Thinktronic Systems, LTD. Functionality determined by an EEPROM cartridge."
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "pda"
|
||||
item_state = "electronic"
|
||||
w_class = 2.0
|
||||
flags = FPRINT | TABLEPASS
|
||||
slow_flags = SLOT_BELT
|
||||
|
||||
var/owner = null
|
||||
var/default_cartridge = null // Access level defined by cartridge
|
||||
var/obj/item/weapon/disk/data/cartridge/cartridge = null //current cartridge
|
||||
var/datum/computer/file/pda_program/active_program = null
|
||||
var/datum/computer/file/pda_program/os/host_program = null
|
||||
var/datum/computer/file/pda_program/scan/scan_program = null
|
||||
var/obj/item/weapon/disk/data/fixed_disk/hd = null
|
||||
var/fon = 0 //Is the flashlight function on?
|
||||
var/f_lum = 3 //Luminosity for the flashlight function
|
||||
// var/datum/data/record/active1 = null //General
|
||||
// var/datum/data/record/active2 = null //Medical
|
||||
// var/datum/data/record/active3 = null //Security
|
||||
// var/obj/item/weapon/integrated_uplink/uplink = null //Maybe replace uplink with some remote ~syndicate~ server
|
||||
var/frequency = 1149
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/setup_default_cartridge = null //Cartridge contains job-specific programs
|
||||
var/setup_drive_size = 24.0 //PDAs don't have much work room at all, really.
|
||||
var/setup_system_os_path = /datum/computer/file/pda_program/os/main_os //Needs an operating system to...operate!!
|
||||
|
||||
|
||||
/obj/item/device/pda2/pickup(mob/user)
|
||||
if (src.fon)
|
||||
src.sd_SetLuminosity(0)
|
||||
user.sd_SetLuminosity(user.luminosity + src.f_lum)
|
||||
|
||||
/obj/item/device/pda2/dropped(mob/user)
|
||||
if (src.fon)
|
||||
user.sd_SetLuminosity(user.luminosity - src.f_lum)
|
||||
src.sd_SetLuminosity(src.f_lum)
|
||||
|
||||
/obj/item/device/pda2/New()
|
||||
..()
|
||||
spawn(5)
|
||||
src.hd = new /obj/item/weapon/disk/data/fixed_disk(src)
|
||||
src.hd.file_amount = src.setup_drive_size
|
||||
src.hd.name = "Minidrive"
|
||||
src.hd.title = "Minidrive"
|
||||
|
||||
if(src.setup_system_os_path)
|
||||
src.host_program = new src.setup_system_os_path
|
||||
|
||||
src.hd.file_amount = max(src.hd.file_amount, src.host_program.size)
|
||||
|
||||
src.host_program.transfer_holder(src.hd)
|
||||
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, frequency)
|
||||
|
||||
|
||||
if (src.default_cartridge)
|
||||
src.cartridge = new src.setup_default_cartridge(src)
|
||||
// if(src.owner)
|
||||
// processing_items.Add(src)
|
||||
|
||||
/obj/item/device/pda2/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<html><head><title>Personal Data Assistant</title></head><body>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];close=1'>Close</a>"
|
||||
|
||||
if (!src.owner)
|
||||
if(src.cartridge)
|
||||
dat += " | <a href='byond://?src=\ref[src];eject_cart=1'>Eject [src.cartridge]</a>"
|
||||
dat += "<br>Warning: No owner information entered. Please swipe card.<br><br>"
|
||||
dat += "<a href='byond://?src=\ref[src];refresh=1'>Retry</a>"
|
||||
else
|
||||
if(src.active_program)
|
||||
dat += src.active_program.return_text()
|
||||
else
|
||||
if(src.host_program)
|
||||
src.run_program(src.host_program)
|
||||
dat += src.active_program.return_text()
|
||||
else
|
||||
if(src.cartridge)
|
||||
dat += " | <a href='byond://?src=\ref[src];eject_cart=1'>Eject [src.cartridge]</a><br>"
|
||||
dat += "<center><font color=red>Fatal Error 0x17<br>"
|
||||
dat += "No System Software Loaded</font></center>"
|
||||
//To-do: System recovery shit (maybe have a dedicated computer for this kind of thing)
|
||||
|
||||
|
||||
user << browse(dat,"window=pda2")
|
||||
onclose(user,"pda2")
|
||||
return
|
||||
|
||||
/obj/item/device/pda2/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (usr.contents.Find(src) || usr.contents.Find(src.master) || (istype(src.loc, /turf) && get_dist(src, usr) <= 1))
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
|
||||
|
||||
if(href_list["return_to_host"])
|
||||
if(src.host_program)
|
||||
src.active_program = src.host_program
|
||||
src.host_program = null
|
||||
|
||||
else if (href_list["eject_cart"])
|
||||
src.eject_cartridge()
|
||||
|
||||
else if (href_list["refresh"])
|
||||
src.updateSelfDialog()
|
||||
|
||||
else if (href_list["close"])
|
||||
usr << browse(null, "window=pda2")
|
||||
usr.machine = null
|
||||
|
||||
src.updateSelfDialog()
|
||||
return
|
||||
|
||||
/obj/item/device/pda2/attackby(obj/item/weapon/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/weapon/disk/data/cartridge) && isnull(src.cartridge))
|
||||
user.drop_item()
|
||||
C.loc = src
|
||||
user << "\blue You insert [C] into [src]."
|
||||
src.cartridge = C
|
||||
src.updateSelfDialog()
|
||||
|
||||
else if (istype(C, /obj/item/weapon/card/id) && !src.owner && C:registered_name)
|
||||
src.owner = C:registered_name
|
||||
src.name = "PDA-[src.owner]"
|
||||
user << "\blue Card scanned."
|
||||
src.updateSelfDialog()
|
||||
|
||||
/obj/item/device/pda2/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption || !src.owner) return
|
||||
|
||||
if(signal.data["tag"] && signal.data["tag"] != "\ref[src]") return
|
||||
|
||||
if(src.host_program)
|
||||
src.host_program.receive_signal(signal)
|
||||
|
||||
if(src.active_program && (src.active_program != src.host_program))
|
||||
src.host_program.receive_signal(signal)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/pda2/attack(mob/M as mob, mob/user as mob)
|
||||
if(src.scan_program)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/device/pda2/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
|
||||
var/scan_dat = null
|
||||
if(src.scan_program && istype(src.scan_program))
|
||||
scan_dat = src.scan_program.scan_atom(A)
|
||||
|
||||
if(scan_dat)
|
||||
A.visible_message("\red [user] has scanned [A]!")
|
||||
user.show_message(scan_dat, 1)
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/pda2/proc
|
||||
|
||||
post_signal(datum/signal/signal,var/newfreq)
|
||||
if(!signal)
|
||||
return
|
||||
var/freq = newfreq
|
||||
if(!freq)
|
||||
freq = src.frequency
|
||||
|
||||
signal.source = src
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(frequency)
|
||||
return frequency.post_signal(src, signal)
|
||||
else
|
||||
del(signal)
|
||||
|
||||
eject_cartridge()
|
||||
if(src.cartridge)
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
if(src.active_program && (src.active_program.holder == src.cartridge))
|
||||
src.active_program = null
|
||||
|
||||
if(src.host_program && (src.host_program.holder == src.cartridge))
|
||||
src.host_program = null
|
||||
|
||||
if(src.scan_program && (src.scan_program.holder == src.cartridge))
|
||||
src.scan_program = null
|
||||
|
||||
src.cartridge.loc = T
|
||||
src.cartridge = null
|
||||
|
||||
return
|
||||
|
||||
//Toggle the built-in flashlight
|
||||
toggle_light()
|
||||
src.fon = (!src.fon)
|
||||
|
||||
if (ismob(src.loc))
|
||||
if (src.fon)
|
||||
src.loc.sd_SetLuminosity(src.loc.luminosity + src.f_lum)
|
||||
else
|
||||
src.loc.sd_SetLuminosity(src.loc.luminosity - src.f_lum)
|
||||
else
|
||||
src.sd_SetLuminosity(src.fon * src.f_lum)
|
||||
|
||||
src.updateSelfDialog()
|
||||
|
||||
display_alert(var/alert_message) //Add alert overlay and beep
|
||||
if (alert_message)
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, src.loc))
|
||||
O.show_message(text("\icon[src] *[alert_message]*"))
|
||||
|
||||
src.overlays.Cut()
|
||||
src.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
return
|
||||
|
||||
run_program(datum/computer/file/pda_program/program)
|
||||
if((!program) || (!program.holder))
|
||||
return 0
|
||||
|
||||
if(!(program.holder in src))
|
||||
// world << "Not in src"
|
||||
program = new program.type
|
||||
program.transfer_holder(src.hd)
|
||||
|
||||
if(program.master != src)
|
||||
program.master = src
|
||||
|
||||
if(!src.host_program && istype(program, /datum/computer/file/pda_program/os))
|
||||
src.host_program = program
|
||||
|
||||
if(istype(program, /datum/computer/file/pda_program/scan))
|
||||
if(program == src.scan_program)
|
||||
src.scan_program = null
|
||||
else
|
||||
src.scan_program = program
|
||||
return 1
|
||||
|
||||
src.active_program = program
|
||||
return 1
|
||||
|
||||
delete_file(datum/computer/file/file)
|
||||
//world << "Deleting [file]..."
|
||||
if((!file) || (!file.holder) || (file.holder.read_only))
|
||||
//world << "Cannot delete :("
|
||||
return 0
|
||||
|
||||
//Don't delete the running program you jerk
|
||||
if(src.active_program == file || src.host_program == file)
|
||||
src.active_program = null
|
||||
|
||||
//world << "Now calling del on [file]..."
|
||||
del(file)
|
||||
return 1
|
||||
@@ -0,0 +1,181 @@
|
||||
//CONTENTS:
|
||||
//Generic records
|
||||
//Security records
|
||||
//Medical records
|
||||
|
||||
|
||||
/datum/computer/file/pda_program/records
|
||||
var/mode = 0
|
||||
var/datum/data/record/active1 = null //General
|
||||
var/datum/data/record/active2 = null //Security/Medical/Whatever
|
||||
|
||||
//To-do: editing arrest status/etc from pda.
|
||||
/datum/computer/file/pda_program/records/security
|
||||
name = "Security Records"
|
||||
size = 12.0
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
switch(src.mode)
|
||||
if(0)
|
||||
dat += "<h4>Security Record List</h4>"
|
||||
|
||||
for (var/datum/data/record/R in data_core.general)
|
||||
dat += "<a href='byond://?src=\ref[src];select_rec=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
if(1)
|
||||
|
||||
dat += "<h4>Security Record</h4>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];mode=0'>Back</a><br>"
|
||||
|
||||
if (istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))
|
||||
dat += "Name: [src.active1.fields["name"]] ID: [src.active1.fields["id"]]<br>"
|
||||
dat += "Sex: [src.active1.fields["sex"]]<br>"
|
||||
dat += "Age: [src.active1.fields["age"]]<br>"
|
||||
dat += "Fingerprint: [src.active1.fields["fingerprint"]]<br>"
|
||||
dat += "Physical Status: [src.active1.fields["p_stat"]]<br>"
|
||||
dat += "Mental Status: [src.active1.fields["m_stat"]]<br>"
|
||||
else
|
||||
dat += "<b>Record Lost!</b><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
dat += "<h4>Security Data</h4>"
|
||||
if (istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2))
|
||||
dat += "Criminal Status: [src.active2.fields["criminal"]]<br>"
|
||||
|
||||
dat += "Minor Crimes: [src.active2.fields["mi_crim"]]<br>"
|
||||
dat += "Details: [src.active2.fields["mi_crim"]]<br><br>"
|
||||
|
||||
dat += "Major Crimes: [src.active2.fields["ma_crim"]]<br>"
|
||||
dat += "Details: [src.active2.fields["ma_crim_d"]]<br><br>"
|
||||
|
||||
dat += "Important Notes:<br>"
|
||||
dat += "[src.active2.fields["notes"]]"
|
||||
else
|
||||
dat += "<b>Record Lost!</b><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["mode"])
|
||||
var/newmode = text2num(href_list["mode"])
|
||||
src.mode = max(newmode, 0)
|
||||
|
||||
else if(href_list["select_rec"])
|
||||
var/datum/data/record/R = locate(href_list["select_rec"])
|
||||
var/datum/data/record/S = locate(href_list["select_rec"])
|
||||
|
||||
if (data_core.general.Find(R))
|
||||
for (var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
S = E
|
||||
break
|
||||
|
||||
src.active1 = R
|
||||
src.active2 = S
|
||||
|
||||
src.mode = 1
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
|
||||
/datum/computer/file/pda_program/records/medical
|
||||
name = "Medical Records"
|
||||
size = 8.0
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
switch(src.mode)
|
||||
if(0)
|
||||
|
||||
dat += "<h4>Medical Record List</h4>"
|
||||
for (var/datum/data/record/R in data_core.general)
|
||||
dat += "<a href='byond://?src=\ref[src];select_rec=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
|
||||
dat += "<br>"
|
||||
|
||||
if(1)
|
||||
|
||||
dat += "<h4>Medical Record</h4>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];mode=0'>Back</a><br>"
|
||||
|
||||
if (istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))
|
||||
dat += "Name: [src.active1.fields["name"]] ID: [src.active1.fields["id"]]<br>"
|
||||
dat += "Sex: [src.active1.fields["sex"]]<br>"
|
||||
dat += "Age: [src.active1.fields["age"]]<br>"
|
||||
dat += "Fingerprint: [src.active1.fields["fingerprint"]]<br>"
|
||||
dat += "Physical Status: [src.active1.fields["p_stat"]]<br>"
|
||||
dat += "Mental Status: [src.active1.fields["m_stat"]]<br>"
|
||||
else
|
||||
dat += "<b>Record Lost!</b><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
dat += "<h4>Medical Data</h4>"
|
||||
if (istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2))
|
||||
dat += "Blood Type: [src.active2.fields["b_type"]]<br><br>"
|
||||
|
||||
dat += "Minor Disabilities: [src.active2.fields["mi_dis"]]<br>"
|
||||
dat += "Details: [src.active2.fields["mi_dis_d"]]<br><br>"
|
||||
|
||||
dat += "Major Disabilities: [src.active2.fields["ma_dis"]]<br>"
|
||||
dat += "Details: [src.active2.fields["ma_dis_d"]]<br><br>"
|
||||
|
||||
dat += "Allergies: [src.active2.fields["alg"]]<br>"
|
||||
dat += "Details: [src.active2.fields["alg_d"]]<br><br>"
|
||||
|
||||
dat += "Current Diseases: [src.active2.fields["cdi"]]<br>"
|
||||
dat += "Details: [src.active2.fields["cdi_d"]]<br><br>"
|
||||
|
||||
dat += "Important Notes: [src.active2.fields["notes"]]<br>"
|
||||
else
|
||||
dat += "<b>Record Lost!</b><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["mode"])
|
||||
var/newmode = text2num(href_list["mode"])
|
||||
src.mode = max(newmode, 0)
|
||||
|
||||
else if(href_list["select_rec"])
|
||||
var/datum/data/record/R = locate(href_list["select_rec"])
|
||||
var/datum/data/record/M = locate(href_list["select_rec"])
|
||||
|
||||
if (data_core.general.Find(R))
|
||||
for (var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
break
|
||||
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
|
||||
src.mode = 1
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
@@ -0,0 +1,103 @@
|
||||
//CONTENTS:
|
||||
//Base scanner stuff
|
||||
//Health scanner
|
||||
//Forensic scanner
|
||||
//Reagent scanner
|
||||
|
||||
/datum/computer/file/pda_program/scan
|
||||
return_text()
|
||||
return src.return_text_header()
|
||||
|
||||
proc/scan_atom(atom/A as mob|obj|turf|area)
|
||||
|
||||
if( !A || (!src.holder) || (!src.master))
|
||||
return 1
|
||||
|
||||
if((!istype(holder)) || (!istype(master)))
|
||||
return 1
|
||||
|
||||
if(!(holder in src.master.contents))
|
||||
if(master.scan_program == src)
|
||||
master.scan_program = null
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
//Health analyzer program
|
||||
health_scan
|
||||
name = "Health Scan"
|
||||
size = 8.0
|
||||
|
||||
scan_atom(atom/A as mob|obj|turf|area)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = A
|
||||
if(!istype(C))
|
||||
return
|
||||
|
||||
var/dat = "\blue Analyzing Results for [C]:\n"
|
||||
dat += "\blue \t Overall Status: [C.stat > 1 ? "dead" : "[C.health]% healthy"]\n"
|
||||
dat += "\blue \t Damage Specifics: [C.getOxyLoss() > 50 ? "\red" : "\blue"][C.getOxyLoss()]-[C.getToxLoss() > 50 ? "\red" : "\blue"][C.getToxLoss()]-[C.getFireLoss() > 50 ? "\red" : "\blue"][C.getFireLoss()]-[C.getBruteLoss() > 50 ? "\red" : "\blue"][C.getBruteLoss()]\n"
|
||||
dat += "\blue \t Key: Suffocation/Toxin/Burns/Brute\n"
|
||||
dat += "\blue \t Body Temperature: [C.bodytemperature-T0C]°C ([C.bodytemperature*1.8-459.67]°F)"
|
||||
if(C.virus)
|
||||
dat += "\red \n<b>Warning Virus Detected.</b>\nName: [C.virus.name].\nType: [C.virus.spread].\nStage: [C.virus.stage]/[C.virus.max_stages].\nPossible Cure: [C.virus.cure]"
|
||||
|
||||
return dat
|
||||
|
||||
//Forensic scanner
|
||||
forensic_scan
|
||||
name = "Forensic Scan"
|
||||
size = 8.0
|
||||
|
||||
scan_atom(atom/A as mob|obj|turf|area)
|
||||
if(..())
|
||||
return
|
||||
var/dat = null
|
||||
|
||||
if(istype(A,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = A
|
||||
if (!istype(H.dna, /datum/dna) || !isnull(H.gloves))
|
||||
dat += "\blue Unable to scan [A]'s fingerprints.\n"
|
||||
else
|
||||
dat += "\blue [H]'s Fingerprints: [md5(H.dna.uni_identity)]\n"
|
||||
if ( !(H.blood_DNA.len) )
|
||||
dat += "\blue No blood found on [H]\n"
|
||||
else
|
||||
for(var/i = 1, i < H.blood_DNA.len, i++)
|
||||
var/list/templist = H.blood_DNA[i]
|
||||
user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]"
|
||||
|
||||
if (!A.fingerprints)
|
||||
dat += "\blue Unable to locate any fingerprints on [A]!\n"
|
||||
else
|
||||
var/list/L = params2list(A:fingerprints)
|
||||
dat += "\blue Isolated [L.len] fingerprints.\n"
|
||||
for(var/i in L)
|
||||
dat += "\blue \t [i]\n"
|
||||
|
||||
return dat
|
||||
|
||||
|
||||
//Reagent scanning program
|
||||
reagent_scan
|
||||
name = "Reagent Scan"
|
||||
size = 6.0
|
||||
|
||||
scan_atom(atom/A as mob|obj|turf|area)
|
||||
if(..())
|
||||
return
|
||||
var/dat = null
|
||||
if(!isnull(A.reagents))
|
||||
if(A.reagents.reagent_list.len > 0)
|
||||
var/reagents_length = A.reagents.reagent_list.len
|
||||
dat += "\blue [reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found.\n"
|
||||
for (var/datum/reagent/re in A.reagents.reagent_list)
|
||||
dat += "\blue \t [re] - [re.volume]\n"
|
||||
else
|
||||
dat = "\blue No active chemical agents found in [A]."
|
||||
else
|
||||
dat = "\blue No significant chemical agents found in [A]."
|
||||
|
||||
return dat
|
||||
@@ -0,0 +1,204 @@
|
||||
//Assorted small programs not worthy of their own file
|
||||
//CONTENTS:
|
||||
//Crew Manifest viewer
|
||||
//Status display controller
|
||||
//Remote signaling program
|
||||
//Cargo orders monitor
|
||||
|
||||
//Manifest
|
||||
/datum/computer/file/pda_program/manifest
|
||||
name = "Manifest"
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
dat += "Entries cannot be modified from this terminal.<br><br>"
|
||||
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
dat += "[t.fields["name"]] - [t.fields["rank"]]<br>"
|
||||
dat += "<br>"
|
||||
|
||||
return dat
|
||||
|
||||
//Status Display
|
||||
/datum/computer/file/pda_program/status_display
|
||||
name = "Status Controller"
|
||||
size = 8.0
|
||||
var/message1 // For custom messages on the displays.
|
||||
var/message2
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
dat += "<h4>Station Status Display Interlink</h4>"
|
||||
|
||||
dat += "\[ <A HREF='?src=\ref[src];statdisp=blank'>Clear</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];statdisp=message'>Message</A> \]"
|
||||
|
||||
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];statdisp=setmsg1'>[ message1 ? message1 : "(none)"]</A>"
|
||||
dat += "<li> Line 2: <A HREF='?src=\ref[src];statdisp=setmsg2'>[ message2 ? message2 : "(none)"]</A></ul><br>"
|
||||
dat += "\[ Alert: <A HREF='?src=\ref[src];statdisp=alert;alert=default'>None</A> |"
|
||||
|
||||
dat += " <A HREF='?src=\ref[src];statdisp=alert;alert=redalert'>Red Alert</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];statdisp=alert;alert=lockdown'>Lockdown</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR>"
|
||||
|
||||
return dat
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["statdisp"])
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
post_status("message", message1, message2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
|
||||
if("setmsg1")
|
||||
message1 = input("Line 1", "Enter Message Text", message1) as text|null
|
||||
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
|
||||
return
|
||||
|
||||
if(!(src.holder in src.master))
|
||||
return
|
||||
src.master.updateSelfDialog()
|
||||
|
||||
if("setmsg2")
|
||||
message2 = input("Line 2", "Enter Message Text", message2) as text|null
|
||||
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
|
||||
return
|
||||
|
||||
if(!(src.holder in src.master))
|
||||
return
|
||||
|
||||
src.master.updateSelfDialog()
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
|
||||
proc/post_status(var/command, var/data1, var/data2)
|
||||
if(!src.master)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src.master
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
src.post_signal(status_signal,"1435")
|
||||
|
||||
//Signaler
|
||||
/datum/computer/file/pda_program/signaler
|
||||
name = "Signalix 5"
|
||||
size = 8.0
|
||||
var/send_freq = 1457 //Frequency signal is sent at, should be kept within normal radio ranges.
|
||||
var/send_code = 30
|
||||
var/last_transmission = 0 //No signal spamming etc
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
|
||||
dat += "<h4>Remote Signaling System</h4>"
|
||||
dat += {"
|
||||
<a href='byond://?src=\ref[src];send=1'>Send Signal</A><BR>
|
||||
|
||||
Frequency:
|
||||
<a href='byond://?src=\ref[src];adj_freq=-10'>-</a>
|
||||
<a href='byond://?src=\ref[src];adj_freq=-2'>-</a>
|
||||
[format_frequency(send_freq)]
|
||||
<a href='byond://?src=\ref[src];adj_freq=2'>+</a>
|
||||
<a href='byond://?src=\ref[src];adj_freq=10'>+</a><br>
|
||||
<br>
|
||||
Code:
|
||||
<a href='byond://?src=\ref[src];adj_code=-5'>-</a>
|
||||
<a href='byond://?src=\ref[src];adj_code=-1'>-</a>
|
||||
[send_code]
|
||||
<a href='byond://?src=\ref[src];adj_code=1'>+</a>
|
||||
<a href='byond://?src=\ref[src];adj_code=5'>+</a><br>"}
|
||||
|
||||
return dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if (href_list["send"])
|
||||
if(last_transmission && world.time < (last_transmission + 5))
|
||||
return
|
||||
last_transmission = world.time
|
||||
spawn( 0 )
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lastsignalers.Add("[time] <B>:</B> [usr.key] used [src.master] @ location ([src.master.loc.x],[src.master.loc.y],[src.master.loc.z]) <B>:</B> [format_frequency(send_freq)]/[send_code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = send_code
|
||||
signal.data["message"] = "ACTIVATE"
|
||||
|
||||
src.post_signal(signal,"[send_freq]")
|
||||
return
|
||||
|
||||
else if (href_list["adj_freq"])
|
||||
src.send_freq = sanitize_frequency(src.send_freq + text2num(href_list["adj_freq"]))
|
||||
|
||||
else if (href_list["adj_code"])
|
||||
src.send_code += text2num(href_list["adj_code"])
|
||||
src.send_code = round(src.send_code)
|
||||
src.send_code = min(100, src.send_code)
|
||||
src.send_code = max(1, src.send_code)
|
||||
|
||||
src.master.add_fingerprint(usr)
|
||||
src.master.updateSelfDialog()
|
||||
return
|
||||
|
||||
//Supply record monitor
|
||||
/datum/computer/file/pda_program/qm_records
|
||||
name = "Supply Records"
|
||||
size = 8.0
|
||||
|
||||
return_text()
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = src.return_text_header()
|
||||
dat += "<h4>Supply Record Interlink</h4>"
|
||||
|
||||
dat += "<BR><B>Supply shuttle</B><BR>"
|
||||
dat += "Location: [supply_shuttle_moving ? "Moving to station ([supply_shuttle_timeleft] Mins.)":supply_shuttle_at_station ? "Station":"Dock"]<BR>"
|
||||
dat += "Current approved orders: <BR><ol>"
|
||||
for(var/S in supply_shuttle_shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
dat += "<li>[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]</li>"
|
||||
dat += "</ol>"
|
||||
|
||||
dat += "Current requests: <BR><ol>"
|
||||
for(var/S in supply_shuttle_requestlist)
|
||||
var/datum/supply_order/SO = S
|
||||
dat += "<li>[SO.object.name] requested by [SO.orderedby]</li>"
|
||||
dat += "</ol><font size=\"-3\">Upgrade NOW to Space Parts & Space Vendors PLUS for full remote order control and inventory management."
|
||||
|
||||
return dat
|
||||
+1832
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,243 @@
|
||||
// *** pipefilter
|
||||
|
||||
/obj/machinery/pipefilter/New()
|
||||
..()
|
||||
p_dir = (NORTH|SOUTH|EAST|WEST) ^ turn(dir, 180)
|
||||
|
||||
src.gas = new /datum/gas_mixture/()
|
||||
src.ngas = new /datum/gas_mixture/()
|
||||
|
||||
src.f_gas = new /datum/gas_mixture/()
|
||||
src.f_ngas = new /datum/gas_mixture/()
|
||||
|
||||
gasflowlist += src
|
||||
|
||||
/obj/machinery/pipefilter/buildnodes()
|
||||
var/turf/T = src.loc
|
||||
|
||||
n1dir = turn(dir, 90)
|
||||
n2dir = turn(dir,-90)
|
||||
|
||||
node1 = get_machine( level, T , n1dir ) // the main flow dir
|
||||
node2 = get_machine( level, T , n2dir )
|
||||
node3 = get_machine( level, T, dir ) // the ejector port
|
||||
|
||||
if(node1) vnode1 = node1.getline()
|
||||
if(node2) vnode2 = node2.getline()
|
||||
if(node3) vnode3 = node3.getline()
|
||||
|
||||
/obj/machinery/pipefilter/gas_flow()
|
||||
gas.copy_from(ngas)
|
||||
f_gas.copy_from(f_ngas)
|
||||
|
||||
/obj/machinery/pipefilter/process()
|
||||
/* var/delta_gt
|
||||
|
||||
if(vnode1)
|
||||
delta_gt = FLOWFRAC * ( vnode1.get_gas_val(src) - gas.total_moles() / capmult)
|
||||
calc_delta( src, gas, ngas, vnode1, delta_gt)
|
||||
else
|
||||
leak_to_turf(1)
|
||||
if(vnode2)
|
||||
delta_gt = FLOWFRAC * ( vnode2.get_gas_val(src) - gas.total_moles() / capmult)
|
||||
calc_delta( src, gas, ngas, vnode2, delta_gt)
|
||||
else
|
||||
leak_to_turf(2)
|
||||
if(vnode3)
|
||||
delta_gt = FLOWFRAC * ( vnode3.get_gas_val(src) - f_gas.total_moles() / capmult)
|
||||
calc_delta( src, f_gas, f_ngas, vnode3, delta_gt)
|
||||
else
|
||||
leak_to_turf(3)
|
||||
|
||||
// transfer gas from ngas->f_ngas according to extraction rate, but only if we have power
|
||||
if(! (stat & NOPOWER) )
|
||||
use_power(min(src.f_per, 100),ENVIRON)
|
||||
var/datum/gas_mixture/ndelta = src.get_extract()
|
||||
ngas.sub_delta(ndelta)
|
||||
f_ngas.add_delta(ndelta)
|
||||
AutoUpdateAI(src)
|
||||
src.updateUsrDialog()*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/pipefilter/get_gas_val(from)
|
||||
return ((from == vnode3) ? f_gas.total_moles() : gas.total_moles())/capmult
|
||||
|
||||
/obj/machinery/pipefilter/get_gas(from)
|
||||
return (from == vnode3) ? f_gas : gas
|
||||
|
||||
/obj/machinery/pipefilter/proc/leak_to_turf(var/port)
|
||||
var/turf/T
|
||||
|
||||
switch(port)
|
||||
if(1)
|
||||
T = get_step(src, n1dir)
|
||||
if(2)
|
||||
T = get_step(src, n2dir)
|
||||
if(3)
|
||||
T = get_step(src, dir)
|
||||
if(T.density)
|
||||
T = src.loc
|
||||
if(T.density)
|
||||
return
|
||||
flow_to_turf(f_gas, f_ngas, T)
|
||||
return
|
||||
|
||||
if(T.density)
|
||||
T = src.loc
|
||||
if(T.density)
|
||||
return
|
||||
|
||||
flow_to_turf(gas, ngas, T)
|
||||
|
||||
/obj/machinery/pipefilter/proc/get_extract()
|
||||
/*
|
||||
var/datum/gas_mixture/ndelta = new()
|
||||
if (src.f_mask & GAS_O2)
|
||||
ndelta.oxygen = min(src.f_per, src.ngas.oxygen)
|
||||
if (src.f_mask & GAS_N2)
|
||||
ndelta.n2 = min(src.f_per, src.ngas.n2)
|
||||
if (src.f_mask & GAS_PL)
|
||||
ndelta.plasma = min(src.f_per, src.ngas.plasma)
|
||||
if (src.f_mask & GAS_CO2)
|
||||
ndelta.co2 = min(src.f_per, src.ngas.co2)
|
||||
if (src.f_mask & GAS_N2O)
|
||||
ndelta.sl_gas = min(src.f_per, src.ngas.sl_gas)
|
||||
return ndelta
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/pipefilter/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/detective_scanner))
|
||||
return ..()
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(bypassed)
|
||||
user.show_message(text("\red Remove the foreign wires first!"), 1)
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
user.show_message(text("\red Now []securing the access system panel...", (src.locked) ? "un" : "re"), 1)
|
||||
sleep(30)
|
||||
locked =! locked
|
||||
user.show_message(text("\red Done!"),1)
|
||||
src.updateicon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/cable_coil) && !bypassed)
|
||||
if(src.locked)
|
||||
user.show_message(text("\red You must remove the panel first!"),1)
|
||||
return
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(C.use(4))
|
||||
user.show_message(text("\red You unravel some cable.."),1)
|
||||
else
|
||||
user.show_message(text("\red Not enough cable! <I>(Requires four pieces)</I>"),1)
|
||||
src.add_fingerprint(user)
|
||||
user.show_message(text("\red Now bypassing the access system... <I>(This may take a while)</I>"), 1)
|
||||
sleep(100)
|
||||
bypassed = 1
|
||||
src.updateicon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wirecutters) && bypassed)
|
||||
src.add_fingerprint(user)
|
||||
user.show_message(text("\red Now removing the bypass wires... <I>(This may take a while)</I>"), 1)
|
||||
sleep(50)
|
||||
bypassed = 0
|
||||
src.updateicon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/card/emag) && (!emagged))
|
||||
emagged++
|
||||
src.add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] has shorted out the [] with an electromagnetic card!", user, src), 1)
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-spark")
|
||||
sleep(6)
|
||||
src.updateicon()
|
||||
return src.attack_hand(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
// pipefilter interact/topic
|
||||
/obj/machinery/pipefilter/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/pipefilter/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/pipefilter/attack_hand(mob/user as mob)
|
||||
/* if(stat & NOPOWER)
|
||||
user << browse(null, "window=pipefilter")
|
||||
user.machine = null
|
||||
return
|
||||
|
||||
var/list/gases = list("O2", "N2", "Plasma", "CO2", "N2O")
|
||||
user.machine = src
|
||||
var/dat = "Filter Release Rate:<BR>\n<A href='?src=\ref[src];fp=-[num2text(src.maxrate, 9)]'>M</A> <A href='?src=\ref[src];fp=-100000'>-</A> <A href='?src=\ref[src];fp=-10000'>-</A> <A href='?src=\ref[src];fp=-1000'>-</A> <A href='?src=\ref[src];fp=-100'>-</A> <A href='?src=\ref[src];fp=-1'>-</A> [src.f_per] <A href='?src=\ref[src];fp=1'>+</A> <A href='?src=\ref[src];fp=100'>+</A> <A href='?src=\ref[src];fp=1000'>+</A> <A href='?src=\ref[src];fp=10000'>+</A> <A href='?src=\ref[src];fp=100000'>+</A> <A href='?src=\ref[src];fp=[num2text(src.maxrate, 9)]'>M</A><BR>\n"
|
||||
for (var/i = 1; i <= gases.len; i++)
|
||||
dat += "[gases[i]]: <A HREF='?src=\ref[src];tg=[1 << (i - 1)]'>[(src.f_mask & 1 << (i - 1)) ? "Releasing" : "Passing"]</A><BR>\n"
|
||||
if(gas.total_moles())
|
||||
var/totalgas = gas.total_moles()
|
||||
var/pressure = round(totalgas / gas.maximum * 100)
|
||||
var/nitrogen = gas.n2 / totalgas * 100
|
||||
var/oxygen = gas.oxygen / totalgas * 100
|
||||
var/plasma = gas.plasma / totalgas * 100
|
||||
var/co2 = gas.co2 / totalgas * 100
|
||||
var/no2 = gas.sl_gas / totalgas * 100
|
||||
|
||||
dat += "<BR>Gas Levels: <BR>\nPressure: [pressure]%<BR>\nNitrogen: [nitrogen]%<BR>\nOxygen: [oxygen]%<BR>\nPlasma: [plasma]%<BR>\nCO2: [co2]%<BR>\nN2O: [no2]%<BR>\n"
|
||||
else
|
||||
dat += "<BR>Gas Levels: <BR>\nPressure: 0%<BR>\nNitrogen: 0%<BR>\nOxygen: 0%<BR>\nPlasma: 0%<BR>\nCO2: 0%<BR>\nN2O: 0%<BR>\n"
|
||||
dat += "<BR>\n<A href='?src=\ref[src];close=1'>Close</A><BR>\n"
|
||||
|
||||
user << browse(dat, "window=pipefilter;size=300x365")*/ //TODO: FIX
|
||||
//onclose(user, "pipefilter")
|
||||
|
||||
/obj/machinery/pipefilter/Topic(href, href_list)
|
||||
..()
|
||||
if(usr.restrained() || usr.lying)
|
||||
return
|
||||
if ((((get_dist(src, usr) <= 1 || usr.telekinesis == 1) || istype(usr, /mob/living/silicon/ai)) && istype(src.loc, /turf)))
|
||||
usr.machine = src
|
||||
if (href_list["close"])
|
||||
usr << browse(null, "window=pipefilter;")
|
||||
usr.machine = null
|
||||
return
|
||||
if (src.allowed(usr) || src.emagged || src.bypassed)
|
||||
if (href_list["fp"])
|
||||
src.f_per = min(max(round(src.f_per + text2num(href_list["fp"])), 0), src.maxrate)
|
||||
else if (href_list["tg"])
|
||||
// toggle gas
|
||||
src.f_mask ^= text2num(href_list["tg"])
|
||||
src.updateicon()
|
||||
else
|
||||
usr.see("\red Access Denied ([src.name] operation restricted to authorized atmospheric technicians.)")
|
||||
AutoUpdateAI(src)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=pipefilter")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
/obj/machinery/pipefilter/power_change()
|
||||
if(powered(ENVIRON))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
spawn(rand(1,15)) //so all the filters don't come on at once
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/pipefilter/proc/updateicon()
|
||||
src.overlays.Cut()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "filter-off"
|
||||
else
|
||||
icon_state = "filter"
|
||||
if(emagged) //only show if powered because presumeably its the interface that has been fried
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-emag")
|
||||
if (src.f_mask & (GAS_N2O|GAS_PL))
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-tox")
|
||||
if (src.f_mask & GAS_O2)
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-o2")
|
||||
if (src.f_mask & GAS_N2)
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-n2")
|
||||
if (src.f_mask & GAS_CO2)
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-co2")
|
||||
if(!locked)
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-open")
|
||||
if(bypassed) //should only be bypassed if unlocked
|
||||
src.overlays += image('icons/obj/pipes2.dmi', "filter-bypass")
|
||||
@@ -0,0 +1,281 @@
|
||||
/obj/item/clothing/suit/powered
|
||||
name = "Powered armor"
|
||||
desc = "Not for rookies."
|
||||
icon_state = "swat"
|
||||
item_state = "swat"
|
||||
w_class = 4//bulky item
|
||||
|
||||
protective_temperature = 1000
|
||||
flags = FPRINT | TABLEPASS
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/gun,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_oxygen)
|
||||
slowdown = 9
|
||||
var/fuel = 0
|
||||
|
||||
var/list/togglearmor = list(melee = 90, bullet = 70, laser = 60,energy = 40, bomb = 75, bio = 75, rad = 75)
|
||||
var/active = 0
|
||||
|
||||
var/helmrequired = 1
|
||||
var/obj/item/clothing/head/powered/helm
|
||||
|
||||
var/glovesrequired = 0
|
||||
var/obj/item/clothing/gloves/powered/gloves
|
||||
|
||||
var/shoesrequired = 0
|
||||
var/obj/item/clothing/shoes/powered/shoes
|
||||
//Adding gloves and shoes as possible armor components. --NEO
|
||||
|
||||
var/obj/item/powerarmor/servos/servos
|
||||
var/obj/item/powerarmor/reactive/reactive
|
||||
var/obj/item/powerarmor/atmoseal/atmoseal
|
||||
var/obj/item/powerarmor/power/power
|
||||
|
||||
New()
|
||||
verbs += /obj/item/clothing/suit/powered/proc/poweron
|
||||
|
||||
proc/poweron()
|
||||
set category = "Object"
|
||||
set name = "Activate armor systems"
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
|
||||
if(user.stat)
|
||||
return //if you're unconscious or dead, no dicking with your armor. --NEO
|
||||
|
||||
if(!istype(user))
|
||||
user << "\red This suit was engineered for human use only."
|
||||
return
|
||||
|
||||
if(user.wear_suit!=src)
|
||||
user << "\red The suit functions best if you are inside of it."
|
||||
return
|
||||
|
||||
if(helmrequired && !istype(user.head, /obj/item/clothing/head/powered))
|
||||
user << "\red Helmet missing, unable to initiate power-on procedure."
|
||||
return
|
||||
|
||||
if(glovesrequired && !istype(user.gloves, /obj/item/clothing/gloves/powered))
|
||||
user << "\red Gloves missing, unable to initiate power-on procedure."
|
||||
return
|
||||
|
||||
if(shoesrequired && !istype(user.shoes, /obj/item/clothing/shoes/powered))
|
||||
user << "\red Shoes missing, unable to initiate power-on procedure."
|
||||
return
|
||||
|
||||
if(active)
|
||||
user << "\red The suit is already on, you can't turn it on twice."
|
||||
return
|
||||
|
||||
if(!power || !power.checkpower())
|
||||
user << "\red Powersource missing or depleted."
|
||||
return
|
||||
|
||||
verbs -= /obj/item/clothing/suit/powered/proc/poweron
|
||||
|
||||
user << "\blue Suit interlocks engaged."
|
||||
if(helmrequired)
|
||||
helm = user.head
|
||||
helm.canremove = 0
|
||||
if(glovesrequired)
|
||||
gloves = user.gloves
|
||||
gloves.canremove = 0
|
||||
if(shoesrequired)
|
||||
shoes = user.shoes
|
||||
shoes.canremove = 0
|
||||
canremove = 0
|
||||
sleep(20)
|
||||
|
||||
if(atmoseal)
|
||||
atmoseal.toggle()
|
||||
sleep(20)
|
||||
|
||||
if(reactive)
|
||||
reactive.toggle()
|
||||
sleep(20)
|
||||
|
||||
if(servos)
|
||||
servos.toggle()
|
||||
sleep(20)
|
||||
|
||||
user << "\blue All systems online."
|
||||
active = 1
|
||||
power.process()
|
||||
|
||||
verbs += /obj/item/clothing/suit/powered/proc/poweroff
|
||||
|
||||
|
||||
proc/poweroff()
|
||||
set category = "Object"
|
||||
set name = "Deactivate armor systems"
|
||||
powerdown() //BYOND doesn't seem to like it if you try using a proc with vars in it as a verb, hence this. --NEO
|
||||
|
||||
proc/powerdown(sudden = 0)
|
||||
|
||||
var/delay = sudden?0:20
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
|
||||
if(user.stat && !sudden)
|
||||
return //if you're unconscious or dead, no dicking with your armor. --NEO
|
||||
|
||||
if(!active)
|
||||
return
|
||||
|
||||
verbs -= /obj/item/clothing/suit/powered/proc/poweroff
|
||||
|
||||
if(sudden)
|
||||
user << "\red Your armor loses power!"
|
||||
|
||||
if(servos)
|
||||
servos.toggle(sudden)
|
||||
sleep(delay)
|
||||
|
||||
if(reactive)
|
||||
reactive.toggle(sudden)
|
||||
sleep(delay)
|
||||
|
||||
if(atmoseal)
|
||||
if(istype(atmoseal, /obj/item/powerarmor/atmoseal/optional) && helm)
|
||||
atmoseal:helmtoggle(sudden)
|
||||
atmoseal.toggle(sudden)
|
||||
|
||||
sleep(delay)
|
||||
|
||||
if(!sudden)
|
||||
usr << "\blue Suit interlocks disengaged."
|
||||
if(helm)
|
||||
helm.canremove = 1
|
||||
helm = null
|
||||
if(gloves)
|
||||
gloves.canremove = 1
|
||||
gloves = null
|
||||
if(shoes)
|
||||
shoes.canremove = 1
|
||||
gloves = null
|
||||
canremove = 1
|
||||
//Not a tabbing error, the thing only unlocks if you intentionally power-down the armor. --NEO
|
||||
sleep(delay)
|
||||
|
||||
if(!sudden)
|
||||
usr << "\blue All systems disengaged."
|
||||
|
||||
active = 0
|
||||
verbs += /obj/item/clothing/suit/powered/proc/poweron
|
||||
|
||||
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(power && istype(power,/obj/item/powerarmor/power/plasma))
|
||||
switch(W.type)
|
||||
if(/obj/item/stack/sheet/mineral/plasma)
|
||||
if(fuel < 50)
|
||||
user << "\blue You feed some refined plasma into the armor's generator."
|
||||
power:fuel += 25
|
||||
W:amount--
|
||||
if (W:amount <= 0)
|
||||
del(W)
|
||||
return
|
||||
else
|
||||
user << "\red The generator already has plenty of plasma."
|
||||
return
|
||||
|
||||
if(/obj/item/weapon/ore/plasma) //raw plasma has impurities, so it doesn't provide as much fuel. --NEO
|
||||
if(fuel < 50)
|
||||
user << "\blue You feed some plasma into the armor's generator."
|
||||
power:fuel += 15
|
||||
del(W)
|
||||
return
|
||||
else
|
||||
user << "\red The generator already has plenty of plasma."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/powered
|
||||
name = "Powered armor"
|
||||
icon_state = "swat"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
see_face = 0.0
|
||||
item_state = "swat"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
var/obj/item/clothing/suit/powered/parent
|
||||
|
||||
proc/atmotoggle()
|
||||
set category = "Object"
|
||||
set name = "Toggle helmet seals"
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
|
||||
if(!istype(user))
|
||||
user << "\red This helmet is not rated for nonhuman use."
|
||||
return
|
||||
|
||||
if(user.head != src)
|
||||
user << "\red Can't engage the seals without wearing the helmet."
|
||||
return
|
||||
|
||||
if(!user.wear_suit || !istype(user.wear_suit,/obj/item/clothing/suit/powered))
|
||||
user << "\red This helmet can only couple with powered armor."
|
||||
return
|
||||
|
||||
var/obj/item/clothing/suit/powered/armor = user.wear_suit
|
||||
|
||||
if(!armor.atmoseal || !istype(armor.atmoseal, /obj/item/powerarmor/atmoseal/optional))
|
||||
user << "\red This armor's atmospheric seals are missing or incompatible."
|
||||
return
|
||||
|
||||
armor.atmoseal:helmtoggle(0,1)
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/clothing/gloves/powered
|
||||
name = "Powered armor"
|
||||
icon_state = "swat"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS
|
||||
item_state = "swat"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
|
||||
/obj/item/clothing/shoes/powered
|
||||
name = "Powered armor"
|
||||
icon_state = "swat"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS
|
||||
item_state = "swat"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
|
||||
|
||||
obj/item/clothing/suit/powered/spawnable/badmin
|
||||
New()
|
||||
servos = new /obj/item/powerarmor/servos(src)
|
||||
servos.parent = src
|
||||
reactive = new /obj/item/powerarmor/reactive(src)
|
||||
reactive.parent = src
|
||||
atmoseal = new /obj/item/powerarmor/atmoseal/optional/adminbus(src)
|
||||
atmoseal.parent = src
|
||||
power = new /obj/item/powerarmor/power(src)
|
||||
power.parent = src
|
||||
|
||||
verbs += /obj/item/clothing/suit/powered/proc/poweron
|
||||
|
||||
var/obj/item/clothing/head/powered/helm = new /obj/item/clothing/head/powered(src.loc)
|
||||
helm.verbs += /obj/item/clothing/head/powered/proc/atmotoggle
|
||||
|
||||
obj/item/clothing/suit/powered/spawnable/regular
|
||||
New()
|
||||
servos = new /obj/item/powerarmor/servos(src)
|
||||
servos.parent = src
|
||||
reactive = new /obj/item/powerarmor/reactive/centcomm(src)
|
||||
reactive.parent = src
|
||||
atmoseal = new /obj/item/powerarmor/atmoseal/optional/adminbus(src)
|
||||
atmoseal.parent = src
|
||||
power = new /obj/item/powerarmor/power(src)
|
||||
power.parent = src
|
||||
|
||||
verbs += /obj/item/clothing/suit/powered/proc/poweron
|
||||
|
||||
var/obj/item/clothing/head/powered/helm = new /obj/item/clothing/head/powered(src.loc)
|
||||
helm.verbs += /obj/item/clothing/head/powered/proc/atmotoggle
|
||||
@@ -0,0 +1,246 @@
|
||||
/obj/item/powerarmor
|
||||
name = "Generic power armor component"
|
||||
desc = "This is the base object, you should never see one."
|
||||
var/obj/item/clothing/suit/powered/parent //so the component knows which armor it belongs to.
|
||||
var/slowdown = 0 //how much the component slows down the wearer
|
||||
|
||||
proc/toggle()
|
||||
return
|
||||
//The child objects will use this proc
|
||||
|
||||
|
||||
|
||||
/obj/item/powerarmor/power
|
||||
name = "Adminbus power armor power source"
|
||||
desc = "Runs on the rare Badminium molecule."
|
||||
|
||||
process()
|
||||
return
|
||||
|
||||
proc/checkpower()
|
||||
return 1
|
||||
|
||||
plasma
|
||||
name = "Miniaturized plasma generator"
|
||||
desc = "Runs on plasma."
|
||||
slowdown = 1
|
||||
var/fuel = 0
|
||||
|
||||
process()
|
||||
if (fuel > 0 && parent.active)
|
||||
fuel--
|
||||
spawn(50)
|
||||
process()
|
||||
return
|
||||
else if (parent.active)
|
||||
parent.powerdown(1)
|
||||
return
|
||||
|
||||
checkpower()
|
||||
return fuel
|
||||
|
||||
powercell
|
||||
name = "Powercell interface"
|
||||
desc = "Boring, but reliable."
|
||||
var/obj/item/weapon/cell/cell
|
||||
slowdown = 0.5
|
||||
|
||||
process()
|
||||
if (cell && cell.charge > 0 && parent.active)
|
||||
cell.use(50)
|
||||
spawn(50)
|
||||
process()
|
||||
return
|
||||
else if (parent.active)
|
||||
parent.powerdown(1)
|
||||
return
|
||||
|
||||
checkpower()
|
||||
return max(cell.charge, 0)
|
||||
|
||||
nuclear
|
||||
name = "Miniaturized nuclear generator"
|
||||
desc = "For all your radioactive needs."
|
||||
slowdown = 1.5
|
||||
|
||||
process()
|
||||
if(!crit_fail)
|
||||
if (prob(src.reliability)) return 1 //No failure
|
||||
if (prob(src.reliability))
|
||||
for (var/mob/M in range(0,src.parent)) //Only a minor failure, enjoy your radiation.
|
||||
if (src.parent in M.contents)
|
||||
M << "\red Your armor feels pleasantly warm for a moment."
|
||||
else
|
||||
M << "\red You feel a warm sensation."
|
||||
M.radiation += rand(1,40)
|
||||
else
|
||||
for (var/mob/M in range(rand(1,4),src.parent)) //Big failure, TIME FOR RADIATION BITCHES
|
||||
if (src.parent in M.contents)
|
||||
M << "\red Your armor's reactor overloads!"
|
||||
M << "\red You feel a wave of heat wash over you."
|
||||
M.radiation += 100
|
||||
crit_fail = 1 //broken~
|
||||
parent.powerdown(1)
|
||||
spawn(50)
|
||||
process()
|
||||
|
||||
checkpower()
|
||||
return !crit_fail
|
||||
|
||||
/obj/item/powerarmor/reactive
|
||||
name = "Adminbus power armor reactive plating"
|
||||
desc = "Made with the rare Badminium molecule."
|
||||
var/list/togglearmor = list(melee = 250, bullet = 100, laser = 100,energy = 100, bomb = 100, bio = 100, rad = 100)
|
||||
//Good lord an active energy axe does 150 damage a swing? Anyway, barring var editing, this armor loadout should be impervious to anything. Enjoy, badmins~ --NEO
|
||||
|
||||
toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "\blue Reactive armor systems disengaged."
|
||||
if(0)
|
||||
usr << "\blue Reactive armor systems engaged."
|
||||
var/list/switchover = list()
|
||||
for (var/armorvar in parent.armor)
|
||||
switchover[armorvar] = togglearmor[armorvar]
|
||||
togglearmor[armorvar] = parent.armor[armorvar]
|
||||
parent.armor[armorvar] = switchover[armorvar]
|
||||
//Probably not the most elegant way to have the vars switch over, but it works. Also propagates the values to the other objects.
|
||||
if(parent.helm)
|
||||
parent.helm.armor[armorvar] = parent.armor[armorvar]
|
||||
if(parent.gloves)
|
||||
parent.gloves.armor[armorvar] = parent.armor[armorvar]
|
||||
if(parent.shoes)
|
||||
parent.shoes.armor[armorvar] = parent.armor[armorvar]
|
||||
|
||||
centcomm
|
||||
name = "CentComm power armor reactive plating"
|
||||
desc = "Pretty effective against everything, not perfect though."
|
||||
togglearmor = list(melee = 90, bullet = 70, laser = 60,energy = 40, bomb = 75, bio = 75, rad = 75)
|
||||
slowdown = 2
|
||||
|
||||
|
||||
/obj/item/powerarmor/servos
|
||||
name = "Adminbus power armor movement servos"
|
||||
desc = "Made with the rare Badminium molecule."
|
||||
var/toggleslowdown = 9
|
||||
|
||||
toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "\blue Movement assist servos disengaged."
|
||||
parent.slowdown += toggleslowdown
|
||||
if(0)
|
||||
usr << "\blue Movement assist servos engaged."
|
||||
parent.slowdown -= toggleslowdown
|
||||
|
||||
/obj/item/powerarmor/atmoseal
|
||||
name = "Power armor atmospheric seals"
|
||||
desc = "Keeps the bad stuff out."
|
||||
slowdown = 1
|
||||
var/sealed = 0
|
||||
|
||||
toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "\blue Atmospheric seals disengaged."
|
||||
parent.gas_transfer_coefficient = 1
|
||||
parent.permeability_coefficient = 1
|
||||
parent.heat_transfer_coefficient = 1
|
||||
parent.flags &= ~SUITSPACE
|
||||
if(parent.helmrequired)
|
||||
parent.helm.gas_transfer_coefficient = 1
|
||||
parent.helm.permeability_coefficient = 1
|
||||
parent.helm.heat_transfer_coefficient = 1
|
||||
parent.helm.flags &= ~HEADSPACE
|
||||
if(parent.glovesrequired)
|
||||
parent.gloves.gas_transfer_coefficient = 1
|
||||
parent.gloves.permeability_coefficient = 1
|
||||
parent.gloves.heat_transfer_coefficient = 1
|
||||
if(parent.shoesrequired)
|
||||
parent.shoes.gas_transfer_coefficient = 1
|
||||
parent.shoes.permeability_coefficient = 1
|
||||
parent.shoes.heat_transfer_coefficient = 1
|
||||
sealed = 0
|
||||
|
||||
if(0)
|
||||
usr << "\blue Atmospheric seals engaged."
|
||||
parent.gas_transfer_coefficient = 0.01
|
||||
parent.permeability_coefficient = 0.02
|
||||
parent.heat_transfer_coefficient = 0.02
|
||||
parent.flags |= SUITSPACE
|
||||
if(parent.helmrequired)
|
||||
parent.helm.gas_transfer_coefficient = 0.01
|
||||
parent.helm.permeability_coefficient = 0.02
|
||||
parent.helm.heat_transfer_coefficient = 0.02
|
||||
parent.helm.flags |= HEADSPACE
|
||||
if(parent.glovesrequired)
|
||||
parent.gloves.gas_transfer_coefficient = 0.01
|
||||
parent.gloves.permeability_coefficient = 0.02
|
||||
parent.gloves.heat_transfer_coefficient = 0.02
|
||||
if(parent.shoesrequired)
|
||||
parent.shoes.gas_transfer_coefficient = 0.01
|
||||
parent.shoes.permeability_coefficient = 0.02
|
||||
parent.shoes.heat_transfer_coefficient = 0.02
|
||||
sealed = 1
|
||||
|
||||
adminbus
|
||||
name = "Adminbus power armor atmospheric seals"
|
||||
desc = "Made with the rare Badminium molecule."
|
||||
slowdown = 0
|
||||
|
||||
optional
|
||||
name = "Togglable power armor atmospheric seals"
|
||||
desc = "Keeps the bad stuff out, but lets you remove your helmet without having to turn the whole suit off."
|
||||
|
||||
proc/helmtoggle(sudden = 0, manual = 0)
|
||||
var/mob/living/carbon/human/user = usr
|
||||
var/obj/item/clothing/head/powered/helm
|
||||
if(user.head && istype(user.head,/obj/item/clothing/head/powered))
|
||||
helm = user.head
|
||||
|
||||
if(!sealed)
|
||||
user << "\red Unable to initialize helmet seal, armor seals not active."
|
||||
return
|
||||
if(!helm.parent)
|
||||
user << "\blue Helmet locked."
|
||||
helm.canremove = 0
|
||||
parent.helm = helm
|
||||
helm.parent = parent
|
||||
sleep(20)
|
||||
parent.helm.gas_transfer_coefficient = 0.01
|
||||
parent.helm.permeability_coefficient = 0.02
|
||||
parent.helm.heat_transfer_coefficient = 0.02
|
||||
parent.helm.flags |= HEADSPACE
|
||||
user << "\blue Helmet atmospheric seals engaged."
|
||||
if(manual)
|
||||
for (var/armorvar in helm.armor)
|
||||
helm.armor[armorvar] = parent.armor[armorvar]
|
||||
return
|
||||
else
|
||||
if(manual)
|
||||
user << "\blue Helmet atmospheric seals disengaged."
|
||||
parent.helm.gas_transfer_coefficient = 1
|
||||
parent.helm.permeability_coefficient = 1
|
||||
parent.helm.heat_transfer_coefficient = 1
|
||||
parent.helm.flags &= ~HEADSPACE
|
||||
if(manual)
|
||||
for (var/armorvar in helm.armor)
|
||||
helm.armor[armorvar] = parent.reactive.togglearmor[armorvar]
|
||||
if(!sudden)
|
||||
if(manual)
|
||||
sleep(20)
|
||||
user << "\blue Helmet unlocked."
|
||||
helm.canremove = 1
|
||||
parent.helm = null
|
||||
helm.parent = null
|
||||
|
||||
adminbus
|
||||
name = "Adminbus togglable power armor atmospheric seals"
|
||||
desc = "Made with the rare Badminium molecule."
|
||||
slowdown = 0
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
// The scrap item
|
||||
// a single object type represents all combinations of size and composition of scrap
|
||||
//
|
||||
|
||||
|
||||
/obj/item/scrap
|
||||
name = "scrap"
|
||||
icon = 'scrap.dmi'
|
||||
icon_state = "1metal0"
|
||||
item_state = "scrap-metal"
|
||||
desc = "A piece of scrap"
|
||||
var/classtext = ""
|
||||
throwforce = 14.0
|
||||
m_amt = 0
|
||||
g_amt = 0
|
||||
w_amt = 0
|
||||
var/size = 1 // 1=piece, 2= few pieces, 3=small pile, 4=large pile
|
||||
var/blood = 0 // 0=none, 1=blood-stained, 2=bloody
|
||||
|
||||
throwforce = 8.0
|
||||
throw_speed = 1
|
||||
throw_range = 4
|
||||
w_class = 1
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
|
||||
#define MAX_SCRAP 15000 // maximum content amount of a scrap pile
|
||||
|
||||
|
||||
/obj/item/scrap/New()
|
||||
src.verbs -= /atom/movable/verb/pull
|
||||
..()
|
||||
update()
|
||||
|
||||
// return a copy
|
||||
/obj/item/scrap/proc/copy()
|
||||
var/obj/item/scrap/ret = new()
|
||||
ret.set_components(m_amt, g_amt, w_amt)
|
||||
return ret
|
||||
|
||||
|
||||
// set the metal, glass and waste content
|
||||
/obj/item/scrap/proc/set_components(var/m, var/g, var/w)
|
||||
m_amt = m
|
||||
g_amt = g
|
||||
w_amt = w
|
||||
update()
|
||||
|
||||
// returns the total amount of scrap in this pile
|
||||
/obj/item/scrap/proc/total()
|
||||
return m_amt + g_amt + w_amt
|
||||
|
||||
|
||||
// sets the size, appearance, and description of the scrap depending on component amounts
|
||||
/obj/item/scrap/proc/update()
|
||||
var/total = total()
|
||||
|
||||
|
||||
// determine size of pile
|
||||
if(total<=400)
|
||||
size = 1
|
||||
else if(total<=1600)
|
||||
size = 2
|
||||
else
|
||||
size = 3
|
||||
|
||||
w_class = size
|
||||
|
||||
var/sizetext = ""
|
||||
|
||||
switch(size)
|
||||
if(1)
|
||||
sizetext = "A piece of"
|
||||
if(2)
|
||||
sizetext = "A few pieces of"
|
||||
if(3)
|
||||
sizetext = "A pile of"
|
||||
|
||||
// determine bloodiness
|
||||
var/bloodtext = ""
|
||||
switch(blood)
|
||||
if(0)
|
||||
bloodtext = ""
|
||||
if(1)
|
||||
bloodtext = "blood-stained "
|
||||
if(2)
|
||||
bloodtext = "bloody "
|
||||
|
||||
|
||||
// find mixture and composition
|
||||
var/class = 0 // 0 = mixed, 1=mostly. 2=pure
|
||||
var/major = "waste" // the major component type
|
||||
|
||||
var/max = 0
|
||||
|
||||
if(m_amt > max)
|
||||
max = m_amt
|
||||
else if(g_amt > max)
|
||||
max = g_amt
|
||||
else if(w_amt > max)
|
||||
max = w_amt
|
||||
|
||||
if(max == total)
|
||||
class = 2 // pure
|
||||
else if(max/total > 0.6)
|
||||
class = 1 // mostly
|
||||
else
|
||||
class = 0 // mixed
|
||||
|
||||
if(class>0)
|
||||
var/remain = total - max
|
||||
if(m_amt > remain)
|
||||
major = "metal"
|
||||
else if(g_amt > remain)
|
||||
major = "glass"
|
||||
else
|
||||
major = "waste"
|
||||
|
||||
|
||||
if(class == 1)
|
||||
desc = "[sizetext] mostly [major] [bloodtext]scrap."
|
||||
classtext = "mostly [major] [bloodtext]"
|
||||
else
|
||||
desc = "[sizetext] [bloodtext][major] scrap."
|
||||
classtext = "[bloodtext][major] "
|
||||
icon_state = "[size][major][blood]"
|
||||
else
|
||||
desc = "[sizetext] [bloodtext]mixed scrap."
|
||||
classtext = "[bloodtext]mixed"
|
||||
icon_state = "[size]mixed[blood]"
|
||||
|
||||
if(size==0)
|
||||
pixel_x = rand(-5,5)
|
||||
pixel_y = rand(-5,5)
|
||||
else
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
|
||||
// clear or set conduction flag depending on whether scrap is mostly metal
|
||||
if(major=="metal")
|
||||
flags |= CONDUCT
|
||||
else
|
||||
flags &= ~CONDUCT
|
||||
|
||||
item_state = "scrap-[major]"
|
||||
|
||||
// add a scrap item to this one
|
||||
// if the resulting pile is too big, transfer only what will fit
|
||||
// otherwise add them and deleted the added pile
|
||||
|
||||
/obj/item/scrap/proc/add_scrap(var/obj/item/scrap/other, var/limit = MAX_SCRAP)
|
||||
var/total = total()
|
||||
var/other_total = other.total()
|
||||
|
||||
if( (total + other_total) <= limit )
|
||||
m_amt += other.m_amt
|
||||
g_amt += other.g_amt
|
||||
w_amt += other.w_amt
|
||||
|
||||
blood = (total*blood + other_total*other.blood) / (total + other_total)
|
||||
del(other)
|
||||
|
||||
else
|
||||
var/space = limit - total
|
||||
|
||||
var/m = round(other.m_amt/other_total*space, 1)
|
||||
var/g = round(other.g_amt/other_total*space, 1)
|
||||
var/w = round(other.w_amt/other_total*space, 1)
|
||||
|
||||
m_amt += m
|
||||
g_amt += g
|
||||
w_amt += w
|
||||
|
||||
other.m_amt -= m
|
||||
other.g_amt -= g
|
||||
other.w_amt -= w
|
||||
|
||||
var/other_trans = m + g + w
|
||||
other.update()
|
||||
blood = (total*blood + other_trans*other.blood) / (total + other_trans)
|
||||
|
||||
|
||||
blood = round(blood,1)
|
||||
src.update()
|
||||
|
||||
// limit this pile to maximum size
|
||||
// return any remainder as a new scrap item (or null if none)
|
||||
// note return item is not necessarily smaller than max size
|
||||
|
||||
/obj/item/scrap/proc/remainder(var/limit = MAX_SCRAP)
|
||||
var/total = total()
|
||||
if(total > limit)
|
||||
var/m = round( m_amt/total * limit, 1)
|
||||
var/g = round( g_amt/total * limit, 1)
|
||||
var/w = round( w_amt/total * limit, 1)
|
||||
|
||||
var/obj/item/scrap/S = new()
|
||||
S.set_components(m_amt - m,g_amt - g,w_amt - w)
|
||||
src.set_components(m,g,w)
|
||||
|
||||
return S
|
||||
return null
|
||||
|
||||
// if other pile of scrap tries to enter the same turf, then add that pile to this one
|
||||
|
||||
/obj/item/scrap/CanPass(var/obj/item/scrap/O)
|
||||
|
||||
if(istype(O))
|
||||
|
||||
src.add_scrap(O)
|
||||
if(O)
|
||||
return 0 // O still exists if not all could be transfered, so block it
|
||||
return 1
|
||||
|
||||
/obj/item/scrap/proc/to_text()
|
||||
return "[m_amt],[g_amt],[w_amt] ([total()])"
|
||||
|
||||
|
||||
// attack with hand removes a single piece from a pile
|
||||
/obj/item/scrap/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(src.is_single_piece())
|
||||
return ..(user)
|
||||
var/obj/item/scrap/S = src.get_single_piece()
|
||||
S.attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/scrap/attackby(obj/item/I, mob/user)
|
||||
..()
|
||||
if(istype(I, /obj/item/scrap))
|
||||
var/obj/item/scrap/S = I
|
||||
if( (S.total()+src.total() ) > MAX_SCRAP )
|
||||
user << "The pile is full."
|
||||
return
|
||||
if(ismob(src.loc)) // can't combine scrap in hand
|
||||
return
|
||||
|
||||
src.add_scrap(S)
|
||||
|
||||
// when dropped, try to make a pile if scrap is already there
|
||||
/obj/item/scrap/dropped()
|
||||
|
||||
spawn(2) // delay to allow drop postprocessing (since src may be destroyed)
|
||||
for(var/obj/item/scrap/S in oview(0,src)) // excludes src itself
|
||||
S.add_scrap(src)
|
||||
|
||||
// return true if this is a single piece of scrap
|
||||
// must be total<=400 and of single composition
|
||||
/obj/item/scrap/proc/is_single_piece()
|
||||
if(total() > 400)
|
||||
return 0
|
||||
|
||||
var/empty = (m_amt == 0) + (g_amt == 0) + (w_amt == 0)
|
||||
|
||||
return (empty==2) // must be 2 components with zero amount
|
||||
|
||||
|
||||
// get a single piece of scrap from a pile
|
||||
/obj/item/scrap/proc/get_single_piece()
|
||||
|
||||
var/obj/item/scrap/S = new()
|
||||
|
||||
var/cmp = pick(m_amt;1 , g_amt;2, w_amt;3)
|
||||
|
||||
var/amount = 400
|
||||
switch(cmp)
|
||||
if(1)
|
||||
if(m_amt < amount)
|
||||
amount = m_amt
|
||||
|
||||
S.set_components(amount, 0, 0)
|
||||
src.set_components(m_amt - amount, g_amt, w_amt)
|
||||
|
||||
if(2)
|
||||
if(g_amt < amount)
|
||||
amount = g_amt
|
||||
S.set_components(0, amount, 0)
|
||||
src.set_components(m_amt, g_amt - amount, w_amt)
|
||||
|
||||
if(3)
|
||||
if(w_amt < amount)
|
||||
amount = w_amt
|
||||
S.set_components(0, 0, amount)
|
||||
src.set_components(m_amt, g_amt, w_amt - amount)
|
||||
|
||||
|
||||
return S
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/obj/structure/shuttle
|
||||
name = "shuttle"
|
||||
icon = 'icons/turf/shuttle.dmi'
|
||||
|
||||
/obj/structure/shuttle/engine
|
||||
name = "engine"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/structure/shuttle/engine/heater
|
||||
name = "heater"
|
||||
icon_state = "heater"
|
||||
|
||||
/obj/structure/shuttle/engine/platform
|
||||
name = "platform"
|
||||
icon_state = "platform"
|
||||
|
||||
/obj/structure/shuttle/engine/propulsion
|
||||
name = "propulsion"
|
||||
icon_state = "propulsion"
|
||||
opacity = 1
|
||||
|
||||
/obj/structure/shuttle/engine/propulsion/burst
|
||||
name = "burst"
|
||||
|
||||
/obj/structure/shuttle/engine/propulsion/burst/left
|
||||
name = "left"
|
||||
icon_state = "burst_l"
|
||||
|
||||
/obj/structure/shuttle/engine/propulsion/burst/right
|
||||
name = "right"
|
||||
icon_state = "burst_r"
|
||||
|
||||
/obj/structure/shuttle/engine/router
|
||||
name = "router"
|
||||
icon_state = "router"
|
||||
@@ -0,0 +1,515 @@
|
||||
/obj/machinery/atmoalter/siphs/New()
|
||||
..()
|
||||
src.gas = new /datum/gas_mixture()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/releaseall()
|
||||
src.t_status = 1
|
||||
src.t_per = max_valve
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/reset(valve, auto)
|
||||
if(c_status!=0)
|
||||
return
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/release(amount, flag)
|
||||
/*
|
||||
var/T = src.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (!( amount ))
|
||||
return
|
||||
if (!( flag ))
|
||||
amount = min(amount, max_valve)
|
||||
src.gas.turf_add(T, amount)
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/siphon(amount, flag)
|
||||
/*
|
||||
var/T = src.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (!( amount ))
|
||||
return
|
||||
if (!( flag ))
|
||||
amount = min(amount, 900000.0)
|
||||
src.gas.turf_take(T, amount)
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "siphon:0"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "siphon:T"
|
||||
else
|
||||
if (src.t_status != 3)
|
||||
src.icon_state = "siphon:1"
|
||||
else
|
||||
src.icon_state = "siphon:0"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/New()
|
||||
/*
|
||||
..()
|
||||
if(!empty)
|
||||
src.gas.oxygen = 2.73E7
|
||||
src.gas.n2 = 1.027E8
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/port/reset(valve, auto)
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/attackby(W as obj, user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
if (src.c_status)
|
||||
src.anchored = 1
|
||||
src.c_status = 0
|
||||
else
|
||||
if (locate(/obj/machinery/connector, src.loc))
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/setstate()
|
||||
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "vent-p"
|
||||
return
|
||||
|
||||
if (src.t_status == 4)
|
||||
src.icon_state = "vent2"
|
||||
else
|
||||
if (src.t_status == 3)
|
||||
src.icon_state = "vent0"
|
||||
else
|
||||
src.icon_state = "vent1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/reset(valve, auto)
|
||||
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/process()
|
||||
/*
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if(src.gas.temperature >= 3000)
|
||||
src.melt()
|
||||
|
||||
if (src.t_status != 3)
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (T.firelevel < 900000.0)
|
||||
src.gas.turf_add_all_oxy(T)
|
||||
|
||||
else
|
||||
T = null
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.turf_add(T, t)
|
||||
if(2.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (t > t2)
|
||||
t = t2
|
||||
src.gas.turf_take(T, t)
|
||||
if(4.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (T)
|
||||
if (T.firelevel > 900000.0)
|
||||
src.f_time = world.time + 400
|
||||
else
|
||||
if (world.time > src.f_time)
|
||||
src.gas.extract_toxs(T)
|
||||
if( !portable() ) use_power(150, ENVIRON)
|
||||
var/contain = src.gas.total_moles()
|
||||
if (contain > 1.3E8)
|
||||
src.gas.turf_add(T, 1.3E8 - contain)
|
||||
|
||||
src.setstate()
|
||||
src.updateDialog()
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "vent-p"
|
||||
return
|
||||
|
||||
if (src.t_status == 4)
|
||||
src.icon_state = "vent2"
|
||||
else
|
||||
if (src.t_status == 3)
|
||||
src.icon_state = "vent0"
|
||||
else
|
||||
src.icon_state = "vent1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/attackby(W as obj, user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
if (src.c_status)
|
||||
src.anchored = 1
|
||||
src.c_status = 0
|
||||
else
|
||||
if (locate(/obj/machinery/connector, src.loc))
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/reset(valve, auto)
|
||||
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/port/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "scrubber:0"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "scrubber:T"
|
||||
else
|
||||
if (src.t_status != 3)
|
||||
src.icon_state = "scrubber:1"
|
||||
else
|
||||
src.icon_state = "scrubber:0"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/port/reset(valve, auto)
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
//true if the siphon is portable (therfore no power needed)
|
||||
|
||||
/obj/machinery/proc/portable()
|
||||
return istype(src, /obj/machinery/atmoalter/siphs/fullairsiphon/port) || istype(src, /obj/machinery/atmoalter/siphs/scrubbers/port)
|
||||
|
||||
/obj/machinery/atmoalter/siphs/power_change()
|
||||
|
||||
if( portable() )
|
||||
return
|
||||
|
||||
if(!powered(ENVIRON))
|
||||
spawn(rand(0,15))
|
||||
stat |= NOPOWER
|
||||
setstate()
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
setstate()
|
||||
|
||||
|
||||
/obj/machinery/atmoalter/siphs/process()
|
||||
/*
|
||||
// var/dbg = (suffix=="d") && Debug
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if (src.t_status != 3)
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
else
|
||||
T = null
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.turf_add(T, t)
|
||||
if(2.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (t > t2)
|
||||
t = t2
|
||||
//var/g = gas.total_moles()
|
||||
//if(dbg) world.log << "VP0 : [t] from turf: [gas.total_moles()]"
|
||||
//if(dbg) Air()
|
||||
|
||||
src.gas.turf_take(T, t)
|
||||
//if(dbg) world.log << "VP1 : now [gas.total_moles()]"
|
||||
|
||||
//if(dbg) world.log << "[gas.total_moles()-g] ([t]) from turf to siph"
|
||||
|
||||
//if(dbg) Air()
|
||||
if(4.0)
|
||||
if( !portable() )
|
||||
use_power(50, ENVIRON)
|
||||
|
||||
if (T)
|
||||
if (T.firelevel > 900000.0)
|
||||
src.f_time = world.time + 300
|
||||
else
|
||||
if (world.time > src.f_time)
|
||||
var/difference = CELLSTANDARD - (T.oxygen + T.n2)
|
||||
if (difference > 0)
|
||||
var/t1 = src.gas.total_moles()
|
||||
if (difference > t1)
|
||||
difference = t1
|
||||
src.gas.turf_add(T, difference)
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
src.setstate()
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attack_paw(user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if(src.portable() && istype(user, /mob/living/silicon/ai)) //AI can't use portable siphons
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/tt
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
tt = text("Releasing <A href='?src=\ref[];t=2'>Siphon</A> <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> Siphoning <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> <A href='?src=\ref[];t=2'>Siphon</A> Stopped <A href='?src=\ref[];t=4'>Automatic</A>", src, src, src)
|
||||
else
|
||||
tt = "Automatic equalizers are on!"
|
||||
var/ct = null
|
||||
switch(src.c_status)
|
||||
if(1.0)
|
||||
ct = text("Releasing <A href='?src=\ref[];c=2'>Accept</A> <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> Accepting <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> <A href='?src=\ref[];c=2'>Accept</A> Stopped", src, src)
|
||||
else
|
||||
ct = "Disconnected"
|
||||
var/at = null
|
||||
if (src.t_status == 4)
|
||||
at = text("Automatic On <A href='?src=\ref[];t=3'>Stop</A>", src)
|
||||
var/dat = text("<TT><B>Canister Valves</B> []<BR>\n\t<FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR>\n\tUpper Valve Status: [] []<BR>\n\t\t<A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR>\n\tPipe Valve Status: []<BR>\n\t\t<A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR>\n<BR>\n\n<A href='?src=\ref[];mach_close=siphon'>Close</A><BR>\n\t</TT>", (!( src.alterable ) ? "<B>Valves are locked. Unlock with wrench!</B>" : "You can lock this interface with a wrench."), num2text(src.gas.return_pressure(), 10), num2text(src.maximum, 10), (src.t_status == 4 ? text("[]", at) : text("[]", tt)), (src.holding ? text("<BR>(<A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.air_contents.return_pressure()) : null), src, num2text(max_valve, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(max_valve, 7), ct, src, num2text(max_valve, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(max_valve, 7), user)
|
||||
user << browse(dat, "window=siphon;size=600x300")
|
||||
onclose(user, "siphon")
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if ((!( src.alterable )) && (!istype(usr, /mob/living/silicon/ai)))
|
||||
return
|
||||
if (((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["c"])
|
||||
var/c = text2num(href_list["c"])
|
||||
switch(c)
|
||||
if(1.0)
|
||||
src.c_status = 1
|
||||
if(2.0)
|
||||
src.c_status = 2
|
||||
if(3.0)
|
||||
src.c_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["t"])
|
||||
var/t = text2num(href_list["t"])
|
||||
if (src.t_status == 0)
|
||||
return
|
||||
switch(t)
|
||||
if(1.0)
|
||||
src.t_status = 1
|
||||
if(2.0)
|
||||
src.t_status = 2
|
||||
if(3.0)
|
||||
src.t_status = 3
|
||||
if(4.0)
|
||||
src.t_status = 4
|
||||
src.f_time = 1
|
||||
else
|
||||
else
|
||||
if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.t_per += tp
|
||||
src.t_per = min(max(round(src.t_per), 0), max_valve)
|
||||
else
|
||||
if (href_list["cp"])
|
||||
var/cp = text2num(href_list["cp"])
|
||||
src.c_per += cp
|
||||
src.c_per = min(max(round(src.c_per), 0), max_valve)
|
||||
else
|
||||
if (href_list["tank"])
|
||||
var/cp = text2num(href_list["tank"])
|
||||
if (cp == 1)
|
||||
src.holding.loc = src.loc
|
||||
src.holding = null
|
||||
if (src.t_status == 2)
|
||||
src.t_status = 3
|
||||
src.updateUsrDialog()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=canister")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attackby(var/obj/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/tank))
|
||||
if (src.holding)
|
||||
return
|
||||
var/obj/item/weapon/tank/T = W
|
||||
user.drop_item()
|
||||
T.loc = src
|
||||
src.holding = T
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
var/obj/machinery/connector/con = locate(/obj/machinery/connector, src.loc)
|
||||
if (src.c_status)
|
||||
src.anchored = 0
|
||||
src.c_status = 0
|
||||
user.show_message("\blue You have disconnected the siphon.")
|
||||
if(con)
|
||||
con.connected = null
|
||||
else
|
||||
if (con && !con.connected)
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
user.show_message("\blue You have connected the siphon.")
|
||||
con.connected = src
|
||||
else
|
||||
user.show_message("\blue There is nothing here to connect to the siphon.")
|
||||
|
||||
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
if (src.alterable)
|
||||
user << "\blue You unlock the interface!"
|
||||
else
|
||||
user << "\blue You lock the interface!"
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
// Entirely unfinished. Mostly just bouncing ideas off the code.
|
||||
|
||||
|
||||
// Smelting
|
||||
// Grinding
|
||||
// Spraying
|
||||
// Crate
|
||||
|
||||
/obj/deploycrate
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "deploycrate"
|
||||
density = 1
|
||||
var/payload
|
||||
|
||||
/obj/deploycrate/attack_hand(mob/user as mob)
|
||||
switch(payload)
|
||||
if(null)
|
||||
return
|
||||
//if("cloner")
|
||||
// make a cloner
|
||||
// blah blah
|
||||
for (var/mob/V in hearers(src))
|
||||
V.show_message("[src] lets out a pneumatic hiss, its panels rapdily unfolding and expanding to produce its payload.", 2)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/machinery/nanosprayer
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "sprayer"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/payload
|
||||
var/hacked = 0
|
||||
var/temp = 100
|
||||
|
||||
var/usr_density = 5
|
||||
var/usr_lastupdate = 0
|
||||
|
||||
var/time_started = 0
|
||||
|
||||
var/points = 0
|
||||
var/totalpoints = 0
|
||||
|
||||
var/state = 0 // 0 - Idle, 1 - Spraying, 2 - Done, 3 - Overheated
|
||||
|
||||
obj/machinery/nanosprayer/proc/update_temp()
|
||||
// 1 second : 1 degree
|
||||
if(src.state == 0)
|
||||
var/diff = (world.time - usr_lastupdate) * 10
|
||||
temp -= diff
|
||||
if(temp < 100)
|
||||
temp = 100
|
||||
usr_lastupdate = world.time
|
||||
return temp
|
||||
else if(src.state == 1)
|
||||
var/diff = (world.time - usr_lastupdate) * 10
|
||||
diff = diff * usr_density
|
||||
temp += diff
|
||||
usr_lastupdate = world.time
|
||||
return temp
|
||||
|
||||
obj/machinery/nanosprayer/process()
|
||||
src.time_started = world.time
|
||||
totalpoints = lentext(payload) * rand(5,10)
|
||||
if(!totalpoints)
|
||||
totalpoints = 1
|
||||
while(src.state == 1)
|
||||
// Each unit of cost is 20 seconds - density
|
||||
temp += density * rand(1,4)
|
||||
sleep(200 - (usr_density * 10))
|
||||
if(src.temp > 350)
|
||||
src.state = 3
|
||||
src.overheat()
|
||||
return 0
|
||||
points += usr_density
|
||||
if(points >= totalpoints)
|
||||
src.state = 2
|
||||
src.complete()
|
||||
return 1
|
||||
|
||||
|
||||
obj/machinery/nanosprayer/proc/cooldown()
|
||||
while(state != 1)
|
||||
sleep(200)
|
||||
temp -= rand(5,20)
|
||||
if(temp < 100)
|
||||
temp = 100
|
||||
return
|
||||
|
||||
obj/machinery/nanosprayer/proc/overheat()
|
||||
return
|
||||
|
||||
obj/machinery/nanosprayer/proc/complete()
|
||||
src.totalpoints = 0
|
||||
src.points = 0
|
||||
spawn() cooldown()
|
||||
return
|
||||
|
||||
obj/machinery/nanosprayer/attack_hand(user as mob)
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
dat += text("Core Temp: [temp]�C<BR>")
|
||||
dat += text("Nanocloud Density: [usr_density] million<BR>")
|
||||
dat += text("\[<A href='?src=\ref[src];minus=1'>-</A> / <A href='?src=\ref[src];plus=1'>+</A>\]<BR>")
|
||||
if(payload)
|
||||
dat += text("<BR>Task: [payload]<BR>")
|
||||
switch(state)
|
||||
if(0)
|
||||
dat += text("Status: Idling<BR>")
|
||||
if(1)
|
||||
dat += text("Status: Spraying<BR>")
|
||||
if(2)
|
||||
dat += text("Status: Spray Task Complete<BR>")
|
||||
if(3)
|
||||
dat += text("Status: <B><FONT COLOR=RED>OVERHEATED</FONT><BR>")
|
||||
if(state == 1)
|
||||
if(points <= 0)
|
||||
points = 1
|
||||
var/complete = (points * 100)/totalpoints
|
||||
if(complete < 0)
|
||||
complete = 0
|
||||
if(complete > 100)
|
||||
complete = 100
|
||||
dat += text("Progress: <B>[complete]%</B><BR>")
|
||||
if(state == 2)
|
||||
dat += text("Progress: <B>100%</B><BR>")
|
||||
dat += text("\[<A href='?src=\ref[src];release=1'>Release Payload</A>\]<BR>")
|
||||
dat += text("<HR><BR><A href='?src=\ref[src];settask=1'>Set Task</A><BR>")
|
||||
dat += text("<A href='?src=\ref[src];start=1'>Start Spray</A><BR>")
|
||||
dat += text("<A href='?src=\ref[src];stop=1'>Cancel Spray</A>")
|
||||
dat += text("<BR><BR><A href='?src=\ref[src];refresh=1'>Refresh</A>")
|
||||
user << browse("<HEAD><TITLE>NANO SPRAY 1.1</TITLE></HEAD><TT>[dat]</TT>", "window=nanosprayer")
|
||||
onclose(user, "nanosprayer")
|
||||
|
||||
obj/machinery/nanosprayer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["plus"])
|
||||
usr_density += 1
|
||||
if(href_list["minus"])
|
||||
usr_density -= 1
|
||||
if(usr_density < 1)
|
||||
usr_density = 1
|
||||
if(href_list["start"])
|
||||
if(state == 0)
|
||||
state = 1
|
||||
spawn() src.process()
|
||||
if(href_list["stop"])
|
||||
if(state == 1)
|
||||
state = 0
|
||||
points = 0
|
||||
totalpoints = 0
|
||||
spawn() cooldown()
|
||||
if(href_list["settask"])
|
||||
if(state == 0)
|
||||
var/temppayload = input("Set a Task:", "Job Assignment") as text|null
|
||||
if(temppayload)
|
||||
payload = temppayload
|
||||
//if(href_list["release"])
|
||||
// if(state == 2)
|
||||
// Create the crate somewhere
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/smelter
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "sprayer"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/locked = 0
|
||||
var/closed = 0
|
||||
var/state = 0 // 0 - Idle, 1 - Smelt, 2 - Cool, 3 - Clean
|
||||
var/slag = 0
|
||||
var/hacked = 0
|
||||
|
||||
obj/machinery/smelter/attack_hand(user as mob)
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
dat += text("<h2>Smelt-o-Matic Control Interface</h2>")
|
||||
dat += text("The red light is [src.closed ? "off" : "on"].<BR>")
|
||||
dat += text("The green light is [src.locked ? "on" : "off"].<BR>")
|
||||
switch(slag)
|
||||
if(0)
|
||||
dat += text("The meter is resting at zero.<BR>")
|
||||
if(1 to 2)
|
||||
dat += text("The meter is wobbling at the mid-point marker.<BR>")
|
||||
if(3)
|
||||
dat += text("The meter strains, displaying its maximum value.<BR>")
|
||||
else
|
||||
dat += text("The meter has broken.<BR>")
|
||||
switch(state)
|
||||
if(0)
|
||||
dat += text("<b>Status</b>:<i>Idle</i><BR>")
|
||||
if(1)
|
||||
dat += text("<b>Status</b>:<i>Smelting</i><BR>")
|
||||
if(2)
|
||||
dat += text("<b>Status</b>:<i>Cooling</i><BR>")
|
||||
if(3)
|
||||
dat += text("<b>Status</b>:<i>Cleaning</i><BR>")
|
||||
dat += text("<HR /><BR>Turn key <A href='?src=\ref[src];key=1'>[src.locked ? "to upper-left position" : "to upper-right position"]</A><BR>")
|
||||
dat += text("Flip switch <A href='?src=\ref[src];switch=1'>[src.closed ? "up" : "down"]</A><BR>")
|
||||
dat += text("<A href='?src=\ref[src];button=1'>Push large flashing yellow button</A><BR>")
|
||||
user << browse("<HEAD><TITLE>SMELTOMATIC</TITLE></HEAD><TT>[dat]</TT>", "window=smelter")
|
||||
onclose(user, "smelter")
|
||||
|
||||
|
||||
obj/machinery/smelter/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["key"])
|
||||
src.locked = !src.locked
|
||||
if(href_list["switch"])
|
||||
src.closed = !src.closed
|
||||
if(href_list["button"])
|
||||
//Do stuff to actually smelt shit or something I don't know
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
/obj/machinery/slaggrinder
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
|
||||
|
||||
/obj/machinery/adminmachine
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "sprayer"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/gameticker
|
||||
var/gameworld
|
||||
|
||||
New()
|
||||
..()
|
||||
gameticker = ticker
|
||||
gameworld = world
|
||||
@@ -0,0 +1,348 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
/obj/machinery/shipcore
|
||||
icon = 'craft.dmi'
|
||||
icon_state = "core"
|
||||
density = 1
|
||||
|
||||
var/width = 6
|
||||
var/height = 8
|
||||
var/list/turfs = list()
|
||||
var/list/builders
|
||||
var/list/components = list()
|
||||
var/build_status = "unbuilt"
|
||||
|
||||
|
||||
proc/group_self()
|
||||
builders = list()
|
||||
turfs = list()
|
||||
components = list()
|
||||
|
||||
src.anchored = 1
|
||||
|
||||
var/obj/ship_builder/L = new(locate(src.x, src.y, src.z))
|
||||
L.dir = WEST
|
||||
L.distance = width/2
|
||||
L.core = src
|
||||
|
||||
var/obj/ship_builder/R = new(locate(src.x+1, src.y, src.z))
|
||||
R.dir = EAST
|
||||
R.distance = (width/2)-1
|
||||
R.core = src
|
||||
|
||||
builders.Add(L, R)
|
||||
|
||||
spawn() L.scan()
|
||||
spawn() R.scan()
|
||||
|
||||
var/h
|
||||
for(h=1, h<height/2, h++)
|
||||
var/obj/ship_builder/A = new(locate(src.x+1, src.y+h, src.z))
|
||||
A.dir = EAST
|
||||
A.distance = (width/2)-1
|
||||
A.core = src
|
||||
|
||||
var/obj/ship_builder/B = new(locate(src.x, src.y+h, src.z))
|
||||
B.dir = WEST
|
||||
B.distance = width/2
|
||||
B.core = src
|
||||
|
||||
var/obj/ship_builder/C = new(locate(src.x+1, src.y-h, src.z))
|
||||
C.dir = EAST
|
||||
C.distance = (width/2)-1
|
||||
C.core = src
|
||||
|
||||
var/obj/ship_builder/D = new(locate(src.x, src.y-h, src.z))
|
||||
D.dir = WEST
|
||||
D.distance = width/2
|
||||
D.core = src
|
||||
|
||||
builders.Add(A, B, C, D)
|
||||
|
||||
spawn() A.scan()
|
||||
spawn() B.scan()
|
||||
spawn() C.scan()
|
||||
spawn() D.scan()
|
||||
|
||||
while(src.builders.len)
|
||||
sleep(50)
|
||||
del(src.builders)
|
||||
for(var/turf/T in turfs)
|
||||
for(var/obj/O in T.contents)
|
||||
if(istype(O, /obj/machinery/ship_component))
|
||||
O:core = src
|
||||
src.components.Add(O)
|
||||
src.build_status = "built"
|
||||
//world << "Ship initialization complete. [src.turfs.len] tiles added."
|
||||
|
||||
proc/receive_turf(var/turf/T)
|
||||
turfs.Add(T)
|
||||
|
||||
|
||||
proc/MoveShip(var/turf/Center) // Center - The new position of the ship's core
|
||||
src.anchored = 0
|
||||
var/turf/lowerleft = locate(Center.x - (src.width/2), Center.y - (src.height/2), Center.z)
|
||||
var/turf/upperright = locate(Center.x + (src.width/2), Center.y + (src.height/2), Center.z)
|
||||
|
||||
var/xsav = src.loc.x
|
||||
var/ysav = src.loc.y
|
||||
var/zsav = src.loc.z
|
||||
|
||||
for(var/turf/T in block(lowerleft, upperright))
|
||||
if(!istype(T, /turf/space))
|
||||
return 0 // One of the tiles in the range we're moving to isn't a space tile - something's in the way!
|
||||
|
||||
// Alright, the way is clear, we can actually begin transferring everything over now.
|
||||
for(var/turf/T in src.turfs)
|
||||
|
||||
for(var/obj/O in T)
|
||||
if(istype(O, /obj/effect/ship_landing_beacon)) // Leave beacons where they are, we don't want to take them with us.
|
||||
continue
|
||||
var/
|
||||
_x = Center.x + O.x - xsav
|
||||
_y = Center.y + O.y - ysav
|
||||
_z = Center.z + O.z - zsav
|
||||
O.loc = locate(_x, _y, _z)
|
||||
|
||||
for(var/mob/M in T)
|
||||
var/
|
||||
_x = Center.x + M.x - xsav
|
||||
_y = Center.y + M.y - ysav
|
||||
_z = Center.z + M.z - zsav
|
||||
M.loc = locate(_x, _y, _z)
|
||||
|
||||
var/
|
||||
_x = Center.x + T.x - xsav
|
||||
_y = Center.y + T.y - ysav
|
||||
_z = Center.z + T.z - zsav
|
||||
var/turf/Newloc = locate(_x, _y, _z)
|
||||
//new T(Newloc)
|
||||
new T.type(Newloc)
|
||||
T.ChangeTurf(/turf/space)
|
||||
|
||||
if(Newloc)
|
||||
Newloc.assume_air(T.return_air())
|
||||
T.remove_air(T.return_air())
|
||||
src.build_status = "rebuilding"
|
||||
src.group_self()
|
||||
|
||||
proc/draw_power(var/n as num)
|
||||
for(var/obj/machinery/ship_component/engine/E in components)
|
||||
if(E.draw_power(n))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
obj/machinery/shipcore/attack_hand(user as mob)
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
if (1 == 1) // Haha why did I even do this what the fuck. Whatever. It's too entertaining to remove now. -- TLE
|
||||
/*
|
||||
dat += "Autolathe Wires:<BR>"
|
||||
var/wire
|
||||
for(wire in src.wires)
|
||||
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];act=wire'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];act=pulse'>Pulse</A><BR>")
|
||||
|
||||
dat += text("The red light is [src.disabled ? "off" : "on"].<BR>")
|
||||
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
|
||||
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
|
||||
*/
|
||||
switch(src.build_status)
|
||||
if("unbuilt")
|
||||
dat += "<h3>Core Status: <font color =#FF3300>Undeployed</font></h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];groupself=1'>Build Ship</A><BR>"
|
||||
if("built")
|
||||
dat += "<h3>Core Status: <font color =#00CC00>Deployed</font></h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];move=1'>Move</A><BR>"
|
||||
if("rebuilding")
|
||||
dat += "<h3>Core Status: <font color =#FFCC00>Recalibrating</font></h3><BR>"
|
||||
user << browse("<HEAD><TITLE>Ship Core</TITLE></HEAD>[dat]","window=shipcore")
|
||||
onclose(user, "shipcore")
|
||||
return
|
||||
user << browse("<HEAD><TITLE>Ship Core Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=shipcore")
|
||||
onclose(user, "shipcore")
|
||||
return
|
||||
|
||||
obj/machinery/shipcore/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["groupself"])
|
||||
src.group_self()
|
||||
if (href_list["move"])
|
||||
var/list/beacons = list()
|
||||
for(var/obj/effect/ship_landing_beacon/b in world)
|
||||
if(istype(b, /obj/effect/ship_landing_beacon))
|
||||
if(b.active)
|
||||
beacons.Add(b)
|
||||
if(!beacons.len)
|
||||
return
|
||||
var/obj/choice = input("Choose a beacon to land at.", "Beacon Selection") in beacons
|
||||
if(choice)
|
||||
src.MoveShip(choice.loc)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
|
||||
obj/machinery/ship_component
|
||||
name = "ship component"
|
||||
icon = 'craft.dmi'
|
||||
var/obj/machinery/shipcore/core
|
||||
var/required_draw = 0
|
||||
var/active = 1
|
||||
|
||||
proc
|
||||
draw_power(var/n as num)
|
||||
if(!n)
|
||||
n = required_draw
|
||||
if(core.draw_power(n))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
obj/machinery/ship_component/thruster
|
||||
name = "thruster"
|
||||
icon_state = "thruster"
|
||||
density = 1
|
||||
opacity = 1
|
||||
|
||||
var/cooldown = 600 // In 1/10th seconds
|
||||
var/lastused
|
||||
var/ready = 0
|
||||
required_draw = 100
|
||||
|
||||
proc
|
||||
check_ready()
|
||||
if(ready)
|
||||
return 1
|
||||
if(lastused + cooldown <= world.time)
|
||||
for(var/turf/T in range(1,src))
|
||||
if(istype(T, /turf/space))
|
||||
src.ready = 1
|
||||
break
|
||||
else
|
||||
src.ready = 0
|
||||
return src.ready
|
||||
|
||||
fire()
|
||||
src.check_ready()
|
||||
if(!ready)
|
||||
return 0
|
||||
if(src.draw_power())
|
||||
src.ready = 0
|
||||
src.lastused = world.time
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
obj/machinery/ship_component/engine
|
||||
name = "engine"
|
||||
icon_state = "engine"
|
||||
density = 1
|
||||
opacity = 1
|
||||
|
||||
var/charge = 1000
|
||||
var/capacity = 1000
|
||||
|
||||
draw_power(var/n as num)
|
||||
if(charge >= n)
|
||||
charge -= n
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
obj/machinery/ship_component/control_panel
|
||||
name = "control panel"
|
||||
icon_state = "controlpanel"
|
||||
density = 1
|
||||
opacity = 0
|
||||
|
||||
attack_hand(user as mob)
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
if(!src.core)
|
||||
dat += "<b>No linked core found. Deploy ship core first.</b>"
|
||||
else
|
||||
dat += "Ship Status: [src.core.build_status]<br><br>"
|
||||
dat += "<h3>Installed Components:</h3><br><br>"
|
||||
dat += "<table>"
|
||||
for(var/obj/machinery/ship_component/C in core.components)
|
||||
dat += "<tr><td><b>[C.name]</b></td><td>[C.active ? "<font color=green>Active</font>" : "<font color=red>Inactive</font>"]</td></tr>"
|
||||
if(istype(C, /obj/machinery/ship_component/engine))
|
||||
dat += "<tr><td></td><td><i>Fuel: [C:charge]/[C:capacity]</i></td></tr>"
|
||||
if(istype(C, /obj/machinery/ship_component/thruster))
|
||||
dat += "<tr><td></td><td><i>Status: [C:check_ready() ? "Ready" : "On Cooldown"]</i></td></tr>"
|
||||
dat += "</table>"
|
||||
user << browse("<HEAD><TITLE>Ship Controls</TITLE></HEAD>[dat]","window=shipcontrols")
|
||||
onclose(user, "shipcontrols")
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/ship_builder
|
||||
icon = 'craft.dmi'
|
||||
icon_state = "builder"
|
||||
density = 0
|
||||
opacity = 0
|
||||
|
||||
var/obj/machinery/shipcore/core
|
||||
var/distance = 0
|
||||
|
||||
proc/scan()
|
||||
if(distance < 0)
|
||||
cleanup_self()
|
||||
var/i
|
||||
for(i=0, i<distance, i++)
|
||||
if(istype(src.loc, /turf/space))
|
||||
break
|
||||
else
|
||||
core.receive_turf(src.loc)
|
||||
src.loc = get_step(src, src.dir)
|
||||
sleep(0)
|
||||
cleanup_self()
|
||||
proc/cleanup_self()
|
||||
core.builders.Remove(src)
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
/obj/ship_overlay
|
||||
icon = 'craft.dmi'
|
||||
icon_state = "ship_overlay"
|
||||
|
||||
/obj/effect/ship_landing_beacon
|
||||
icon = 'craft.dmi'
|
||||
icon_state = "beacon"
|
||||
name = "Beacon"
|
||||
var/active = 0
|
||||
|
||||
proc
|
||||
deploy()
|
||||
if(active)
|
||||
return
|
||||
src.active = 1
|
||||
src.anchored = 1
|
||||
deactivate()
|
||||
if(!active)
|
||||
return
|
||||
src.active = 0
|
||||
src.anchored = 0
|
||||
@@ -0,0 +1,585 @@
|
||||
//the old style proc spells. not sure why these were removed in favour of obj style spells, in all honesty.
|
||||
|
||||
//BLIND
|
||||
|
||||
/client/proc/blind()
|
||||
set category = "Spells"
|
||||
set name = "Blind"
|
||||
set desc = "This spell temporarly blinds a single person and does not require wizard garb."
|
||||
|
||||
var/mob/M = input(usr, "Who do you wish to blind?") as mob in oview()
|
||||
|
||||
if(M)
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
// if(!usr.casting()) return
|
||||
usr.verbs -= /client/proc/blind
|
||||
spawn(300)
|
||||
usr.verbs += /client/proc/blind
|
||||
|
||||
usr.whisper("STI KALY")
|
||||
|
||||
var/obj/effect/overlay/B = new /obj/effect/overlay( M.loc )
|
||||
B.icon_state = "blspell"
|
||||
B.icon = 'icons/obj/wizard.dmi'
|
||||
B.name = "spell"
|
||||
B.anchored = 1
|
||||
B.density = 0
|
||||
B.layer = 4
|
||||
M.canmove = 0
|
||||
spawn(5)
|
||||
del(B)
|
||||
M.canmove = 1
|
||||
M << text("\blue Your eyes cry out in pain!")
|
||||
M.disabilities |= NEARSIGHTED
|
||||
spawn(300)
|
||||
M.disabilities &= ~NEARSIGHTED
|
||||
M.eye_blind = 10
|
||||
M.eye_blurry = 20
|
||||
return
|
||||
|
||||
//MAGIC MISSILE
|
||||
|
||||
/client/proc/magicmissile()
|
||||
set category = "Spells"
|
||||
set name = "Magic missile"
|
||||
set desc = "This spell fires several, slow moving, magic projectiles at nearby targets."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
|
||||
usr.say("FORTI GY AMA")
|
||||
|
||||
for (var/mob/living/M as mob in oview())
|
||||
spawn(0)
|
||||
var/obj/effect/overlay/A = new /obj/effect/overlay( usr.loc )
|
||||
A.icon_state = "magicm"
|
||||
A.icon = 'icons/obj/wizard.dmi'
|
||||
A.name = "a magic missile"
|
||||
A.anchored = 0
|
||||
A.density = 0
|
||||
A.layer = 4
|
||||
var/i
|
||||
for(i=0, i<20, i++)
|
||||
if (!istype(M)) //it happens sometimes --rastaf0
|
||||
break
|
||||
var/obj/effect/overlay/B = new /obj/effect/overlay( A.loc )
|
||||
B.icon_state = "magicmd"
|
||||
B.icon = 'icons/obj/wizard.dmi'
|
||||
B.name = "trail"
|
||||
B.anchored = 1
|
||||
B.density = 0
|
||||
B.layer = 3
|
||||
spawn(5)
|
||||
del(B)
|
||||
step_to(A,M,0)
|
||||
if (get_dist(A,M) == 0)
|
||||
M.Weaken(5)
|
||||
M.take_overall_damage(0,10)
|
||||
del(A)
|
||||
return
|
||||
sleep(5)
|
||||
del(A)
|
||||
|
||||
usr.verbs -= /client/proc/magicmissile
|
||||
spawn(100)
|
||||
usr.verbs += /client/proc/magicmissile
|
||||
|
||||
//SMOKE
|
||||
|
||||
/client/proc/smokecloud()
|
||||
|
||||
set category = "Spells"
|
||||
set name = "Smoke"
|
||||
set desc = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
// if(!usr.casting()) return
|
||||
usr.verbs -= /client/proc/smokecloud
|
||||
spawn(120)
|
||||
usr.verbs += /client/proc/smokecloud
|
||||
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
|
||||
smoke.set_up(10, 0, usr.loc)
|
||||
smoke.start()
|
||||
|
||||
|
||||
//SLEEP SMOKE
|
||||
|
||||
///client/proc/smokecloud()
|
||||
//
|
||||
// set category = "Spells"
|
||||
// set name = "Sleep Smoke"
|
||||
// set desc = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb. But, without the robes, you have no protection against the magic."
|
||||
// if(usr.stat)
|
||||
// src << "Not when you are incapacitated."
|
||||
// return
|
||||
// if(!usr.casting()) return
|
||||
// usr.verbs -= /client/proc/smokecloud
|
||||
// spawn(120)
|
||||
// usr.verbs += /client/proc/smokecloud
|
||||
// var/datum/effect/system/sleep_smoke_spread/smoke = new /datum/effect/system/sleep_smoke_spread()
|
||||
// smoke.set_up(10, 0, usr.loc)
|
||||
// smoke.start()
|
||||
|
||||
//FORCE WALL
|
||||
|
||||
/obj/effect/forcefield
|
||||
desc = "A space wizard's magic wall."
|
||||
name = "FORCEWALL"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "m_shield"
|
||||
anchored = 1.0
|
||||
opacity = 0
|
||||
density = 1
|
||||
unacidable = 1
|
||||
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj, var/def_zone)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
for(var/mob/M in T)
|
||||
Proj.on_hit(M,M.bullet_act(Proj, def_zone))
|
||||
return
|
||||
|
||||
|
||||
|
||||
/client/proc/forcewall()
|
||||
|
||||
set category = "Spells"
|
||||
set name = "Forcewall"
|
||||
set desc = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
// if(!usr.casting()) return
|
||||
|
||||
usr.verbs -= /client/proc/forcewall
|
||||
spawn(100)
|
||||
usr.verbs += /client/proc/forcewall
|
||||
var/forcefield
|
||||
|
||||
usr.whisper("TARCOL MINTI ZHERI")
|
||||
|
||||
forcefield = new /obj/effect/forcefield(locate(usr.x,usr.y,usr.z))
|
||||
spawn (300)
|
||||
del (forcefield)
|
||||
return
|
||||
|
||||
//FIREBALLAN
|
||||
|
||||
/client/proc/fireball()
|
||||
set category = "Spells"
|
||||
set name = "Fireball"
|
||||
set desc = "This spell fires a fireball at a target and does not require wizard garb."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
// if(!usr.casting()) return
|
||||
|
||||
usr.verbs -= /client/proc/fireball
|
||||
spawn(100)
|
||||
usr.verbs += /client/proc/fireball
|
||||
|
||||
usr.say("ONI SOMA")
|
||||
|
||||
var/mob/living/user = src
|
||||
if(!istype(user))
|
||||
return
|
||||
|
||||
var/i
|
||||
var/turf/T
|
||||
var/range = 15
|
||||
|
||||
var/x = user.loc.x
|
||||
var/y = user.loc.y
|
||||
var/z = user.loc.z
|
||||
|
||||
switch(user.dir)
|
||||
if(NORTH)
|
||||
T = get_turf(locate(x, y + range, z))
|
||||
if(EAST)
|
||||
T = get_turf(locate(x + range, y, z))
|
||||
if(SOUTH)
|
||||
T = get_turf(locate(x, y - range, z))
|
||||
if(WEST)
|
||||
T = get_turf(locate(x - range, y, z))
|
||||
else
|
||||
return
|
||||
|
||||
var/obj/effect/overlay/A = new /obj/effect/overlay( usr.loc )
|
||||
|
||||
A.icon_state = "fireball"
|
||||
A.icon = 'icons/obj/wizard.dmi'
|
||||
A.name = "a fireball"
|
||||
A.anchored = 0
|
||||
A.density = 0
|
||||
A.luminosity = 3
|
||||
|
||||
step_to(A, T, 0)
|
||||
for(i=0, i<100, i++)
|
||||
var/hit = 0
|
||||
var/moving = step_to(A,T,0)
|
||||
for(var/mob/living/target in range(1, A))
|
||||
hit = 1
|
||||
target.take_overall_damage(20,25)
|
||||
if(hit)
|
||||
explosion(A.loc, -1, -1, 2, 2)
|
||||
del(A)
|
||||
return
|
||||
if(!moving)
|
||||
explosion(A.loc, -1, -1, 2, 2)
|
||||
del(A)
|
||||
return
|
||||
sleep(2)
|
||||
if(A)
|
||||
explosion(A.loc, -1, -1, 2, 2)
|
||||
del(A)
|
||||
return
|
||||
|
||||
//KNOCK
|
||||
|
||||
/client/proc/knock()
|
||||
set category = "Spells"
|
||||
set name = "Knock"
|
||||
set desc = "This spell opens nearby doors and does not require wizard garb."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
// if(!usr.casting()) return
|
||||
usr.verbs -= /client/proc/knock
|
||||
spawn(100)
|
||||
usr.verbs += /client/proc/knock
|
||||
|
||||
usr.whisper("AULIE OXIN FIERA")
|
||||
|
||||
for(var/obj/machinery/door/G in oview(3))
|
||||
spawn(1)
|
||||
G.open()
|
||||
return
|
||||
|
||||
//KILL
|
||||
|
||||
/mob/proc/kill(mob/living/M as mob in oview(1))
|
||||
set category = "Spells"
|
||||
set name = "Disintegrate"
|
||||
set desc = "This spell instantly kills somebody adjacent to you with the vilest of magick."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
usr.verbs -= /mob/proc/kill
|
||||
spawn(600)
|
||||
usr.verbs += /mob/proc/kill
|
||||
|
||||
usr.say("EI NATH")
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(4, 1, M)
|
||||
s.start()
|
||||
|
||||
M.dust()
|
||||
|
||||
//DISABLE TECH
|
||||
|
||||
/mob/proc/tech()
|
||||
set category = "Spells"
|
||||
set name = "Disable Technology"
|
||||
set desc = "This spell disables all weapons, cameras and most other technology in range."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
usr.verbs -= /mob/proc/tech
|
||||
spawn(400)
|
||||
usr.verbs += /mob/proc/tech
|
||||
|
||||
usr.say("NEC CANTIO")
|
||||
empulse(src, 6, 10)
|
||||
return
|
||||
|
||||
//BLINK
|
||||
|
||||
/client/proc/blink()
|
||||
set category = "Spells"
|
||||
set name = "Blink"
|
||||
set desc = "This spell randomly teleports you a short distance."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/T in orange(6))
|
||||
if(istype(T,/turf/space)) continue
|
||||
if(T.density) continue
|
||||
if(T.x>world.maxx-4 || T.x<4) continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-4 || T.y<4) continue
|
||||
turfs += T
|
||||
if(!turfs.len) turfs += pick(/turf in orange(6))
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
|
||||
smoke.set_up(10, 0, usr.loc)
|
||||
smoke.start()
|
||||
var/turf/picked = pick(turfs)
|
||||
if(!isturf(picked)) return
|
||||
usr.loc = picked
|
||||
usr.verbs -= /client/proc/blink
|
||||
spawn(40)
|
||||
usr.verbs += /client/proc/blink
|
||||
|
||||
//TELEPORT
|
||||
|
||||
/mob/proc/teleport()
|
||||
set category = "Spells"
|
||||
set name = "Teleport"
|
||||
set desc = "This spell teleports you to a type of area of your selection."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
var/A
|
||||
usr.verbs -= /mob/proc/teleport
|
||||
/*
|
||||
var/list/theareas = new/list()
|
||||
for(var/area/AR in world)
|
||||
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station)) continue
|
||||
if(theareas.Find(AR.name)) continue
|
||||
var/turf/picked = pick(get_area_turfs(AR.type))
|
||||
if (picked.z == src.z)
|
||||
theareas += AR.name
|
||||
theareas[AR.name] = AR
|
||||
*/
|
||||
|
||||
A = input("Area to jump to", "BOOYEA", A) in teleportlocs
|
||||
|
||||
spawn(600)
|
||||
usr.verbs += /mob/proc/teleport
|
||||
|
||||
var/area/thearea = teleportlocs[A]
|
||||
|
||||
usr.say("SCYAR NILA [uppertext(A)]")
|
||||
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
|
||||
smoke.set_up(5, 0, usr.loc)
|
||||
smoke.attach(usr)
|
||||
smoke.start()
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
if(!T.density)
|
||||
var/clear = 1
|
||||
for(var/obj/O in T)
|
||||
if(O.density)
|
||||
clear = 0
|
||||
break
|
||||
if(clear)
|
||||
L+=T
|
||||
|
||||
if(!L.len)
|
||||
usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
|
||||
return
|
||||
|
||||
var/attempt = 0
|
||||
var/success = 0
|
||||
while(!success)
|
||||
success = Move(pick(L))
|
||||
if(attempt > 20) break //Failsafe
|
||||
if(!success)
|
||||
usr.loc = pick(L)
|
||||
|
||||
smoke.start()
|
||||
|
||||
|
||||
//JAUNT
|
||||
|
||||
/client/proc/jaunt()
|
||||
set category = "Spells"
|
||||
set name = "Ethereal Jaunt"
|
||||
set desc = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
usr.verbs -= /client/proc/jaunt
|
||||
spawn(300)
|
||||
usr.verbs += /client/proc/jaunt
|
||||
spell_jaunt(usr)
|
||||
|
||||
/proc/spell_jaunt(var/mob/H, time = 50)
|
||||
if(H.stat) return
|
||||
spawn(0)
|
||||
var/mobloc = get_turf(H.loc)
|
||||
var/obj/effect/dummy/spell_jaunt/holder = new /obj/effect/dummy/spell_jaunt( mobloc )
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay( mobloc )
|
||||
animation.name = "water"
|
||||
animation.density = 0
|
||||
animation.anchored = 1
|
||||
animation.icon = 'icons/mob/mob.dmi'
|
||||
animation.icon_state = "liquify"
|
||||
animation.layer = 5
|
||||
animation.master = holder
|
||||
flick("liquify",animation)
|
||||
H.loc = holder
|
||||
H.client.eye = holder
|
||||
var/datum/effect/effect/system/steam_spread/steam = new /datum/effect/effect/system/steam_spread()
|
||||
steam.set_up(10, 0, mobloc)
|
||||
steam.start()
|
||||
sleep(time)
|
||||
mobloc = get_turf(H.loc)
|
||||
animation.loc = mobloc
|
||||
steam.location = mobloc
|
||||
steam.start()
|
||||
H.canmove = 0
|
||||
sleep(20)
|
||||
flick("reappear",animation)
|
||||
sleep(5)
|
||||
if(!H.Move(mobloc))
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
var/turf/T = get_step(mobloc, direction)
|
||||
if(T)
|
||||
if(H.Move(T))
|
||||
break
|
||||
H.canmove = 1
|
||||
H.client.eye = H
|
||||
del(animation)
|
||||
del(holder)
|
||||
/*
|
||||
/obj/effect/dummy/spell_jaunt
|
||||
name = "water"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "nothing"
|
||||
var/canmove = 1
|
||||
density = 0
|
||||
anchored = 1
|
||||
|
||||
/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
|
||||
if (!src.canmove) return
|
||||
switch(direction)
|
||||
if(NORTH)
|
||||
src.y++
|
||||
if(SOUTH)
|
||||
src.y--
|
||||
if(EAST)
|
||||
src.x++
|
||||
if(WEST)
|
||||
src.x--
|
||||
if(NORTHEAST)
|
||||
src.y++
|
||||
src.x++
|
||||
if(NORTHWEST)
|
||||
src.y++
|
||||
src.x--
|
||||
if(SOUTHEAST)
|
||||
src.y--
|
||||
src.x++
|
||||
if(SOUTHWEST)
|
||||
src.y--
|
||||
src.x--
|
||||
src.canmove = 0
|
||||
spawn(2) src.canmove = 1
|
||||
|
||||
/obj/effect/dummy/spell_jaunt/ex_act(blah)
|
||||
return
|
||||
/obj/effect/dummy/spell_jaunt/bullet_act(blah,blah)
|
||||
return
|
||||
*/
|
||||
//MUTATE
|
||||
|
||||
/client/proc/mutate()
|
||||
set category = "Spells"
|
||||
set name = "Mutate"
|
||||
set desc = "This spell causes you to turn into a hulk and gain laser vision for a short while."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
if(!usr.casting()) return
|
||||
usr.verbs -= /client/proc/mutate
|
||||
spawn(400)
|
||||
usr.verbs += /client/proc/mutate
|
||||
|
||||
usr.say("BIRUZ BENNAR")
|
||||
|
||||
usr << text("\blue You feel strong! You feel pressure building behind your eyes!")
|
||||
if (!(HULK in usr.mutations))
|
||||
usr.mutations.Add(HULK)
|
||||
if (!(LASER in usr.mutations))
|
||||
usr.mutations.Add(LASER)
|
||||
spawn (300)
|
||||
if (LASER in usr.mutations) usr.mutations.Remove(LASER)
|
||||
if (HULK in usr.mutations) usr.mutations.Remove(HULK)
|
||||
return
|
||||
|
||||
//BODY SWAP /N
|
||||
|
||||
/mob/proc/swap(mob/living/M as mob in oview())
|
||||
set category = "Spells"
|
||||
set name = "Mind Transfer"
|
||||
set desc = "This spell allows the user to switch bodies with a target."
|
||||
if(usr.stat)
|
||||
src << "Not when you are incapacitated."
|
||||
return
|
||||
|
||||
if(M.client && M.mind)
|
||||
if(M.mind.special_role != "Wizard" || "Fake Wizard" || "Changeling" || "Cultist" || "Space Ninja")//Wizards, changelings, ninjas, and cultists are protected.
|
||||
if( (istype(M, /mob/living/carbon/human)) || (istype(M, /mob/living/carbon/monkey)) && M.stat != 2)
|
||||
var/mob/living/carbon/human/H = M //so it does not freak out when looking at the variables.
|
||||
var/mob/living/carbon/human/U = src
|
||||
|
||||
U.whisper("GIN'YU CAPAN")
|
||||
U.verbs -= /mob/proc/swap
|
||||
//Remove special verbs from both mobs
|
||||
if(U.mind.special_verbs.len)
|
||||
for(var/V in U.mind.special_verbs)
|
||||
U.verbs -= V
|
||||
if(H.mind.special_verbs.len)
|
||||
for(var/V in H.mind.special_verbs)
|
||||
H.verbs -= V
|
||||
|
||||
//empty out H
|
||||
var/mob/dead/observer/G = H.ghostize(0) //Transfers H to a temporary mob
|
||||
|
||||
//Start the Transfer
|
||||
U.mind.transfer_to(H)
|
||||
G.mind.transfer_to(U)
|
||||
U.key = G.key //has to be called explicitly since ghostize() set the datum/mind/var/active = 0
|
||||
|
||||
//Re-add those special verbs and stuff
|
||||
if(H.mind.special_verbs.len)
|
||||
var/spell_loss = 1//Can lose only one spell during transfer.
|
||||
var/probability = 95 //To determine the chance of wizard losing their spell.
|
||||
for(var/V in H.mind.special_verbs)
|
||||
if(spell_loss == 0)
|
||||
H.verbs += V
|
||||
else
|
||||
if(prob(probability))
|
||||
H.verbs += V
|
||||
probability -= 7//Chance of of keeping spells goes down each time a spell is added. Less spells means less chance of losing them.
|
||||
else
|
||||
spell_loss = 0
|
||||
H.mind.special_verbs -= V
|
||||
spawn(500)
|
||||
H << "The mind transfer has robbed you of a spell."
|
||||
|
||||
if(U.mind.special_verbs.len)//Basic fix to swap verbs for any mob if needed.
|
||||
for(var/V in U.mind.special_verbs)
|
||||
U.verbs += V
|
||||
|
||||
spawn(500)
|
||||
U << "Something about your body doesn't seem quite right..."
|
||||
|
||||
U.Paralyse(20)
|
||||
H.Paralyse(20)
|
||||
|
||||
spawn(600)
|
||||
H.verbs += /mob/proc/swap
|
||||
|
||||
else
|
||||
src << "Their mind is not compatible."
|
||||
return
|
||||
else
|
||||
src << "Their mind is resisting your spell."
|
||||
return
|
||||
|
||||
else
|
||||
src << "They appear to be brain-dead."
|
||||
return
|
||||
@@ -0,0 +1,876 @@
|
||||
#define PLAYER_WEIGHT 5
|
||||
#define HUMAN_DEATH -5000
|
||||
#define OTHER_DEATH -5000
|
||||
#define EXPLO_SCORE -10000 //boum
|
||||
|
||||
#define COOLDOWN_TIME 12000 // Twenty minutes
|
||||
#define MIN_ROUND_TIME 18000
|
||||
|
||||
|
||||
#define FLAT_PERCENT 0
|
||||
|
||||
//estimated stats
|
||||
//80 minute round
|
||||
//60 player server
|
||||
//48k player-ticks
|
||||
|
||||
//60 deaths (ideally)
|
||||
//20 explosions
|
||||
|
||||
|
||||
var/global/datum/tension/tension_master
|
||||
|
||||
/datum/tension
|
||||
var/score
|
||||
|
||||
var/deaths
|
||||
var/human_deaths
|
||||
var/explosions
|
||||
var/adminhelps
|
||||
var/air_alarms
|
||||
|
||||
var/nuketeam = 0
|
||||
var/malfAI = 0
|
||||
var/wizard = 0
|
||||
|
||||
var/forcenexttick = 0
|
||||
var/supress = 0
|
||||
var/eversupressed = 0
|
||||
var/cooldown = 0
|
||||
|
||||
var/round1 = 0
|
||||
var/round2 = 0
|
||||
var/round3 = 0
|
||||
var/round4 = 0
|
||||
|
||||
var/list/antagonistmodes = null
|
||||
|
||||
|
||||
|
||||
var/list/potentialgames = list()
|
||||
|
||||
New()
|
||||
score = 0
|
||||
deaths=0
|
||||
human_deaths=0
|
||||
explosions=0
|
||||
adminhelps=0
|
||||
air_alarms=0
|
||||
|
||||
if(FLAT_PERCENT) // I cannot into balance
|
||||
antagonistmodes = list (
|
||||
"POINTS_FOR_TRATIOR" = 6,
|
||||
"POINTS_FOR_CHANGLING" = 6,
|
||||
"POINTS_FOR_REVS" = 3,
|
||||
"POINTS_FOR_MALF" = 1,
|
||||
"POINTS_FOR_WIZARD" = 2,
|
||||
"POINTS_FOR_CULT" = 3,
|
||||
"POINTS_FOR_NUKETEAM" = 2,
|
||||
"POINTS_FOR_ALIEN" = 5,
|
||||
"POINTS_FOR_NINJA" = 3,
|
||||
"POINTS_FOR_DEATHSQUAD" = 2,
|
||||
"POINTS_FOR_BORGDEATHSQUAD" = 2
|
||||
)
|
||||
|
||||
else
|
||||
antagonistmodes = list (
|
||||
"POINTS_FOR_TRATIOR" = 100000,
|
||||
"POINTS_FOR_CHANGLING" = 120000,
|
||||
"POINTS_FOR_REVS" = 150000,
|
||||
"POINTS_FOR_MALF" = 250000,
|
||||
"POINTS_FOR_WIZARD" = 150000,
|
||||
"POINTS_FOR_CULT" = 150000,
|
||||
"POINTS_FOR_NUKETEAM" = 250000,
|
||||
"POINTS_FOR_ALIEN" = 200000,
|
||||
"POINTS_FOR_NINJA" = 200000,
|
||||
"POINTS_FOR_DEATHSQUAD" = 500000,
|
||||
"POINTS_FOR_BORGDEATHSQUAD" = 500000
|
||||
)
|
||||
|
||||
proc/process()
|
||||
score += get_num_players()*PLAYER_WEIGHT
|
||||
|
||||
if(config.Tensioner_Active)
|
||||
if(world.time > MIN_ROUND_TIME)
|
||||
round1++
|
||||
if(!supress && !cooldown)
|
||||
if(prob(1) || forcenexttick)
|
||||
round2++
|
||||
if(prob(10) || forcenexttick)
|
||||
round3++
|
||||
if(forcenexttick)
|
||||
forcenexttick = 0
|
||||
|
||||
for (var/client/C in admin_list)
|
||||
C << "<font color='red' size='3'><b> The tensioner wishes to create additional antagonists! Press (<a href='?src=\ref[tension_master];Supress=1'>this</a>) in 60 seconds to abort!</b></font>"
|
||||
|
||||
spawn(600)
|
||||
if(!supress)
|
||||
cooldown = 1
|
||||
spawn(COOLDOWN_TIME)
|
||||
cooldown = 0
|
||||
round4++
|
||||
|
||||
if(!antagonistmodes.len)
|
||||
return
|
||||
|
||||
var/thegame = null
|
||||
|
||||
if(FLAT_PERCENT)
|
||||
thegame = pickweight(antagonistmodes)
|
||||
antagonistmodes.Remove(thegame)
|
||||
|
||||
else
|
||||
for(var/V in antagonistmodes) // OH SHIT SOMETHING IS GOING TO HAPPEN NOW
|
||||
if(antagonistmodes[V] < score)
|
||||
potentialgames.Add(V)
|
||||
antagonistmodes.Remove(V)
|
||||
if(potentialgames.len)
|
||||
thegame = pick(potentialgames)
|
||||
|
||||
|
||||
if(thegame)
|
||||
|
||||
|
||||
log_admin("The tensioner fired, and decided on [thegame]")
|
||||
|
||||
switch(thegame)
|
||||
if("POINTS_FOR_TRATIOR")
|
||||
if(!makeTratiors())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
if("POINTS_FOR_CHANGLING")
|
||||
if(!makeChanglings())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
if("POINTS_FOR_REVS")
|
||||
if(!makeRevs())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
if("POINTS_FOR_MALF")
|
||||
if(!makeMalfAImode())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
if("POINTS_FOR_WIZARD")
|
||||
if(!makeWizard())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_CULT")
|
||||
if(!makeCult())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_NUKETEAM")
|
||||
if(!makeNukeTeam())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_ALIEN")
|
||||
if(!makeAliens())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_NINJA")
|
||||
if(!makeSpaceNinja())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_DEATHSQUAD")
|
||||
if(!makeDeathsquad())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
if("POINTS_FOR_BORG_DEATHSQUAD")
|
||||
if(!makeBorgDeathsquad())
|
||||
forcenexttick = 1
|
||||
else
|
||||
potentialgames.Remove(thegame)
|
||||
|
||||
|
||||
proc/get_num_players()
|
||||
var/peeps = 0
|
||||
for (var/mob/M in player_list)
|
||||
if (!M.client)
|
||||
continue
|
||||
peeps += 1
|
||||
|
||||
return peeps
|
||||
|
||||
proc/death(var/mob/M)
|
||||
if (!M) return
|
||||
deaths++
|
||||
|
||||
if (istype(M,/mob/living/carbon/human))
|
||||
score += HUMAN_DEATH
|
||||
human_deaths++
|
||||
else
|
||||
score += OTHER_DEATH
|
||||
|
||||
|
||||
proc/explosion()
|
||||
score += EXPLO_SCORE
|
||||
explosions++
|
||||
|
||||
proc/new_adminhelp()
|
||||
adminhelps++
|
||||
|
||||
proc/new_air_alarm()
|
||||
air_alarms++
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
|
||||
if(!usr || !usr.client)
|
||||
return //This shouldnt happen
|
||||
|
||||
if(!usr.client.holder)
|
||||
message_admins("\red [key_name(usr)] tried to use the tensioner without authorization.")
|
||||
log_admin("[key_name(usr)] tried to use the tensioner without authorization.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] used a tensioner override. The override was [href]")
|
||||
message_admins("[key_name(usr)] used a tensioner override. The override was [href]")
|
||||
|
||||
|
||||
if(href_list["addScore"])
|
||||
score += 50000
|
||||
|
||||
if (href_list["makeTratior"])
|
||||
makeTratiors()
|
||||
|
||||
else if (href_list["makeChanglings"])
|
||||
makeChanglings()
|
||||
|
||||
else if (href_list["makeRevs"])
|
||||
makeRevs()
|
||||
|
||||
else if (href_list["makeWizard"])
|
||||
makeWizard()
|
||||
|
||||
else if (href_list["makeCult"])
|
||||
makeCult()
|
||||
|
||||
else if (href_list["makeMalf"])
|
||||
makeMalfAImode()
|
||||
|
||||
else if (href_list["makeNukeTeam"])
|
||||
makeNukeTeam()
|
||||
|
||||
else if (href_list["makeAliens"])
|
||||
makeAliens()
|
||||
|
||||
else if (href_list["makeSpaceNinja"])
|
||||
makeSpaceNinja()
|
||||
|
||||
else if (href_list["makeDeathsquad"])
|
||||
makeDeathsquad()
|
||||
|
||||
else if (href_list["makeBorgDeathsquad"])
|
||||
makeBorgDeathsquad()
|
||||
|
||||
else if (href_list["Supress"])
|
||||
supress = 1
|
||||
eversupressed++
|
||||
spawn(6000)
|
||||
supress = 0
|
||||
|
||||
else if (href_list["ToggleStatus"])
|
||||
config.Tensioner_Active = !config.Tensioner_Active
|
||||
|
||||
|
||||
proc/makeMalfAImode()
|
||||
|
||||
var/list/mob/living/silicon/AIs = list()
|
||||
var/mob/living/silicon/malfAI = null
|
||||
var/datum/mind/themind = null
|
||||
|
||||
for(var/mob/living/silicon/ai/ai in player_list)
|
||||
if(ai.client)
|
||||
AIs += ai
|
||||
|
||||
if(AIs.len)
|
||||
malfAI = pick(AIs)
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
if(malfAI)
|
||||
themind = malfAI.mind
|
||||
themind.make_AI_Malf()
|
||||
return 1
|
||||
|
||||
/*
|
||||
if(BE_CHANGELING) roletext="changeling"
|
||||
if(BE_TRAITOR) roletext="traitor"
|
||||
if(BE_OPERATIVE) roletext="operative"
|
||||
if(BE_WIZARD) roletext="wizard"
|
||||
if(BE_REV) roletext="revolutionary"
|
||||
if(BE_CULTIST) roletext="cultist"
|
||||
|
||||
|
||||
for(var/mob/new_player/player in world)
|
||||
if(player.client && player.ready)
|
||||
if(player.preferences.be_special & role)
|
||||
*/
|
||||
|
||||
|
||||
proc/makeTratiors()
|
||||
|
||||
var/datum/game_mode/traitor/temp = new
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
|
||||
var/datum/preferences/preferences = new
|
||||
|
||||
if(applicant.stat < 2)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate"))
|
||||
if(!(applicant.job in temp.restricted_jobs))
|
||||
if(applicant.client)
|
||||
if(preferences.savefile_load(applicant, 0))
|
||||
if(preferences.be_special & BE_TRAITOR)
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numTratiors = min(candidates.len, 3)
|
||||
|
||||
for(var/i = 0, i<numTratiors, i++)
|
||||
H = pick(candidates)
|
||||
H.mind.make_Tratior()
|
||||
candidates.Remove(H)
|
||||
|
||||
return 1
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
proc/makeChanglings()
|
||||
|
||||
var/datum/game_mode/changeling/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
|
||||
var/datum/preferences/preferences = new
|
||||
|
||||
if(applicant.stat < 2)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate"))
|
||||
if(!(applicant.job in temp.restricted_jobs))
|
||||
if(applicant.client)
|
||||
if(preferences.savefile_load(applicant, 0))
|
||||
if(preferences.be_special & BE_CHANGELING)
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numChanglings = min(candidates.len, 3)
|
||||
|
||||
for(var/i = 0, i<numChanglings, i++)
|
||||
H = pick(candidates)
|
||||
H.mind.make_Changling()
|
||||
candidates.Remove(H)
|
||||
|
||||
return 1
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/makeRevs()
|
||||
|
||||
var/datum/game_mode/revolution/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
|
||||
var/datum/preferences/preferences = new
|
||||
|
||||
if(applicant.stat < 2)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
if(!jobban_isbanned(applicant, "revolutionary") && !jobban_isbanned(applicant, "Syndicate"))
|
||||
if(!(applicant.job in temp.restricted_jobs))
|
||||
if(applicant.client)
|
||||
if(preferences.savefile_load(applicant, 0))
|
||||
if(preferences.be_special & BE_REV)
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numRevs = min(candidates.len, 3)
|
||||
|
||||
for(var/i = 0, i<numRevs, i++)
|
||||
H = pick(candidates)
|
||||
H.mind.make_Rev()
|
||||
candidates.Remove(H)
|
||||
return 1
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/makeWizard()
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
|
||||
spawn(0)
|
||||
switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
return
|
||||
|
||||
sleep(300)
|
||||
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.client)
|
||||
candidates.Remove(G)
|
||||
|
||||
spawn(0)
|
||||
if(candidates.len)
|
||||
while((!theghost || !theghost.client) && candidates.len)
|
||||
theghost = pick(candidates)
|
||||
candidates.Remove(theghost)
|
||||
if(!theghost)
|
||||
return 0
|
||||
var/mob/living/carbon/human/new_character=makeBody(theghost)
|
||||
new_character.mind.make_Wizard()
|
||||
|
||||
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
|
||||
|
||||
|
||||
proc/makeCult()
|
||||
|
||||
var/datum/game_mode/cult/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
|
||||
var/datum/preferences/preferences = new
|
||||
|
||||
if(applicant.stat < 2)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
if(!jobban_isbanned(applicant, "cultist") && !jobban_isbanned(applicant, "Syndicate"))
|
||||
if(!(applicant.job in temp.restricted_jobs))
|
||||
if(applicant.client)
|
||||
if(preferences.savefile_load(applicant, 0))
|
||||
if(preferences.be_special & BE_CULTIST)
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numCultists = min(candidates.len, 4)
|
||||
// var/list/runeWords = list()
|
||||
|
||||
for(var/i = 0, i<numCultists, i++)
|
||||
H = pick(candidates)
|
||||
H.mind.make_Cultist()
|
||||
candidates.Remove(H)
|
||||
temp.grant_runeword(H)
|
||||
// runeWords.Add(H)
|
||||
|
||||
// for(var/i = 0, i < 4, i++) // Four rune words
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
proc/makeNukeTeam()
|
||||
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate"))
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
return
|
||||
|
||||
sleep(300)
|
||||
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.client)
|
||||
candidates.Remove(G)
|
||||
|
||||
spawn(0)
|
||||
if(candidates.len)
|
||||
var/numagents = 5
|
||||
syndicate_begin()
|
||||
|
||||
for(var/i = 0, i<numagents,i++)
|
||||
while((!theghost || !theghost.client) && candidates.len)
|
||||
theghost = pick(candidates)
|
||||
candidates.Remove(theghost)
|
||||
if(!theghost)
|
||||
break
|
||||
var/mob/living/carbon/human/new_character=makeBody(theghost)
|
||||
new_character.mind.make_Nuke()
|
||||
|
||||
|
||||
var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
|
||||
var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet")
|
||||
|
||||
var/nuke_code = "[rand(10000, 99999)]"
|
||||
|
||||
if(nuke_spawn)
|
||||
var/obj/item/weapon/paper/P = new
|
||||
P.info = "Sadly, the Syndicate could not get you a nuclear bomb. We have, however, acquired the arming code for the station's onboard nuke. The nuclear authorization code is: <b>[nuke_code]</b>"
|
||||
P.name = "nuclear bomb code and instructions"
|
||||
P.loc = nuke_spawn.loc
|
||||
|
||||
if(closet_spawn)
|
||||
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
|
||||
|
||||
for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
|
||||
if (A.name == "Syndicate-Gear-Closet")
|
||||
new /obj/structure/closet/syndicate/personal(A.loc)
|
||||
del(A)
|
||||
continue
|
||||
|
||||
if (A.name == "Syndicate-Bomb")
|
||||
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
|
||||
del(A)
|
||||
continue
|
||||
|
||||
|
||||
spawn(0)
|
||||
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/image/I in synd_mind.current.client.images)
|
||||
if(I.icon_state == "synd")
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/datum/mind/synd_mind_1 in ticker.mode.syndicates)
|
||||
if(synd_mind_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
|
||||
synd_mind.current.client.images += I
|
||||
|
||||
for (var/obj/machinery/nuclearbomb/bomb in world)
|
||||
bomb.r_code = nuke_code // All the nukes are set to this code.
|
||||
|
||||
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
proc/makeAliens()
|
||||
alien_infestation(3)
|
||||
return 1
|
||||
|
||||
proc/makeSpaceNinja()
|
||||
space_ninja_arrival()
|
||||
return 1
|
||||
|
||||
proc/makeDeathsquad()
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
var/input = "Purify the station."
|
||||
if(prob(10))
|
||||
input = "Save Runtime and any other cute things on the station."
|
||||
/*
|
||||
if (emergency_shuttle.direction == 1 && emergency_shuttle.online == 1)
|
||||
emergency_shuttle.recall()
|
||||
world << "\blue <B>Alert: The shuttle is going back!</B>"
|
||||
|
||||
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
|
||||
|
||||
*/
|
||||
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
|
||||
|
||||
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
|
||||
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for an elite syndicate strike team being sent in?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
return
|
||||
sleep(300)
|
||||
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.key)
|
||||
candidates.Remove(G)
|
||||
|
||||
if(candidates.len)
|
||||
var/numagents = 6
|
||||
//Spawns commandos and equips them.
|
||||
for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
|
||||
if(numagents<=0)
|
||||
break
|
||||
if (L.name == "Syndicate-Commando")
|
||||
syndicate_leader_selected = numagents == 1?1:0
|
||||
|
||||
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
|
||||
|
||||
|
||||
while((!theghost || !theghost.client) && candidates.len)
|
||||
theghost = pick(candidates)
|
||||
candidates.Remove(theghost)
|
||||
|
||||
if(!theghost)
|
||||
del(new_syndicate_commando)
|
||||
break
|
||||
|
||||
new_syndicate_commando.key = theghost.key
|
||||
new_syndicate_commando.internal = new_syndicate_commando.s_store
|
||||
new_syndicate_commando.internals.icon_state = "internal1"
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
|
||||
|
||||
new_syndicate_commando << "\blue You are an Elite Syndicate. [!syndicate_leader_selected?"commando":"<B>LEADER</B>"] in the service of the Syndicate. \nYour current mission is: \red<B> [input]</B>"
|
||||
|
||||
numagents--
|
||||
|
||||
//Spawns the rest of the commando gear.
|
||||
// for (var/obj/effect/landmark/L)
|
||||
// if (L.name == "Commando_Manual")
|
||||
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
|
||||
// var/obj/item/weapon/paper/P = new(L.loc)
|
||||
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
|
||||
// P.name = "Spec. Ops. Manual"
|
||||
|
||||
for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
|
||||
if (L.name == "Syndicate-Commando-Bomb")
|
||||
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
|
||||
// del(L)
|
||||
|
||||
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
|
||||
|
||||
|
||||
proc/makeBorgDeathsquad()
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
var/list/namelist = list("Tyr","Fenrir","Lachesis","Clotho","Atropos","Nyx")
|
||||
|
||||
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for a cyborg strike team being sent in?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
return
|
||||
sleep(300)
|
||||
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.client || !G.key)
|
||||
candidates.Remove(G)
|
||||
|
||||
if(candidates.len)
|
||||
var/numagents = 3
|
||||
|
||||
//Spawns commandos and equips them.
|
||||
for (var/obj/effect/landmark/L in /area/borg_deathsquad)
|
||||
if(numagents<=0)
|
||||
break
|
||||
if (L.name == "Borg-Deathsquad")
|
||||
|
||||
var/name = pick(namelist)
|
||||
namelist.Remove(name)
|
||||
|
||||
var/mob/living/silicon/robot/new_borg_deathsquad = create_borg_death_commando(L, name)
|
||||
|
||||
|
||||
|
||||
while((!theghost || !theghost.client) && candidates.len)
|
||||
theghost = pick(candidates)
|
||||
candidates.Remove(theghost)
|
||||
|
||||
if(!theghost)
|
||||
del(new_borg_deathsquad)
|
||||
break
|
||||
|
||||
new_borg_deathsquad.key = theghost.key
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
|
||||
|
||||
new_borg_deathsquad << "You are a borg deathsquad operative. Follow your laws."
|
||||
numagents--
|
||||
|
||||
//Spawns the rest of the commando gear.
|
||||
// for (var/obj/effect/landmark/L)
|
||||
// if (L.name == "Commando_Manual")
|
||||
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
|
||||
// var/obj/item/weapon/paper/P = new(L.loc)
|
||||
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
|
||||
// P.name = "Spec. Ops. Manual"
|
||||
|
||||
|
||||
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
|
||||
|
||||
|
||||
proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
|
||||
new_character.gender = pick(MALE,FEMALE)
|
||||
|
||||
var/datum/preferences/A = new()
|
||||
A.randomize_appearance_for(new_character)
|
||||
if(new_character.gender == MALE)
|
||||
new_character.real_name = "[pick(first_names_male)] [pick(last_names)]"
|
||||
else
|
||||
new_character.real_name = "[pick(first_names_female)] [pick(last_names)]"
|
||||
new_character.name = new_character.real_name
|
||||
new_character.age = rand(17,45)
|
||||
|
||||
new_character.dna.ready_dna(new_character)
|
||||
new_character.key = G_found.key
|
||||
|
||||
return new_character
|
||||
|
||||
/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
|
||||
var/mob/living/carbon/human/new_syndicate_commando = new(spawn_location.loc)
|
||||
var/syndicate_commando_leader_rank = pick("Lieutenant", "Captain", "Major")
|
||||
var/syndicate_commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
|
||||
var/syndicate_commando_name = pick(last_names)
|
||||
|
||||
new_syndicate_commando.gender = pick(MALE, FEMALE)
|
||||
|
||||
var/datum/preferences/A = new()//Randomize appearance for the commando.
|
||||
A.randomize_appearance_for(new_syndicate_commando)
|
||||
|
||||
new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]"
|
||||
new_syndicate_commando.name = new_syndicate_commando.real_name
|
||||
new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45)
|
||||
|
||||
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
|
||||
|
||||
//Creates mind stuff.
|
||||
new_syndicate_commando.mind_initialize()
|
||||
new_syndicate_commando.mind.assigned_role = "MODE"
|
||||
new_syndicate_commando.mind.special_role = "Syndicate Commando"
|
||||
|
||||
//Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
ticker.mode.traitors += new_syndicate_commando.mind
|
||||
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
|
||||
|
||||
return new_syndicate_commando
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/proc/create_borg_death_commando(obj/spawn_location, name)
|
||||
|
||||
var/mob/living/silicon/robot/new_borg_deathsquad = new(spawn_location.loc, 1)
|
||||
|
||||
new_borg_deathsquad.real_name = name
|
||||
new_borg_deathsquad.name = name
|
||||
|
||||
//Creates mind stuff.
|
||||
new_borg_deathsquad.mind_initialize()
|
||||
new_borg_deathsquad.mind.assigned_role = "MODE"
|
||||
new_borg_deathsquad.mind.special_role = "Borg Commando"
|
||||
|
||||
//Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
ticker.mode.traitors += new_borg_deathsquad.mind
|
||||
//del(spawn_location) // Commenting this out for multiple commando teams.
|
||||
return new_borg_deathsquad
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/Borg_station
|
||||
name = "Cyborg Station Terminal"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "syndishuttle"
|
||||
req_access = list()
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/jumpcomplete = 0
|
||||
|
||||
/obj/machinery/computer/Borg_station/attack_hand()
|
||||
if(jumpcomplete)
|
||||
return
|
||||
if(alert(usr, "Are you sure you want to send a cyborg deathsquad?", "Confirmation", "Yes", "No") == "Yes")
|
||||
var/area/start_location = locate(/area/borg_deathsquad/start)
|
||||
var/area/end_location = locate(/area/borg_deathsquad/station)
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in end_location)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
|
||||
// hey you, get out of the way!
|
||||
for(var/turf/T in dstturfs)
|
||||
// find the turf to move things to
|
||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
||||
//var/turf/E = get_step(D, SOUTH)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.Move(D)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
for(var/obj/machinery/door/poddoor/P in end_location)
|
||||
P.open()
|
||||
jumpcomplete = 1
|
||||
command_alert("DRADIS contact! Set condition one throughout the station!")
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
TOILET
|
||||
|
||||
/obj/item/weapon/storage/toilet
|
||||
name = "toilet"
|
||||
w_class = 4.0
|
||||
anchored = 1.0
|
||||
density = 0.0
|
||||
var/status = 0.0
|
||||
var/clogged = 0.0
|
||||
anchored = 1.0
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "toilet"
|
||||
item_state = "syringe_kit"
|
||||
|
||||
/obj/item/weapon/storage/toilet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (src.contents.len >= 7)
|
||||
user << "The toilet is clogged!"
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/disk/nuclear))
|
||||
user << "This is far too important to flush!"
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/storage/))
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
playsound(src.loc, 'sound/effects/slosh.ogg', 50, 1)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O << text("\blue [] gives [] a swirlie!", user, W)
|
||||
return
|
||||
var/t
|
||||
for(var/obj/item/weapon/O in src)
|
||||
t += O.w_class
|
||||
t += W.w_class
|
||||
if (t > 30)
|
||||
user << "You cannot fit the item inside."
|
||||
return
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
src.orient2hud(user)
|
||||
W.dropped(user)
|
||||
add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [] has put [] in []!", user, W, src), 1)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/toilet/MouseDrop_T(mob/M as mob, mob/user as mob)
|
||||
if (!ticker)
|
||||
user << "You can't help relieve anyone before the game starts."
|
||||
return
|
||||
if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat))
|
||||
return
|
||||
if (M == usr)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue [] sits on the toilet.", user)
|
||||
else
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue [] is seated on the toilet by []!", M, user)
|
||||
M.anchored = 1
|
||||
M.buckled = src
|
||||
M.loc = src.loc
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/toilet/attack_hand(mob/user as mob)
|
||||
for(var/mob/M in src.loc)
|
||||
if (M.buckled)
|
||||
if (M != user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue [] is zipped up by [].", M, user)
|
||||
else
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue [] zips up.", M)
|
||||
// world << "[M] is no longer buckled to [src]"
|
||||
M.anchored = 0
|
||||
M.buckled = null
|
||||
src.add_fingerprint(user)
|
||||
if((src.clogged < 1) || (src.contents.len < 7) || (user.loc != src.loc))
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O << text("\blue [] flushes the toilet.", user)
|
||||
src.clogged = 0
|
||||
src.contents.len = 0
|
||||
else if((src.clogged >= 1) || (src.contents.len >= 7) || (user.buckled != src.loc))
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O << text("\blue The toilet is clogged!")
|
||||
return
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,225 @@
|
||||
/obj/effect/pressure_plate
|
||||
name = "pressure plate"
|
||||
desc = "A pressure plate that triggers a trap or a few of them."
|
||||
density = 0
|
||||
var/list/connected_traps_names = list() //mappers, edit this when you place pressure plates on the map. don't forget to make the connected traps have an UNIQUE name
|
||||
var/list/connected_traps = list() //actual references to the connected traps. leave empty, it is generated at runtime from connected_traps_names
|
||||
var/trigger_type = "mob and obj" //can be "mob", "obj" or "mob and obj", the only moveable types
|
||||
|
||||
/obj/effect/pressure_plate/New()
|
||||
..()
|
||||
src:visibility = 0
|
||||
refresh()
|
||||
|
||||
/obj/effect/pressure_plate/verb/refresh()
|
||||
set name = "Refresh Pressure Plate Links"
|
||||
set category = "Object"
|
||||
set src in view()
|
||||
connected_traps = list() //emptying the list first
|
||||
for(var/trap_name in connected_traps_names)
|
||||
for(var/obj/effect/trap/the_trap in world)
|
||||
if(the_trap.name == trap_name)
|
||||
connected_traps += the_trap //adding the trap with the matching name
|
||||
|
||||
/obj/effect/pressure_plate/HasEntered(atom/victim as mob|obj)
|
||||
if(victim.density && (trigger_type == "mob and obj" || (trigger_type == "mob" && istype(victim,/mob)) || (trigger_type == "obj" && istype(victim,/obj))))
|
||||
for(var/obj/effect/trap/T in connected_traps)
|
||||
T.trigger(victim)
|
||||
|
||||
/obj/effect/pressure_plate/Bumped(atom/victim as mob|obj)
|
||||
if(victim.density && (trigger_type == "mob and obj" || (trigger_type == "mob" && istype(victim,/mob)) || (trigger_type == "obj" && istype(victim,/obj))))
|
||||
for(var/obj/effect/trap/T in connected_traps)
|
||||
T.trigger(victim)
|
||||
|
||||
/obj/effect/trap //has three subtypes - /aoe, /area (ie affects an entire area), /single (only the victim is affected)
|
||||
name = "trap"
|
||||
desc = "It's a trap!"
|
||||
density = 0
|
||||
var/uses = 1 //how many times it can be triggered
|
||||
var/trigger_type = "mob and obj" //can be "mob", "obj" or "mob and obj", the only moveable types. can also be "none" to not be triggered by entering its square (needs to have a pressure plate attached in that case)
|
||||
var/target_type = "mob" //if it targets mobs, turfs or objs
|
||||
var/include_dense = 1 //if it includes dense targets in the aoe (may be important for some reason). you'll probably want to change it to 1 if you target mobs or objs
|
||||
|
||||
/obj/effect/trap/New()
|
||||
..()
|
||||
src:visibility = 0 //seriously, it keeps saying "undefined var" when I try to do it in the define
|
||||
|
||||
/obj/effect/trap/HasEntered(victim as mob|obj)
|
||||
if(trigger_type == "mob and obj" || (trigger_type == "mob" && istype(victim,/mob)) || (trigger_type == "obj" && istype(victim,/obj)))
|
||||
trigger(victim)
|
||||
|
||||
/obj/effect/trap/Bumped(victim as mob|obj)
|
||||
if(trigger_type == "mob and obj" || (trigger_type == "mob" && istype(victim,/mob)) || (trigger_type == "obj" && istype(victim,/obj)))
|
||||
trigger(victim)
|
||||
|
||||
/obj/effect/trap/proc/trigger(victim)
|
||||
if(!uses)
|
||||
return
|
||||
uses--
|
||||
activate(victim)
|
||||
|
||||
/obj/effect/trap/proc/activate()
|
||||
|
||||
/obj/effect/trap/aoe
|
||||
name = "aoe trap"
|
||||
desc = "This trap affects a number of mobs, turfs or objs in an aoe"
|
||||
var/aoe_radius = 3 //radius of aoe
|
||||
var/aoe_range_or_view = "view" //if it includes all tiles in [radius] range or view
|
||||
|
||||
/obj/effect/trap/aoe/proc/picktargets()
|
||||
|
||||
var/list/targets = list()
|
||||
|
||||
switch(target_type)
|
||||
if("turf")
|
||||
switch(aoe_range_or_view)
|
||||
if("view")
|
||||
for(var/turf/T in view(src,aoe_radius))
|
||||
if(!T.density || include_dense)
|
||||
targets += T
|
||||
if("range")
|
||||
for(var/turf/T in range(src,aoe_radius))
|
||||
if(!T.density || include_dense)
|
||||
targets += T
|
||||
if("mob")
|
||||
switch(aoe_range_or_view)
|
||||
if("view")
|
||||
for(var/mob/living/M in view(src,aoe_radius))
|
||||
if(!M.density || include_dense)
|
||||
targets += M
|
||||
if("range")
|
||||
for(var/mob/living/M in range(src,aoe_radius))
|
||||
if(!M.density || include_dense)
|
||||
targets += M
|
||||
if("obj")
|
||||
switch(aoe_range_or_view)
|
||||
if("view")
|
||||
for(var/obj/O in view(src,aoe_radius))
|
||||
if(!O.density || include_dense)
|
||||
targets += O
|
||||
if("range")
|
||||
for(var/obj/O in range(src,aoe_radius))
|
||||
if(!O.density || include_dense)
|
||||
targets += O
|
||||
|
||||
return targets
|
||||
|
||||
/obj/effect/trap/aoe/rocksfall
|
||||
name = "rocks fall trap"
|
||||
desc = "Your DM must really hate you."
|
||||
target_type = "turf"
|
||||
include_dense = 0
|
||||
var/rocks_amt = 10 //amount of rocks falling
|
||||
var/rocks_min_dmg = 50 //min damage per rock
|
||||
var/rocks_max_dmg = 100 //max damage per rock
|
||||
var/rocks_hit_chance = 100 //the chance for a rock to hit you
|
||||
var/list/rocks_type = list() //what rocks might it drop on the target. with var editing, not even limited to rocks.
|
||||
|
||||
/obj/effect/trap/aoe/rocksfall/New()
|
||||
|
||||
..()
|
||||
|
||||
rocks_type = pick_rock_types()
|
||||
|
||||
/obj/effect/trap/aoe/rocksfall/proc/pick_rock_types() //since we may want subtypes of the trap with completely different rock types, which is best done this way
|
||||
|
||||
var/list/varieties = list()
|
||||
|
||||
varieties = typesof(/obj/item/weapon/ore)
|
||||
varieties -= /obj/item/weapon/ore/diamond //don't want easily available rare ores, hmm?
|
||||
varieties -= /obj/item/weapon/ore/uranium
|
||||
varieties -= /obj/item/weapon/ore/slag //that'd be just stupid
|
||||
|
||||
return varieties
|
||||
|
||||
/obj/effect/trap/aoe/rocksfall/activate()
|
||||
|
||||
var/list/targets = list()
|
||||
targets = picktargets()
|
||||
|
||||
if(target_type == "turf")
|
||||
for(var/i=0,i<rocks_amt,i++)
|
||||
var/turf/hit_loc = pick(targets)
|
||||
var/rock_type = pick(rocks_type)
|
||||
var/obj/item/weapon/ore/rock = new rock_type(hit_loc)
|
||||
for(var/mob/living/M in hit_loc)
|
||||
if(prob(rocks_hit_chance))
|
||||
M.take_organ_damage(rand(rocks_min_dmg,rocks_max_dmg))
|
||||
M << "A chunk of [lowertext(rock.name)] hits you in the head!"
|
||||
|
||||
if(target_type == "mob")
|
||||
for(var/i=0,i<rocks_amt,i++)
|
||||
var/mob/living/hit_loc = pick(targets)
|
||||
var/rock_type = pick(rocks_type)
|
||||
var/obj/item/weapon/ore/rock = new rock_type(hit_loc.loc)
|
||||
if(prob(rocks_hit_chance))
|
||||
hit_loc.take_organ_damage(rand(rocks_min_dmg,rocks_max_dmg))
|
||||
hit_loc << "A chunk of [lowertext(rock.name)] hits you in the head!"
|
||||
|
||||
/obj/effect/trap/single
|
||||
name = "single-target trap"
|
||||
desc = "This trap targets a single movable atom, usually the one who triggered it" //usually as in I will code only those ones. if you want to add a different type of targeting, go ahead.
|
||||
|
||||
/obj/effect/trap/single/rockfalls
|
||||
name = "rock falls trap"
|
||||
desc = "Your DM must really hate <b>YOU</b>."
|
||||
trigger_type = "mob"
|
||||
var/rock_min_dmg = 100 //min damage of the rock
|
||||
var/rock_max_dmg = 200 //max damage of the rock
|
||||
var/rock_hit_chance = 100 //the chance for the rock to hit you
|
||||
var/list/rocks_type = list() //what rocks might it drop on the target. with var editing, not even limited to rocks.
|
||||
|
||||
/obj/effect/trap/single/rockfalls/New()
|
||||
|
||||
..()
|
||||
|
||||
rocks_type = pick_rock_types()
|
||||
|
||||
/obj/effect/trap/single/rockfalls/proc/pick_rock_types() //since we may want subtypes of the trap with completely different rock types, which is best done this way
|
||||
|
||||
var/list/varieties = list()
|
||||
|
||||
varieties = typesof(/obj/item/weapon/ore)
|
||||
varieties -= /obj/item/weapon/ore/diamond //don't want easily available rare ores, hmm?
|
||||
varieties -= /obj/item/weapon/ore/uranium
|
||||
varieties -= /obj/item/weapon/ore/slag //that'd be just stupid
|
||||
|
||||
return varieties
|
||||
|
||||
/obj/effect/trap/single/rockfalls/activate(mob/living/victim)
|
||||
var/rock_type = pick(rocks_type)
|
||||
var/obj/item/weapon/ore/rock = new rock_type(victim:loc)
|
||||
if (istype(victim) && prob(rock_hit_chance))
|
||||
var/dmg = rand(rock_min_dmg,rock_max_dmg)
|
||||
if(istype(victim, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
var/datum/organ/external/affecting = H.organs["head"]
|
||||
affecting.take_damage(dmg)
|
||||
H.updatehealth()
|
||||
else
|
||||
victim.take_organ_damage(dmg)
|
||||
victim << "A chunk of [lowertext(rock.name)] hits you in the head!"
|
||||
|
||||
/obj/effect/trap/area
|
||||
name = "area trap"
|
||||
desc = "This trap targets all atoms of the target_type in its area"
|
||||
|
||||
/obj/effect/trap/area/proc/pick_targets() //src.loc.loc should be the area
|
||||
|
||||
var/list/targets = list()
|
||||
|
||||
switch(target_type)
|
||||
if("turf")
|
||||
for(var/turf/T in src.loc.loc)
|
||||
if(!T.density || include_dense)
|
||||
targets += T
|
||||
if("mob")
|
||||
for(var/mob/living/M in src.loc.loc)
|
||||
if(!M.density || include_dense)
|
||||
targets += M
|
||||
if("obj")
|
||||
for(var/obj/O in src.loc.loc)
|
||||
if(!O.density || include_dense)
|
||||
targets += O
|
||||
|
||||
return targets
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
/obj/machinery/travel
|
||||
name = "travel thingie"
|
||||
desc = "it is used for travel idunno"
|
||||
icon = 'travel.dmi'
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
//note - didn't use a single loc list just because it's easier to edit via adminmagics if this is done this way
|
||||
var/list/z_connect = list() //the z position of the tiles it connects to
|
||||
var/list/x_connect = list() //the x position of the tiles it connects to
|
||||
var/list/y_connect = list() //the y position of the tiles it connects to
|
||||
|
||||
/obj/machinery/travel/ladder
|
||||
icon_state = "ladder_up"
|
||||
name = "ladder"
|
||||
desc = "It is a ladder."
|
||||
|
||||
/obj/machinery/travel/elevator
|
||||
icon_state = "elevator_closed"
|
||||
name = "elevator"
|
||||
desc = "It is an elevator. The display shows \"1\"."
|
||||
|
||||
var/current_floor = 1 //current floor the elevator is on. do NOT confuse with current z-level of the elevator
|
||||
var/list/elevators_connected = list() //list of elevators it is connected to
|
||||
var/list/floors = list() //dependant on the number of elevators, converts z-levels to floors, basically
|
||||
*/
|
||||
|
||||
/obj/machinery/travel/ladder/New()
|
||||
for(var/i=src.z,i<=world.maxz,i++)
|
||||
var/isladder = 0
|
||||
for(var/obj/machinery/travel/ladder/L in locate(src.x,src.y,i))
|
||||
if(L==src)
|
||||
continue
|
||||
src.x_connect[i] = L.x
|
||||
src.y_connect[i] = L.y
|
||||
src.z_connect[i] = L.z
|
||||
L.icon_state = "ladder_down"
|
||||
L.x_connect[src.z] = src.x
|
||||
L.y_connect[src.z] = src.y
|
||||
L.z_connect[src.z] = src.z
|
||||
isladder = 1
|
||||
L.connected = src.z
|
||||
if(isladder)
|
||||
src.connected = i
|
||||
break
|
||||
if(!src.connected)
|
||||
for(var/i=1,i<=src.z,i++)
|
||||
var/isladder = 0
|
||||
for(var/obj/machinery/travel/ladder/L in locate(src.x,src.y,i))
|
||||
if(L==src)
|
||||
continue
|
||||
src.x_connect[i] = L.x
|
||||
src.y_connect[i] = L.y
|
||||
src.z_connect[i] = L.z
|
||||
src.icon_state = "ladder_down"
|
||||
L.x_connect[src.z] = src.x
|
||||
L.y_connect[src.z] = src.y
|
||||
L.z_connect[src.z] = src.z
|
||||
isladder = 1
|
||||
L.connected = src.z
|
||||
if(isladder)
|
||||
src.connected = i
|
||||
break
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/travel/ladder/attack_hand(mob/user as mob)
|
||||
if(!src.connected)
|
||||
return
|
||||
user.x = src.x_connect[src.connected]
|
||||
user.y = src.y_connect[src.connected]
|
||||
user.z = src.z_connect[src.connected]
|
||||
|
||||
/*
|
||||
/obj/machinery/travel/elevator/proc/check_connect()
|
||||
for(var/i=1,i<=world.maxz,i++)
|
||||
var/iselevator = 0
|
||||
for(var/obj/machinery/travel/elevator/E in src.x,src.y,i)
|
||||
src.elevators_connected[i] = E
|
||||
src.x_connect[i] = E.x
|
||||
src.y_connect[i] = E.y
|
||||
src.z_connect[i] = E.z
|
||||
iselevator = 1
|
||||
if(!iselevator)
|
||||
src.elevators_connected[i] = null
|
||||
src.x_connect[i] = null
|
||||
src.y_connect[i] = null
|
||||
src.z_connect[i] = null
|
||||
*/
|
||||
@@ -0,0 +1,328 @@
|
||||
/obj/machinery/vehicle
|
||||
name = "Vehicle Pod"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "podfire"
|
||||
density = 1
|
||||
flags = FPRINT
|
||||
anchored = 1.0
|
||||
var/speed = 10.0
|
||||
var/maximum_speed = 10.0
|
||||
var/can_rotate = 1
|
||||
var/can_maximize_speed = 0
|
||||
var/one_person_only = 0
|
||||
use_power = 0
|
||||
|
||||
/obj/machinery/vehicle/pod
|
||||
name = "Escape Pod"
|
||||
desc = "A pod, for, moving in space"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "pod"
|
||||
can_rotate = 0
|
||||
var/id = 1.0
|
||||
|
||||
/obj/machinery/vehicle/recon
|
||||
name = "Reconaissance Pod"
|
||||
desc = "A fast moving pod."
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "recon"
|
||||
speed = 1.0
|
||||
maximum_speed = 30.0
|
||||
can_maximize_speed = 1
|
||||
one_person_only = 1
|
||||
|
||||
|
||||
/obj/machinery/vehicle/process()
|
||||
if (src.speed)
|
||||
if (src.speed <= 10)
|
||||
var/t1 = 10 - src.speed
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else
|
||||
var/t1 = round(src.speed / 5)
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/meteorhit(var/obj/O as obj)
|
||||
for (var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for (var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
del(src)
|
||||
|
||||
/obj/machinery/vehicle/ex_act(severity)
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//SN src = null
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//SN src = null
|
||||
del(src)
|
||||
|
||||
/obj/machinery/vehicle/blob_act()
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/vehicle/Bump(var/atom/A)
|
||||
//world << "[src] bumped into [A]"
|
||||
spawn (0)
|
||||
..()
|
||||
src.speed = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/relaymove(mob/user as mob, direction)
|
||||
if (user.stat)
|
||||
return
|
||||
|
||||
if ((user in src))
|
||||
if (direction & 1)
|
||||
src.speed = max(src.speed - 1, 1)
|
||||
else if (direction & 2)
|
||||
src.speed = min(src.maximum_speed, src.speed + 1)
|
||||
else if (src.can_rotate && direction & 4)
|
||||
src.dir = turn(src.dir, -90.0)
|
||||
else if (src.can_rotate && direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
else if (direction & 16 && src.can_maximize_speed)
|
||||
src.speed = src.maximum_speed
|
||||
|
||||
/obj/machinery/vehicle/verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
var/mob/M = usr
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
step(M, turn(src.dir, 180))
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
if (src.one_person_only && locate(/mob, src))
|
||||
usr << "There is no room! You can only fit one person."
|
||||
return
|
||||
|
||||
var/mob/M = usr
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
M.loc = src
|
||||
|
||||
/obj/machinery/vehicle/verb/unload(var/atom/movable/A in src)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
A.loc = src.loc
|
||||
for(var/mob/O in view(src, null))
|
||||
if ((O.client && !(O.blinded)))
|
||||
O << text("\blue <B> [] unloads [] from []!</B>", usr, A, src)
|
||||
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
|
||||
/obj/machinery/vehicle/verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
if (((istype(usr, /mob/living/carbon/human)) && (!(ticker) || (ticker && ticker.mode != "monkey"))))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if ((H.pulling && !(H.pulling.anchored)))
|
||||
if (src.one_person_only && !(istype(H.pulling, /obj/item/weapon)))
|
||||
usr << "You may only place items in."
|
||||
else
|
||||
H.pulling.loc = src
|
||||
if (ismob(H.pulling))
|
||||
var/mob/M = H.pulling
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] loads [] into []!</B>", H, H.pulling, src)
|
||||
|
||||
H.stop_pulling()
|
||||
|
||||
|
||||
/obj/machinery/vehicle/space_ship
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "pod"
|
||||
var/datum/global_iterator/space_ship_inertial_movement/pr_inertial_movement
|
||||
var/datum/global_iterator/space_ship_speed_increment/pr_speed_increment
|
||||
var/last_relay = 0
|
||||
var/obj/machinery/portable_atmospherics/canister/internal_tank
|
||||
var/health = 100
|
||||
var/datum/effects/system/spark_spread/spark_system = new
|
||||
|
||||
New()
|
||||
..()
|
||||
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
|
||||
pr_inertial_movement = new /datum/global_iterator/space_ship_inertial_movement(list(src),0)
|
||||
pr_speed_increment = new /datum/global_iterator/space_ship_speed_increment(list(src),0)
|
||||
src.spark_system.set_up(2, 0, src)
|
||||
src.spark_system.attach(src)
|
||||
return
|
||||
|
||||
proc/inspace()
|
||||
if(istype(src.loc, /turf/space))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
remove_air(amount)
|
||||
if(src.internal_tank)
|
||||
return src.internal_tank.air_contents.remove(amount)
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
return T.remove_air(amount)
|
||||
|
||||
return_air()
|
||||
if(src.internal_tank)
|
||||
return src.internal_tank.return_air()
|
||||
return
|
||||
|
||||
proc/return_pressure()
|
||||
if(src.internal_tank)
|
||||
return src.internal_tank.return_pressure()
|
||||
return 0
|
||||
|
||||
proc/return_temperature()
|
||||
if(src.internal_tank)
|
||||
return src.internal_tank.return_temperature()
|
||||
return 0
|
||||
|
||||
Bump(var/atom/movable/A)
|
||||
if(istype(A))
|
||||
step(A, src.dir)
|
||||
else
|
||||
if(pr_inertial_movement.cur_delay<2)
|
||||
take_damage(25)
|
||||
pr_speed_increment.stop()
|
||||
pr_inertial_movement.stop()
|
||||
return
|
||||
|
||||
proc/take_damage(value)
|
||||
if(isnum(value))
|
||||
src.health -= value
|
||||
if(src.health>0)
|
||||
src.spark_system.start()
|
||||
// world << "[src] health is [health]"
|
||||
else
|
||||
src.ex_act(1)
|
||||
return
|
||||
|
||||
process()
|
||||
return
|
||||
|
||||
proc/get_desired_speed()
|
||||
return (pr_inertial_movement.max_delay-pr_inertial_movement.desired_delay)/(pr_inertial_movement.max_delay-pr_inertial_movement.min_delay)*100
|
||||
|
||||
proc/get_current_speed()
|
||||
return (pr_inertial_movement.max_delay-pr_inertial_movement.cur_delay)/(pr_inertial_movement.max_delay-pr_inertial_movement.min_delay)*100
|
||||
|
||||
/obj/machinery/vehicle/space_ship/relaymove(mob/user as mob, direction)
|
||||
spawn()
|
||||
if (user.stat || world.time-last_relay<2)
|
||||
return
|
||||
last_relay = world.time
|
||||
var/speed_change = 0
|
||||
if(direction & NORTH)
|
||||
pr_inertial_movement.desired_delay = between(pr_inertial_movement.min_delay, pr_inertial_movement.desired_delay-1, pr_inertial_movement.max_delay)
|
||||
speed_change = 1
|
||||
else if (direction & SOUTH)
|
||||
pr_inertial_movement.desired_delay = between(pr_inertial_movement.min_delay, pr_inertial_movement.desired_delay+1, pr_inertial_movement.max_delay)
|
||||
speed_change = 1
|
||||
else if (src.can_rotate && direction & 4)
|
||||
src.dir = turn(src.dir, -90.0)
|
||||
else if (src.can_rotate && direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
if(speed_change)
|
||||
// user << "Desired speed: [get_desired_speed()]%"
|
||||
src.pr_speed_increment.start()
|
||||
src.pr_inertial_movement.start()
|
||||
return
|
||||
|
||||
//should try two directional iterator datums, one for vertical, one for horizontal movement.
|
||||
/datum/global_iterator/space_ship_inertial_movement
|
||||
delay = 1
|
||||
var/min_delay = 0
|
||||
var/max_delay = 15
|
||||
var/desired_delay
|
||||
var/cur_delay
|
||||
var/last_move
|
||||
|
||||
New()
|
||||
..()
|
||||
desired_delay = max_delay
|
||||
cur_delay = max_delay
|
||||
|
||||
stop()
|
||||
src.cur_delay = max_delay
|
||||
src.desired_delay = max_delay
|
||||
return ..()
|
||||
|
||||
process(var/obj/machinery/vehicle/space_ship/SS as obj)
|
||||
if(cur_delay >= max_delay)
|
||||
return src.stop()
|
||||
if(world.time - last_move < cur_delay)
|
||||
return
|
||||
last_move = world.time
|
||||
/*
|
||||
if(src.delay>=SS.max_delay)
|
||||
return src.stop()
|
||||
*/
|
||||
if(!step(SS, SS.dir) || !SS.inspace())
|
||||
src.stop()
|
||||
return
|
||||
|
||||
proc/set_desired_delay(var/num as num)
|
||||
src.desired_delay = num
|
||||
return
|
||||
|
||||
/datum/global_iterator/space_ship_speed_increment
|
||||
delay = 5
|
||||
|
||||
process(var/obj/machinery/vehicle/space_ship/SS as obj)
|
||||
if(SS.pr_inertial_movement.desired_delay!=SS.pr_inertial_movement.cur_delay)
|
||||
var/delta = SS.pr_inertial_movement.desired_delay - SS.pr_inertial_movement.cur_delay
|
||||
SS.pr_inertial_movement.cur_delay += delta>0?1:-1
|
||||
/*
|
||||
for(var/mob/M in SS)
|
||||
M << "Current speed: [SS.get_current_speed()]"
|
||||
*/
|
||||
else
|
||||
src.stop()
|
||||
return
|
||||
Reference in New Issue
Block a user