Unused/WorkInProgress folder cleanup
@@ -1,49 +0,0 @@
|
||||
var/maxZ = 6
|
||||
var/minZ = 2
|
||||
|
||||
// Maybe it's best to have this hardcoded for whatever we'd add to the map, in order to avoid exploits
|
||||
// (such as mining base => admin station)
|
||||
// Note that this assumes the ship's top is at z=1 and bottom at z=4
|
||||
/obj/item/weapon/tank/jetpack/proc/move_z(cardinal, mob/user as mob)
|
||||
if (user.z > 1)
|
||||
user << "\red There is nothing of interest in that direction."
|
||||
return
|
||||
if(allow_thrust(0.01, user))
|
||||
switch(cardinal)
|
||||
if (UP) // Going up!
|
||||
if(user.z > maxZ) // If we aren't at the very top of the ship
|
||||
var/turf/T = locate(user.x, user.y, user.z - 1)
|
||||
// You can only jetpack up if there's space above, and you're sitting on either hull (on the exterior), or space
|
||||
//if(T && istype(T, /turf/space) && (istype(user.loc, /turf/space) || istype(user.loc, /turf/space/*/hull*/)))
|
||||
//check through turf contents to make sure there's nothing blocking the way
|
||||
if(T && istype(T, /turf/space))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(T.density)
|
||||
blocked = 1
|
||||
user << "\red You bump into [T.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
user.Move(T)
|
||||
else
|
||||
user << "\red You bump into the ship's plating."
|
||||
else
|
||||
user << "\red The ship's gravity well keeps you in orbit!" // Assuming the ship starts on z level 1, you don't want to go past it
|
||||
|
||||
if (DOWN) // Going down!
|
||||
if (user.z < 1) // If we aren't at the very bottom of the ship, or out in space
|
||||
var/turf/T = locate(user.x, user.y, user.z + 1)
|
||||
// You can only jetpack down if you're sitting on space and there's space down below, or hull
|
||||
if(T && (istype(T, /turf/space) || istype(T, /turf/space/*/hull*/)) && istype(user.loc, /turf/space))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(T.density)
|
||||
blocked = 1
|
||||
user << "\red You bump into [T.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
user.Move(T)
|
||||
else
|
||||
user << "\red You bump into the ship's plating."
|
||||
else
|
||||
user << "\red The ship's gravity well keeps you in orbit!"
|
||||
@@ -1,205 +0,0 @@
|
||||
///////////////////////////////////////
|
||||
//Contents: Ladders, Hatches, Stairs.//
|
||||
///////////////////////////////////////
|
||||
|
||||
/obj/multiz
|
||||
icon = 'code/TriDimension/multiz.dmi'
|
||||
density = 0
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
var/obj/multiz/target
|
||||
|
||||
CanPass(obj/mover, turf/source, height, airflow)
|
||||
return airflow || !density
|
||||
|
||||
/obj/multiz/ladder
|
||||
icon_state = "ladderdown"
|
||||
name = "ladder"
|
||||
desc = "A Ladder. You climb up and down it."
|
||||
|
||||
var/top_icon_state = "ladderdown"
|
||||
var/bottom_icon_state = "ladderup"
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
spawn(1) //Allow map to load
|
||||
if(z in levels_3d)
|
||||
if(!target)
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if("up" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["up"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = top_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
if(target)
|
||||
target.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
target.target = src
|
||||
else
|
||||
del src
|
||||
|
||||
Del()
|
||||
spawn(1)
|
||||
if(target)
|
||||
del target
|
||||
return ..()
|
||||
|
||||
attack_paw(var/mob/M)
|
||||
return attack_hand(M)
|
||||
|
||||
attackby(var/W, var/mob/M)
|
||||
return attack_hand(M)
|
||||
|
||||
attack_hand(var/mob/M)
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
M.visible_message("\blue \The [M] climbs [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You climb [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.")
|
||||
M.Move(target.loc)
|
||||
|
||||
|
||||
hatch
|
||||
icon_state = "hatchdown"
|
||||
name = "hatch"
|
||||
desc = "A hatch. You climb down it, and it will automatically seal against pressure loss behind you."
|
||||
top_icon_state = "hatchdown"
|
||||
var/top_icon_state_open = "hatchdown-open"
|
||||
var/top_icon_state_close = "hatchdown-close"
|
||||
|
||||
bottom_icon_state = "ladderup"
|
||||
|
||||
var/image/green_overlay
|
||||
var/image/red_overlay
|
||||
|
||||
var/active = 0
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
red_overlay = image(icon, "red-ladderlight")
|
||||
green_overlay = image(icon, "green-ladderlight")
|
||||
|
||||
attack_hand(var/mob/M)
|
||||
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
|
||||
if(active)
|
||||
M << "That [src] is being used."
|
||||
return // It is a tiny airlock, only one at a time.
|
||||
|
||||
active = 1
|
||||
var/obj/multiz/ladder/hatch/top_hatch = target
|
||||
var/obj/multiz/ladder/hatch/bottom_hatch = src
|
||||
if(icon_state == top_icon_state)
|
||||
top_hatch = src
|
||||
bottom_hatch = target
|
||||
|
||||
flick(top_icon_state_open, top_hatch)
|
||||
bottom_hatch.overlays += green_overlay
|
||||
|
||||
spawn(7)
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
if(M.z == z && get_dist(src,M) <= 1)
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
M.visible_message("\blue \The [M] scurries [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You scramble [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and a hatch sealing.")
|
||||
M.Move(target.loc)
|
||||
flick(top_icon_state_close,top_hatch)
|
||||
bottom_hatch.overlays -= green_overlay
|
||||
bottom_hatch.overlays += red_overlay
|
||||
|
||||
spawn(7)
|
||||
top_hatch.icon_state = top_icon_state
|
||||
bottom_hatch.overlays -= red_overlay
|
||||
active = 0
|
||||
|
||||
/obj/multiz/stairs
|
||||
name = "Stairs"
|
||||
desc = "Stairs. You walk up and down them."
|
||||
icon_state = "ramptop"
|
||||
var/top_icon_state = "ramptop"
|
||||
var/bottom_icon_state = "rampbottom"
|
||||
|
||||
active
|
||||
density = 1
|
||||
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
spawn(1)
|
||||
if(z in levels_3d)
|
||||
if(!target)
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if("up" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["up"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = top_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
if(target)
|
||||
target.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
target.target = src
|
||||
var/obj/multiz/stairs/lead_in = locate() in get_step(src, reverse_direction(dir))
|
||||
if(lead_in)
|
||||
lead_in.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
else
|
||||
del src
|
||||
|
||||
|
||||
Del()
|
||||
spawn(1)
|
||||
if(target)
|
||||
del target
|
||||
return ..()
|
||||
|
||||
|
||||
Bumped(var/atom/movable/M)
|
||||
if(target.z > z && istype(src, /obj/multiz/stairs/active) && !locate(/obj/multiz/stairs) in M.loc)
|
||||
return //If on bottom, only let them go up stairs if they've moved to the entry tile first.
|
||||
//If it's the top, they can fall down just fine.
|
||||
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
|
||||
if(ismob(M) && M:client)
|
||||
M:client.moving = 1
|
||||
M.Move(target.loc)
|
||||
if (ismob(M) && M:client)
|
||||
M:client.moving = 0
|
||||
|
||||
Click()
|
||||
if(!istype(usr,/mob/dead/observer))
|
||||
return ..()
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
usr.client.moving = 1
|
||||
usr.Move(target.loc)
|
||||
usr.client.moving = 0
|
||||
@@ -1,96 +0,0 @@
|
||||
atom/movable/var/list/adjacent_z_levels
|
||||
atom/movable/var/archived_z_level
|
||||
|
||||
atom/movable/Move() //Hackish
|
||||
|
||||
if(adjacent_z_levels && adjacent_z_levels["up"])
|
||||
var/turf/above_me = locate(x,y,adjacent_z_levels["up"])
|
||||
if(istype(above_me, /turf/simulated/floor/open))
|
||||
above_me:RemoveImage(src)
|
||||
|
||||
. = ..()
|
||||
|
||||
if(archived_z_level != z)
|
||||
archived_z_level = z
|
||||
if(z in levels_3d)
|
||||
adjacent_z_levels = global_adjacent_z_levels["[z]"]
|
||||
else
|
||||
adjacent_z_levels = null
|
||||
|
||||
if(adjacent_z_levels && adjacent_z_levels["up"])
|
||||
var/turf/above_me = locate(x,y,adjacent_z_levels["up"])
|
||||
if(istype(above_me, /turf/simulated/floor/open))
|
||||
above_me:AddImage(src)
|
||||
|
||||
/turf/simulated/floor/open
|
||||
name = "open space"
|
||||
intact = 0
|
||||
density = 0
|
||||
icon_state = "black"
|
||||
pathweight = 100000 //Seriously, don't try and path over this one numbnuts
|
||||
var/icon/darkoverlays = null
|
||||
var/turf/floorbelow
|
||||
var/list/overlay_references
|
||||
mouse_opacity = 2
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(1)
|
||||
if(!(z in levels_3d))
|
||||
ReplaceWithSpace()
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if(!("down" in adjacent_to_me))
|
||||
ReplaceWithSpace()
|
||||
|
||||
floorbelow = locate(x, y, adjacent_to_me["down"])
|
||||
if(floorbelow)
|
||||
if(!istype(floorbelow,/turf))
|
||||
del src
|
||||
else if(floorbelow.density)
|
||||
ReplaceWithPlating()
|
||||
else
|
||||
set_up()
|
||||
else
|
||||
ReplaceWithSpace()
|
||||
|
||||
|
||||
Enter(var/atom/movable/AM)
|
||||
if (..()) //TODO make this check if gravity is active (future use) - Sukasa
|
||||
spawn(1)
|
||||
if(AM)
|
||||
AM.Move(floorbelow)
|
||||
if (istype(AM, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
var/damage = rand(5,15)
|
||||
H.apply_damage(2*damage, BRUTE, "head")
|
||||
H.apply_damage(2*damage, BRUTE, "chest")
|
||||
H.apply_damage(0.5*damage, BRUTE, "l_leg")
|
||||
H.apply_damage(0.5*damage, BRUTE, "r_leg")
|
||||
H.apply_damage(0.5*damage, BRUTE, "l_arm")
|
||||
H.apply_damage(0.5*damage, BRUTE, "r_arm")
|
||||
H:weakened = max(H:weakened,2)
|
||||
H:updatehealth()
|
||||
return ..()
|
||||
|
||||
attackby()
|
||||
return //nothing
|
||||
|
||||
proc/set_up() //Update the overlays to make the openspace turf show what's down a level
|
||||
if(!overlay_references)
|
||||
overlay_references = list()
|
||||
if(!floorbelow) return
|
||||
overlays += floorbelow
|
||||
for(var/obj/o in floorbelow)
|
||||
var/image/o_img = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
overlays += o_img
|
||||
overlay_references[o] = o_img
|
||||
|
||||
proc/AddImage(var/atom/movable/o)
|
||||
var/o_img = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
overlays += o_img
|
||||
overlay_references[o] = o_img
|
||||
|
||||
proc/RemoveImage(var/atom/movable/o)
|
||||
var/o_img = overlay_references[o]
|
||||
overlays -= o_img
|
||||
overlay_references -= o
|
||||
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,573 +0,0 @@
|
||||
//All credit for this goes to Uristqwerty.
|
||||
|
||||
//And some to me! -Mini
|
||||
|
||||
|
||||
|
||||
//This file is partly designed around being able to uninclude it to go back to the old ai viewing system completely.
|
||||
//(And therefore also be portable to another similar codebase simply by transferring the file and including it after the other AI code files.)
|
||||
//There are probably a few parts that don't do that at the moment, but I'll fix them at some point.
|
||||
|
||||
|
||||
#define MINIMAP_UPDATE_DELAY 1200
|
||||
|
||||
/turf
|
||||
var/image/obscured
|
||||
var/image/dim
|
||||
|
||||
/turf/proc/visibilityChanged()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
/*
|
||||
/turf/Del()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
*/
|
||||
/datum/camerachunk
|
||||
var/list/obscuredTurfs = list()
|
||||
var/list/visibleTurfs = list()
|
||||
var/list/dimTurfs = list()
|
||||
var/list/obscured = list()
|
||||
var/list/dim = list()
|
||||
var/list/cameras = list()
|
||||
var/list/turfs = list()
|
||||
var/list/seenby = list()
|
||||
var/visible = 0
|
||||
var/changed = 1
|
||||
var/updating = 0
|
||||
|
||||
var/x
|
||||
var/y
|
||||
var/z
|
||||
|
||||
var/minimap_updating = 0
|
||||
|
||||
var/icon/minimap_icon = new('icons/minimap.dmi', "chunk_base")
|
||||
var/obj/minimap_obj/minimap_obj = new()
|
||||
|
||||
/obj/minimap_obj/Click(location, control, params)
|
||||
if(!istype(usr, /mob/dead) && !istype(usr, /mob/living/silicon/ai) && !(usr.client && usr.client.holder && usr.client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/list/par = params2list(params)
|
||||
var/screen_loc = par["screen-loc"]
|
||||
|
||||
if(findtext(screen_loc, "minimap:") != 1)
|
||||
return
|
||||
|
||||
screen_loc = copytext(screen_loc, length("minimap:") + 1)
|
||||
|
||||
var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
|
||||
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
|
||||
|
||||
var/x = (text2num(copytext(x_text, 1, findtext(x_text, ":"))) - 1) * 16
|
||||
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
var/y = (text2num(copytext(y_text, 1, findtext(y_text, ":"))) - 1) * 16
|
||||
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/ai = usr
|
||||
ai.freelook()
|
||||
ai.eyeobj.loc = locate(max(1, x - 1), max(1, y - 1), ai.eyeobj.z)
|
||||
cameranet.visibility(ai.eyeobj)
|
||||
|
||||
else
|
||||
usr.loc = locate(max(1, x - 1), max(1, y - 1), usr.z)
|
||||
|
||||
/mob/dead/verb/Open_Minimap()
|
||||
set category = "Ghost"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
client.screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src
|
||||
|
||||
/mob/living/silicon/ai/verb/Open_Minimap()
|
||||
set category = "AI Commands"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
client.screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src
|
||||
|
||||
/client/proc/Open_Minimap()
|
||||
set category = "Admin"
|
||||
winshow(src, "minimapwindow", 1)
|
||||
screen |= cameranet.minimap
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
cameranet.minimap_viewers += src.mob
|
||||
|
||||
/datum/camerachunk/proc/update_minimap()
|
||||
if(changed && !updating)
|
||||
update()
|
||||
|
||||
minimap_icon.Blend(rgb(255, 0, 0), ICON_MULTIPLY)
|
||||
|
||||
var/list/turfs = visibleTurfs | dimTurfs
|
||||
|
||||
for(var/turf/turf in turfs)
|
||||
var/x = (turf.x & 0xf) * 2
|
||||
var/y = (turf.y & 0xf) * 2
|
||||
|
||||
if(turf.density)
|
||||
minimap_icon.DrawBox(rgb(100, 100, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
continue
|
||||
|
||||
else if(istype(turf, /turf/space))
|
||||
minimap_icon.DrawBox(rgb(0, 0, 0), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(200, 200, 200), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
for(var/obj/structure/o in turf)
|
||||
if(o.density)
|
||||
if(istype(o, /obj/structure/window) && (o.dir == NORTH || o.dir == SOUTH || o.dir == EAST || o.dir == WEST))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 3, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(150, 150, 150), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
for(var/obj/machinery/door/o in turf)
|
||||
if(istype(o, /obj/machinery/door/window))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 2, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
minimap_obj.screen_loc = "minimap:[src.x / 16],[src.y / 16]"
|
||||
minimap_obj.icon = minimap_icon
|
||||
|
||||
/mob/aiEye
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/ai = null
|
||||
density = 0
|
||||
|
||||
/datum/camerachunk/proc/add(mob/aiEye/ai)
|
||||
ai.visibleCameraChunks += src
|
||||
if(ai.ai.client)
|
||||
ai.ai.client.images += obscured
|
||||
ai.ai.client.images += dim
|
||||
visible++
|
||||
seenby += ai
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/aiEye/ai)
|
||||
ai.visibleCameraChunks -= src
|
||||
if(ai.ai.client)
|
||||
ai.ai.client.images -= obscured
|
||||
ai.ai.client.images -= dim
|
||||
seenby -= ai
|
||||
if(visible > 0)
|
||||
visible--
|
||||
|
||||
/datum/camerachunk/proc/visibilityChanged(turf/loc)
|
||||
if(!(loc in visibleTurfs))
|
||||
return
|
||||
|
||||
hasChanged()
|
||||
|
||||
/datum/camerachunk/proc/hasChanged()
|
||||
if(visible)
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(10)//Batch large changes, such as many doors opening or closing at once
|
||||
update()
|
||||
updating = 0
|
||||
else
|
||||
changed = 1
|
||||
|
||||
if(!minimap_updating)
|
||||
minimap_updating = 1
|
||||
|
||||
spawn(MINIMAP_UPDATE_DELAY)
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
update_minimap()
|
||||
minimap_updating = 0
|
||||
|
||||
/datum/camerachunk/proc/update()
|
||||
|
||||
var/list/newDimTurfs = list()
|
||||
var/list/newVisibleTurfs = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
newDimTurfs |= turfs & view(7, c)
|
||||
newVisibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
var/list/dimAdded = newDimTurfs - dimTurfs
|
||||
var/list/dimRemoved = dimTurfs - newDimTurfs
|
||||
var/list/visAdded = newVisibleTurfs - visibleTurfs
|
||||
var/list/visRemoved = visibleTurfs - newVisibleTurfs
|
||||
|
||||
visibleTurfs = newVisibleTurfs
|
||||
dimTurfs = newDimTurfs
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in dimRemoved)
|
||||
if(t.dim)
|
||||
dim -= t.dim
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.dim
|
||||
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.obscured
|
||||
|
||||
for(var/turf/t in dimAdded)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", 15)
|
||||
t.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.dim
|
||||
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.obscured
|
||||
|
||||
for(var/turf/t in visAdded)
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images -= t.obscured
|
||||
|
||||
for(var/turf/t in visRemoved)
|
||||
if(t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
for(var/mob/aiEye/m in seenby)
|
||||
if(m.ai.client)
|
||||
m.ai.client.images += t.obscured
|
||||
|
||||
|
||||
/datum/camerachunk/New(loc, x, y, z)
|
||||
x &= ~0xf
|
||||
y &= ~0xf
|
||||
|
||||
src.x = x
|
||||
src.y = y
|
||||
src.z = z
|
||||
|
||||
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
||||
if(c.status)
|
||||
cameras += c
|
||||
|
||||
turfs = block(locate(x, y, z), locate(min(world.maxx, x + 15), min(world.maxy, y + 15), z))
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
dimTurfs |= turfs & view(7, c)
|
||||
visibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
|
||||
for(var/turf/t in dimTurfs)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", TURF_LAYER)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
|
||||
cameranet.minimap += minimap_obj
|
||||
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
/datum/cameranet
|
||||
var/list/cameras = list()
|
||||
var/list/chunks = list()
|
||||
var/network = "net1"
|
||||
var/ready = 0
|
||||
|
||||
var/list/minimap = list()
|
||||
|
||||
var/generating_minimap = TRUE
|
||||
var/list/minimap_viewers = list()
|
||||
|
||||
/datum/cameranet/New()
|
||||
..()
|
||||
|
||||
spawn(200)
|
||||
for(var/x = 0, x <= world.maxx, x += 16)
|
||||
for(var/y = 0, y <= world.maxy, y += 16)
|
||||
sleep(1)
|
||||
var/datum/camerachunk/c = getCameraChunk(x, y, 1)
|
||||
c.update_minimap()
|
||||
|
||||
for(var/mob/m in minimap_viewers)
|
||||
m.client.screen |= c.minimap_obj
|
||||
|
||||
generating_minimap = FALSE
|
||||
minimap_viewers = list()
|
||||
|
||||
/datum/cameranet/proc/chunkGenerated(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
return key in chunks
|
||||
|
||||
/datum/cameranet/proc/getCameraChunk(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
|
||||
if(!(key in chunks))
|
||||
chunks[key] = new /datum/camerachunk(null, x, y, z)
|
||||
|
||||
return chunks[key]
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/aiEye/ai)
|
||||
var/x1 = max(0, ai.x - 16) & ~0xf
|
||||
var/y1 = max(0, ai.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, ai.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, ai.y + 16) & ~0xf
|
||||
|
||||
var/list/visibleChunks = list()
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
visibleChunks += getCameraChunk(x, y, ai.z)
|
||||
|
||||
var/list/remove = ai.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - ai.visibleCameraChunks
|
||||
|
||||
for(var/datum/camerachunk/c in remove)
|
||||
c.remove(ai)
|
||||
|
||||
for(var/datum/camerachunk/c in add)
|
||||
c.add(ai)
|
||||
|
||||
/datum/cameranet/proc/updateVisibility(turf/loc)
|
||||
if(!chunkGenerated(loc.x & ~0xf, loc.y & ~0xf, loc.z))
|
||||
return
|
||||
|
||||
var/datum/camerachunk/chunk = getCameraChunk(loc.x & ~0xf, loc.y & ~0xf, loc.z)
|
||||
chunk.visibilityChanged(loc)
|
||||
|
||||
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
if(!(c in chunk.cameras))
|
||||
chunk.cameras += c
|
||||
chunk.hasChanged()
|
||||
|
||||
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
if(!c)
|
||||
chunk.hasChanged()
|
||||
if(c in chunk.cameras)
|
||||
chunk.cameras -= c
|
||||
chunk.hasChanged()
|
||||
|
||||
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
|
||||
|
||||
/mob/living/silicon/ai/New()
|
||||
..()
|
||||
eyeobj.ai = src
|
||||
spawn(20)
|
||||
freelook()
|
||||
|
||||
/mob/living/silicon/ai/death(gibbed)
|
||||
if(client && client.eye == eyeobj)
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
client.eye = src
|
||||
return ..(gibbed)
|
||||
|
||||
/mob/living/silicon/ai/verb/freelook()
|
||||
set category = "AI Commands"
|
||||
set name = "freelook"
|
||||
current = null //cancel camera view first, it causes problems
|
||||
cameraFollow = null
|
||||
// machine = null
|
||||
if(!eyeobj) //if it got deleted somehow (like an admin trying to fix things <.<')
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
client.eye = eyeobj
|
||||
eyeobj.loc = loc
|
||||
cameranet.visibility(eyeobj)
|
||||
cameraFollow = null
|
||||
|
||||
/mob/aiEye/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
cameranet.visibility(src)
|
||||
|
||||
/client/AIMove(n, direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
user.eyeobj.loc = get_step(user.eyeobj, direct)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/*
|
||||
/client/AIMoveZ(direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
var/dif = 0
|
||||
if(direct == UP && user.eyeobj.z > 1)
|
||||
dif = -1
|
||||
else if(direct == DOWN && user.eyeobj.z < 4)
|
||||
dif = 1
|
||||
user.eyeobj.loc = locate(user.eyeobj.x, user.eyeobj.y, user.eyeobj.z + dif)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
else
|
||||
return ..()
|
||||
*/
|
||||
|
||||
/turf/move_camera_by_click()
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
if(AI.client.eye == AI.eyeobj)
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/door/update_nearby_tiles(need_rebuild)
|
||||
. = ..(need_rebuild)
|
||||
cameranet.updateVisibility(loc)
|
||||
|
||||
/obj/machinery/camera/New()
|
||||
..()
|
||||
cameranet.addCamera(src)
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
cameranet.removeCamera(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
. = ..(W, user)
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if(status)
|
||||
cameranet.addCamera(src)
|
||||
else
|
||||
cameranet.removeCamera(src)
|
||||
|
||||
/proc/checkcameravis(atom/A)
|
||||
for(var/obj/machinery/camera/C in view(A,7))
|
||||
if(!C.status || C.stat == 2)
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
|
||||
if (user != src)
|
||||
return
|
||||
|
||||
if (stat == 2)
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in world)
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
L = camera_network_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
for (var/obj/machinery/camera/C in L)
|
||||
if ( C.network in src.networks )
|
||||
D[text("[]: [][]", C.network, C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
D["Cancel"] = "Cancel"
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
|
||||
if (!t || t == "Cancel")
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
eyeobj.loc = C.loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
set category = "OOC"
|
||||
reset_view(null)
|
||||
machine = null
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if (client)
|
||||
if(!eyeobj)
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
|
||||
client.eye = eyeobj
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
eyeobj.loc = locate(A.x, A.y, A.z)
|
||||
|
||||
else
|
||||
eyeobj.loc = locate(src.x, src.y, src.z)
|
||||
|
||||
cameranet.visibility(eyeobj)
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
/mob/aiEye
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/ai = null
|
||||
density = 0
|
||||
|
||||
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
|
||||
|
||||
/mob/living/silicon/ai/New()
|
||||
..()
|
||||
eyeobj.ai = src
|
||||
spawn(20)
|
||||
freelook()
|
||||
|
||||
/mob/living/silicon/ai/death(gibbed)
|
||||
if(client && client.eye == eyeobj)
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
client.eye = src
|
||||
return ..(gibbed)
|
||||
|
||||
/mob/living/silicon/ai/verb/freelook()
|
||||
set category = "AI Commands"
|
||||
set name = "freelook"
|
||||
current = null //cancel camera view first, it causes problems
|
||||
cameraFollow = null
|
||||
if(!eyeobj) //if it got deleted somehow (like an admin trying to fix things <.<')
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
client.eye = eyeobj
|
||||
eyeobj.loc = loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
/mob/aiEye/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
cameranet.visibility(src)
|
||||
|
||||
/client/AIMove(n, direct, var/mob/living/silicon/ai/user)
|
||||
if(eye == user.eyeobj)
|
||||
user.eyeobj.loc = get_step(user.eyeobj, direct)
|
||||
cameranet.visibility(user.eyeobj)
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/turf/move_camera_by_click()
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
if(AI.client.eye == AI.eyeobj)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
|
||||
if (user != src)
|
||||
return
|
||||
|
||||
if (stat == 2)
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in world)
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
L = camera_network_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
for (var/obj/machinery/camera/C in L)
|
||||
if ( C.network in src.networks )
|
||||
D[text("[]: [][]", C.network, C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
D["Cancel"] = "Cancel"
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
|
||||
if (!t || t == "Cancel")
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
eyeobj.loc = C.loc
|
||||
cameranet.visibility(eyeobj)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
set category = "OOC"
|
||||
reset_view(null)
|
||||
machine = null
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if (client)
|
||||
if(!eyeobj)
|
||||
eyeobj = new()
|
||||
eyeobj.ai = src
|
||||
|
||||
client.eye = eyeobj
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
eyeobj.loc = locate(A.x, A.y, A.z)
|
||||
|
||||
else
|
||||
eyeobj.loc = locate(src.x, src.y, src.z)
|
||||
|
||||
cameranet.visibility(eyeobj)
|
||||
@@ -1,156 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
//
|
||||
// The Cameranet
|
||||
//
|
||||
// The cameranet is a single global instance of a unique
|
||||
// datum, which contains logic for managing the individual
|
||||
// chunks.
|
||||
//
|
||||
//------------------------------------------------------------
|
||||
|
||||
/datum/cameranet
|
||||
var/list/cameras = list()
|
||||
var/list/chunks = list()
|
||||
var/network = "net1"
|
||||
var/ready = 0
|
||||
|
||||
var/list/minimap = list()
|
||||
|
||||
var/generating_minimap = TRUE
|
||||
|
||||
var/datum/cameranet/cameranet = new()
|
||||
|
||||
|
||||
|
||||
/datum/cameranet/New()
|
||||
..()
|
||||
|
||||
spawn(100)
|
||||
init_minimap()
|
||||
|
||||
|
||||
/datum/cameranet/proc/init_minimap()
|
||||
for(var/x = 0, x <= world.maxx, x += 16)
|
||||
for(var/y = 0, y <= world.maxy, y += 16)
|
||||
sleep(1)
|
||||
getCameraChunk(x, y, 5)
|
||||
getCameraChunk(x, y, 1)
|
||||
|
||||
generating_minimap = FALSE
|
||||
|
||||
|
||||
/datum/cameranet/proc/chunkGenerated(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
return key in chunks
|
||||
|
||||
|
||||
/datum/cameranet/proc/getCameraChunk(x, y, z)
|
||||
var/key = "[x],[y],[z]"
|
||||
|
||||
if(!(key in chunks))
|
||||
chunks[key] = new /datum/camerachunk(null, x, y, z)
|
||||
|
||||
return chunks[key]
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates what chunks are considered seen
|
||||
// by an aiEye. As part of the process, it will force
|
||||
// any newly visible chunks with pending unscheduled
|
||||
// updates to update, and show the correct obscuring
|
||||
// and dimming image sets. If you do not call this
|
||||
// after the eye has moved, it may result in the
|
||||
// affected AI gaining (partial) xray, seeing through
|
||||
// now-closed doors, not seeing through open doors,
|
||||
// or other visibility oddities, depending on if/when
|
||||
// they last visited any of the chunks in the nearby
|
||||
// area.
|
||||
|
||||
// It must be called manually, as there is no way to
|
||||
// have a proc called automatically every time an
|
||||
// object's loc changes.
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/aiEye/ai)
|
||||
var/x1 = max(0, ai.x - 16) & ~0xf
|
||||
var/y1 = max(0, ai.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, ai.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, ai.y + 16) & ~0xf
|
||||
|
||||
var/list/visibleChunks = list()
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
visibleChunks += getCameraChunk(x, y, ai.z)
|
||||
|
||||
var/list/remove = ai.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - ai.visibleCameraChunks
|
||||
|
||||
for(var/datum/camerachunk/c in remove)
|
||||
c.remove(ai)
|
||||
|
||||
for(var/datum/camerachunk/c in add)
|
||||
c.add(ai)
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc should be called if a turf, or the contents
|
||||
// of a turf, changes opacity. This includes such things
|
||||
// as changing the turf, opening or closing a door, or
|
||||
// anything else that would alter line of sight in the
|
||||
// general area.
|
||||
|
||||
/datum/cameranet/proc/updateVisibility(turf/loc)
|
||||
if(!chunkGenerated(loc.x & ~0xf, loc.y & ~0xf, loc.z))
|
||||
return
|
||||
|
||||
var/datum/camerachunk/chunk = getCameraChunk(loc.x & ~0xf, loc.y & ~0xf, loc.z)
|
||||
chunk.visibilityChanged(loc)
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates all relevant chunks when enabling or
|
||||
// creating a camera, allowing freelook and the minimap to
|
||||
// respond correctly.
|
||||
|
||||
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
|
||||
if(!(c in chunk.cameras))
|
||||
chunk.cameras += c
|
||||
chunk.hasChanged()
|
||||
|
||||
|
||||
|
||||
|
||||
// This proc updates all relevant chunks when disabling or
|
||||
// deleting a camera, allowing freelook and the minimap to
|
||||
// respond correctly.
|
||||
|
||||
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
|
||||
var/x1 = max(0, c.x - 16) & ~0xf
|
||||
var/y1 = max(0, c.y - 16) & ~0xf
|
||||
var/x2 = min(world.maxx, c.x + 16) & ~0xf
|
||||
var/y2 = min(world.maxy, c.y + 16) & ~0xf
|
||||
|
||||
for(var/x = x1; x <= x2; x += 16)
|
||||
for(var/y = y1; y <= y2; y += 16)
|
||||
if(chunkGenerated(x, y, c.z))
|
||||
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
|
||||
|
||||
if(!c)
|
||||
chunk.hasChanged()
|
||||
|
||||
if(c in chunk.cameras)
|
||||
chunk.cameras -= c
|
||||
chunk.hasChanged()
|
||||
@@ -1,224 +0,0 @@
|
||||
#define MINIMAP_UPDATE_DELAY 1200
|
||||
|
||||
/datum/camerachunk
|
||||
var/list/turfs = list()
|
||||
|
||||
var/list/obscuredTurfs = list()
|
||||
var/list/visibleTurfs = list()
|
||||
var/list/dimTurfs = list()
|
||||
|
||||
var/list/obscured = list()
|
||||
var/list/dim = list()
|
||||
|
||||
var/list/cameras = list()
|
||||
var/list/seenby = list()
|
||||
|
||||
var/changed = 1
|
||||
var/updating = 0
|
||||
var/minimap_updating = 0
|
||||
|
||||
var/x
|
||||
var/y
|
||||
var/z
|
||||
|
||||
|
||||
var/icon/minimap_icon = new('icons/minimap.dmi', "chunk_base")
|
||||
var/obj/minimap_obj/minimap_obj = new()
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/New(loc, x, y, z)
|
||||
//Round X and Y down to a multiple of 16, if nessecary
|
||||
src.x = x & ~0xF
|
||||
src.y = y & ~0xF
|
||||
src.z = z
|
||||
|
||||
rebuild_chunk()
|
||||
|
||||
|
||||
|
||||
// Completely re-calculate the whole chunk.
|
||||
|
||||
/datum/camerachunk/proc/rebuild_chunk()
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(!eye.ai)
|
||||
seenby -= eye
|
||||
continue
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= obscured
|
||||
eye.ai.client.images -= dim
|
||||
|
||||
var/start = locate(x, y, z)
|
||||
var/end = locate(min(x + 15, world.maxx), min(y + 15, world.maxy), z)
|
||||
|
||||
turfs = block(start, end)
|
||||
dimTurfs = list()
|
||||
visibleTurfs = list()
|
||||
obscured = list()
|
||||
dim = list()
|
||||
cameras = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
||||
if(c.status)
|
||||
cameras += c
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
dimTurfs |= turfs & view(7, c)
|
||||
visibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
for(var/turf/t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
|
||||
for(var/turf/t in dimTurfs)
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", TURF_LAYER)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
|
||||
cameranet.minimap |= minimap_obj
|
||||
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images |= obscured
|
||||
eye.ai.client.images |= dim
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/proc/add(mob/aiEye/eye)
|
||||
eye.visibleCameraChunks |= src
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images |= obscured
|
||||
eye.ai.client.images |= dim
|
||||
|
||||
seenby |= eye
|
||||
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/aiEye/eye)
|
||||
eye.visibleCameraChunks -= src
|
||||
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= obscured
|
||||
eye.ai.client.images -= dim
|
||||
|
||||
seenby -= eye
|
||||
|
||||
/datum/camerachunk/proc/visibilityChanged(turf/loc)
|
||||
if(!(loc in visibleTurfs))
|
||||
return
|
||||
|
||||
hasChanged()
|
||||
|
||||
/datum/camerachunk/proc/hasChanged()
|
||||
if(length(seenby) > 0)
|
||||
if(!updating)
|
||||
updating = 1
|
||||
|
||||
spawn(10)//Batch large changes, such as many doors opening or closing at once
|
||||
update()
|
||||
updating = 0
|
||||
|
||||
else
|
||||
changed = 1
|
||||
|
||||
if(!minimap_updating)
|
||||
minimap_updating = 1
|
||||
|
||||
spawn(MINIMAP_UPDATE_DELAY)
|
||||
if(changed && !updating)
|
||||
update()
|
||||
changed = 0
|
||||
|
||||
update_minimap()
|
||||
minimap_updating = 0
|
||||
|
||||
/datum/camerachunk/proc/update()
|
||||
|
||||
var/list/newDimTurfs = list()
|
||||
var/list/newVisibleTurfs = list()
|
||||
|
||||
for(var/obj/machinery/camera/c in cameras)
|
||||
var/lum = c.luminosity
|
||||
c.luminosity = 7
|
||||
|
||||
newDimTurfs |= turfs & view(7, c)
|
||||
newVisibleTurfs |= turfs & view(6, c)
|
||||
|
||||
c.luminosity = lum
|
||||
|
||||
var/list/dimAdded = newDimTurfs - dimTurfs
|
||||
var/list/dimRemoved = dimTurfs - newDimTurfs
|
||||
var/list/visAdded = newVisibleTurfs - visibleTurfs
|
||||
var/list/visRemoved = visibleTurfs - newVisibleTurfs
|
||||
|
||||
visibleTurfs = newVisibleTurfs
|
||||
dimTurfs = newDimTurfs
|
||||
obscuredTurfs = turfs - dimTurfs
|
||||
dimTurfs -= visibleTurfs
|
||||
|
||||
var/list/images_added = list()
|
||||
var/list/images_removed = list()
|
||||
|
||||
for(var/turf/t in dimRemoved)
|
||||
if(t.dim)
|
||||
dim -= t.dim
|
||||
images_removed += t.dim
|
||||
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
images_added += t.obscured
|
||||
|
||||
for(var/turf/t in dimAdded)
|
||||
if(!(t in visibleTurfs))
|
||||
if(!t.dim)
|
||||
t.dim = image('icons/effects/cameravis.dmi', t, "dim", 15)
|
||||
t.dim.mouse_opacity = 0
|
||||
|
||||
dim += t.dim
|
||||
images_added += t.dim
|
||||
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
images_removed += t.obscured
|
||||
|
||||
for(var/turf/t in visAdded)
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
images_removed += t.obscured
|
||||
|
||||
for(var/turf/t in visRemoved)
|
||||
if(t in obscuredTurfs)
|
||||
if(!t.obscured)
|
||||
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
|
||||
|
||||
obscured += t.obscured
|
||||
images_added += t.obscured
|
||||
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(eye.ai)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= images_removed
|
||||
eye.ai.client.images |= images_added
|
||||
else
|
||||
seenby -= eye
|
||||
@@ -1,137 +0,0 @@
|
||||
/client/var/minimap_view_z = 1
|
||||
|
||||
/obj/minimap_obj
|
||||
var/datum/camerachunk/chunk
|
||||
|
||||
/obj/minimap_obj/Click(location, control, params)
|
||||
if(!istype(usr, /mob/dead) && !istype(usr, /mob/living/silicon/ai) && !(usr.client && usr.client.holder && usr.client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/list/par = params2list(params)
|
||||
var/screen_loc = par["screen-loc"]
|
||||
|
||||
if(findtext(screen_loc, "minimap:") != 1)
|
||||
return
|
||||
|
||||
screen_loc = copytext(screen_loc, length("minimap:") + 1)
|
||||
|
||||
var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
|
||||
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
|
||||
|
||||
var/x = chunk.x
|
||||
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
var/y = chunk.y
|
||||
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
|
||||
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/ai = usr
|
||||
ai.freelook()
|
||||
ai.eyeobj.loc = locate(max(1, x - 1), max(1, y - 1), usr.client.minimap_view_z)
|
||||
cameranet.visibility(ai.eyeobj)
|
||||
|
||||
else
|
||||
usr.loc = locate(max(1, x - 1), max(1, y - 1), usr.client.minimap_view_z)
|
||||
|
||||
/mob/dead/verb/Open_Minimap()
|
||||
set category = "Ghost"
|
||||
cameranet.show_minimap(client)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/Open_Minimap()
|
||||
set category = "AI Commands"
|
||||
cameranet.show_minimap(client)
|
||||
|
||||
|
||||
/client/proc/Open_Minimap()
|
||||
set category = "Admin"
|
||||
cameranet.show_minimap(src)
|
||||
|
||||
|
||||
/mob/verb/Open_Minimap_Z()
|
||||
set hidden = 1
|
||||
|
||||
if(!istype(src, /mob/dead) && !istype(src, /mob/living/silicon/ai) && !(client && client.holder && client.holder.level >= 4))
|
||||
return
|
||||
|
||||
var/level = input("Select a Z level", "Z select", null) as null | anything in cameranet.minimap
|
||||
|
||||
if(level != null)
|
||||
cameranet.show_minimap(client, level)
|
||||
|
||||
|
||||
|
||||
/datum/cameranet/proc/show_minimap(client/client, z_level = "z-1")
|
||||
if(!istype(client.mob, /mob/dead) && !istype(client.mob, /mob/living/silicon/ai) && !(client.holder && client.holder.level >= 4))
|
||||
return
|
||||
|
||||
if(z_level in cameranet.minimap)
|
||||
winshow(client, "minimapwindow", 1)
|
||||
|
||||
for(var/key in cameranet.minimap)
|
||||
client.screen -= cameranet.minimap[key]
|
||||
|
||||
client.screen |= cameranet.minimap[z_level]
|
||||
|
||||
if(cameranet.generating_minimap)
|
||||
spawn(50)
|
||||
show_minimap(client, z_level)
|
||||
|
||||
client.minimap_view_z = text2num(copytext(z_level, 3))
|
||||
|
||||
|
||||
/datum/camerachunk/proc/update_minimap()
|
||||
if(changed && !updating)
|
||||
update()
|
||||
|
||||
minimap_icon.Blend(rgb(255, 0, 0), ICON_MULTIPLY)
|
||||
|
||||
var/list/turfs = visibleTurfs | dimTurfs
|
||||
|
||||
for(var/turf/turf in turfs)
|
||||
var/x = (turf.x & 0xf) * 2
|
||||
var/y = (turf.y & 0xf) * 2
|
||||
|
||||
if(turf.density)
|
||||
minimap_icon.DrawBox(rgb(100, 100, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
continue
|
||||
|
||||
else if(istype(turf, /turf/space))
|
||||
minimap_icon.DrawBox(rgb(0, 0, 0), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(200, 200, 200), x + 1, y + 1, x + 2, y + 2)
|
||||
|
||||
for(var/obj/structure/o in turf)
|
||||
if(o.density)
|
||||
if(istype(o, /obj/structure/window) && (o.dir == NORTH || o.dir == SOUTH || o.dir == EAST || o.dir == WEST))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 3, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(150, 150, 200), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(150, 150, 150), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
for(var/obj/machinery/door/o in turf)
|
||||
if(istype(o, /obj/machinery/door/window))
|
||||
if(o.dir == NORTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 2, x + 2, y + 2)
|
||||
else if(o.dir == SOUTH)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 1)
|
||||
else if(o.dir == EAST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 2, y + 1, x + 2, y + 2)
|
||||
else if(o.dir == WEST)
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 1, y + 2)
|
||||
|
||||
else
|
||||
minimap_icon.DrawBox(rgb(100, 150, 100), x + 1, y + 1, x + 2, y + 2)
|
||||
break
|
||||
|
||||
minimap_obj.screen_loc = "minimap:[src.x / 16],[src.y / 16]"
|
||||
minimap_obj.icon = minimap_icon
|
||||
@@ -1,38 +0,0 @@
|
||||
|
||||
/turf
|
||||
var/image/obscured
|
||||
var/image/dim
|
||||
|
||||
/turf/proc/visibilityChanged()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
cameranet.updateVisibility(src)
|
||||
|
||||
/obj/machinery/door/update_nearby_tiles(need_rebuild)
|
||||
. = ..(need_rebuild)
|
||||
cameranet.updateVisibility(loc)
|
||||
|
||||
/obj/machinery/camera/New()
|
||||
..()
|
||||
cameranet.addCamera(src)
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
cameranet.removeCamera(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
. = ..(W, user)
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if(status)
|
||||
cameranet.addCamera(src)
|
||||
else
|
||||
cameranet.removeCamera(src)
|
||||
|
||||
/proc/checkcameravis(atom/A)
|
||||
for(var/obj/machinery/camera/C in view(A,7))
|
||||
if(!C.status || C.stat == 2)
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
@@ -1,77 +0,0 @@
|
||||
|
||||
//reactor areas
|
||||
|
||||
/area/engine
|
||||
icon_state = "engine"
|
||||
|
||||
fore
|
||||
name = "\improper Fore"
|
||||
|
||||
construction_storage
|
||||
name = "\improper Construction storage"
|
||||
|
||||
locker
|
||||
name = "\improper Locker room"
|
||||
|
||||
atmos_storage
|
||||
name = "\improper Atmos storage"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
control
|
||||
name = "\improper Control"
|
||||
icon_state = "engine_control"
|
||||
|
||||
electrical_storage
|
||||
name = "\improper Electrical storage"
|
||||
|
||||
engine_monitoring
|
||||
name = "\improper Electrical storage"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
reactor_core
|
||||
name = "\improper Reactor Core"
|
||||
//icon_state = "engine_core"
|
||||
|
||||
reactor_gas
|
||||
name = "Reactor Gas Storage"
|
||||
//icon_state = "engine_atmos"
|
||||
|
||||
aux_control
|
||||
name = "Reactor Auxiliary Control"
|
||||
//icon_state = "engine_aux"
|
||||
|
||||
turbine_control
|
||||
name = "Turbine Control"
|
||||
//icon_state = "engine_turbine"
|
||||
|
||||
reactor_airlock
|
||||
name = "\improper Reactor Primary Entrance"
|
||||
//icon_state = "engine_airlock"
|
||||
|
||||
reactor_fuel_storage
|
||||
name = "Reactor Fuel Storage"
|
||||
//icon_state = "engine_fuel"
|
||||
|
||||
reactor_fuel_ports
|
||||
name = "\improper Reactor Fuel Ports"
|
||||
//icon_state = "engine_port"
|
||||
|
||||
generators
|
||||
name = "\improper Generator Room"
|
||||
//icon_state = "engine_generators"
|
||||
|
||||
port_gyro_bay
|
||||
name = "\improper Port Gyrotron Bay"
|
||||
//icon_state = "engine_starboardgyro"
|
||||
|
||||
starboard_gyro_bay
|
||||
name = "\improper Starboard Gyrotron Bay"
|
||||
//icon_state = "engine_portgyro"
|
||||
|
||||
storage
|
||||
name = "\improper Engineering hallway"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
hallway
|
||||
name = "\improper Engineering storage"
|
||||
icon_state = "engine_hallway"
|
||||
@@ -1,120 +0,0 @@
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Core Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core_control
|
||||
name = "Circuit board (RUST core controller)"
|
||||
build_path = "/obj/machinery/computer/rust_core_control"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
|
||||
datum/design/rust_core_control
|
||||
name = "Circuit Design (RUST core controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine."
|
||||
id = "rust_core_control"
|
||||
req_tech = list("programming" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_fuel_control
|
||||
name = "Circuit board (RUST fuel controller)"
|
||||
build_path = "/obj/machinery/computer/rust_fuel_control"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
|
||||
datum/design/rust_fuel_control
|
||||
name = "Circuit Design (RUST fuel controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine."
|
||||
id = "rust_fuel_control"
|
||||
req_tech = list("programming" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_fuel_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Port board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "engineering=4;materials=5"
|
||||
|
||||
datum/design/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine."
|
||||
id = "rust_fuel_port"
|
||||
req_tech = list("engineering" = 4, "materials" = 5)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$uranium" = 3000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_port"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Compressor board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_compressor
|
||||
name = "Internal circuitry (RUST fuel compressor)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "materials=6;plasmatech=4"
|
||||
|
||||
datum/design/rust_fuel_compressor
|
||||
name = "Circuit Design (RUST fuel compressor)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine."
|
||||
id = "rust_fuel_compressor"
|
||||
req_tech = list("materials" = 6, "plasmatech" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_compressor"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Tokamak Core board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
build_path = "/obj/machinery/power/rust_core"
|
||||
board_type = "machine"
|
||||
origin_tech = "bluespace=3;plasmatech=4;magnets=5;powerstorage=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/ultra" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern tokamak fusion core."
|
||||
id = "pacman"
|
||||
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, powerstorage = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Injector board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_injector
|
||||
name = "Internal circuitry (RUST fuel injector)"
|
||||
build_path = "/obj/machinery/power/rust_fuel_injector"
|
||||
board_type = "machine"
|
||||
origin_tech = "powerstorage=3;engineering=4;plasmatech=4;materials=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Phasic Scanning Module, 1 Super Matter Bin, 1 Console Screen and 5 Pieces of Cable."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/scanning_module/phasic" = 1,
|
||||
"/obj/item/weapon/stock_parts/matter_bin/super" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_injector
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern particle accelerator."
|
||||
id = "pacman"
|
||||
req_tech = list(powerstorage = 3, engineering = 4, plasmatech = 4, materials = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$uranium" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
@@ -1,143 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/rust_core_control
|
||||
name = "RUST Core Control"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core_control"
|
||||
var/list/connected_devices = list()
|
||||
var/id_tag = "allan remember to update this before you leave"
|
||||
var/scan_range = 25
|
||||
|
||||
//currently viewed
|
||||
var/obj/machinery/power/rust_core/cur_viewed_device
|
||||
|
||||
/obj/machinery/computer/rust_core_control/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
if (!istype(user, /mob/living/silicon) && (get_dist(src, user) > 1 ))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(stat & NOPOWER)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Primary Monitor</B><BR>"
|
||||
if(cur_viewed_device && cur_viewed_device.stat & (BROKEN|NOPOWER))
|
||||
cur_viewed_device = null
|
||||
if(cur_viewed_device && !cur_viewed_device.remote_access_enabled)
|
||||
cur_viewed_device = null
|
||||
|
||||
if(cur_viewed_device)
|
||||
dat += "<b>Device tag:</b> [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]<br>"
|
||||
dat += "<font color=blue>Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].</font><br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];toggle_active=1'>\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]</a><br>"
|
||||
dat += "<b>Device [cur_viewed_device.anchored ? "secured" : "unsecured"].</b><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field encumbrance:</b> [cur_viewed_device.owned_field ? 0 : "NA"]<br>"
|
||||
dat += "<b>Field strength:</b> [cur_viewed_device.field_strength] Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
dat += "<b>Field frequency:</b> [cur_viewed_device.field_frequency] MHz<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/power_stat = "Good"
|
||||
if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage)
|
||||
power_stat = "Insufficient"
|
||||
else if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage * 2)
|
||||
power_stat = "Check"
|
||||
dat += "<b>Power status:</b> [power_stat]<br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];scan=1'>\[Refresh device list\]</a><br><br>"
|
||||
if(connected_devices.len)
|
||||
dat += "<table width='100%' border=1>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>Device tag</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
for(var/obj/machinery/power/rust_core/C in connected_devices)
|
||||
if(!check_core_status(C))
|
||||
connected_devices.Remove(C)
|
||||
continue
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[C.id_tag]</td>"
|
||||
dat += "<td><a href='?src=\ref[src];manage_individual=\ref[C]'>\[Manage\]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
else
|
||||
dat += "No devices connected.<br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> "
|
||||
dat += "<a href='?src=\ref[src];close=1'>Close</a>"
|
||||
|
||||
user << browse(dat, "window=core_control;size=500x400")
|
||||
onclose(user, "core_control")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["goto_scanlist"] )
|
||||
cur_viewed_device = null
|
||||
|
||||
if( href_list["manage_individual"] )
|
||||
cur_viewed_device = locate(href_list["manage_individual"])
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_devices = list()
|
||||
for(var/obj/machinery/power/rust_core/C in range(scan_range, src))
|
||||
if(check_core_status(C))
|
||||
connected_devices.Add(C)
|
||||
|
||||
if( href_list["startup"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Startup()
|
||||
|
||||
if( href_list["shutdown"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Shutdown()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=core_control")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_core_control/proc/check_core_status(var/obj/machinery/power/rust_core/C)
|
||||
if(!C)
|
||||
return 0
|
||||
|
||||
if(C.stat & (BROKEN|NOPOWER) || !C.remote_access_enabled || !C.id_tag)
|
||||
if(connected_devices.Find(C))
|
||||
connected_devices.Remove(C)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -1,438 +0,0 @@
|
||||
//the em field is where the fun happens
|
||||
/*
|
||||
Deuterium-deuterium fusion : 40 x 10^7 K
|
||||
Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
*/
|
||||
|
||||
//#DEFINE MAX_STORED_ENERGY (held_plasma.toxins * held_plasma.toxins * SPECIFIC_HEAT_TOXIN)
|
||||
|
||||
/obj/effect/rust_em_field
|
||||
name = "EM Field"
|
||||
desc = "A coruscating, barely visible field of energy. It is shaped like a slightly flattened torus."
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "emfield_s1"
|
||||
//
|
||||
var/major_radius = 0 //longer radius in meters = field_strength * 0.21875, max = 8.75
|
||||
var/minor_radius = 0 //shorter radius in meters = field_strength * 0.2125, max = 8.625
|
||||
var/size = 1 //diameter in tiles
|
||||
var/volume_covered = 0 //atmospheric volume covered
|
||||
//
|
||||
var/obj/machinery/power/rust_core/owned_core
|
||||
var/list/dormant_reactant_quantities = new
|
||||
//luminosity = 1
|
||||
layer = 3.1
|
||||
//
|
||||
var/energy = 0
|
||||
var/mega_energy = 0
|
||||
var/radiation = 0
|
||||
var/frequency = 1
|
||||
var/field_strength = 0.01 //in teslas, max is 50T
|
||||
|
||||
var/obj/machinery/rust/rad_source/radiator
|
||||
var/datum/gas_mixture/held_plasma = new
|
||||
var/particle_catchers[13]
|
||||
|
||||
var/emp_overload = 0
|
||||
|
||||
/obj/effect/rust_em_field/New()
|
||||
..()
|
||||
//create radiator
|
||||
for(var/obj/machinery/rust/rad_source/rad in range(0))
|
||||
radiator = rad
|
||||
if(!radiator)
|
||||
radiator = new()
|
||||
|
||||
//make sure there's a field generator
|
||||
for(var/obj/machinery/power/rust_core/core in loc)
|
||||
owned_core = core
|
||||
|
||||
if(!owned_core)
|
||||
del(src)
|
||||
|
||||
//create the gimmicky things to handle field collisions
|
||||
var/obj/effect/rust_particle_catcher/catcher
|
||||
//
|
||||
catcher = new (locate(src.x,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(1)
|
||||
particle_catchers.Add(catcher)
|
||||
//
|
||||
catcher = new (locate(src.x-1,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(3)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x+1,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(3)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y+1,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(3)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y-1,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(3)
|
||||
particle_catchers.Add(catcher)
|
||||
//
|
||||
catcher = new (locate(src.x-2,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(5)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x+2,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(5)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y+2,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(5)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y-2,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(5)
|
||||
particle_catchers.Add(catcher)
|
||||
//
|
||||
catcher = new (locate(src.x-3,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(7)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x+3,src.y,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(7)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y+3,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(7)
|
||||
particle_catchers.Add(catcher)
|
||||
catcher = new (locate(src.x,src.y-3,src.z))
|
||||
catcher.parent = src
|
||||
catcher.SetSize(7)
|
||||
particle_catchers.Add(catcher)
|
||||
|
||||
//init values
|
||||
major_radius = field_strength * 0.21875// max = 8.75
|
||||
minor_radius = field_strength * 0.2125// max = 8.625
|
||||
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000
|
||||
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/effect/rust_em_field/process()
|
||||
//make sure the field generator is still intact
|
||||
if(!owned_core)
|
||||
del(src)
|
||||
|
||||
//handle radiation
|
||||
if(!radiator)
|
||||
radiator = new /obj/machinery/rust/rad_source()
|
||||
radiator.mega_energy += radiation
|
||||
radiator.source_alive++
|
||||
radiation = 0
|
||||
|
||||
//update values
|
||||
var/transfer_ratio = field_strength / 50 //higher field strength will result in faster plasma aggregation
|
||||
major_radius = field_strength * 0.21875// max = 8.75m
|
||||
minor_radius = field_strength * 0.2125// max = 8.625m
|
||||
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio //one tile = 2.5m*2.5m*2.5m
|
||||
|
||||
//add plasma from the surrounding environment
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
//hack in some stuff to remove plasma from the air because SCIENCE
|
||||
//the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field
|
||||
//at minimum strength, 0.25% of the field volume is pulled in per update (?)
|
||||
//have a max of 1000 moles suspended
|
||||
if(held_plasma.toxins < transfer_ratio * 1000)
|
||||
var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
//world << "\blue moles_covered: [moles_covered]"
|
||||
//
|
||||
var/datum/gas_mixture/gas_covered = environment.remove(moles_covered)
|
||||
var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture()
|
||||
//
|
||||
plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio)
|
||||
//world << "\blue[plasma_captured.toxins] moles of plasma captured"
|
||||
plasma_captured.temperature = gas_covered.temperature
|
||||
plasma_captured.update_values()
|
||||
//
|
||||
gas_covered.toxins -= plasma_captured.toxins
|
||||
gas_covered.update_values()
|
||||
//
|
||||
held_plasma.merge(plasma_captured)
|
||||
//
|
||||
environment.merge(gas_covered)
|
||||
|
||||
//let the particles inside the field react
|
||||
React()
|
||||
|
||||
//forcibly radiate any excess energy
|
||||
/*var/energy_max = transfer_ratio * 100000
|
||||
if(mega_energy > energy_max)
|
||||
var/energy_lost = rand( 1.5 * (mega_energy - energy_max), 2.5 * (mega_energy - energy_max) )
|
||||
mega_energy -= energy_lost
|
||||
radiation += energy_lost*/
|
||||
|
||||
//change held plasma temp according to energy levels
|
||||
//SPECIFIC_HEAT_TOXIN
|
||||
if(mega_energy > 0 && held_plasma.toxins)
|
||||
var/heat_capacity = held_plasma.heat_capacity()//200 * number of plasma moles
|
||||
if(heat_capacity > 0.0003) //formerly MINIMUM_HEAT_CAPACITY
|
||||
held_plasma.temperature = (heat_capacity + mega_energy * 35000)/heat_capacity
|
||||
|
||||
//if there is too much plasma in the field, lose some
|
||||
/*if( held_plasma.toxins > (MOLES_CELLSTANDARD * 7) * (50 / field_strength) )
|
||||
LosePlasma()*/
|
||||
if(held_plasma.toxins > 1)
|
||||
//lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually)
|
||||
var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength))
|
||||
//world << "lost [loss_ratio*100]% of held plasma"
|
||||
//
|
||||
var/datum/gas_mixture/plasma_lost = new
|
||||
plasma_lost.temperature = held_plasma.temperature
|
||||
//
|
||||
plasma_lost.toxins = held_plasma.toxins * loss_ratio
|
||||
//plasma_lost.update_values()
|
||||
held_plasma.toxins -= held_plasma.toxins * loss_ratio
|
||||
//held_plasma.update_values()
|
||||
//
|
||||
environment.merge(plasma_lost)
|
||||
radiation += loss_ratio * mega_energy * 0.1
|
||||
mega_energy -= loss_ratio * mega_energy * 0.1
|
||||
else
|
||||
held_plasma.toxins = 0
|
||||
//held_plasma.update_values()
|
||||
|
||||
//handle some reactants formatting
|
||||
for(var/reactant in dormant_reactant_quantities)
|
||||
var/amount = dormant_reactant_quantities[reactant]
|
||||
if(amount < 1)
|
||||
dormant_reactant_quantities.Remove(reactant)
|
||||
else if(amount >= 1000000)
|
||||
var/radiate = rand(3 * amount / 4, amount / 4)
|
||||
dormant_reactant_quantities[reactant] -= radiate
|
||||
radiation += radiate
|
||||
|
||||
return 1
|
||||
|
||||
/obj/effect/rust_em_field/proc/ChangeFieldStrength(var/new_strength)
|
||||
var/calc_size = 1
|
||||
emp_overload = 0
|
||||
if(new_strength <= 50)
|
||||
calc_size = 1
|
||||
else if(new_strength <= 200)
|
||||
calc_size = 3
|
||||
else if(new_strength <= 500)
|
||||
calc_size = 5
|
||||
else
|
||||
calc_size = 7
|
||||
if(new_strength > 900)
|
||||
emp_overload = 1
|
||||
//
|
||||
field_strength = new_strength
|
||||
change_size(calc_size)
|
||||
|
||||
/obj/effect/rust_em_field/proc/ChangeFieldFrequency(var/new_frequency)
|
||||
frequency = new_frequency
|
||||
|
||||
/obj/effect/rust_em_field/proc/AddEnergy(var/a_energy, var/a_mega_energy, var/a_frequency)
|
||||
var/energy_loss_ratio = 0
|
||||
if(a_frequency != src.frequency)
|
||||
energy_loss_ratio = 1 / abs(a_frequency - src.frequency)
|
||||
energy += a_energy - a_energy * energy_loss_ratio
|
||||
mega_energy += a_mega_energy - a_mega_energy * energy_loss_ratio
|
||||
|
||||
while(energy > 100000)
|
||||
energy -= 100000
|
||||
mega_energy += 0.1
|
||||
|
||||
/obj/effect/rust_em_field/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(name in dormant_reactant_quantities)
|
||||
dormant_reactant_quantities[name] += quantity
|
||||
else if(name != "proton" && name != "electron" && name != "neutron")
|
||||
dormant_reactant_quantities.Add(name)
|
||||
dormant_reactant_quantities[name] = quantity
|
||||
|
||||
/obj/effect/rust_em_field/proc/RadiateAll(var/ratio_lost = 1)
|
||||
for(var/particle in dormant_reactant_quantities)
|
||||
radiation += dormant_reactant_quantities[particle]
|
||||
dormant_reactant_quantities.Remove(particle)
|
||||
radiation += mega_energy
|
||||
mega_energy = 0
|
||||
|
||||
//lose all held plasma back into the air
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
environment.merge(held_plasma)
|
||||
|
||||
/obj/effect/rust_em_field/proc/change_size(var/newsize = 1)
|
||||
//
|
||||
var/changed = 0
|
||||
switch(newsize)
|
||||
if(1)
|
||||
size = 1
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "emfield_s1"
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
//
|
||||
changed = 1
|
||||
if(3)
|
||||
size = 3
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "emfield_s3"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
//
|
||||
changed = 3
|
||||
if(5)
|
||||
size = 5
|
||||
icon = 'icons/effects/160x160.dmi'
|
||||
icon_state = "emfield_s5"
|
||||
pixel_x = -64
|
||||
pixel_y = -64
|
||||
//
|
||||
changed = 5
|
||||
if(7)
|
||||
size = 7
|
||||
icon = 'icons/effects/224x224.dmi'
|
||||
icon_state = "emfield_s7"
|
||||
pixel_x = -96
|
||||
pixel_y = -96
|
||||
//
|
||||
changed = 7
|
||||
|
||||
for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers)
|
||||
catcher.UpdateSize()
|
||||
return changed
|
||||
|
||||
//the !!fun!! part
|
||||
/obj/effect/rust_em_field/proc/React()
|
||||
//loop through the reactants in random order
|
||||
var/list/reactants_reacting_pool = dormant_reactant_quantities.Copy()
|
||||
/*
|
||||
for(var/reagent in dormant_reactant_quantities)
|
||||
world << " before: [reagent]: [dormant_reactant_quantities[reagent]]"
|
||||
*/
|
||||
|
||||
//cant have any reactions if there aren't any reactants present
|
||||
if(reactants_reacting_pool.len)
|
||||
//determine a random amount to actually react this cycle, and remove it from the standard pool
|
||||
//this is a hack, and quite nonrealistic :(
|
||||
for(var/reactant in reactants_reacting_pool)
|
||||
reactants_reacting_pool[reactant] = rand(0,reactants_reacting_pool[reactant])
|
||||
dormant_reactant_quantities[reactant] -= reactants_reacting_pool[reactant]
|
||||
if(!reactants_reacting_pool[reactant])
|
||||
reactants_reacting_pool -= reactant
|
||||
|
||||
//loop through all the reacting reagents, picking out random reactions for them
|
||||
var/list/produced_reactants = new/list
|
||||
var/list/primary_reactant_pool = reactants_reacting_pool.Copy()
|
||||
while(primary_reactant_pool.len)
|
||||
//pick one of the unprocessed reacting reagents randomly
|
||||
var/cur_primary_reactant = pick(primary_reactant_pool)
|
||||
primary_reactant_pool.Remove(cur_primary_reactant)
|
||||
//world << "\blue primary reactant chosen: [cur_primary_reactant]"
|
||||
|
||||
//grab all the possible reactants to have a reaction with
|
||||
var/list/possible_secondary_reactants = reactants_reacting_pool.Copy()
|
||||
//if there is only one of a particular reactant, then it can not react with itself so remove it
|
||||
possible_secondary_reactants[cur_primary_reactant] -= 1
|
||||
if(possible_secondary_reactants[cur_primary_reactant] < 1)
|
||||
possible_secondary_reactants.Remove(cur_primary_reactant)
|
||||
|
||||
//loop through and work out all the possible reactions
|
||||
var/list/possible_reactions = new/list
|
||||
for(var/cur_secondary_reactant in possible_secondary_reactants)
|
||||
if(possible_secondary_reactants[cur_secondary_reactant] < 1)
|
||||
continue
|
||||
var/datum/fusion_reaction/cur_reaction = get_fusion_reaction(cur_primary_reactant, cur_secondary_reactant)
|
||||
if(cur_reaction)
|
||||
//world << "\blue secondary reactant: [cur_secondary_reactant], [reaction_products.len]"
|
||||
possible_reactions.Add(cur_reaction)
|
||||
|
||||
//if there are no possible reactions here, abandon this primary reactant and move on
|
||||
if(!possible_reactions.len)
|
||||
//world << "\blue no reactions"
|
||||
continue
|
||||
|
||||
//split up the reacting atoms between the possible reactions
|
||||
while(possible_reactions.len)
|
||||
//pick a random substance to react with
|
||||
var/datum/fusion_reaction/cur_reaction = pick(possible_reactions)
|
||||
possible_reactions.Remove(cur_reaction)
|
||||
|
||||
//set the randmax to be the lower of the two involved reactants
|
||||
var/max_num_reactants = reactants_reacting_pool[cur_reaction.primary_reactant] > reactants_reacting_pool[cur_reaction.secondary_reactant] ? \
|
||||
reactants_reacting_pool[cur_reaction.secondary_reactant] : reactants_reacting_pool[cur_reaction.primary_reactant]
|
||||
if(max_num_reactants < 1)
|
||||
continue
|
||||
|
||||
//make sure we have enough energy
|
||||
if(mega_energy < max_num_reactants * cur_reaction.energy_consumption)
|
||||
max_num_reactants = round(mega_energy / cur_reaction.energy_consumption)
|
||||
if(max_num_reactants < 1)
|
||||
continue
|
||||
|
||||
//randomly determined amount to react
|
||||
var/amount_reacting = rand(1, max_num_reactants)
|
||||
|
||||
//removing the reacting substances from the list of substances that are primed to react this cycle
|
||||
//if there aren't enough of that substance (there should be) then modify the reactant amounts accordingly
|
||||
if( reactants_reacting_pool[cur_reaction.primary_reactant] - amount_reacting >= 0 )
|
||||
reactants_reacting_pool[cur_reaction.primary_reactant] -= amount_reacting
|
||||
else
|
||||
amount_reacting = reactants_reacting_pool[cur_reaction.primary_reactant]
|
||||
reactants_reacting_pool[cur_reaction.primary_reactant] = 0
|
||||
//same again for secondary reactant
|
||||
if( reactants_reacting_pool[cur_reaction.secondary_reactant] - amount_reacting >= 0 )
|
||||
reactants_reacting_pool[cur_reaction.secondary_reactant] -= amount_reacting
|
||||
else
|
||||
reactants_reacting_pool[cur_reaction.primary_reactant] += amount_reacting - reactants_reacting_pool[cur_reaction.primary_reactant]
|
||||
amount_reacting = reactants_reacting_pool[cur_reaction.secondary_reactant]
|
||||
reactants_reacting_pool[cur_reaction.secondary_reactant] = 0
|
||||
|
||||
//remove the consumed energy
|
||||
mega_energy -= max_num_reactants * cur_reaction.energy_consumption
|
||||
|
||||
//add any produced energy
|
||||
mega_energy += max_num_reactants * cur_reaction.energy_production
|
||||
|
||||
//add any produced radiation
|
||||
radiation += max_num_reactants * cur_reaction.radiation
|
||||
|
||||
//create the reaction products
|
||||
for(var/reactant in cur_reaction.products)
|
||||
var/success = 0
|
||||
for(var/check_reactant in produced_reactants)
|
||||
if(check_reactant == reactant)
|
||||
produced_reactants[reactant] += cur_reaction.products[reactant] * amount_reacting
|
||||
success = 1
|
||||
break
|
||||
if(!success)
|
||||
produced_reactants[reactant] = cur_reaction.products[reactant] * amount_reacting
|
||||
|
||||
//this reaction is done, and can't be repeated this sub-cycle
|
||||
possible_reactions.Remove(cur_reaction.secondary_reactant)
|
||||
|
||||
//
|
||||
/*if(new_radiation)
|
||||
if(!radiating)
|
||||
radiating = 1
|
||||
PeriodicRadiate()*/
|
||||
|
||||
//loop through the newly produced reactants and add them to the pool
|
||||
//var/list/neutronic_radiation = new
|
||||
//var/list/protonic_radiation = new
|
||||
for(var/reactant in produced_reactants)
|
||||
AddParticles(reactant, produced_reactants[reactant])
|
||||
//world << "produced: [reactant], [dormant_reactant_quantities[reactant]]"
|
||||
|
||||
//check whether there are reactants left, and add them back to the pool
|
||||
for(var/reactant in reactants_reacting_pool)
|
||||
AddParticles(reactant, reactants_reacting_pool[reactant])
|
||||
//world << "retained: [reactant], [reactants_reacting_pool[reactant]]"
|
||||
|
||||
/obj/effect/rust_em_field/Destroy()
|
||||
//radiate everything in one giant burst
|
||||
for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers)
|
||||
del (catcher)
|
||||
RadiateAll()
|
||||
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
@@ -1,287 +0,0 @@
|
||||
//the core [tokamaka generator] big funky solenoid, it generates an EM field
|
||||
|
||||
/*
|
||||
when the core is turned on, it generates [creates] an electromagnetic field
|
||||
the em field attracts plasma, and suspends it in a controlled torus (doughnut) shape, oscillating around the core
|
||||
|
||||
the field strength is directly controllable by the user
|
||||
field strength = sqrt(energy used by the field generator)
|
||||
|
||||
the size of the EM field = field strength / k
|
||||
(k is an arbitrary constant to make the calculated size into tilewidths)
|
||||
|
||||
1 tilewidth = below 5T
|
||||
3 tilewidth = between 5T and 12T
|
||||
5 tilewidth = between 10T and 25T
|
||||
7 tilewidth = between 20T and 50T
|
||||
(can't go higher than 40T)
|
||||
|
||||
energy is added by a gyrotron, and lost when plasma escapes
|
||||
energy transferred from the gyrotron beams is reduced by how different the frequencies are (closer frequencies = more energy transferred)
|
||||
|
||||
frequency = field strength * (stored energy / stored moles of plasma) * x
|
||||
(where x is an arbitrary constant to make the frequency something realistic)
|
||||
the gyrotron beams' frequency and energy are hardcapped low enough that they won't heat the plasma much
|
||||
|
||||
energy is generated in considerable amounts by fusion reactions from injected particles
|
||||
fusion reactions only occur when the existing energy is above a certain level, and it's near the max operating level of the gyrotron. higher energy reactions only occur at higher energy levels
|
||||
a small amount of energy constantly bleeds off in the form of radiation
|
||||
|
||||
the field is constantly pulling in plasma from the surrounding [local] atmosphere
|
||||
at random intervals, the field releases a random percentage of stored plasma in addition to a percentage of energy as intense radiation
|
||||
|
||||
the amount of plasma is a percentage of the field strength, increased by frequency
|
||||
*/
|
||||
|
||||
/*
|
||||
- VALUES -
|
||||
|
||||
max volume of plasma storeable by the field = the total volume of a number of tiles equal to the (field tilewidth)^2
|
||||
|
||||
*/
|
||||
|
||||
#define MAX_FIELD_FREQ 1000
|
||||
#define MIN_FIELD_FREQ 1
|
||||
#define MAX_FIELD_STR 1000
|
||||
#define MIN_FIELD_STR 1
|
||||
|
||||
/obj/machinery/power/rust_core
|
||||
name = "RUST Tokamak core"
|
||||
desc = "Enormous solenoid for generating extremely high power electromagnetic fields"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core0"
|
||||
density = 1
|
||||
var/obj/effect/rust_em_field/owned_field
|
||||
var/field_strength = 1//0.01
|
||||
var/field_frequency = 1
|
||||
var/id_tag = "allan, don't forget to set the ID of this one too"
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 500 //multiplied by field strength
|
||||
var/cached_power_avail = 0
|
||||
directwired = 1
|
||||
anchored = 0
|
||||
|
||||
var/state = 0
|
||||
var/locked = 1
|
||||
var/remote_access_enabled = 1
|
||||
|
||||
/obj/machinery/power/rust_core/process()
|
||||
if(stat & BROKEN || !powernet)
|
||||
Shutdown()
|
||||
|
||||
cached_power_avail = avail()
|
||||
//luminosity = round(owned_field.field_strength/10)
|
||||
//luminosity = max(luminosity,1)
|
||||
|
||||
/obj/machinery/power/rust_core/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(owned_field)
|
||||
user << "Turn off [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(owned_field)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
if(owned_field)
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
user << "\red The controls can only be locked when the [src] is online"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_core/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_core/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_core/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(stat & NOPOWER || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
|
||||
dat += "<b>Device ID tag: </b> [id_tag ? id_tag : "UNSET"] <a href='?src=\ref[src];new_id_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_active=1'>\[[owned_field ? "Deactivate" : "Activate"]\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]</a><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field strength:</b> [field_strength]Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
|
||||
dat += "<b>Field frequency:</b> [field_frequency]MHz<br>"
|
||||
dat += "<a href='?src=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
|
||||
user << browse(dat, "window=core_gen;size=500x300")
|
||||
onclose(user, "core_gen")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_core/Topic(href, href_list)
|
||||
if(href_list["str"])
|
||||
var/dif = text2num(href_list["str"])
|
||||
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
||||
active_power_usage = 5 * field_strength //change to 500 later
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
|
||||
if(href_list["freq"])
|
||||
var/dif = text2num(href_list["freq"])
|
||||
field_frequency = min(max(field_frequency + dif, MIN_FIELD_FREQ), MAX_FIELD_FREQ)
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
|
||||
if(href_list["toggle_active"])
|
||||
if(!Startup())
|
||||
Shutdown()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if(href_list["new_id_tag"])
|
||||
if(usr)
|
||||
id_tag = input("Enter a new ID tag", "Tokamak core ID tag", id_tag) as text|null
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=core_gen")
|
||||
usr.unset_machine()
|
||||
|
||||
if(href_list["extern_update"])
|
||||
var/obj/machinery/computer/rust_core_control/C = locate(href_list["extern_update"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Startup()
|
||||
if(owned_field)
|
||||
return
|
||||
owned_field = new(src.loc)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
icon_state = "core1"
|
||||
luminosity = 1
|
||||
use_power = 2
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Shutdown()
|
||||
//todo: safety checks for field status
|
||||
if(owned_field)
|
||||
icon_state = "core0"
|
||||
del(owned_field)
|
||||
luminosity = 0
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/power/rust_core/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(owned_field)
|
||||
owned_field.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/power/rust_core/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(owned_field)
|
||||
return owned_field.bullet_act(Proj)
|
||||
return 0
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
/obj/item/weapon/fuel_assembly
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_assembly"
|
||||
name = "Fuel Rod Assembly"
|
||||
var/list/rod_quantities
|
||||
var/percent_depleted = 1
|
||||
layer = 3.1
|
||||
//
|
||||
New()
|
||||
rod_quantities = new/list
|
||||
|
||||
//these can be abstracted away for now
|
||||
/*
|
||||
/obj/item/weapon/fuel_rod
|
||||
/obj/item/weapon/control_rod
|
||||
*/
|
||||
@@ -1,102 +0,0 @@
|
||||
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port
|
||||
name = "Fuel Assembly Port"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
density = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/busy = 0
|
||||
anchored = 1
|
||||
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/fuel_assembly) && !opened)
|
||||
if(cur_assembly)
|
||||
user << "\red There is already a fuel rod assembly in there!"
|
||||
else
|
||||
cur_assembly = I
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
icon_state = "port1"
|
||||
user << "\blue You insert [I] into [src]. Touch the panel again to insert [I] into the injector."
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER) || opened)
|
||||
return
|
||||
|
||||
if(cur_assembly)
|
||||
if(try_insert_assembly())
|
||||
user << "\blue \icon[src] [src] inserts it's fuel rod assembly into an injector."
|
||||
else
|
||||
if(eject_assembly())
|
||||
user << "\red \icon[src] [src] ejects it's fuel assembly. Check the fuel injector status."
|
||||
else if(try_draw_assembly())
|
||||
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
|
||||
else if(try_draw_assembly())
|
||||
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
|
||||
else
|
||||
user << "\red \icon[src] [src] was unable to draw a fuel rod assembly from an injector."
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly()
|
||||
var/success = 0
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(I.cur_assembly)
|
||||
break
|
||||
if(I.state != 2)
|
||||
break
|
||||
|
||||
I.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = I
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
return success
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly()
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc//get_step(get_turf(src), src.dir)
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
return 1
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly()
|
||||
var/success = 0
|
||||
if(!cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(!I.cur_assembly)
|
||||
break
|
||||
if(I.injecting)
|
||||
break
|
||||
if(I.state != 2)
|
||||
break
|
||||
|
||||
cur_assembly = I.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
I.cur_assembly = null
|
||||
icon_state = "port1"
|
||||
success = 1
|
||||
break
|
||||
|
||||
return success
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/eject_assembly_verb()
|
||||
set name = "Eject assembly from port"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
eject_assembly()
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame
|
||||
name = "Fuel Assembly Port frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Port cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Port cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 0
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_port(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "port0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(cur_assembly)
|
||||
user << "\red You cannot open the cover while there is a fuel assembly inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "port2"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/stack/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the port frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/stack/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the port.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_port) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the port control board into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the port control board inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the port frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the port frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,116 +0,0 @@
|
||||
var/const/max_assembly_amount = 300
|
||||
|
||||
/obj/machinery/rust_fuel_compressor
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor1"
|
||||
name = "Fuel Compressor"
|
||||
var/list/new_assembly_quantities = list("Deuterium" = 150,"Tritium" = 150,"Rodinium-6" = 0,"Stravium-7" = 0, "Pergium" = 0, "Dilithium" = 0)
|
||||
var/compressed_matter = 0
|
||||
anchored = 1
|
||||
layer = 2.9
|
||||
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/locked = 0
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/rcd_ammo))
|
||||
compressed_matter += 10
|
||||
del(W)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuelcomp")
|
||||
return
|
||||
|
||||
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
if(locked)
|
||||
t += "Swipe your ID to unlock this console."
|
||||
else
|
||||
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a><br>"
|
||||
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
|
||||
t += "<hr>"
|
||||
t += "- New fuel assembly constituents:- <br>"
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];change_reagent=[reagent]'>Modify</A>\]<br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=fuelcomp;size=500x300")
|
||||
user.set_machine(src)
|
||||
|
||||
//var/locked
|
||||
//var/coverlocked
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
|
||||
if( href_list["eject_matter"] )
|
||||
var/ejected = 0
|
||||
while(compressed_matter > 10)
|
||||
new /obj/item/weapon/rcd_ammo(get_step(get_turf(src), src.dir))
|
||||
compressed_matter -= 10
|
||||
ejected = 1
|
||||
if(ejected)
|
||||
usr << "\blue \icon[src] [src] ejects some compressed matter units."
|
||||
else
|
||||
usr << "\red \icon[src] there are no more compressed matter units in [src]."
|
||||
|
||||
if( href_list["activate"] )
|
||||
//world << "\blue New fuel rod assembly"
|
||||
var/obj/item/weapon/fuel_assembly/F = new(src)
|
||||
var/fail = 0
|
||||
var/old_matter = compressed_matter
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
var/req_matter = round(new_assembly_quantities[reagent] / 30)
|
||||
//world << "[reagent] matter: [req_matter]/[compressed_matter]"
|
||||
if(req_matter <= compressed_matter)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
compressed_matter -= req_matter
|
||||
if(compressed_matter < 1)
|
||||
compressed_matter = 0
|
||||
else
|
||||
/*world << "bad reagent: [reagent], [req_matter > compressed_matter ? "req_matter > compressed_matter"\
|
||||
: (req_matter < compressed_matter ? "req_matter < compressed_matter" : "req_matter == compressed_matter")]"*/
|
||||
fail = 1
|
||||
break
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
if(fail)
|
||||
del(F)
|
||||
compressed_matter = old_matter
|
||||
usr << "\red \icon[src] [src] flashes red: \'Out of matter.\'"
|
||||
else
|
||||
F.loc = src.loc//get_step(get_turf(src), src.dir)
|
||||
F.percent_depleted = 0
|
||||
if(compressed_matter < 0.034)
|
||||
compressed_matter = 0
|
||||
|
||||
if( href_list["change_reagent"] )
|
||||
var/cur_reagent = href_list["change_reagent"]
|
||||
var/avail_rods = 300
|
||||
for(var/rod in new_assembly_quantities)
|
||||
avail_rods -= new_assembly_quantities[rod]
|
||||
avail_rods += new_assembly_quantities[cur_reagent]
|
||||
avail_rods = max(avail_rods, 0)
|
||||
|
||||
var/new_amount = min(input("Enter new [cur_reagent] rod amount (max [avail_rods])", "Fuel Assembly Rod Composition ([cur_reagent])") as num, avail_rods)
|
||||
new_assembly_quantities[cur_reagent] = new_amount
|
||||
|
||||
updateDialog()
|
||||
@@ -1,160 +0,0 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame
|
||||
name = "Fuel Compressor frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Compressor cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Compressor cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 0
|
||||
locked = 0
|
||||
icon_state = "fuel_compressor1"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard board.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_compressor(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "fuel_compressor0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(compressed_matter > 0)
|
||||
user << "\red You cannot open the cover while there is compressed matter inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "fuel_compressor1"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
if(src.allowed(usr))
|
||||
locked = !locked
|
||||
user << "You [ locked ? "lock" : "unlock"] the compressor interface."
|
||||
update_icon()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "You emag the port interface."
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/stack/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the compressor frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/stack/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the compressor.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_compressor) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the circuitboard into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the circuitboard inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the compressor frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,192 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control
|
||||
name = "RUST Fuel Injection Control"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel"
|
||||
var/list/connected_injectors = list()
|
||||
var/list/active_stages = list()
|
||||
var/list/proceeding_stages = list()
|
||||
var/list/stage_times = list()
|
||||
//var/list/stage_status
|
||||
var/announce_fueldepletion = 0
|
||||
var/announce_stageprogression = 0
|
||||
var/scan_range = 25
|
||||
var/ticks_this_stage = 0
|
||||
|
||||
/*/obj/machinery/computer/rust_fuel_control/New()
|
||||
..()
|
||||
//these are the only three stages we can accept
|
||||
//we have another console for SCRAM
|
||||
fuel_injectors = new/list
|
||||
stage_status = new/list
|
||||
|
||||
fuel_injectors.Add("One")
|
||||
fuel_injectors["One"] = new/list
|
||||
stage_status.Add("One")
|
||||
stage_status["One"] = 0
|
||||
fuel_injectors.Add("Two")
|
||||
fuel_injectors["Two"] = new/list
|
||||
stage_status.Add("Two")
|
||||
stage_status["Two"] = 0
|
||||
fuel_injectors.Add("Three")
|
||||
fuel_injectors["Three"] = new/list
|
||||
stage_status.Add("Three")
|
||||
stage_status["Three"] = 0
|
||||
fuel_injectors.Add("SCRAM")
|
||||
fuel_injectors["SCRAM"] = new/list
|
||||
stage_status.Add("SCRAM")
|
||||
stage_status["SCRAM"] = 0
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/Injector in world)
|
||||
if(Injector.stage in fuel_injectors)
|
||||
var/list/targetlist = fuel_injectors[Injector.stage]
|
||||
targetlist.Add(Injector)*/
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/interact(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
var/dat = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
/*dat += "<b>Fuel depletion announcement:</b> "
|
||||
dat += "[announce_fueldepletion == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_fueldepletion=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_fueldepletion=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_fueldepletion=2'>\[Broadcast\]</a>"]<br>"
|
||||
dat += "<b>Stage progression announcement:</b> "
|
||||
dat += "[announce_stageprogression == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_stageprogression=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_stageprogression == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_stageprogression=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_stageprogression == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_stageprogression=2'>\[Broadcast\]</a>"]<br>"*/
|
||||
dat += "<hr>"
|
||||
|
||||
dat += "<b>Detected devices</b> <a href='?src=\ref[src];scan=1'>\[Refresh list\]</a>"
|
||||
dat += "<table border=1 width='100%'>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>ID</b></td>"
|
||||
dat += "<td><b>Assembly</b></td>"
|
||||
dat += "<td><b>Consumption</b></td>"
|
||||
dat += "<td><b>Depletion</b></td>"
|
||||
dat += "<td><b>Duration</b></td>"
|
||||
dat += "<td><b>Next stage</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
dat += "<tr>"
|
||||
dat += "<td>[I.id_tag]</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td><a href='?src=\ref[I];toggle_injecting=1;update_extern=\ref[src]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
|
||||
else
|
||||
dat += "<td>None</td>"
|
||||
dat += "<td>[I.fuel_usage * 100]%</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
|
||||
else
|
||||
dat += "<td>NA</td>"
|
||||
if(stage_times.Find(I.id_tag))
|
||||
dat += "<td>[ticks_this_stage]/[stage_times[I.id_tag]]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Modify</td>"
|
||||
else
|
||||
dat += "<td>[ticks_this_stage]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Set</td>"
|
||||
if(proceeding_stages.Find(I.id_tag))
|
||||
dat += "<td><a href='?src=\ref[src];set_next_stage=[I.id_tag]'>[proceeding_stages[I.id_tag]]</a></td>"
|
||||
else
|
||||
dat += "<td>None <a href='?src=\ref[src];set_next_stage=[I.id_tag]'>\[modify\]</a></td>"
|
||||
dat += "<td><a href='?src=\ref[src];toggle_stage=[I.id_tag]'>\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(dat, "window=fuel_control;size=800x400")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_injectors = list()
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in range(scan_range, src))
|
||||
if(check_injector_status(I))
|
||||
connected_injectors.Add(I)
|
||||
|
||||
if( href_list["toggle_stage"] )
|
||||
var/cur_stage = href_list["toggle_stage"]
|
||||
if(active_stages.Find(cur_stage))
|
||||
active_stages.Remove(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
else
|
||||
active_stages.Add(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
|
||||
if( href_list["cooldown"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
active_stages = list()
|
||||
|
||||
if( href_list["warmup"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
if(!active_stages.Find(I.id_tag))
|
||||
active_stages.Add(I.id_tag)
|
||||
|
||||
if( href_list["stage_time"] )
|
||||
var/cur_stage = href_list["stage_time"]
|
||||
var/new_duration = input("Enter new stage duration in seconds", "Stage duration") as num
|
||||
if(new_duration)
|
||||
stage_times[cur_stage] = new_duration
|
||||
else if(stage_times.Find(cur_stage))
|
||||
stage_times.Remove(cur_stage)
|
||||
|
||||
if( href_list["announce_fueldepletion"] )
|
||||
announce_fueldepletion = text2num(href_list["announce_fueldepletion"])
|
||||
|
||||
if( href_list["announce_stageprogression"] )
|
||||
announce_stageprogression = text2num(href_list["announce_stageprogression"])
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_control")
|
||||
usr.unset_machine()
|
||||
|
||||
if( href_list["set_next_stage"] )
|
||||
var/cur_stage = href_list["set_next_stage"]
|
||||
if(!proceeding_stages.Find(cur_stage))
|
||||
proceeding_stages.Add(cur_stage)
|
||||
var/next_stage = input("Enter next stage ID", "Automated stage procession") as text|null
|
||||
if(next_stage)
|
||||
proceeding_stages[cur_stage] = next_stage
|
||||
else
|
||||
proceeding_stages.Remove(cur_stage)
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/proc/check_injector_status(var/obj/machinery/power/rust_fuel_injector/I)
|
||||
if(!I)
|
||||
return 0
|
||||
|
||||
if(I.stat & (BROKEN|NOPOWER) || !I.remote_access_enabled || !I.id_tag)
|
||||
if(connected_injectors.Find(I))
|
||||
connected_injectors.Remove(I)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -1,308 +0,0 @@
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector
|
||||
name = "Fuel Injector"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "injector0"
|
||||
|
||||
density = 1
|
||||
anchored = 0
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
req_access = list(access_engine)
|
||||
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/id_tag = "One"
|
||||
var/injecting = 0
|
||||
var/trying_to_swap_fuel = 0
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 500
|
||||
directwired = 0
|
||||
var/remote_access_enabled = 1
|
||||
var/cached_power_avail = 0
|
||||
var/emergency_insert_ready = 0
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/process()
|
||||
if(injecting)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
StopInjecting()
|
||||
else
|
||||
Inject()
|
||||
|
||||
cached_power_avail = avail()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
//src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
//src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly)
|
||||
if(emergency_insert_ready)
|
||||
cur_assembly = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
emergency_insert_ready = 0
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
if(get_dist(src, user) > 1 )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if (stat & NOPOWER || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
dat += "<b>Device ID tag:</b> [id_tag] <a href='?src=\ref[src];modify_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
dat += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Fuel assembly port:</b> "
|
||||
dat += "<a href='?src=\ref[src];fuel_assembly=1'>\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\]</a> "
|
||||
if(cur_assembly)
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[Emergency eject\]</a><br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]</a><br>"
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(dat, "window=fuel_injector;size=500x300")
|
||||
onclose(user, "fuel_injector")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["modify_tag"] )
|
||||
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
||||
|
||||
if( href_list["fuel_assembly"] )
|
||||
attempt_fuel_swap()
|
||||
|
||||
if( href_list["emergency_fuel_assembly"] )
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc
|
||||
cur_assembly = null
|
||||
//irradiate!
|
||||
else
|
||||
emergency_insert_ready = !emergency_insert_ready
|
||||
|
||||
if( href_list["toggle_injecting"] )
|
||||
if(injecting)
|
||||
StopInjecting()
|
||||
else
|
||||
BeginInjecting()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if( href_list["fuel_usage"] )
|
||||
var/new_usage = text2num(input("Enter new fuel usage (0.01% - 100%)", "Modifying fuel usage", fuel_usage * 100))
|
||||
if(!new_usage)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_usage = max(new_usage, 0.01)
|
||||
new_usage = min(new_usage, 100)
|
||||
fuel_usage = new_usage / 100
|
||||
active_power_usage = 500 + 1000 * fuel_usage
|
||||
|
||||
if( href_list["update_extern"] )
|
||||
var/obj/machinery/computer/rust_fuel_control/C = locate(href_list["update_extern"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_injector")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/BeginInjecting()
|
||||
if(!injecting && cur_assembly)
|
||||
icon_state = "injector1"
|
||||
injecting = 1
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/StopInjecting()
|
||||
if(injecting)
|
||||
injecting = 0
|
||||
icon_state = "injector0"
|
||||
use_power = 0
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/Inject()
|
||||
if(!injecting)
|
||||
return
|
||||
if(cur_assembly)
|
||||
var/amount_left = 0
|
||||
for(var/reagent in cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
//
|
||||
|
||||
var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir)
|
||||
A.particle_type = reagent
|
||||
A.additional_particles = numparticles - 1
|
||||
//A.target = target_field
|
||||
//
|
||||
cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += cur_assembly.rod_quantities[reagent]
|
||||
cur_assembly.percent_depleted = amount_left / 300
|
||||
flick("injector-emitting",src)
|
||||
else
|
||||
StopInjecting()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/attempt_fuel_swap()
|
||||
var/rev_dir = reverse_direction(dir)
|
||||
var/turf/mid = get_step(src, rev_dir)
|
||||
var/success = 0
|
||||
for(var/obj/machinery/rust_fuel_assembly_port/check_port in get_step(mid, rev_dir))
|
||||
if(cur_assembly)
|
||||
if(!check_port.cur_assembly)
|
||||
check_port.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = check_port
|
||||
cur_assembly = null
|
||||
check_port.icon_state = "port1"
|
||||
success = 1
|
||||
else
|
||||
if(check_port.cur_assembly)
|
||||
cur_assembly = check_port.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
check_port.cur_assembly = null
|
||||
check_port.icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
break
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src].")
|
||||
updateDialog()
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src].")
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/verb/rotate_clock()
|
||||
set category = "Object"
|
||||
set name = "Rotate Generator (Clockwise)"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/verb/rotate_anticlock()
|
||||
set category = "Object"
|
||||
set name = "Rotate Generator (Counterclockwise)"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, -90)
|
||||
@@ -1,160 +0,0 @@
|
||||
|
||||
datum/fusion_reaction
|
||||
var/primary_reactant = ""
|
||||
var/secondary_reactant = ""
|
||||
var/energy_consumption = 0
|
||||
var/energy_production = 0
|
||||
var/radiation = 0
|
||||
var/list/products = list()
|
||||
|
||||
/datum/controller/game_controller/var/list/fusion_reactions
|
||||
|
||||
proc/get_fusion_reaction(var/primary_reactant, var/secondary_reactant)
|
||||
if(!master_controller.fusion_reactions)
|
||||
populate_fusion_reactions()
|
||||
if(master_controller.fusion_reactions.Find(primary_reactant))
|
||||
var/list/secondary_reactions = master_controller.fusion_reactions[primary_reactant]
|
||||
if(secondary_reactions.Find(secondary_reactant))
|
||||
return master_controller.fusion_reactions[primary_reactant][secondary_reactant]
|
||||
|
||||
proc/populate_fusion_reactions()
|
||||
if(!master_controller.fusion_reactions)
|
||||
master_controller.fusion_reactions = list()
|
||||
for(var/cur_reaction_type in typesof(/datum/fusion_reaction) - /datum/fusion_reaction)
|
||||
var/datum/fusion_reaction/cur_reaction = new cur_reaction_type()
|
||||
if(!master_controller.fusion_reactions[cur_reaction.primary_reactant])
|
||||
master_controller.fusion_reactions[cur_reaction.primary_reactant] = list()
|
||||
master_controller.fusion_reactions[cur_reaction.primary_reactant][cur_reaction.secondary_reactant] = cur_reaction
|
||||
if(!master_controller.fusion_reactions[cur_reaction.secondary_reactant])
|
||||
master_controller.fusion_reactions[cur_reaction.secondary_reactant] = list()
|
||||
master_controller.fusion_reactions[cur_reaction.secondary_reactant][cur_reaction.primary_reactant] = cur_reaction
|
||||
|
||||
//Fake elements and fake reactions, but its nicer gameplay-wise
|
||||
//Deuterium
|
||||
//Tritium
|
||||
//Uridium-3
|
||||
//Obdurium
|
||||
//Solonium
|
||||
//Rodinium-6
|
||||
//Dilithium
|
||||
//Trilithium
|
||||
//Pergium
|
||||
//Stravium-7
|
||||
|
||||
//Primary Production Reactions
|
||||
|
||||
datum/fusion_reaction/tritium_deuterium
|
||||
primary_reactant = "Tritium"
|
||||
secondary_reactant = "Deuterium"
|
||||
energy_consumption = 1
|
||||
energy_production = 5
|
||||
radiation = 0
|
||||
|
||||
//Secondary Production Reactions
|
||||
|
||||
datum/fusion_reaction/deuterium_deuterium
|
||||
primary_reactant = "Deuterium"
|
||||
secondary_reactant = "Deuterium"
|
||||
energy_consumption = 1
|
||||
energy_production = 4
|
||||
radiation = 1
|
||||
products = list("Obdurium" = 2)
|
||||
|
||||
datum/fusion_reaction/tritium_tritium
|
||||
primary_reactant = "Tritium"
|
||||
secondary_reactant = "Tritium"
|
||||
energy_consumption = 1
|
||||
energy_production = 4
|
||||
radiation = 1
|
||||
products = list("Solonium" = 2)
|
||||
|
||||
//Cleanup Reactions
|
||||
|
||||
datum/fusion_reaction/rodinium6_obdurium
|
||||
primary_reactant = "Rodinium-6"
|
||||
secondary_reactant = "Obdurium"
|
||||
energy_consumption = 1
|
||||
energy_production = 2
|
||||
radiation = 2
|
||||
|
||||
datum/fusion_reaction/rodinium6_solonium
|
||||
primary_reactant = "Rodinium-6"
|
||||
secondary_reactant = "Solonium"
|
||||
energy_consumption = 1
|
||||
energy_production = 2
|
||||
radiation = 2
|
||||
|
||||
//Breeder Reactions
|
||||
|
||||
datum/fusion_reaction/dilithium_obdurium
|
||||
primary_reactant = "Dilithium"
|
||||
secondary_reactant = "Obdurium"
|
||||
energy_consumption = 1
|
||||
energy_production = 1
|
||||
radiation = 3
|
||||
products = list("Deuterium" = 1, "Dilithium" = 1)
|
||||
|
||||
datum/fusion_reaction/dilithium_solonium
|
||||
primary_reactant = "Dilithium"
|
||||
secondary_reactant = "Solonium"
|
||||
energy_consumption = 1
|
||||
energy_production = 1
|
||||
radiation = 3
|
||||
products = list("Tritium" = 1, "Dilithium" = 1)
|
||||
|
||||
//Breeder Inhibitor Reactions
|
||||
|
||||
datum/fusion_reaction/stravium7_dilithium
|
||||
primary_reactant = "Stravium-7"
|
||||
secondary_reactant = "Dilithium"
|
||||
energy_consumption = 2
|
||||
energy_production = 1
|
||||
radiation = 4
|
||||
|
||||
//Enhanced Breeder Reactions
|
||||
|
||||
datum/fusion_reaction/trilithium_obdurium
|
||||
primary_reactant = "Trilithium"
|
||||
secondary_reactant = "Obdurium"
|
||||
energy_consumption = 1
|
||||
energy_production = 2
|
||||
radiation = 5
|
||||
products = list("Dilithium" = 1, "Trilithium" = 1, "Deuterium" = 1)
|
||||
|
||||
datum/fusion_reaction/trilithium_solonium
|
||||
primary_reactant = "Trilithium"
|
||||
secondary_reactant = "Solonium"
|
||||
energy_consumption = 1
|
||||
energy_production = 2
|
||||
radiation = 5
|
||||
products = list("Dilithium" = 1, "Trilithium" = 1, "Tritium" = 1)
|
||||
|
||||
//Control Reactions
|
||||
|
||||
datum/fusion_reaction/pergium_deuterium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Deuterium"
|
||||
energy_consumption = 5
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
|
||||
datum/fusion_reaction/pergium_tritium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Tritium"
|
||||
energy_consumption = 5
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
|
||||
datum/fusion_reaction/pergium_obdurium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Obdurium"
|
||||
energy_consumption = 5
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
|
||||
datum/fusion_reaction/pergium_solonium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Solonium"
|
||||
energy_consumption = 5
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
@@ -1,186 +0,0 @@
|
||||
|
||||
//high frequency photon (laser beam)
|
||||
/obj/item/projectile/beam/ehf_beam
|
||||
|
||||
/obj/machinery/rust/gyrotron
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "emitter-off"
|
||||
name = "Gyrotron"
|
||||
anchored = 1
|
||||
density = 0
|
||||
layer = 4
|
||||
var/frequency = 1
|
||||
var/emitting = 0
|
||||
var/rate = 10
|
||||
var/mega_energy = 0.001
|
||||
var/on = 1
|
||||
var/remoteenabled = 1
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
|
||||
New()
|
||||
..()
|
||||
//pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
||||
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=gyro_monitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["modifypower"] )
|
||||
var/new_val = text2num(input("Enter new emission power level (0.001 - 0.01)", "Modifying power level (MeV)", mega_energy))
|
||||
if(!new_val)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_val = min(new_val,0.01)
|
||||
new_val = max(new_val,0.001)
|
||||
mega_energy = new_val
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["modifyrate"] )
|
||||
var/new_val = text2num(input("Enter new emission rate (1 - 10)", "Modifying emission rate (sec)", rate))
|
||||
if(!new_val)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_val = min(new_val,1)
|
||||
new_val = max(new_val,10)
|
||||
rate = new_val
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["modifyfreq"] )
|
||||
var/new_val = text2num(input("Enter new emission frequency (1 - 50000)", "Modifying emission frequency (GHz)", frequency))
|
||||
if(!new_val)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_val = min(new_val,1)
|
||||
new_val = max(new_val,50000)
|
||||
frequency = new_val
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["activate"] )
|
||||
emitting = 1
|
||||
spawn(rate)
|
||||
Emit()
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["deactivate"] )
|
||||
emitting = 0
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["enableremote"] )
|
||||
remoteenabled = 1
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
if( href_list["disableremote"] )
|
||||
remoteenabled = 0
|
||||
for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25))
|
||||
comp.updateDialog()
|
||||
return
|
||||
/*
|
||||
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
|
||||
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
|
||||
if(prob(35))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
A.dir = src.dir
|
||||
if(src.dir == 1)//Up
|
||||
A.yo = 20
|
||||
A.xo = 0
|
||||
else if(src.dir == 2)//Down
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
else if(src.dir == 4)//Right
|
||||
A.yo = 0
|
||||
A.xo = 20
|
||||
else if(src.dir == 8)//Left
|
||||
A.yo = 0
|
||||
A.xo = -20
|
||||
else // Any other
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
A.fired()
|
||||
*/
|
||||
proc/Emit()
|
||||
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
|
||||
A.frequency = frequency
|
||||
A.damage = mega_energy * 500
|
||||
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
|
||||
use_power(100 * mega_energy + 500)
|
||||
/*if(prob(35))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()*/
|
||||
A.dir = src.dir
|
||||
if(src.dir == 1)//Up
|
||||
A.yo = 20
|
||||
A.xo = 0
|
||||
else if(src.dir == 2)//Down
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
else if(src.dir == 4)//Right
|
||||
A.yo = 0
|
||||
A.xo = 20
|
||||
else if(src.dir == 8)//Left
|
||||
A.yo = 0
|
||||
A.xo = -20
|
||||
else // Any other
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
A.process()
|
||||
//
|
||||
flick("emitter-active",src)
|
||||
if(emitting)
|
||||
spawn(rate)
|
||||
Emit()
|
||||
|
||||
proc/UpdateIcon()
|
||||
if(on)
|
||||
icon_state = "emitter-on"
|
||||
else
|
||||
icon_state = "emitter-off"
|
||||
|
||||
/obj/machinery/rust/gyrotron/control_panel
|
||||
icon_state = "control_panel"
|
||||
name = "Control panel"
|
||||
var/obj/machinery/rust/gyrotron/owned_gyrotron
|
||||
New()
|
||||
..()
|
||||
pixel_x = -pixel_x
|
||||
pixel_y = -pixel_y
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=gyro_monitor")
|
||||
return
|
||||
var/t = "<B>Free electron MASER (Gyrotron) Control Panel</B><BR>"
|
||||
if(owned_gyrotron && owned_gyrotron.on)
|
||||
t += "<font color=green>Gyrotron operational</font><br>"
|
||||
t += "Operational mode: <font color=blue>"
|
||||
if(owned_gyrotron.emitting)
|
||||
t += "Emitting</font> <a href='?src=\ref[owned_gyrotron];deactivate=1'>\[Deactivate\]</a><br>"
|
||||
else
|
||||
t += "Not emitting</font> <a href='?src=\ref[owned_gyrotron];activate=1'>\[Activate\]</a><br>"
|
||||
t += "Emission rate: [owned_gyrotron.rate] <a href='?src=\ref[owned_gyrotron];modifyrate=1'>\[Modify\]</a><br>"
|
||||
t += "Beam frequency: [owned_gyrotron.frequency] <a href='?src=\ref[owned_gyrotron];modifyfreq=1'>\[Modify\]</a><br>"
|
||||
t += "Beam power: [owned_gyrotron.mega_energy] <a href='?src=\ref[owned_gyrotron];modifypower=1'>\[Modify\]</a><br>"
|
||||
else
|
||||
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=gyro_monitor;size=500x800")
|
||||
user.machine = src
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/rust_gyrotron_controller
|
||||
name = "Gyrotron Remote Controller"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "engine"
|
||||
var/updating = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=gyrotron_controller")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["target"] )
|
||||
var/obj/machinery/rust/gyrotron/gyro = locate(href_list["target"])
|
||||
gyro.Topic(href, href_list)
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(updating)
|
||||
src.updateDialog()
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=gyrotron_controller")
|
||||
return
|
||||
var/t = "<B>Gyrotron Remote Control Console</B><BR>"
|
||||
t += "<hr>"
|
||||
for(var/obj/machinery/rust/gyrotron/gyro in world)
|
||||
if(gyro.remoteenabled && gyro.on)
|
||||
t += "<font color=green>Gyrotron operational</font><br>"
|
||||
t += "Operational mode: <font color=blue>"
|
||||
if(gyro.emitting)
|
||||
t += "Emitting</font> <a href='?src=\ref[gyro];deactivate=1'>\[Deactivate\]</a><br>"
|
||||
else
|
||||
t += "Not emitting</font> <a href='?src=\ref[gyro];activate=1'>\[Activate\]</a><br>"
|
||||
t += "Emission rate: [gyro.rate] <a href='?src=\ref[gyro];modifyrate=1'>\[Modify\]</a><br>"
|
||||
t += "Beam frequency: [gyro.frequency] <a href='?src=\ref[gyro];modifyfreq=1'>\[Modify\]</a><br>"
|
||||
t += "Beam power: [gyro.mega_energy] <a href='?src=\ref[gyro];modifypower=1'>\[Modify\]</a><br>"
|
||||
else
|
||||
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
|
||||
t += "<hr>"
|
||||
/*
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
t += "Current fuel injection stage: [active_stage]<br>"
|
||||
if(active_stage == "Cooling")
|
||||
//t += "<a href='?src=\ref[src];restart=1;'>Restart injection cycle</a><br>"
|
||||
t += "----<br>"
|
||||
else
|
||||
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
|
||||
t += "Fuel depletion announcement: "
|
||||
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
|
||||
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
|
||||
t += "Stage progression announcement: "
|
||||
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
|
||||
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
|
||||
t += "<hr>"
|
||||
t += "<table border=1><tr>"
|
||||
t += "<td><b>Injector Status</b></td>"
|
||||
t += "<td><b>Injection interval (sec)</b></td>"
|
||||
t += "<td><b>Assembly consumption per injection</b></td>"
|
||||
t += "<td><b>Fuel Assembly Port</b></td>"
|
||||
t += "<td><b>Assembly depletion percentage</b></td>"
|
||||
t += "</tr>"
|
||||
for(var/stage in fuel_injectors)
|
||||
var/list/cur_stage = fuel_injectors[stage]
|
||||
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> <font color=blue>[stage]</font> [active_stage == stage ? "<font color=green> (Currently active)</font>" : "<a href='?src=\ref[src];beginstage=[stage]'>Activate</a>"]</td></tr>"
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
|
||||
t += "<tr>"
|
||||
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
|
||||
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
|
||||
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
*/
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=gyrotron_controller;size=500x400")
|
||||
user.machine = src
|
||||
@@ -1,74 +0,0 @@
|
||||
|
||||
/obj/machinery/rust/rad_source
|
||||
var/mega_energy = 0
|
||||
var/time_alive = 0
|
||||
var/source_alive = 2
|
||||
New()
|
||||
..()
|
||||
|
||||
process()
|
||||
..()
|
||||
//fade away over time
|
||||
if(source_alive > 0)
|
||||
time_alive++
|
||||
source_alive--
|
||||
else
|
||||
time_alive -= 0.1
|
||||
if(time_alive < 0)
|
||||
del(src)
|
||||
|
||||
//radiate mobs nearby here
|
||||
//
|
||||
|
||||
/*
|
||||
/obj/machinery/rust
|
||||
proc/RadiateParticle(var/energy, var/ionizing, var/dir = 0)
|
||||
if(!dir)
|
||||
RadiateParticleRand(energy, ionizing)
|
||||
var/obj/effect/accelerated_particle/particle = new
|
||||
particle.dir = dir
|
||||
particle.ionizing = ionizing
|
||||
if(energy)
|
||||
particle.energy = energy
|
||||
//particle.invisibility = 2
|
||||
//
|
||||
return particle
|
||||
|
||||
proc/RadiateParticleRand(var/energy, var/ionizing)
|
||||
var/turf/target
|
||||
var/particle_range = 3 * round(energy) + rand(3,20)
|
||||
if(energy > 1)
|
||||
//for penetrating radiation
|
||||
for(var/mob/M in range(particle_range))
|
||||
var/dist_ratio = particle_range / get_dist(M, src)
|
||||
//particles are more likely to hit a person if the person is closer
|
||||
// 1/8 = 12.5% (closest)
|
||||
// 1/360 = 0.27% (furthest)
|
||||
// variation of 12.2%
|
||||
if( rand() < (0.25 + dist_ratio * 12.5) )
|
||||
target = get_turf(M)
|
||||
break
|
||||
if(!target)
|
||||
target = pick(range(particle_range))
|
||||
else
|
||||
//for slower, non-penetrating radiation
|
||||
for(var/mob/M in view(particle_range))
|
||||
var/dist_ratio = particle_range / get_dist(M, src)
|
||||
if( rand() < (0.25 + dist_ratio * 12.5) )
|
||||
target = get_turf(M)
|
||||
break
|
||||
if(!target)
|
||||
target = pick(view(particle_range))
|
||||
var/obj/effect/accelerated_particle/particle = new
|
||||
particle.target = target
|
||||
particle.ionizing = ionizing
|
||||
if(energy)
|
||||
particle.energy = energy
|
||||
//particle.invisibility = 2
|
||||
//
|
||||
return particle
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/rust_radiation_monitor
|
||||
name = "Radiation Monitor"
|
||||
icon_state = "power"
|
||||
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 492 B |
@@ -1,53 +0,0 @@
|
||||
|
||||
//gimmicky hack to collect particles and direct them into the field
|
||||
/obj/effect/rust_particle_catcher
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
density = 0
|
||||
anchored = 1
|
||||
layer = 4
|
||||
var/obj/effect/rust_em_field/parent
|
||||
var/mysize = 0
|
||||
|
||||
invisibility = 101
|
||||
|
||||
/*/obj/effect/rust_particle_catcher/New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
|
||||
/obj/effect/rust_particle_catcher/process()
|
||||
if(!parent)
|
||||
del(src)
|
||||
|
||||
/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
mysize = newsize
|
||||
UpdateSize()
|
||||
|
||||
/obj/effect/rust_particle_catcher/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(parent && parent.size >= mysize)
|
||||
parent.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/effect/rust_particle_catcher/proc/UpdateSize()
|
||||
if(parent.size >= mysize)
|
||||
density = 1
|
||||
//invisibility = 0
|
||||
name = "collector [mysize] ON"
|
||||
else
|
||||
density = 0
|
||||
//invisibility = 101
|
||||
name = "collector [mysize] OFF"
|
||||
|
||||
/obj/effect/rust_particle_catcher/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && parent)
|
||||
parent.AddEnergy(Proj.damage * 20, 0, 1)
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
/obj/effect/rust_particle_catcher/Bumped(atom/AM)
|
||||
if(ismob(AM) && density && prob(10))
|
||||
AM << "\red A powerful force pushes you back."
|
||||
..()
|
||||
@@ -1,132 +0,0 @@
|
||||
//mostly replaced these with emitter code
|
||||
//they're functionally identical
|
||||
|
||||
/obj/machinery/computer/laser
|
||||
name = "Zero-point laser"
|
||||
desc = "A super-powerful laser"
|
||||
var/visible = 1
|
||||
var/state = 1.0
|
||||
//var/obj/beam/e_beam/first
|
||||
var/power = 500
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "laser"
|
||||
anchored = 1
|
||||
var/id
|
||||
var/on = 0
|
||||
var/freq = 50000
|
||||
var/phase = 0
|
||||
var/phase_variance = 0
|
||||
|
||||
/obj/machinery/computer/laser/process()
|
||||
/*if(on)
|
||||
if(!first)
|
||||
src.first = new /obj/beam/e_beam(src.loc)
|
||||
src.first.master = src
|
||||
src.first.dir = src.dir
|
||||
src.first.power = src.power
|
||||
src.first.freq = src.freq
|
||||
src.first.phase = src.phase
|
||||
src.first.phase_variance = src.phase_variance
|
||||
step(first, dir)
|
||||
if(first)
|
||||
src.first.updatebeam()
|
||||
else
|
||||
src.first.updatebeam()
|
||||
else
|
||||
if(first)
|
||||
del first*/
|
||||
|
||||
/obj/machinery/computer/laser/proc/setpower(var/powera)
|
||||
/*src.power = powera
|
||||
if(first)
|
||||
first.setpower(src.power)*/
|
||||
|
||||
/*
|
||||
/obj/beam/e_beam
|
||||
name = "Laser beam"
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "u_laser"
|
||||
var/obj/machinery/engine/laser/master = null
|
||||
var/obj/beam/e_beam/next = null
|
||||
var/power
|
||||
var/freq = 50000
|
||||
var/phase = 0
|
||||
var/phase_variance = 0
|
||||
anchored = 1
|
||||
|
||||
/obj/beam/e_beam/New()
|
||||
sd_SetLuminosity(1, 1, 4)
|
||||
|
||||
/obj/beam/e_beam/proc/updatebeam()
|
||||
if(!next)
|
||||
if(get_step(src.loc,src.dir))
|
||||
var/obj/beam/e_beam/e = new /obj/beam/e_beam(src.loc)
|
||||
e.dir = src.dir
|
||||
src.next = e
|
||||
e.master = src.master
|
||||
e.power = src.power
|
||||
e.phase = src.phase
|
||||
src.phase+=src.phase_variance
|
||||
e.freq = src.freq
|
||||
e.phase_variance = src.phase_variance
|
||||
if(src.loc.density == 0)
|
||||
for(var/atom/o in src.loc.contents)
|
||||
if(o.density || o == src.master || (ismob(o) && !istype(o, /mob/dead)) )
|
||||
o.laser_act(src)
|
||||
del src
|
||||
return
|
||||
else
|
||||
src.loc.laser_act(src)
|
||||
del e
|
||||
return
|
||||
step(e,e.dir)
|
||||
if(e)
|
||||
e.updatebeam()
|
||||
else
|
||||
next.updatebeam()
|
||||
|
||||
/atom/proc/laser_act(var/obj/beam/e_beam/b)
|
||||
return
|
||||
|
||||
/mob/living/carbon/laser_act(var/obj/beam/e_beam/b)
|
||||
for(var/t in organs)
|
||||
var/datum/organ/external/affecting = organs["[t]"]
|
||||
if (affecting.take_damage(0, b.power/400,0,0))
|
||||
UpdateDamageIcon()
|
||||
else
|
||||
UpdateDamage()
|
||||
|
||||
/obj/beam/e_beam/Bump(atom/Obstacle)
|
||||
Obstacle.laser_act(src)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/beam/e_beam/proc/setpower(var/powera)
|
||||
src.power = powera
|
||||
if(src.next)
|
||||
src.next.setpower(powera)
|
||||
|
||||
/obj/beam/e_beam/Bumped()
|
||||
src.hit()
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/Crossed(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/beam))
|
||||
return
|
||||
spawn( 0 )
|
||||
AM.laser_act(src)
|
||||
src.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/Destroy()
|
||||
if(next)
|
||||
del(next)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/beam/e_beam/proc/hit()
|
||||
del src
|
||||
return
|
||||
*/
|
||||
@@ -1,122 +0,0 @@
|
||||
//The laser control computer
|
||||
//Used to control the lasers
|
||||
/obj/machinery/computer/lasercon
|
||||
name = "Laser control computer"
|
||||
var/list/lasers = new/list
|
||||
icon_state = "atmos"
|
||||
var/id
|
||||
//var/advanced = 0
|
||||
|
||||
/obj/machinery/computer/lasercon
|
||||
New()
|
||||
spawn(1)
|
||||
for(var/obj/machinery/zero_point_emitter/las in world)
|
||||
if(las.id == src.id)
|
||||
lasers += las
|
||||
|
||||
process()
|
||||
..()
|
||||
updateDialog()
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=laser_control")
|
||||
return
|
||||
var/t = "<TT><B>Laser status monitor</B><HR>"
|
||||
for(var/obj/machinery/zero_point_emitter/laser in lasers)
|
||||
t += "Zero Point Laser<br>"
|
||||
t += "Power level: <A href = '?src=\ref[laser];input=-0.005'>-</A> <A href = '?src=\ref[laser];input=-0.001'>-</A> <A href = '?src=\ref[laser];input=-0.0005'>-</A> <A href = '?src=\ref[laser];input=-0.0001'>-</A> [laser.energy]MeV <A href = '?src=\ref[laser];input=0.0001'>+</A> <A href = '?src=\ref[laser];input=0.0005'>+</A> <A href = '?src=\ref[laser];input=0.001'>+</A> <A href = '?src=\ref[laser];input=0.005'>+</A><BR>"
|
||||
t += "Frequency: <A href = '?src=\ref[laser];freq=-10000'>-</A> <A href = '?src=\ref[laser];freq=-1000'>-</A> [laser.freq] <A href = '?src=\ref[laser];freq=1000'>+</A> <A href = '?src=\ref[laser];freq=10000'>+</A><BR>"
|
||||
t += "Output: [laser.active ? "<B>Online</B> <A href = '?src=\ref[laser];online=1'>Offline</A>" : "<A href = '?src=\ref[laser];online=1'>Online</A> <B>Offline</B> "]<BR>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=laser_control;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/lasercon/proc/interact(mob/user)
|
||||
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=powcomp")
|
||||
return
|
||||
|
||||
|
||||
user.machine = src
|
||||
var/t = "<TT><B>Laser status monitor</B><HR>"
|
||||
|
||||
var/obj/machinery/engine/laser/laser = src.laser[1]
|
||||
|
||||
if(!laser)
|
||||
t += "\red No laser found"
|
||||
else
|
||||
|
||||
|
||||
t += "Power level: <A href = '?src=\ref[src];input=-4'>-</A> <A href = '?src=\ref[src];input=-3'>-</A> <A href = '?src=\ref[src];input=-2'>-</A> <A href = '?src=\ref[src];input=-1'>-</A> [add_lspace(laser.power,5)] <A href = '?src=\ref[src];input=1'>+</A> <A href = '?src=\ref[src];input=2'>+</A> <A href = '?src=\ref[src];input=3'>+</A> <A href = '?src=\ref[src];input=4'>+</A><BR>"
|
||||
if(advanced)
|
||||
t += "Frequency: <A href = '?src=\ref[src];freq=-10000'>-</A> <A href = '?src=\ref[src];freq=-1000'>-</A> [add_lspace(laser.freq,5)] <A href = '?src=\ref[src];freq=1000'>+</A> <A href = '?src=\ref[src];freq=10000'>+</A><BR>"
|
||||
|
||||
t += "Output: [laser.on ? "<B>Online</B> <A href = '?src=\ref[src];online=1'>Offline</A>" : "<A href = '?src=\ref[src];online=1'>Online</A> <B>Offline</B> "]<BR>"
|
||||
|
||||
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A></TT>"
|
||||
|
||||
user << browse(t, "window=lascomp;size=420x700")
|
||||
onclose(user, "lascomp")
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/lasercon/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=laser_control")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
else if( href_list["input"] )
|
||||
var/i = text2num(href_list["input"])
|
||||
var/d = i
|
||||
for(var/obj/machinery/zero_point_emitter/laser in lasers)
|
||||
var/new_power = laser.energy + d
|
||||
new_power = max(new_power,0.0001) //lowest possible value
|
||||
new_power = min(new_power,0.01) //highest possible value
|
||||
laser.energy = new_power
|
||||
//
|
||||
src.updateDialog()
|
||||
else if( href_list["online"] )
|
||||
var/obj/machinery/zero_point_emitter/laser = href_list["online"]
|
||||
laser.active = !laser.active
|
||||
src.updateDialog()
|
||||
else if( href_list["freq"] )
|
||||
var/amt = text2num(href_list["freq"])
|
||||
for(var/obj/machinery/zero_point_emitter/laser in lasers)
|
||||
var/new_freq = laser.frequency + amt
|
||||
new_freq = max(new_freq,1) //lowest possible value
|
||||
new_freq = min(new_freq,20000) //highest possible value
|
||||
laser.frequency = new_freq
|
||||
//
|
||||
src.updateDialog()
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/lasercon/process()
|
||||
if(!(stat & (NOPOWER|BROKEN)) )
|
||||
use_power(250)
|
||||
|
||||
//src.updateDialog()
|
||||
*/
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/lasercon/power_change()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
*/
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,186 +0,0 @@
|
||||
#define NITROGEN_RETARDATION_FACTOR 12 //Higher == N2 slows reaction more
|
||||
#define THERMAL_RELEASE_MODIFIER 0.55 //Percentage of output power given to heat generation.
|
||||
|
||||
#define PLASMA_RELEASE_MODIFIER 0.24 //Percentage of output power given to plasma generation.
|
||||
#define PLASMA_CONVERSION_FACTOR 50 //How much energy per mole of plasma
|
||||
#define MAX_PLASMA_RELATIVE_INCREASE 0.3 //Percentage of current plasma amounts that can be added to preexisting plasma.
|
||||
|
||||
#define OXYGEN_RELEASE_MODIFIER 0.13 //Percentage of output power given to oxygen generation.
|
||||
#define OXYGEN_CONVERSION_FACTOR 150 //How much energy per mole of oxygen.
|
||||
#define MAX_OXYGEN_RELATIVE_INCREASE 0.2 //Percentage of current oxygen amounts that can be added to preexisting oxygen.
|
||||
|
||||
#define RADIATION_POWER_MODIFIER 0.03 //How much power goes to irradiating the area.
|
||||
#define RADIATION_FACTOR 10
|
||||
#define HALLUCINATION_POWER_MODIFIER 0.05 //How much power goes to hallucinations.
|
||||
#define HALLUCINATION_FACTOR 20
|
||||
|
||||
#define REACTION_POWER_MODIFIER 4 //Higher == more overall power
|
||||
|
||||
#define WARNING_DELAY 45 //45 seconds between warnings.
|
||||
|
||||
/obj/machinery/power/supermatter
|
||||
name = "Supermatter"
|
||||
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "darkmatter"
|
||||
density = 1
|
||||
anchored = 0
|
||||
|
||||
var/gasefficency = 0.25
|
||||
|
||||
var/base_icon_state = "darkmatter"
|
||||
|
||||
var/damage = 0
|
||||
var/damage_archived = 0
|
||||
var/safe_alert = "Crystaline hyperstructure returning to safe operating levels."
|
||||
var/warning_point = 100
|
||||
var/warning_alert = "Danger! Crystal hyperstructure instability!"
|
||||
var/emergency_point = 700
|
||||
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT"
|
||||
var/explosion_point = 1000
|
||||
|
||||
var/emergency_issued = 0
|
||||
|
||||
var/explosion_power = 8
|
||||
|
||||
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
|
||||
|
||||
var/power = 0
|
||||
|
||||
|
||||
shard //Small subtype, less efficient and more sensitive, but less boom.
|
||||
name = "Supermatter Shard"
|
||||
desc = "A strangely translucent and iridescent crystal. Looks like it used to be part of a larger structure. \red You get headaches just from looking at it."
|
||||
icon_state = "darkmatter_shard"
|
||||
base_icon_state = "darkmatter_shard"
|
||||
|
||||
warning_point = 50
|
||||
emergency_point = 500
|
||||
explosion_point = 900
|
||||
|
||||
gasefficency = 0.125
|
||||
|
||||
explosion_power = 3 //3,6,9,12? Or is that too small?
|
||||
|
||||
|
||||
process()
|
||||
|
||||
var/turf/L = loc
|
||||
|
||||
if(!istype(L)) //If we are not on a turf, uh oh.
|
||||
del src
|
||||
|
||||
//Ok, get the air from the turf
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
|
||||
//Remove gas from surrounding area
|
||||
var/datum/gas_mixture/removed = env.remove(gasefficency * env.total_moles)
|
||||
|
||||
if (!removed)
|
||||
return 1
|
||||
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
|
||||
|
||||
if(damage > emergency_point)
|
||||
//radioalert("states, \"[emergency_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
//radioalert("states, \"[warning_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday-150
|
||||
else // Phew, we're safe
|
||||
//radioalert("states, \"[safe_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
|
||||
if(damage > explosion_point)
|
||||
explosion(loc,explosion_power,explosion_power*2,explosion_power*3,explosion_power*4,1)
|
||||
del src
|
||||
|
||||
damage_archived = damage
|
||||
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
|
||||
|
||||
if(!removed.total_moles)
|
||||
damage += max((power-1600)/10,0)
|
||||
power = max(power,1600)
|
||||
return 1
|
||||
|
||||
var/nitrogen_mod = abs((removed.nitrogen / removed.total_moles)) * NITROGEN_RETARDATION_FACTOR
|
||||
var/oxygen = max(min(removed.oxygen / removed.total_moles - nitrogen_mod, 1), 0)
|
||||
|
||||
var/temp_factor = 0
|
||||
if(oxygen > 0.8)
|
||||
// with a perfect gas mix, make the power less based on heat
|
||||
temp_factor = 100
|
||||
icon_state = "[base_icon_state]_glow"
|
||||
else
|
||||
// in normal mode, base the produced energy around the heat
|
||||
temp_factor = 60
|
||||
icon_state = base_icon_state
|
||||
|
||||
//Calculate power released as heat and gas, in as the sqrt of the power.
|
||||
var/power_factor = (power/500) ** 3
|
||||
var/device_energy = oxygen * power_factor
|
||||
power = max(round((removed.temperature - T0C) / temp_factor) + power - power_factor, 0) //Total laser power plus an overload factor
|
||||
|
||||
//Final energy calcs.
|
||||
device_energy = max(device_energy * REACTION_POWER_MODIFIER,0)
|
||||
|
||||
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
|
||||
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
|
||||
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
|
||||
//Since the core is effectively "cold"
|
||||
|
||||
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
|
||||
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
|
||||
|
||||
var/plasma_energy = device_energy * PLASMA_RELEASE_MODIFIER
|
||||
var/oxygen_energy = device_energy * OXYGEN_RELEASE_MODIFIER
|
||||
var/other_energy = device_energy * (1- (OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
|
||||
//Put as much plasma out as is permitted.
|
||||
if( plasma_energy > removed.total_moles * PLASMA_CONVERSION_FACTOR * MAX_PLASMA_RELATIVE_INCREASE / gasefficency)
|
||||
removed.toxins += (MAX_PLASMA_RELATIVE_INCREASE * removed.total_moles / gasefficency)
|
||||
other_energy += plasma_energy - (removed.total_moles * PLASMA_CONVERSION_FACTOR * MAX_PLASMA_RELATIVE_INCREASE / gasefficency)
|
||||
else
|
||||
removed.toxins += plasma_energy/PLASMA_CONVERSION_FACTOR
|
||||
|
||||
//Put as much plasma out as is permitted.
|
||||
if( oxygen_energy > removed.total_moles * OXYGEN_CONVERSION_FACTOR * MAX_OXYGEN_RELATIVE_INCREASE / gasefficency)
|
||||
removed.oxygen += (MAX_OXYGEN_RELATIVE_INCREASE * removed.total_moles / gasefficency)
|
||||
other_energy += oxygen_energy - (removed.total_moles * OXYGEN_CONVERSION_FACTOR * MAX_OXYGEN_RELATIVE_INCREASE / gasefficency)
|
||||
else
|
||||
removed.oxygen += oxygen_energy/OXYGEN_CONVERSION_FACTOR
|
||||
|
||||
|
||||
var/heat_energy = (other_energy*THERMAL_RELEASE_MODIFIER)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
var/hallucination_energy = (other_energy*HALLUCINATION_POWER_MODIFIER*HALLUCINATION_FACTOR)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
var/rad_energy = (other_energy*RADIATION_POWER_MODIFIER*RADIATION_FACTOR)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
|
||||
var/heat_applied = max(heat_energy,0)
|
||||
if(heat_applied + removed.temperature > 800)
|
||||
removed.temperature = 800
|
||||
var/energy_to_reconsider = (heat_applied + removed.temperature - 800)
|
||||
hallucination_energy += (energy_to_reconsider*HALLUCINATION_POWER_MODIFIER)/(HALLUCINATION_POWER_MODIFIER+RADIATION_POWER_MODIFIER)
|
||||
rad_energy += (energy_to_reconsider*RADIATION_POWER_MODIFIER)/(HALLUCINATION_POWER_MODIFIER+RADIATION_POWER_MODIFIER)
|
||||
else
|
||||
removed.temperature += heat_applied
|
||||
|
||||
removed.update_values()
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
for(var/mob/living/carbon/human/l in view(src, round(hallucination_energy**0.25))) // you have to be seeing the core to get hallucinations
|
||||
if(prob(10) && !istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
l.hallucination += hallucination_energy/((get_dist(l,src)**2))
|
||||
|
||||
for(var/mob/living/l in range(src,round(rad_energy**0.25)))
|
||||
var/rads = rad_energy/((get_dist(l,src)**2))
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet")
|
||||
power += Proj.damage
|
||||
return 0
|
||||
@@ -1,236 +0,0 @@
|
||||
//new supermatter lasers
|
||||
|
||||
/obj/machinery/zero_point_emitter
|
||||
name = "Zero-point laser"
|
||||
desc = "A super-powerful laser"
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "laser"
|
||||
anchored = 0
|
||||
density = 1
|
||||
req_access = list(access_research)
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
|
||||
var/active = 0
|
||||
var/fire_delay = 100
|
||||
var/last_shot = 0
|
||||
var/shot_number = 0
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
|
||||
var/energy = 0.0001
|
||||
var/frequency = 1
|
||||
|
||||
var/freq = 50000
|
||||
var/id
|
||||
|
||||
/obj/machinery/zero_point_emitter/verb/rotate()
|
||||
set name = "Rotate"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
/obj/machinery/zero_point_emitter/New()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/zero_point_emitter/update_icon()
|
||||
if (active && !(stat & (NOPOWER|BROKEN)))
|
||||
icon_state = "laser"//"emitter_+a"
|
||||
else
|
||||
icon_state = "laser"//"emitter"
|
||||
|
||||
/obj/machinery/zero_point_emitter/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(state == 2)
|
||||
if(!src.locked)
|
||||
if(src.active==1)
|
||||
src.active = 0
|
||||
user << "You turn off the [src]."
|
||||
src.use_power = 1
|
||||
else
|
||||
src.active = 1
|
||||
user << "You turn on the [src]."
|
||||
src.shot_number = 0
|
||||
src.fire_delay = 100
|
||||
src.use_power = 2
|
||||
update_icon()
|
||||
else
|
||||
user << "\red The controls are locked!"
|
||||
else
|
||||
user << "\red The [src] needs to be firmly secured to the floor first."
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/zero_point_emitter/emp_act(var/severity)//Emitters are hardened but still might have issues
|
||||
use_power(1000)
|
||||
/* if((severity == 1)&&prob(1)&&prob(1))
|
||||
if(src.active)
|
||||
src.active = 0
|
||||
src.use_power = 1 */
|
||||
return 1
|
||||
|
||||
/obj/machinery/zero_point_emitter/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(src.state != 2)
|
||||
src.active = 0
|
||||
return
|
||||
if(((src.last_shot + src.fire_delay) <= world.time) && (src.active == 1))
|
||||
src.last_shot = world.time
|
||||
if(src.shot_number < 3)
|
||||
src.fire_delay = 2
|
||||
src.shot_number ++
|
||||
else
|
||||
src.fire_delay = rand(20,100)
|
||||
src.shot_number = 0
|
||||
use_power(1000)
|
||||
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
|
||||
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
|
||||
if(prob(35))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
A.dir = src.dir
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
A.yo = 20
|
||||
A.xo = 0
|
||||
if(EAST)
|
||||
A.yo = 0
|
||||
A.xo = 20
|
||||
if(WEST)
|
||||
A.yo = 0
|
||||
A.xo = -20
|
||||
else // Any other
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
A.process() //TODO: Carn: check this out
|
||||
|
||||
|
||||
/obj/machinery/zero_point_emitter/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
if(active)
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
user << "\red The controls can only be locked when the [src] is online"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/zero_point_emitter/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/zero_point_emitter/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["input"] )
|
||||
var/i = text2num(href_list["input"])
|
||||
var/d = i
|
||||
var/new_power = energy + d
|
||||
new_power = max(new_power,0.0001) //lowest possible value
|
||||
new_power = min(new_power,0.01) //highest possible value
|
||||
energy = new_power
|
||||
//
|
||||
for(var/obj/machinery/computer/lasercon/comp in world)
|
||||
if(comp.id == src.id)
|
||||
comp.updateDialog()
|
||||
else if( href_list["online"] )
|
||||
active = !active
|
||||
//
|
||||
for(var/obj/machinery/computer/lasercon/comp in world)
|
||||
if(comp.id == src.id)
|
||||
comp.updateDialog()
|
||||
else if( href_list["freq"] )
|
||||
var/amt = text2num(href_list["freq"])
|
||||
var/new_freq = frequency + amt
|
||||
new_freq = max(new_freq,1) //lowest possible value
|
||||
new_freq = min(new_freq,20000) //highest possible value
|
||||
frequency = new_freq
|
||||
//
|
||||
for(var/obj/machinery/computer/lasercon/comp in world)
|
||||
if(comp.id == src.id)
|
||||
comp.updateDialog()
|
||||
|
Before Width: | Height: | Size: 8.9 KiB |
@@ -1,261 +0,0 @@
|
||||
#define MISSILE_SPEED 5
|
||||
|
||||
//automated turret that shoots missiles at meteors
|
||||
|
||||
/obj/item/projectile/missile
|
||||
name = "missile"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/meteor_turret.dmi'
|
||||
icon_state = "missile"
|
||||
var/turf/target
|
||||
var/tracking = 0
|
||||
density = 1
|
||||
desc = "It's sparking and shaking slightly."
|
||||
|
||||
/obj/item/projectile/missile/process(var/turf/newtarget)
|
||||
target = newtarget
|
||||
dir = get_dir(src.loc, target)
|
||||
walk_towards(src, target, MISSILE_SPEED)
|
||||
|
||||
/obj/item/projectile/missile/Bump(atom/A)
|
||||
spawn(0)
|
||||
if(istype(A,/obj/effect/meteor))
|
||||
del(A)
|
||||
explode()
|
||||
return
|
||||
|
||||
/obj/item/projectile/missile/proc/explode()
|
||||
explosion(src.loc, 1, 1, 2, 7, 0)
|
||||
playsound(src.loc, "explosion", 50, 1)
|
||||
del(src)
|
||||
|
||||
/obj/item/projectile/missile/attack_hand(mob/user)
|
||||
..()
|
||||
return attackby(null, user)
|
||||
|
||||
/obj/item/projectile/missile/attackby(obj/item/weapon/W, mob/user)
|
||||
//can't touch this
|
||||
..()
|
||||
explode()
|
||||
|
||||
/obj/machinery/meteor_battery
|
||||
name = "meteor battery"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/meteor_turret.dmi'
|
||||
icon_state = "turret0"
|
||||
var/raised = 0
|
||||
var/enabled = 1
|
||||
anchored = 1
|
||||
layer = 3
|
||||
invisibility = 2
|
||||
density = 1
|
||||
var/health = 18
|
||||
var/id = ""
|
||||
var/obj/machinery/turretcover/cover = null
|
||||
var/popping = 0
|
||||
var/wasvalid = 0
|
||||
var/lastfired = 0
|
||||
var/shot_delay = 50
|
||||
var/datum/effect/effect/system/spark_spread/spark_system
|
||||
use_power = 1
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 300
|
||||
var/atom/movable/cur_target
|
||||
var/targeting_active = 0
|
||||
var/protect_range = 30
|
||||
var/tracking_missiles = 0
|
||||
var/list/fired_missiles
|
||||
|
||||
/obj/machinery/meteor_battery/New()
|
||||
spark_system = new /datum/effect/effect/system/spark_spread
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
fired_missiles = new/list()
|
||||
// targets = new
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/isPopping()
|
||||
return (popping!=0)
|
||||
|
||||
/obj/machinery/meteor_battery/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.enabled)
|
||||
icon_state = "turret1"
|
||||
else
|
||||
icon_state = "turret0"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "turret0"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/meteor_battery/proc/setState(var/enabled)
|
||||
src.enabled = enabled
|
||||
src.power_change()
|
||||
|
||||
/obj/machinery/meteor_battery/proc/get_new_target()
|
||||
var/list/new_targets = new
|
||||
var/new_target
|
||||
for(var/obj/effect/meteor/M in view(protect_range, get_turf(src)))
|
||||
new_targets += M
|
||||
if(new_targets.len)
|
||||
new_target = pick(new_targets)
|
||||
return new_target
|
||||
|
||||
/obj/machinery/meteor_battery/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(src.cover==null)
|
||||
src.cover = new /obj/machinery/turretcover(src.loc)
|
||||
src.cover.host = src
|
||||
if(!enabled)
|
||||
if(!isDown() && !isPopping())
|
||||
popDown()
|
||||
return
|
||||
|
||||
//update our missiles
|
||||
for(var/obj/item/projectile/missile/M in fired_missiles)
|
||||
if(!M)
|
||||
fired_missiles.Remove(M)
|
||||
continue
|
||||
if(tracking_missiles && cur_target)
|
||||
//update homing missile target
|
||||
M.target = get_turf(cur_target)
|
||||
walk_towards(M, M.target, MISSILE_SPEED)
|
||||
|
||||
if(get_turf(M) == M.target && M)
|
||||
//missile has arrived at destination
|
||||
fired_missiles.Remove(M)
|
||||
if( istype(get_turf(M), /turf/space) )
|
||||
//send the missile shooting off into the distance
|
||||
walk(M, get_dir(src,M), MISSILE_SPEED)
|
||||
spawn(rand(3,10) * 10)
|
||||
if(M)
|
||||
M.explode()
|
||||
else if(rand(3) == 3)
|
||||
//chance to blow up later (between 4 seconds and 2 minutes), or just sit there being ominous
|
||||
spawn(rand(4,120) * 10)
|
||||
M.explode()
|
||||
for(var/mob/P in view(7))
|
||||
P.visible_message("\red The missile skids to a halt, vibrating and sparking ominously!")
|
||||
|
||||
if(!cur_target)
|
||||
cur_target = get_new_target() //get new target
|
||||
|
||||
if(cur_target) //if it's found, proceed
|
||||
if(!isPopping())
|
||||
if(isDown())
|
||||
popUp()
|
||||
use_power = 2
|
||||
else
|
||||
spawn()
|
||||
if(!targeting_active)
|
||||
targeting_active = 1
|
||||
target()
|
||||
targeting_active = 0
|
||||
else if(!isPopping())//else, pop down
|
||||
if(!isDown())
|
||||
popDown()
|
||||
use_power = 1
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/target()
|
||||
while(src && enabled && !stat)
|
||||
src.dir = get_dir(src, cur_target)
|
||||
shootAt(cur_target)
|
||||
sleep(shot_delay)
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/proc/shootAt(var/atom/movable/target)
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/U = get_turf(target)
|
||||
if (!T || !U)
|
||||
return
|
||||
use_power(500)
|
||||
var/obj/item/projectile/missile/A = new(T)
|
||||
A.tracking = tracking_missiles
|
||||
fired_missiles.Add(A)
|
||||
spawn(0)
|
||||
A.process(U)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/meteor_battery/proc/isDown()
|
||||
return (invisibility!=0)
|
||||
|
||||
/obj/machinery/meteor_battery/proc/popUp()
|
||||
if ((!isPopping()) || src.popping==-1)
|
||||
invisibility = 0
|
||||
popping = 1
|
||||
if (src.cover!=null)
|
||||
flick("popup", src.cover)
|
||||
src.cover.icon_state = "openTurretCover"
|
||||
spawn(10)
|
||||
if (popping==1) popping = 0
|
||||
|
||||
/obj/machinery/meteor_battery/proc/popDown()
|
||||
if ((!isPopping()) || src.popping==1)
|
||||
popping = -1
|
||||
if (src.cover!=null)
|
||||
flick("popdown", src.cover)
|
||||
src.cover.icon_state = "turretCover"
|
||||
spawn(10)
|
||||
if (popping==-1)
|
||||
invisibility = 2
|
||||
popping = 0
|
||||
|
||||
/obj/machinery/meteor_battery/bullet_act(var/obj/item/projectile/Proj)
|
||||
src.health -= Proj.damage
|
||||
..()
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N
|
||||
..()
|
||||
playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1)
|
||||
src.spark_system.start()
|
||||
src.health -= W.force * 0.5
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
/obj/machinery/meteor_battery/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
enabled = 0
|
||||
power_change()
|
||||
..()
|
||||
|
||||
/obj/machinery/meteor_battery/ex_act(severity)
|
||||
if(severity < 3)
|
||||
src.die()
|
||||
|
||||
/obj/machinery/meteor_battery/proc/die()
|
||||
src.health = 0
|
||||
src.density = 0
|
||||
src.stat |= BROKEN
|
||||
src.icon_state = "broke"
|
||||
if (cover!=null)
|
||||
del(cover)
|
||||
sleep(3)
|
||||
flick("explosion", src)
|
||||
spawn(13)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/meteor_battery/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if(!(stat & BROKEN))
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
|
||||
src.health -= 15
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
else
|
||||
M << "\green That object is useless to you."
|
||||
return
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -1,262 +0,0 @@
|
||||
|
||||
//sculpture
|
||||
//SCP-173, nothing more need be said
|
||||
/mob/living/simple_animal/sculpture
|
||||
name = "\improper sculpture"
|
||||
real_name = "sculpture"
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. "
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/unknown.dmi'
|
||||
icon_state = "sculpture"
|
||||
icon_living = "sculpture"
|
||||
icon_dead = "sculpture"
|
||||
emote_hear = list("makes a faint scraping sound")
|
||||
emote_see = list("twitches slightly", "shivers")
|
||||
response_help = "touches the"
|
||||
response_disarm = "pushes the"
|
||||
response_harm = "hits the"
|
||||
var/obj/item/weapon/grab/G
|
||||
var/observed = 0
|
||||
var/allow_escape = 0 //set this to 1 for src to drop it's target next Life() call and try to escape
|
||||
var/hibernate = 0
|
||||
var/random_escape_chance = 0.5
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/GrabMob(var/mob/living/target)
|
||||
if(target && target != src && ishuman(target))
|
||||
G = new /obj/item/weapon/grab(src, target)
|
||||
G.loc=src
|
||||
target.grabbed_by += G
|
||||
G.synch()
|
||||
target.LAssailant = src
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red [src] has grabbed [target]!")
|
||||
target << "\red <b>You feel something suddenly grab you around the neck from behind!</b> Everything goes black..."
|
||||
|
||||
G.state = GRAB_KILL
|
||||
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. [G ? "\red The sculpture is holding [G.affecting] in a vice-like grip." : ""]"
|
||||
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been grabbed by SCP-173, and is being strangled!</font>")
|
||||
log_admin("[target] ([target.ckey]) has been grabbed and is being strangled by SCP-173.")
|
||||
message_admins("Alert: [target.real_name] has been grabbed and is being strangled by SCP-173.") //Set var/allow_escape = 1 to allow this player to escape temporarily, or var/hibernate = 1 to disable it entirely.
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/Escape()
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(50,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
src.dir = get_dir(src, target_turf)
|
||||
src.loc = target_turf
|
||||
|
||||
hibernate = 1
|
||||
spawn(rand(20,35) * 10)
|
||||
hibernate = 0
|
||||
|
||||
/mob/living/simple_animal/sculpture/Life()
|
||||
|
||||
observed = 0
|
||||
|
||||
//update the desc
|
||||
if(!G)
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid."
|
||||
|
||||
//if we are sent into forced hibernation mode, allow our victim to escape
|
||||
if(hibernate && G && G.state == GRAB_KILL)
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip due to hibernate!")
|
||||
G.state = GRAB_AGGRESSIVE
|
||||
return
|
||||
|
||||
//
|
||||
if(allow_escape)
|
||||
allow_escape = 0
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.state = GRAB_AGGRESSIVE
|
||||
if(!observed)
|
||||
Escape()
|
||||
observed = 1
|
||||
|
||||
//can't do anything in space at all
|
||||
if(istype(get_turf(src), /turf/space) || hibernate)
|
||||
return
|
||||
|
||||
// Grabbing
|
||||
if(G)
|
||||
G.process()
|
||||
|
||||
for(var/mob/living/M in view(7, src))
|
||||
if(M.stat || M == src)
|
||||
continue
|
||||
var/xdif = M.x - src.x
|
||||
var/ydif = M.y - src.y
|
||||
if(abs(xdif) < abs(ydif))
|
||||
//mob is either above or below src
|
||||
if(ydif < 0 && M.dir == NORTH)
|
||||
//mob is below src and looking up
|
||||
observed = 1
|
||||
break
|
||||
else if(ydif > 0 && M.dir == SOUTH)
|
||||
//mob is above src and looking down
|
||||
observed = 1
|
||||
break
|
||||
else if(abs(xdif) > abs(ydif))
|
||||
//mob is either left or right of src
|
||||
if(xdif < 0 && M.dir == EAST)
|
||||
//mob is to the left of src and looking right
|
||||
observed = 1
|
||||
break
|
||||
else if(xdif > 0 && M.dir == WEST)
|
||||
//mob is to the right of src and looking left
|
||||
observed = 1
|
||||
break
|
||||
else if (xdif == 0 && ydif == 0)
|
||||
//mob is on the same tile as src
|
||||
observed = 1
|
||||
break
|
||||
|
||||
//account for darkness
|
||||
var/turf/T = get_turf(src)
|
||||
var/in_darkness = 0
|
||||
if(T.luminosity == 0 && !istype(T, /turf/simulated))
|
||||
in_darkness = 1
|
||||
|
||||
//see if we're able to do stuff
|
||||
if(!observed || in_darkness)
|
||||
if(G)
|
||||
if(prob(1))
|
||||
//chance to allow the stranglee to escape
|
||||
allow_escape = 1
|
||||
if(G.affecting.stat == 2)
|
||||
del G
|
||||
else if(!G)
|
||||
//see if we're able to strangle anyone
|
||||
var/turf/myTurf = get_turf(src)
|
||||
for(var/mob/living/M in myTurf)
|
||||
GrabMob(M)
|
||||
if(G)
|
||||
break
|
||||
|
||||
//find out what mobs we can see
|
||||
var/list/incapacitated = list()
|
||||
var/list/conscious = list()
|
||||
for(var/mob/living/carbon/M in view(7, src))
|
||||
//this may not be quite the right test
|
||||
if(M == src)
|
||||
continue
|
||||
if(M.stat == 1)
|
||||
incapacitated.Add(M)
|
||||
else if(!M.stat)
|
||||
conscious.Add(M)
|
||||
|
||||
//pick the nearest valid conscious target
|
||||
var/mob/living/carbon/target_mob
|
||||
for(var/mob/living/carbon/M in conscious)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
|
||||
if(!target_mob)
|
||||
//get an unconscious mob
|
||||
for(var/mob/living/carbon/M in incapacitated)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
if(target_mob)
|
||||
var/turf/target_turf
|
||||
if(in_darkness)
|
||||
//move to right behind them
|
||||
target_turf = get_step(target_mob, src)
|
||||
else
|
||||
//move to them really really fast and knock them down
|
||||
target_turf = get_turf(target_mob)
|
||||
|
||||
//rampage along a path to get to them, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_mob)
|
||||
var/num_turfs = get_dist(src,target_mob)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.destroy()
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.dir = get_dir(src, target_mob)
|
||||
next_turf = get_step(src, get_dir(next_turf,target_mob))
|
||||
num_turfs--
|
||||
|
||||
//if we reached them, knock them down and start strangling them
|
||||
if(get_turf(src) == target_turf)
|
||||
target_mob.Stun(1)
|
||||
target_mob.Paralyse(1)
|
||||
GrabMob(target_mob)
|
||||
|
||||
//if we're not strangling anyone, take a stroll
|
||||
if(!G && prob(10))
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(7,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
|
||||
//rampage along a path to get to it, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_turf)
|
||||
var/num_turfs = get_dist(src,target_turf)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.destroy()
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.dir = get_dir(src, target_mob)
|
||||
next_turf = get_step(src, get_dir(next_turf,target_turf))
|
||||
num_turfs--
|
||||
|
||||
// else if(G)
|
||||
// //we can't move while observed, so we can't effectively strangle any more //since victim is observer this means no strangling
|
||||
// //our grip is still rock solid, but the victim has a chance to escape
|
||||
// G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
// visible_message("\red [src] suddenly loosens it's grip due to being observed!")
|
||||
// G.state = GRAB_AGGRESSIVE
|
||||
|
||||
/mob/living/simple_animal/sculpture/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bump(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bumped(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/ex_act(var/severity)
|
||||
//nothing
|
||||
|
Before Width: | Height: | Size: 950 B |
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
The overmap system allows adding new maps to the big 'galaxy' map.
|
||||
Idea is that new sectors can be added by just ticking in new maps and recompiling.
|
||||
Not real hot-plugging, but still pretty modular.
|
||||
It uses the fact that all ticked in .dme maps are melded together into one as different zlevels.
|
||||
Metaobjects are used to make it not affected by map order in .dme and carry some additional info.
|
||||
|
||||
*************************************************************
|
||||
Metaobject
|
||||
*************************************************************
|
||||
/obj/effect/mapinfo, sectors.dm
|
||||
Used to build overmap in beginning, has basic information needed to create overmap objects and make shuttles work.
|
||||
Its name and icon (if non-standard) vars will be applied to resulting overmap object.
|
||||
'mapy' and 'mapx' vars are optional, sector will be assigned random overmap coordinates if they are not set.
|
||||
Has two important vars:
|
||||
obj_type - type of overmap object it spawns. Could be overriden for custom overmap objects.
|
||||
landing_area - type of area used as inbound shuttle landing, null if no shuttle landing area.
|
||||
|
||||
Object could be placed anywhere on zlevel. Should only be placed on zlevel that should appear on overmap as a separate entitety.
|
||||
Right after creation it sends itself to nullspace and creates an overmap object, corresponding to this zlevel.
|
||||
|
||||
*************************************************************
|
||||
Overmap object
|
||||
*************************************************************
|
||||
/obj/effect/map, sectors.dm
|
||||
Represents a zlevel on the overmap. Spawned by metaobjects at the startup.
|
||||
var/area/shuttle/shuttle_landing - keeps a reference to the area of where inbound shuttles should land
|
||||
|
||||
-CanPass should be overriden for access restrictions
|
||||
-Crossed/Uncrossed can be overriden for applying custom effects.
|
||||
Remember to call ..() in children, it updates ship's current sector.
|
||||
|
||||
subtype /ship of this object represents spacefaring vessels.
|
||||
It has 'current_sector' var that keeps refernce to, well, sector ship currently in.
|
||||
|
||||
*************************************************************
|
||||
Helm console
|
||||
*************************************************************
|
||||
/obj/machinery/computer/helm, helm.dm
|
||||
On creation console seeks a ship overmap object corresponding to this zlevel and links it.
|
||||
Clicking with empty hand on it starts steering, Cancel-Camera-View stops it.
|
||||
Helm console relays movement of mob to the linked overmap object.
|
||||
Helm console currently has no interface. All travel happens instanceously too.
|
||||
Sector shuttles are not supported currently, only ship shuttles.
|
||||
|
||||
*************************************************************
|
||||
Exploration shuttle terminal
|
||||
*************************************************************
|
||||
A generic shuttle controller.
|
||||
Has a var landing_type defining type of area shuttle should be landing at.
|
||||
On initalizing, checks for a shuttle corresponding to this zlevel, and creates one if it's not there.
|
||||
Changes desitnation area depending on current sector ship is in.
|
||||
Currently updating is called in attack_hand(), until a better place is found.
|
||||
Currently no modifications were made to interface to display availability of landing area in sector.
|
||||
|
||||
|
||||
*************************************************************
|
||||
Guide to how make new sector
|
||||
*************************************************************
|
||||
0.Map
|
||||
Remember to define shuttle areas if you want sector be accessible via shuttles.
|
||||
Currently there are no other ways to reach sectors from ships.
|
||||
In examples, 4x6 shuttle area is used. In case of shuttle area being too big, it will apear in bottom left corner of it.
|
||||
|
||||
Remember to put a helm console and engine control console on ship maps.
|
||||
Ships need engines to move. Currently there are only thermal engines.
|
||||
Thermal engines are just a unary atmopheric machine, like a vent. They need high-pressure gas input to produce more thrust.
|
||||
|
||||
|
||||
1.Metaobject
|
||||
All vars needed for it to work could be set directly in map editor, so in most cases you won't have to define new in code.
|
||||
Remember to set landing_area var for sectors.
|
||||
|
||||
2.Overmap object
|
||||
If you need custom behaviour on entering/leaving this sector, or restricting access to it, you can define your custom map object.
|
||||
Remember to put this new type into spawn_type var of metaobject.
|
||||
|
||||
3.Shuttle console
|
||||
Remember to place one on the actual shuttle too, or it won't be able to return from sector without ship-side recall.
|
||||
Remember to set landing_type var to ship-side shuttle area type.
|
||||
shuttle_tag can be set to custom name (it shows up in console interface)
|
||||
|
||||
5.Engines
|
||||
Actual engines could be any type of machinery, as long as it creates a ship_engine datum for itself.
|
||||
|
||||
6.Tick map in and compile.
|
||||
Sector should appear on overmap (in random place if you didn't set mapx,mapy)
|
||||
|
||||
|
||||
TODO:
|
||||
more mechanics to moving ship:
|
||||
actually working engine objects
|
||||
unary atmospheric machinery
|
||||
give more thrust the more pressure gas has
|
||||
ships have mass var, which is used to caalculate how much acceleration those engines give
|
||||
better space travel / stragglers handling
|
||||
shuttle console:
|
||||
checking occupied pad or not with docking controllers
|
||||
?landing pad size detection
|
||||
non-zlevel overmap objects
|
||||
field generator
|
||||
meteor fields
|
||||
speed-based chance for a rock in the ship
|
||||
debris fields
|
||||
speed-based chance of
|
||||
debirs in the ship
|
||||
a drone
|
||||
EMP
|
||||
nebulaes
|
||||
*/
|
||||
@@ -1,35 +0,0 @@
|
||||
//Zlevel where overmap objects should be
|
||||
#define OVERMAP_ZLEVEL 1
|
||||
//How far from the edge of overmap zlevel could randomly placed objects spawn
|
||||
#define OVERMAP_EDGE 7
|
||||
|
||||
//list used to track which zlevels are being 'moved' by the proc below
|
||||
var/list/moving_levels = list()
|
||||
//Proc to 'move' stars in spess
|
||||
//yes it looks ugly, but it should only fire when state actually change.
|
||||
//null direction stops movement
|
||||
proc/toggle_move_stars(zlevel, direction)
|
||||
if(!zlevel)
|
||||
return
|
||||
|
||||
var/gen_dir = null
|
||||
if(direction & (NORTH|SOUTH))
|
||||
gen_dir += "ns"
|
||||
else if(direction & (EAST|WEST))
|
||||
gen_dir += "ew"
|
||||
if(!direction)
|
||||
gen_dir = null
|
||||
|
||||
if (moving_levels["zlevel"] != gen_dir)
|
||||
moving_levels["zlevel"] = gen_dir
|
||||
for(var/turf/space/S in world)
|
||||
if(S.z == zlevel)
|
||||
spawn(0)
|
||||
var/turf/T = S
|
||||
if(!gen_dir)
|
||||
T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]"
|
||||
else
|
||||
T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]"
|
||||
for(var/atom/movable/AM in T)
|
||||
if (!AM.anchored)
|
||||
AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1)
|
||||
@@ -1,95 +0,0 @@
|
||||
|
||||
//===================================================================================
|
||||
//Hook for building overmap
|
||||
//===================================================================================
|
||||
var/global/list/map_sectors = list()
|
||||
|
||||
/hook/startup/proc/build_map()
|
||||
accessable_z_levels = list() //no space travel with this system, at least not like this
|
||||
testing("Building overmap...")
|
||||
var/obj/effect/mapinfo/data
|
||||
for(var/level in 1 to world.maxz)
|
||||
data = locate("sector[level]")
|
||||
if (data)
|
||||
testing("Located sector \"[data.name]\" at [data.mapx],[data.mapy] corresponding to zlevel [level]")
|
||||
map_sectors["[level]"] = new data.obj_type(data)
|
||||
return 1
|
||||
|
||||
//===================================================================================
|
||||
//Metaobject for storing information about sector this zlevel is representing.
|
||||
//Should be placed only once on every zlevel.
|
||||
//===================================================================================
|
||||
/obj/effect/mapinfo/
|
||||
name = "map info metaobject"
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x2"
|
||||
invisibility = 101
|
||||
var/obj_type //type of overmap object it spawns
|
||||
var/landing_area //type of area used as inbound shuttle landing, null if no shuttle landing area
|
||||
var/zlevel
|
||||
var/mapx //coordinates on the
|
||||
var/mapy //overmap zlevel
|
||||
var/known = 1
|
||||
|
||||
/obj/effect/mapinfo/New()
|
||||
tag = "sector[z]"
|
||||
zlevel = z
|
||||
loc = null
|
||||
|
||||
/obj/effect/mapinfo/sector
|
||||
name = "generic sector"
|
||||
obj_type = /obj/effect/map/sector
|
||||
|
||||
/obj/effect/mapinfo/ship
|
||||
name = "generic ship"
|
||||
obj_type = /obj/effect/map/ship
|
||||
|
||||
|
||||
//===================================================================================
|
||||
//Overmap object representing zlevel
|
||||
//===================================================================================
|
||||
|
||||
/obj/effect/map
|
||||
name = "map object"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "sheet-plasteel"
|
||||
var/map_z = 0
|
||||
var/area/shuttle/shuttle_landing
|
||||
var/always_known = 1
|
||||
|
||||
/obj/effect/map/New(var/obj/effect/mapinfo/data)
|
||||
map_z = data.zlevel
|
||||
name = data.name
|
||||
always_known = data.known
|
||||
if (data.icon != 'icons/mob/screen1.dmi')
|
||||
icon = data.icon
|
||||
icon_state = data.icon_state
|
||||
if(data.desc)
|
||||
desc = data.desc
|
||||
var/new_x = data.mapx ? data.mapx : rand(OVERMAP_EDGE, world.maxx - OVERMAP_EDGE)
|
||||
var/new_y = data.mapy ? data.mapy : rand(OVERMAP_EDGE, world.maxy - OVERMAP_EDGE)
|
||||
loc = locate(new_x, new_y, OVERMAP_ZLEVEL)
|
||||
|
||||
if(data.landing_area)
|
||||
shuttle_landing = locate(data.landing_area)
|
||||
|
||||
/obj/effect/map/CanPass(atom/movable/A)
|
||||
testing("[A] attempts to enter sector\"[name]\"")
|
||||
return 1
|
||||
|
||||
/obj/effect/map/Crossed(atom/movable/A)
|
||||
testing("[A] has entered sector\"[name]\"")
|
||||
if (istype(A,/obj/effect/map/ship))
|
||||
var/obj/effect/map/ship/S = A
|
||||
S.current_sector = src
|
||||
|
||||
/obj/effect/map/Uncrossed(atom/movable/A)
|
||||
testing("[A] has left sector\"[name]\"")
|
||||
if (istype(A,/obj/effect/map/ship))
|
||||
var/obj/effect/map/ship/S = A
|
||||
S.current_sector = null
|
||||
|
||||
/obj/effect/map/sector
|
||||
name = "generic sector"
|
||||
desc = "Sector with some stuff in it."
|
||||
anchored = 1
|
||||
@@ -1,99 +0,0 @@
|
||||
//Engine control and monitoring console
|
||||
|
||||
/obj/machinery/computer/engines
|
||||
name = "engines control console"
|
||||
icon_state = "id"
|
||||
var/state = "status"
|
||||
var/list/engines = list()
|
||||
var/obj/effect/map/ship/linked
|
||||
|
||||
/obj/machinery/computer/engines/initialize()
|
||||
linked = map_sectors["[z]"]
|
||||
if (linked)
|
||||
if (!linked.eng_control)
|
||||
linked.eng_control = src
|
||||
testing("Engines console at level [z] found a corresponding overmap object '[linked.name]'.")
|
||||
else
|
||||
testing("Engines console at level [z] was unable to find a corresponding overmap object.")
|
||||
|
||||
for(var/datum/ship_engine/E in engines)
|
||||
if (E.zlevel == z && !(E in engines))
|
||||
engines += E
|
||||
|
||||
/obj/machinery/computer/engines/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
user.unset_machine()
|
||||
return
|
||||
|
||||
if(!isAI(user))
|
||||
user.set_machine(src)
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/engines/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!linked)
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
data["state"] = state
|
||||
|
||||
var/list/enginfo[0]
|
||||
for(var/datum/ship_engine/E in engines)
|
||||
var/list/rdata[0]
|
||||
rdata["eng_type"] = E.name
|
||||
rdata["eng_on"] = E.is_on()
|
||||
rdata["eng_thrust"] = E.get_thrust()
|
||||
rdata["eng_thrust_limiter"] = round(E.get_thrust_limit()*100)
|
||||
rdata["eng_status"] = E.get_status()
|
||||
rdata["eng_reference"] = "\ref[E]"
|
||||
enginfo.Add(list(rdata))
|
||||
|
||||
data["engines_info"] = enginfo
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "engines_control.tmpl", "[linked.name] Engines Control", 380, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/engines/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["state"])
|
||||
state = href_list["state"]
|
||||
|
||||
if(href_list["engine"])
|
||||
if(href_list["set_limit"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
var/newlim = input("Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
var/limit = Clamp(newlim/100, 0, 1)
|
||||
if(E)
|
||||
E.set_thrust_limit(limit)
|
||||
|
||||
if(href_list["limit"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
var/limit = Clamp(E.get_thrust_limit() + text2num(href_list["limit"]), 0, 1)
|
||||
if(E)
|
||||
E.set_thrust_limit(limit)
|
||||
|
||||
if(href_list["toggle"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
if(E)
|
||||
E.toggle()
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/engines/proc/burn()
|
||||
if(engines.len == 0)
|
||||
return 0
|
||||
var/res = 0
|
||||
for(var/datum/ship_engine/E in engines)
|
||||
res |= E.burn()
|
||||
return res
|
||||
|
||||
/obj/machinery/computer/engines/proc/get_total_thrust()
|
||||
for(var/datum/ship_engine/E in engines)
|
||||
. += E.get_thrust()
|
||||
@@ -1,174 +0,0 @@
|
||||
/obj/machinery/computer/helm
|
||||
name = "helm control console"
|
||||
icon_state = "id"
|
||||
var/state = "status"
|
||||
var/obj/effect/map/ship/linked //connected overmap object
|
||||
var/autopilot = 0
|
||||
var/manual_control = 0
|
||||
var/list/known_sectors = list()
|
||||
var/dx //desitnation
|
||||
var/dy //coordinates
|
||||
|
||||
/obj/machinery/computer/helm/initialize()
|
||||
linked = map_sectors["[z]"]
|
||||
if (linked)
|
||||
if(!linked.nav_control)
|
||||
linked.nav_control = src
|
||||
testing("Helm console at level [z] found a corresponding overmap object '[linked.name]'.")
|
||||
else
|
||||
testing("Helm console at level [z] was unable to find a corresponding overmap object.")
|
||||
|
||||
for(var/level in map_sectors)
|
||||
var/obj/effect/map/sector/S = map_sectors["[level]"]
|
||||
if (istype(S) && S.always_known)
|
||||
var/datum/data/record/R = new()
|
||||
R.fields["name"] = S.name
|
||||
R.fields["x"] = S.x
|
||||
R.fields["y"] = S.y
|
||||
known_sectors += R
|
||||
|
||||
/obj/machinery/computer/helm/process()
|
||||
..()
|
||||
if (autopilot && dx && dy)
|
||||
var/turf/T = locate(dx,dy,1)
|
||||
if(linked.loc == T)
|
||||
if(linked.is_still())
|
||||
autopilot = 0
|
||||
else
|
||||
linked.decelerate()
|
||||
|
||||
var/brake_path = linked.get_brake_path()
|
||||
|
||||
if(get_dist(linked.loc, T) > brake_path)
|
||||
linked.accelerate(get_dir(linked.loc, T))
|
||||
else
|
||||
linked.decelerate()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/helm/relaymove(var/mob/user, direction)
|
||||
if(manual_control && linked)
|
||||
linked.relaymove(user,direction)
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/helm/check_eye(var/mob/user as mob)
|
||||
if (!manual_control)
|
||||
return null
|
||||
if (!get_dist(user, src) > 1 || user.blinded || !linked )
|
||||
return null
|
||||
user.reset_view(linked)
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/helm/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
user.unset_machine()
|
||||
manual_control = 0
|
||||
return
|
||||
|
||||
if(!isAI(user))
|
||||
user.set_machine(src)
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/helm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!linked)
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
data["state"] = state
|
||||
|
||||
data["sector"] = linked.current_sector ? linked.current_sector.name : "Deep Space"
|
||||
data["sector_info"] = linked.current_sector ? linked.current_sector.desc : "Not Available"
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["dest"] = dy && dx
|
||||
data["d_x"] = dx
|
||||
data["d_y"] = dy
|
||||
data["speed"] = linked.get_speed()
|
||||
data["accel"] = round(linked.get_acceleration())
|
||||
data["heading"] = linked.get_heading() ? dir2angle(linked.get_heading()) : 0
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = manual_control
|
||||
|
||||
var/list/locations[0]
|
||||
for (var/datum/data/record/R in known_sectors)
|
||||
var/list/rdata[0]
|
||||
rdata["name"] = R.fields["name"]
|
||||
rdata["x"] = R.fields["x"]
|
||||
rdata["y"] = R.fields["y"]
|
||||
rdata["reference"] = "\ref[R]"
|
||||
locations.Add(list(rdata))
|
||||
|
||||
data["locations"] = locations
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "helm.tmpl", "[linked.name] Helm Control", 380, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/helm/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if (!linked)
|
||||
return
|
||||
|
||||
if (href_list["add"])
|
||||
var/datum/data/record/R = new()
|
||||
var/sec_name = input("Input naviation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
|
||||
if(!sec_name)
|
||||
sec_name = "Sector #[known_sectors.len]"
|
||||
R.fields["name"] = sec_name
|
||||
switch(href_list["add"])
|
||||
if("current")
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
R.fields["x"] = Clamp(newx, 1, world.maxx)
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
R.fields["y"] = Clamp(newy, 1, world.maxy)
|
||||
known_sectors += R
|
||||
|
||||
if (href_list["remove"])
|
||||
var/datum/data/record/R = locate(href_list["remove"])
|
||||
known_sectors.Remove(R)
|
||||
|
||||
if (href_list["setx"])
|
||||
var/newx = input("Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
if (newx)
|
||||
dx = Clamp(newx, 1, world.maxx)
|
||||
|
||||
if (href_list["sety"])
|
||||
var/newy = input("Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
if (newy)
|
||||
dy = Clamp(newy, 1, world.maxy)
|
||||
|
||||
if (href_list["x"] && href_list["y"])
|
||||
dx = text2num(href_list["x"])
|
||||
dy = text2num(href_list["y"])
|
||||
|
||||
if (href_list["reset"])
|
||||
dx = 0
|
||||
dy = 0
|
||||
|
||||
if (href_list["move"])
|
||||
var/ndir = text2num(href_list["move"])
|
||||
linked.relaymove(usr, ndir)
|
||||
|
||||
if (href_list["brake"])
|
||||
linked.decelerate()
|
||||
|
||||
if (href_list["apilot"])
|
||||
autopilot = !autopilot
|
||||
|
||||
if (href_list["manual"])
|
||||
manual_control = !manual_control
|
||||
|
||||
if (href_list["state"])
|
||||
state = href_list["state"]
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
//Shuttle controller computer for shuttles going between sectors
|
||||
/datum/shuttle/ferry/var/range = 0 //how many overmap tiles can shuttle go, for picking destinatiosn and returning.
|
||||
/obj/machinery/computer/shuttle_control/explore
|
||||
name = "exploration shuttle console"
|
||||
shuttle_tag = "Exploration"
|
||||
req_access = list()
|
||||
var/landing_type //area for shuttle ship-side
|
||||
var/obj/effect/map/destination //current destination
|
||||
var/obj/effect/map/home //current destination
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/initialize()
|
||||
..()
|
||||
home = map_sectors["[z]"]
|
||||
shuttle_tag = "[shuttle_tag]-[z]"
|
||||
if(!shuttle_controller.shuttles[shuttle_tag])
|
||||
var/datum/shuttle/ferry/shuttle = new()
|
||||
shuttle.warmup_time = 10
|
||||
shuttle.area_station = locate(landing_type)
|
||||
shuttle.area_offsite = shuttle.area_station
|
||||
shuttle_controller.shuttles[shuttle_tag] = shuttle
|
||||
shuttle_controller.process_shuttles += shuttle
|
||||
testing("Exploration shuttle '[shuttle_tag]' at zlevel [z] successfully added.")
|
||||
|
||||
//Sets destination to new sector. Can be null.
|
||||
/obj/machinery/computer/shuttle_control/explore/proc/update_destination(var/obj/effect/map/D)
|
||||
destination = D
|
||||
if(destination && shuttle_controller.shuttles[shuttle_tag])
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
shuttle.area_offsite = destination.shuttle_landing
|
||||
testing("Shuttle controller [shuttle_tag] now sends shuttle to [destination]")
|
||||
shuttle_controller.shuttles[shuttle_tag] = shuttle
|
||||
|
||||
//Gets all sectors with landing zones in shuttle's range
|
||||
/obj/machinery/computer/shuttle_control/explore/proc/get_possible_destinations()
|
||||
var/list/res = list()
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
for (var/obj/effect/map/S in orange(shuttle.range, home))
|
||||
if(S.shuttle_landing)
|
||||
res += S
|
||||
return res
|
||||
|
||||
//Checks if current destination is still reachable
|
||||
/obj/machinery/computer/shuttle_control/explore/proc/check_destination()
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
return shuttle && destination && get_dist(home, destination) <= shuttle.range
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
//If we are already there, or can't reach place anymore, reset destination
|
||||
if(!shuttle.location && !check_destination())
|
||||
destination = null
|
||||
|
||||
//check if shuttle can fly at all
|
||||
var/can_go = !isnull(destination)
|
||||
var/current_destination = destination ? destination.name : "None"
|
||||
//shuttle doesn't need destination set to return home, as long as it's in range.
|
||||
if(shuttle.location)
|
||||
current_destination = "Return"
|
||||
var/area/offsite = shuttle.area_offsite
|
||||
var/obj/effect/map/cur_loc = map_sectors["[offsite.z]"]
|
||||
can_go = (get_dist(home,cur_loc) <= shuttle.range)
|
||||
|
||||
//disable picking locations if there are none, or shuttle is already off-site
|
||||
var/list/possible_d = get_possible_destinations()
|
||||
var/can_pick = !shuttle.location && possible_d.len
|
||||
|
||||
var/shuttle_state
|
||||
switch(shuttle.moving_status)
|
||||
if(SHUTTLE_IDLE) shuttle_state = "idle"
|
||||
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
|
||||
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
|
||||
|
||||
var/shuttle_status
|
||||
switch (shuttle.process_state)
|
||||
if(IDLE_STATE)
|
||||
if (shuttle.in_use)
|
||||
shuttle_status = "Busy."
|
||||
else if (!shuttle.location)
|
||||
shuttle_status = "Standing-by at station."
|
||||
else
|
||||
shuttle_status = "Standing-by at offsite location."
|
||||
if(WAIT_LAUNCH)
|
||||
shuttle_status = "Shuttle has recieved command and will depart shortly."
|
||||
if(WAIT_ARRIVE)
|
||||
shuttle_status = "Proceeding to destination."
|
||||
if(WAIT_FINISH)
|
||||
shuttle_status = "Arriving at destination now."
|
||||
|
||||
data = list(
|
||||
"destination_name" = current_destination,
|
||||
"can_pick" = can_pick,
|
||||
"shuttle_status" = shuttle_status,
|
||||
"shuttle_state" = shuttle_state,
|
||||
"has_docking" = shuttle.docking_controller? 1 : 0,
|
||||
"docking_status" = shuttle.docking_controller? shuttle.docking_controller.get_docking_status() : null,
|
||||
"docking_override" = shuttle.docking_controller? shuttle.docking_controller.override_enabled : null,
|
||||
"can_launch" = can_go && shuttle.can_launch(),
|
||||
"can_cancel" = can_go && shuttle.can_cancel(),
|
||||
"can_force" = can_go && shuttle.can_force(),
|
||||
)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "shuttle_control_console_exploration.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
if(href_list["pick"])
|
||||
var/obj/effect/map/self = map_sectors["[z]"]
|
||||
if(self)
|
||||
var/list/possible_d = get_possible_destinations()
|
||||
var/obj/effect/map/D
|
||||
if(possible_d.len)
|
||||
D = input("Choose shuttle destination", "Shuttle Destination") as null|anything in possible_d
|
||||
update_destination(D)
|
||||
|
||||
if(href_list["move"])
|
||||
shuttle.launch(src)
|
||||
if(href_list["force"])
|
||||
shuttle.force_launch(src)
|
||||
else if(href_list["cancel"])
|
||||
shuttle.cancel_launch(src)
|
||||
@@ -1,60 +0,0 @@
|
||||
//Engine component object
|
||||
|
||||
var/list/ship_engines = list()
|
||||
/datum/ship_engine
|
||||
var/name = "ship engine"
|
||||
var/obj/machinery/engine //actual engine object
|
||||
var/zlevel = 0
|
||||
|
||||
/datum/ship_engine/New(var/obj/machinery/holder)
|
||||
engine = holder
|
||||
zlevel = holder.z
|
||||
for(var/obj/machinery/computer/engines/E in machines)
|
||||
if (E.z == zlevel && !(src in E.engines))
|
||||
E.engines += src
|
||||
break
|
||||
|
||||
//Tries to fire the engine. If successfull, returns 1
|
||||
/datum/ship_engine/proc/burn()
|
||||
if(!engine)
|
||||
die()
|
||||
return 1
|
||||
|
||||
//Returns status string for this engine
|
||||
/datum/ship_engine/proc/get_status()
|
||||
if(!engine)
|
||||
die()
|
||||
return "All systems nominal"
|
||||
|
||||
/datum/ship_engine/proc/get_thrust()
|
||||
if(!engine)
|
||||
die()
|
||||
return 100
|
||||
|
||||
//Sets thrust limiter, a number between 0 and 1
|
||||
/datum/ship_engine/proc/set_thrust_limit(var/new_limit)
|
||||
if(!engine)
|
||||
die()
|
||||
return 1
|
||||
|
||||
/datum/ship_engine/proc/get_thrust_limit()
|
||||
if(!engine)
|
||||
die()
|
||||
return 1
|
||||
|
||||
/datum/ship_engine/proc/is_on()
|
||||
if(!engine)
|
||||
die()
|
||||
return 1
|
||||
|
||||
/datum/ship_engine/proc/toggle()
|
||||
if(!engine)
|
||||
die()
|
||||
return 1
|
||||
|
||||
/datum/ship_engine/proc/die()
|
||||
for(var/obj/machinery/computer/engines/E in machines)
|
||||
if (E.z == zlevel)
|
||||
E.engines -= src
|
||||
break
|
||||
del(src)
|
||||
@@ -1,99 +0,0 @@
|
||||
//Thermal nozzle engine
|
||||
/datum/ship_engine/thermal
|
||||
name = "thermal engine"
|
||||
|
||||
/datum/ship_engine/thermal/get_status()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
return "Fuel pressure: [E.air_contents.return_pressure()]"
|
||||
|
||||
/datum/ship_engine/thermal/get_thrust()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
if(!is_on())
|
||||
return 0
|
||||
var/pressurized_coef = E.air_contents.return_pressure()/E.effective_pressure
|
||||
return round(E.thrust_limit * E.nominal_thrust * pressurized_coef)
|
||||
|
||||
/datum/ship_engine/thermal/burn()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
return E.burn()
|
||||
|
||||
/datum/ship_engine/thermal/set_thrust_limit(var/new_limit)
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
E.thrust_limit = new_limit
|
||||
|
||||
/datum/ship_engine/thermal/get_thrust_limit()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
return E.thrust_limit
|
||||
|
||||
/datum/ship_engine/thermal/is_on()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
return E.on
|
||||
|
||||
/datum/ship_engine/thermal/toggle()
|
||||
..()
|
||||
var/obj/machinery/atmospherics/unary/engine/E = engine
|
||||
E.on = !E.on
|
||||
|
||||
//Actual thermal nozzle engine object
|
||||
|
||||
/obj/machinery/atmospherics/unary/engine
|
||||
name = "engine nozzle"
|
||||
desc = "Simple thermal nozzle, uses heated gast to propell the ship."
|
||||
icon = 'icons/obj/ship_engine.dmi'
|
||||
icon_state = "nozzle"
|
||||
var/on = 1
|
||||
var/thrust_limit = 1 //Value between 1 and 0 to limit the resulting thrust
|
||||
var/nominal_thrust = 3000
|
||||
var/effective_pressure = 3000
|
||||
var/datum/ship_engine/thermal/controller
|
||||
|
||||
/obj/machinery/atmospherics/unary/engine/initialize()
|
||||
..()
|
||||
controller = new(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/engine/Del()
|
||||
..()
|
||||
controller.die()
|
||||
|
||||
/obj/machinery/atmospherics/unary/engine/proc/burn()
|
||||
if (!on)
|
||||
return
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = 100 * air_contents.volume/max(air_contents.temperature * R_IDEAL_GAS_EQUATION, 0,01)
|
||||
transfer_moles = round(thrust_limit * transfer_moles, 0.01)
|
||||
if(transfer_moles > air_contents.total_moles)
|
||||
on = !on
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
if(air_contents.temperature > PHORON_MINIMUM_BURN_TEMPERATURE)
|
||||
var/exhaust_dir = reverse_direction(dir)
|
||||
var/turf/T = get_step(src,exhaust_dir)
|
||||
if(T)
|
||||
new/obj/effect/engine_exhaust(T,exhaust_dir,air_contents.temperature)
|
||||
return 1
|
||||
|
||||
//Exhaust effect
|
||||
/obj/effect/engine_exhaust
|
||||
name = "engine exhaust"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "exhaust"
|
||||
anchored = 1
|
||||
|
||||
New(var/turf/nloc, var/ndir, var/temp)
|
||||
dir = ndir
|
||||
..(nloc)
|
||||
|
||||
if(nloc)
|
||||
nloc.hotspot_expose(temp,125)
|
||||
|
||||
spawn(20)
|
||||
loc = null
|
||||
@@ -1,105 +0,0 @@
|
||||
/obj/effect/map/ship
|
||||
name = "generic ship"
|
||||
desc = "Space faring vessel."
|
||||
icon_state = "sheet-sandstone"
|
||||
var/vessel_mass = 9000 //tonnes, random number
|
||||
var/default_delay = 60
|
||||
var/list/speed = list(0,0)
|
||||
var/last_burn = 0
|
||||
var/list/last_movement = list(0,0)
|
||||
var/fore_dir = NORTH
|
||||
|
||||
var/obj/effect/map/current_sector
|
||||
var/obj/machinery/computer/helm/nav_control
|
||||
var/obj/machinery/computer/engines/eng_control
|
||||
|
||||
/obj/effect/map/ship/initialize()
|
||||
for(var/obj/machinery/computer/engines/E in machines)
|
||||
if (E.z == map_z)
|
||||
eng_control = E
|
||||
break
|
||||
for(var/obj/machinery/computer/helm/H in machines)
|
||||
if (H.z == map_z)
|
||||
nav_control = H
|
||||
break
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/effect/map/ship/relaymove(mob/user, direction)
|
||||
accelerate(direction)
|
||||
|
||||
/obj/effect/map/ship/proc/is_still()
|
||||
return !(speed[1] || speed[2])
|
||||
|
||||
/obj/effect/map/ship/proc/get_acceleration()
|
||||
return eng_control.get_total_thrust()/vessel_mass
|
||||
|
||||
/obj/effect/map/ship/proc/get_speed()
|
||||
return round(sqrt(speed[1]*speed[1] + speed[2]*speed[2]))
|
||||
|
||||
/obj/effect/map/ship/proc/get_heading()
|
||||
var/res = 0
|
||||
if(speed[1])
|
||||
if(speed[1] > 0)
|
||||
res |= EAST
|
||||
else
|
||||
res |= WEST
|
||||
if(speed[2])
|
||||
if(speed[2] > 0)
|
||||
res |= NORTH
|
||||
else
|
||||
res |= SOUTH
|
||||
return res
|
||||
|
||||
/obj/effect/map/ship/proc/adjust_speed(n_x, n_y)
|
||||
speed[1] = Clamp(speed[1] + n_x, -default_delay, default_delay)
|
||||
speed[2] = Clamp(speed[2] + n_y, -default_delay, default_delay)
|
||||
if(is_still())
|
||||
toggle_move_stars(map_z)
|
||||
else
|
||||
toggle_move_stars(map_z, fore_dir)
|
||||
|
||||
/obj/effect/map/ship/proc/can_burn()
|
||||
if (!eng_control)
|
||||
return 0
|
||||
if (world.time < last_burn + 10)
|
||||
return 0
|
||||
if (!eng_control.burn())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/map/ship/proc/get_brake_path()
|
||||
if(!get_acceleration())
|
||||
return INFINITY
|
||||
return max(abs(speed[1]),abs(speed[2]))/get_acceleration()
|
||||
|
||||
/obj/effect/map/ship/proc/decelerate()
|
||||
if(!is_still() && can_burn())
|
||||
if (speed[1])
|
||||
adjust_speed(-SIGN(speed[1]) * min(get_acceleration(),speed[1]), 0)
|
||||
if (speed[2])
|
||||
adjust_speed(0, -SIGN(speed[2]) * min(get_acceleration(),speed[2]))
|
||||
last_burn = world.time
|
||||
|
||||
/obj/effect/map/ship/proc/accelerate(direction)
|
||||
if(can_burn())
|
||||
last_burn = world.time
|
||||
|
||||
if(direction & EAST)
|
||||
adjust_speed(get_acceleration(), 0)
|
||||
if(direction & WEST)
|
||||
adjust_speed(-get_acceleration(), 0)
|
||||
if(direction & NORTH)
|
||||
adjust_speed(0, get_acceleration())
|
||||
if(direction & SOUTH)
|
||||
adjust_speed(0, -get_acceleration())
|
||||
|
||||
/obj/effect/map/ship/process()
|
||||
if(!is_still())
|
||||
var/list/deltas = list(0,0)
|
||||
for(var/i=1, i<=2, i++)
|
||||
if(speed[i] && world.time > last_movement[i] + default_delay - speed[i])
|
||||
deltas[i] = speed[i] > 0 ? 1 : -1
|
||||
last_movement[i] = world.time
|
||||
var/turf/newloc = locate(x + deltas[1], y + deltas[2], z)
|
||||
if(newloc)
|
||||
Move(newloc)
|
||||
@@ -1,590 +0,0 @@
|
||||
/mob/living/carbon/amorph
|
||||
name = "amorph"
|
||||
real_name = "amorph"
|
||||
voice_name = "amorph"
|
||||
icon = 'icons/mob/amorph.dmi'
|
||||
icon_state = ""
|
||||
|
||||
|
||||
var/species = "Amorph"
|
||||
age = 30.0
|
||||
|
||||
var/used_skillpoints = 0
|
||||
var/skill_specialization = null
|
||||
var/list/skills = null
|
||||
|
||||
var/obj/item/l_ear = null
|
||||
|
||||
// might use this later to recolor armorphs with icon.SwapColor
|
||||
var/slime_color = null
|
||||
|
||||
var/examine_text = ""
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/New()
|
||||
|
||||
..()
|
||||
|
||||
// Amorphs don't have a blood vessel, but they can have reagents in their body
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
// Amorphs have no DNA(they're more like carbon-based machines)
|
||||
|
||||
// Amorphs don't have organs
|
||||
..()
|
||||
|
||||
/mob/living/carbon/amorph/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
return
|
||||
now_pushing = 1
|
||||
if (ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
|
||||
//BubbleWrap - Should stop you pushing a restrained person out of the way
|
||||
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
|
||||
for(var/mob/M in range(tmob, 1))
|
||||
if( ((M.pulling == tmob && ( tmob.restrained() && !( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, tmob.grabbed_by.len)) )
|
||||
if ( !(world.time % 5) )
|
||||
src << "\red [tmob] is restrained, you cannot push past"
|
||||
now_pushing = 0
|
||||
return
|
||||
if( tmob.pulling == M && ( M.restrained() && !( tmob.restrained() ) && tmob.stat == 0) )
|
||||
if ( !(world.time % 5) )
|
||||
src << "\red [tmob] is restraining [M], you cannot push past"
|
||||
now_pushing = 0
|
||||
return
|
||||
|
||||
//BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
|
||||
if((tmob.a_intent == "help" || tmob.restrained()) && (a_intent == "help" || src.restrained()) && tmob.canmove && canmove) // mutual brohugs all around!
|
||||
var/turf/oldloc = loc
|
||||
loc = tmob.loc
|
||||
tmob.loc = oldloc
|
||||
now_pushing = 0
|
||||
for(var/mob/living/carbon/metroid/Metroid in view(1,tmob))
|
||||
if(Metroid.Victim == tmob)
|
||||
Metroid.UpdateFeed()
|
||||
return
|
||||
|
||||
if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
|
||||
if(prob(99))
|
||||
now_pushing = 0
|
||||
return
|
||||
if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
|
||||
if(prob(99))
|
||||
now_pushing = 0
|
||||
return
|
||||
if(tmob.nopush)
|
||||
now_pushing = 0
|
||||
return
|
||||
|
||||
tmob.LAssailant = src
|
||||
|
||||
now_pushing = 0
|
||||
spawn(0)
|
||||
..()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
if (!now_pushing)
|
||||
now_pushing = 1
|
||||
|
||||
if (!AM.anchored)
|
||||
var/t = get_dir(src, AM)
|
||||
if (istype(AM, /obj/structure/window))
|
||||
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(AM,t))
|
||||
now_pushing = 0
|
||||
return
|
||||
step(AM, t)
|
||||
now_pushing = 0
|
||||
return
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/movement_delay()
|
||||
var/tally = 2 // amorphs are a bit slower than humans
|
||||
var/mob/M = pulling
|
||||
|
||||
if(reagents.has_reagent("hyperzine")) return -1
|
||||
|
||||
if(reagents.has_reagent("nuka_cola")) return -1
|
||||
|
||||
if(analgesic) return -1
|
||||
|
||||
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
|
||||
|
||||
var/health_deficiency = traumatic_shock
|
||||
if(health_deficiency >= 40) tally += (health_deficiency / 25)
|
||||
|
||||
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
|
||||
if (hungry >= 70) tally += hungry/300
|
||||
|
||||
if (bodytemperature < 283.222)
|
||||
tally += (283.222 - bodytemperature) / 10 * 1.75
|
||||
if (stuttering < 10)
|
||||
stuttering = 10
|
||||
|
||||
if(shock_stage >= 10) tally += 3
|
||||
|
||||
if(tally < 0)
|
||||
tally = 0
|
||||
|
||||
if(istype(M) && M.lying) //Pulling lying down people is slower
|
||||
tally += 3
|
||||
|
||||
if(mRun in mutations)
|
||||
tally = 0
|
||||
|
||||
return tally
|
||||
|
||||
/mob/living/carbon/amorph/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
|
||||
stat(null, "Intent: [a_intent]")
|
||||
stat(null, "Move Mode: [m_intent]")
|
||||
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
|
||||
if(ticker.mode:malf_mode_declared)
|
||||
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
||||
if(emergency_shuttle)
|
||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
||||
var/timeleft = emergency_shuttle.timeleft()
|
||||
if (timeleft)
|
||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||
|
||||
if (client.statpanel == "Status")
|
||||
if (internal)
|
||||
if (!internal.air_contents)
|
||||
del(internal)
|
||||
else
|
||||
stat("Internal Atmosphere Info", internal.name)
|
||||
stat("Tank Pressure", internal.air_contents.return_pressure())
|
||||
stat("Distribution Pressure", internal.distribute_pressure)
|
||||
if (mind)
|
||||
if (mind.special_role == "Changeling" && changeling)
|
||||
stat("Chemical Storage", changeling.chem_charges)
|
||||
stat("Genetic Damage Time", changeling.geneticdamage)
|
||||
|
||||
/mob/living/carbon/amorph/ex_act(severity)
|
||||
flick("flash", flash)
|
||||
|
||||
var/shielded = 0
|
||||
var/b_loss = null
|
||||
var/f_loss = null
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
b_loss += 500
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
gib()
|
||||
return
|
||||
else
|
||||
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
|
||||
throw_at(target, 200, 4)
|
||||
|
||||
if (2.0)
|
||||
if (!shielded)
|
||||
b_loss += 60
|
||||
|
||||
f_loss += 60
|
||||
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
b_loss = b_loss/1.5
|
||||
f_loss = f_loss/1.5
|
||||
|
||||
if(3.0)
|
||||
b_loss += 30
|
||||
if (!prob(getarmor(null, "bomb")))
|
||||
b_loss = b_loss/2
|
||||
if (prob(50) && !shielded)
|
||||
Paralyse(10)
|
||||
|
||||
src.bruteloss += b_loss
|
||||
src.fireloss += f_loss
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/blob_act()
|
||||
if(stat == 2) return
|
||||
show_message("\red The blob attacks you!")
|
||||
src.bruteloss += rand(30,40)
|
||||
UpdateDamageIcon()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/u_equip(obj/item/W as obj)
|
||||
// These are the only slots an amorph has
|
||||
if (W == l_ear)
|
||||
l_ear = null
|
||||
else if (W == r_hand)
|
||||
r_hand = null
|
||||
|
||||
update_clothing()
|
||||
|
||||
/mob/living/carbon/amorph/db_click(text, t1)
|
||||
var/obj/item/W = equipped()
|
||||
var/emptyHand = (W == null)
|
||||
if ((!emptyHand) && (!istype(W, /obj/item)))
|
||||
return
|
||||
if (emptyHand)
|
||||
usr.next_move = usr.prev_move
|
||||
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
|
||||
switch(text)
|
||||
if("l_ear")
|
||||
if (l_ear)
|
||||
if (emptyHand)
|
||||
l_ear.DblClick()
|
||||
return
|
||||
else if(emptyHand)
|
||||
return
|
||||
if (!( istype(W, /obj/item/clothing/ears) ) && !( istype(W, /obj/item/device/radio/headset) ) && W.w_class != 1)
|
||||
return
|
||||
u_equip(W)
|
||||
l_ear = W
|
||||
W.equipped(src, text)
|
||||
|
||||
update_clothing()
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/meteorhit(O as obj)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message(text("\red [] has been hit by []", src, O), 1)
|
||||
if (health > 0)
|
||||
if (istype(O, /obj/effect/immovablerod))
|
||||
src.bruteloss += 101
|
||||
else
|
||||
src.bruteloss += 25
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/Move(a, b, flag)
|
||||
|
||||
if (buckled)
|
||||
return
|
||||
|
||||
if (restrained())
|
||||
pulling = null
|
||||
|
||||
|
||||
var/t7 = 1
|
||||
if (restrained())
|
||||
for(var/mob/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
|
||||
var/turf/T = loc
|
||||
. = ..()
|
||||
|
||||
if (pulling && pulling.loc)
|
||||
if(!( isturf(pulling.loc) ))
|
||||
pulling = null
|
||||
return
|
||||
else
|
||||
if(Debug)
|
||||
diary <<"pulling disappeared? at [__LINE__] in mob.dm - pulling = [pulling]"
|
||||
diary <<"REPORT THIS"
|
||||
|
||||
/////
|
||||
if(pulling && pulling.anchored)
|
||||
pulling = null
|
||||
return
|
||||
|
||||
if (!restrained())
|
||||
var/diag = get_dir(src, pulling)
|
||||
if ((diag - 1) & diag)
|
||||
else
|
||||
diag = null
|
||||
if ((get_dist(src, pulling) > 1 || diag))
|
||||
if (ismob(pulling))
|
||||
var/mob/M = pulling
|
||||
var/ok = 1
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by))
|
||||
if (prob(75))
|
||||
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
|
||||
if (istype(G, /obj/item/weapon/grab))
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
|
||||
//G = null
|
||||
del(G)
|
||||
else
|
||||
ok = 0
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
|
||||
ok = 0
|
||||
if (ok)
|
||||
var/t = M.pulling
|
||||
M.pulling = null
|
||||
|
||||
//this is the gay blood on floor shit -- Added back -- Skie
|
||||
if (M.lying && (prob(M.getBruteLoss() / 6)))
|
||||
var/turf/location = M.loc
|
||||
if (istype(location, /turf/simulated))
|
||||
location.add_blood(M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/H = M
|
||||
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
|
||||
if(blood_volume > 0)
|
||||
H:vessel.remove_reagent("blood",1)
|
||||
if(prob(5))
|
||||
M.adjustBruteLoss(1)
|
||||
visible_message("\red \The [M]'s wounds open more from being dragged!")
|
||||
if(M.pull_damage())
|
||||
if(prob(25))
|
||||
M.adjustBruteLoss(2)
|
||||
visible_message("\red \The [M]'s wounds worsen terribly from being dragged!")
|
||||
var/turf/location = M.loc
|
||||
if (istype(location, /turf/simulated))
|
||||
location.add_blood(M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/H = M
|
||||
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
|
||||
if(blood_volume > 0)
|
||||
H:vessel.remove_reagent("blood",1)
|
||||
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
M.pulling = t
|
||||
else
|
||||
if (pulling)
|
||||
if (istype(pulling, /obj/structure/window))
|
||||
if(pulling:ini_dir == NORTHWEST || pulling:ini_dir == NORTHEAST || pulling:ini_dir == SOUTHWEST || pulling:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
|
||||
pulling = null
|
||||
if (pulling)
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
else
|
||||
pulling = null
|
||||
. = ..()
|
||||
if ((s_active && !( s_active in contents ) ))
|
||||
s_active.close(src)
|
||||
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
M.UpdateFeed(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/proc/misc_clothing_updates()
|
||||
// Temporary proc to shove stuff in that was put into update_clothing()
|
||||
// for questionable reasons
|
||||
|
||||
if (client)
|
||||
if (i_select)
|
||||
if (intent)
|
||||
client.screen += hud_used.intents
|
||||
|
||||
var/list/L = dd_text2list(intent, ",")
|
||||
L[1] += ":-11"
|
||||
i_select.screen_loc = dd_list2text(L,",") //ICONS4
|
||||
else
|
||||
i_select.screen_loc = null
|
||||
if (m_select)
|
||||
if (m_int)
|
||||
client.screen += hud_used.mov_int
|
||||
|
||||
var/list/L = dd_text2list(m_int, ",")
|
||||
L[1] += ":-11"
|
||||
m_select.screen_loc = dd_list2text(L,",") //ICONS4
|
||||
else
|
||||
m_select.screen_loc = null
|
||||
|
||||
// Probably a lazy way to make sure all items are on the screen exactly once
|
||||
if (client)
|
||||
client.screen -= contents
|
||||
client.screen += contents
|
||||
|
||||
/mob/living/carbon/amorph/rebuild_appearance()
|
||||
// Lazy method: Just rebuild everything.
|
||||
// This can be called when the mob is created, but on other occasions, rebuild_body_overlays(),
|
||||
// rebuild_clothing_overlays() etc. should be called individually.
|
||||
|
||||
misc_clothing_updates() // silly stuff
|
||||
|
||||
/mob/living/carbon/amorph/update_body_appearance()
|
||||
// Should be called whenever something about the body appearance itself changes.
|
||||
|
||||
misc_clothing_updates() // silly stuff
|
||||
|
||||
if(lying)
|
||||
icon_state = "lying"
|
||||
else
|
||||
icon_state = "standing"
|
||||
|
||||
/mob/living/carbon/amorph/update_lying()
|
||||
// Should be called whenever something about the lying status of the mob might have changed.
|
||||
|
||||
if(lying)
|
||||
icon_state = "lying"
|
||||
else
|
||||
icon_state = "standing"
|
||||
|
||||
/mob/living/carbon/amorph/hand_p(mob/M as mob)
|
||||
// not even sure what this is meant to do
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/restrained()
|
||||
if (handcuffed)
|
||||
return 0 // handcuffs don't work on amorphs
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/var/co2overloadtime = null
|
||||
/mob/living/carbon/amorph/var/temperature_resistance = T0C+75
|
||||
|
||||
/mob/living/carbon/amorph/show_inv(mob/user as mob)
|
||||
// TODO: add a window for extracting stuff from an amorph's mouth
|
||||
|
||||
// called when something steps onto an amorph
|
||||
// this could be made more general, but for now just handle mulebot
|
||||
/mob/living/carbon/amorph/HasEntered(var/atom/movable/AM)
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
if(istype(MB))
|
||||
MB.RunOver(src)
|
||||
|
||||
//gets assignment from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/amorph/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
|
||||
// TODO: get the ID from the amorph's contents
|
||||
return
|
||||
|
||||
//gets name from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/amorph/proc/get_authentification_name(var/if_no_id = "Unknown")
|
||||
// TODO: get the ID from the amorph's contents
|
||||
return
|
||||
|
||||
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
|
||||
/mob/living/carbon/amorph/proc/get_visible_name()
|
||||
// amorphs can't wear clothes or anything, so always return face_name
|
||||
return get_face_name()
|
||||
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
/mob/living/carbon/amorph/proc/get_face_name()
|
||||
// there might later be ways for amorphs to change the appearance of their face
|
||||
return "[real_name]"
|
||||
|
||||
|
||||
//gets ID card object from special clothes slot or null.
|
||||
/mob/living/carbon/amorph/proc/get_idcard()
|
||||
// TODO: get the ID from the amorph's contents
|
||||
|
||||
|
||||
// heal the amorph
|
||||
/mob/living/carbon/amorph/heal_overall_damage(var/brute, var/burn)
|
||||
bruteloss -= brute
|
||||
fireloss -= burn
|
||||
bruteloss = max(bruteloss, 0)
|
||||
fireloss = max(fireloss, 0)
|
||||
|
||||
updatehealth()
|
||||
UpdateDamageIcon()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/carbon/amorph/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
|
||||
bruteloss += brute
|
||||
fireloss += burn
|
||||
|
||||
updatehealth()
|
||||
UpdateDamageIcon()
|
||||
|
||||
/mob/living/carbon/amorph/Topic(href, href_list)
|
||||
if (href_list["refresh"])
|
||||
if((machine)&&(in_range(src, usr)))
|
||||
show_inv(machine)
|
||||
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[]", href_list["mach_close"])
|
||||
machine = null
|
||||
src << browse(null, t1)
|
||||
|
||||
if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = usr
|
||||
O.target = src
|
||||
O.item = usr.equipped()
|
||||
O.s_loc = usr.loc
|
||||
O.t_loc = loc
|
||||
O.place = href_list["item"]
|
||||
if(href_list["loc"])
|
||||
O.internalloc = href_list["loc"]
|
||||
requests += O
|
||||
spawn( 0 )
|
||||
O.process()
|
||||
return
|
||||
|
||||
if (href_list["criminal"])
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
var/perpname = "wot"
|
||||
var/modified = 0
|
||||
|
||||
/*if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else*/
|
||||
perpname = src.name
|
||||
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
|
||||
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
|
||||
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
if(setcriminal != "Cancel")
|
||||
R.fields["criminal"] = setcriminal
|
||||
modified = 1
|
||||
|
||||
spawn()
|
||||
H.handle_regular_hud_updates()
|
||||
|
||||
if(!modified)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
///eyecheck()
|
||||
///Returns a number between -1 to 2
|
||||
/mob/living/carbon/amorph/eyecheck()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/IsAdvancedToolUser()
|
||||
return 1//Amorphs can use guns and such
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/updatehealth()
|
||||
if(src.nodamage)
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
return
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss() - src.getCloneLoss() -src.halloss
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/abiotic(var/full_body = 0)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/abiotic2(var/full_body2 = 0)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/amorph/getBruteLoss()
|
||||
return src.bruteloss
|
||||
|
||||
/mob/living/carbon/amorph/adjustBruteLoss(var/amount, var/used_weapon = null)
|
||||
src.bruteloss += amount
|
||||
if(bruteloss < 0) bruteloss = 0
|
||||
|
||||
/mob/living/carbon/amorph/getFireLoss()
|
||||
return src.fireloss
|
||||
|
||||
/mob/living/carbon/amorph/adjustFireLoss(var/amount,var/used_weapon = null)
|
||||
src.fireloss += amount
|
||||
if(fireloss < 0) fireloss = 0
|
||||
|
||||
/mob/living/carbon/amorph/get_visible_gender()
|
||||
return gender
|
||||
@@ -1,248 +0,0 @@
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if ("help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
if (health > 0)
|
||||
attacked += 10
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
|
||||
adjustBruteLoss(rand(0, 1))
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/attack_hand(mob/living/carbon/human/M as mob)
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.charge -= 2500
|
||||
Weaken(5)
|
||||
if (stuttering < 5)
|
||||
stuttering = 5
|
||||
Stun(5)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if (O.client)
|
||||
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall", 2)
|
||||
return
|
||||
else
|
||||
M << "\red Not enough charge! "
|
||||
return
|
||||
|
||||
if (M.a_intent == "help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (M.a_intent == "hurt")
|
||||
var/attack_verb
|
||||
switch(M.mutantrace)
|
||||
if("lizard")
|
||||
attack_verb = "scratch"
|
||||
if("plant")
|
||||
attack_verb = "slash"
|
||||
else
|
||||
attack_verb = "punch"
|
||||
|
||||
if(M.type == /mob/living/carbon/human/tajaran)
|
||||
attack_verb = "slash"
|
||||
|
||||
if ((prob(75) && health > 0))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has [attack_verb]ed [name]!</B>", M), 1)
|
||||
|
||||
var/damage = rand(5, 10)
|
||||
if(M.type != /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
else if(M.type == /mob/living/carbon/human/tajaran)
|
||||
damage += 10
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
adjustBruteLoss(damage/10)
|
||||
updatehealth()
|
||||
else
|
||||
if(M.type != /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
else if(M.type == /mob/living/carbon/human/tajaran)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to [attack_verb] [name]!</B>", M), 1)
|
||||
else
|
||||
if (M.a_intent == "grab")
|
||||
if (M == src)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
|
||||
|
||||
else
|
||||
if (!( paralysis ))
|
||||
drop_item()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
|
||||
if ("hurt")
|
||||
if ((prob(95) && health > 0))
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has slashed [name]!</B>", M), 1)
|
||||
adjustBruteLoss(damage/10)
|
||||
updatehealth()
|
||||
react_to_attack(M)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
|
||||
|
||||
if ("disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
var/damage = 5
|
||||
if(prob(95))
|
||||
Weaken(rand(10,15))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down [name]!</B>", M), 1)
|
||||
else
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
react_to_attack(M)
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
bruteloss += damage
|
||||
|
||||
/mob/living/carbon/amorph/attack_metroid(mob/living/carbon/metroid/M as mob)
|
||||
if(M.Victim) return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>The [M.name] has [pick("bit","slashed")] []!</B>", src), 1)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/metroid/adult))
|
||||
damage = rand(10, 35)
|
||||
else
|
||||
damage = rand(5, 25)
|
||||
|
||||
src.cloneloss += damage
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
var/power = M.powerlevel + rand(0,3)
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2) stunprob = 20
|
||||
if(3 to 4) stunprob = 30
|
||||
if(5 to 6) stunprob = 40
|
||||
if(7 to 8) stunprob = 60
|
||||
if(9) stunprob = 70
|
||||
if(10) stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>The [M.name] has shocked []!</B>", src), 1)
|
||||
|
||||
Weaken(power)
|
||||
if (stuttering < power)
|
||||
stuttering = power
|
||||
Stun(power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustFireLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
@@ -1,12 +0,0 @@
|
||||
/mob/living/carbon/amorph/proc/HealDamage(zone, brute, burn)
|
||||
return heal_overall_damage(brute, burn)
|
||||
|
||||
/mob/living/carbon/amorph/UpdateDamageIcon()
|
||||
// no damage sprites for amorphs yet
|
||||
return
|
||||
|
||||
/mob/living/carbon/amorph/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/used_weapon = null)
|
||||
if(damagetype == BRUTE)
|
||||
take_overall_damage(damage, 0)
|
||||
else
|
||||
take_overall_damage(0, damage)
|
||||
@@ -1,318 +0,0 @@
|
||||
/obj/hud/proc/amorph_hud(var/ui_style='icons/mob/screen1_old.dmi')
|
||||
|
||||
src.adding = list( )
|
||||
src.other = list( )
|
||||
src.intents = list( )
|
||||
src.mon_blo = list( )
|
||||
src.m_ints = list( )
|
||||
src.mov_int = list( )
|
||||
src.vimpaired = list( )
|
||||
src.darkMask = list( )
|
||||
src.intent_small_hud_objects = list( )
|
||||
|
||||
src.g_dither = new /obj/screen( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon = ui_style
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new /obj/screen(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon = ui_style
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new /obj/screen( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon = ui_style
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new /obj/screen( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon = ui_style
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "act_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
//intent small hud objects
|
||||
var/icon/ico
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
|
||||
//end intent small hud objects
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mov_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
move_intent = using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "drop"
|
||||
using.icon = ui_style
|
||||
using.icon_state = "act_drop"
|
||||
using.screen_loc = ui_dropbutton
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "r_hand"
|
||||
using.dir = WEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_rhand
|
||||
using.layer = 19
|
||||
src.r_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "l_hand"
|
||||
using.dir = EAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && mymob.hand) //This being 1 means the left hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_lhand
|
||||
using.layer = 19
|
||||
src.l_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand1"
|
||||
using.screen_loc = ui_swaphand1
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand2"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mask"
|
||||
using.dir = NORTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_monkey_mask
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "back"
|
||||
using.dir = NORTHEAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_back
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "1,1 to 5,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "5,1 to 10,5"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "6,11 to 10,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "11,1 to 15,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = ui_style
|
||||
mymob.throw_icon.icon_state = "act_throw_off"
|
||||
mymob.throw_icon.name = "throw"
|
||||
mymob.throw_icon.screen_loc = ui_throw
|
||||
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = ui_style
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.pressure = new /obj/screen( null )
|
||||
mymob.pressure.icon = ui_style
|
||||
mymob.pressure.icon_state = "pressure0"
|
||||
mymob.pressure.name = "pressure"
|
||||
mymob.pressure.screen_loc = ui_pressure
|
||||
|
||||
mymob.toxin = new /obj/screen( null )
|
||||
mymob.toxin.icon = ui_style
|
||||
mymob.toxin.icon_state = "tox0"
|
||||
mymob.toxin.name = "toxin"
|
||||
mymob.toxin.screen_loc = ui_toxin
|
||||
|
||||
mymob.internals = new /obj/screen( null )
|
||||
mymob.internals.icon = ui_style
|
||||
mymob.internals.icon_state = "internal0"
|
||||
mymob.internals.name = "internal"
|
||||
mymob.internals.screen_loc = ui_internal
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = ui_style
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon = ui_style
|
||||
mymob.bodytemp.icon_state = "temp1"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = ui_style
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = ui_style
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = ui_style
|
||||
mymob.blind.icon_state = "blackanimate"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1 to 15,15"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = ui_style
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.dir = 2
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
//, mymob.i_select, mymob.m_select
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach, mymob.hands, )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
|
||||
|
||||
return
|
||||
@@ -1,516 +0,0 @@
|
||||
/mob/living/carbon/amorph
|
||||
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
|
||||
|
||||
var/oxygen_alert = 0
|
||||
var/toxins_alert = 0
|
||||
var/fire_alert = 0
|
||||
|
||||
var/temperature_alert = 0
|
||||
|
||||
|
||||
/mob/living/carbon/amorph/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
|
||||
if(src.loc)
|
||||
environment = loc.return_air()
|
||||
|
||||
if (src.stat != 2) //still breathing
|
||||
|
||||
//First, resolve location and get a breath
|
||||
|
||||
if(air_master.current_cycle%4==2)
|
||||
//Only try to take a breath every 4 seconds, unless suffocating
|
||||
breathe()
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
//Disease Check
|
||||
handle_virus_updates()
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
if(environment) // More error checking -- TLE
|
||||
handle_environment(environment)
|
||||
|
||||
//Mutations and radiation
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
//Chemicals in the body
|
||||
handle_chemicals_in_body()
|
||||
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Status updates, death etc.
|
||||
// UpdateLuminosity()
|
||||
handle_regular_status_updates()
|
||||
|
||||
if(client)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
//Being buckled to a chair or bed
|
||||
check_if_buckled()
|
||||
|
||||
// Yup.
|
||||
update_canmove()
|
||||
|
||||
clamp_values()
|
||||
|
||||
// Grabbing
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
|
||||
/mob/living/carbon/amorph
|
||||
proc
|
||||
|
||||
clamp_values()
|
||||
|
||||
AdjustStunned(0)
|
||||
AdjustParalysis(0)
|
||||
AdjustWeakened(0)
|
||||
|
||||
handle_disabilities()
|
||||
if (src.disabilities & 4)
|
||||
if ((prob(5) && src.paralysis <= 1 && src.r_ch_cou < 1))
|
||||
src.drop_item()
|
||||
spawn( 0 )
|
||||
emote("cough")
|
||||
return
|
||||
if (src.disabilities & 8)
|
||||
if ((prob(10) && src.paralysis <= 1 && src.r_Tourette < 1))
|
||||
Stun(10)
|
||||
spawn( 0 )
|
||||
emote("twitch")
|
||||
return
|
||||
if (src.disabilities & 16)
|
||||
if (prob(10))
|
||||
src.stuttering = max(10, src.stuttering)
|
||||
|
||||
update_mind()
|
||||
if(!mind && client)
|
||||
mind = new
|
||||
mind.current = src
|
||||
mind.key = key
|
||||
|
||||
handle_mutations_and_radiation()
|
||||
// amorphs are immune to this stuff
|
||||
|
||||
breathe()
|
||||
if(src.reagents)
|
||||
|
||||
if(src.reagents.has_reagent("lexorin")) return
|
||||
|
||||
if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/gas_mixture/breath
|
||||
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
src.losebreath--
|
||||
if (prob(75)) //High chance of gasping for air
|
||||
spawn emote("gasp")
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
else
|
||||
//First, check for air from internal atmosphere (using an air tank and mask generally)
|
||||
breath = get_breath_from_internal(BREATH_VOLUME)
|
||||
|
||||
//No breath from internal atmosphere so get breath from location
|
||||
if(!breath)
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
// Handle chem smoke effect -- Doohl
|
||||
var/block = 0
|
||||
if(wear_mask)
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas))
|
||||
block = 1
|
||||
|
||||
if(!block)
|
||||
|
||||
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
|
||||
if(smoke.reagents.total_volume)
|
||||
smoke.reagents.reaction(src, INGEST)
|
||||
spawn(5)
|
||||
if(smoke)
|
||||
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
|
||||
break // If they breathe in the nasty stuff once, no need to continue checking
|
||||
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
handle_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
|
||||
|
||||
get_breath_from_internal(volume_needed)
|
||||
if(internal)
|
||||
if (!contents.Find(src.internal))
|
||||
internal = null
|
||||
if (!wear_mask || !(wear_mask.flags|MASKINTERNALS) )
|
||||
internal = null
|
||||
if(internal)
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal1"
|
||||
return internal.remove_air_volume(volume_needed)
|
||||
else
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal0"
|
||||
return null
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
handle_breath(datum/gas_mixture/breath)
|
||||
if(src.nodamage)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles == 0))
|
||||
adjustOxyLoss(7)
|
||||
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
|
||||
return 0
|
||||
|
||||
var/safe_oxygen_min = 8 // Minimum safe partial pressure of O2, in kPa
|
||||
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
|
||||
var/SA_para_min = 0.5
|
||||
var/SA_sleep_min = 5
|
||||
var/oxygen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the O2 in our breath
|
||||
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
|
||||
|
||||
if(O2_pp < safe_oxygen_min) // Too little oxygen
|
||||
if(prob(20))
|
||||
spawn(0) emote("gasp")
|
||||
if (O2_pp == 0)
|
||||
O2_pp = 0.01
|
||||
var/ratio = safe_oxygen_min/O2_pp
|
||||
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
else // We're in safe limits
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
oxygen_alert = 0
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
src.sleeping = max(src.sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
|
||||
return 1
|
||||
|
||||
handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
var/environment_heat_capacity = environment.heat_capacity()
|
||||
if(istype(loc, /turf/space))
|
||||
environment_heat_capacity = loc:heat_capacity
|
||||
|
||||
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
|
||||
var/transfer_coefficient
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
|
||||
transfer_coefficient *= wear_mask.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
if(stat==2)
|
||||
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
|
||||
|
||||
//Account for massive pressure differences
|
||||
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
|
||||
// if(!wear_suit) Monkies cannot into space.
|
||||
// if(!istype(wear_suit, /obj/item/clothing/suit/space))
|
||||
|
||||
/*if(pressure < 20)
|
||||
if(prob(25))
|
||||
src << "You feel the splittle on your lips and the fluid on your eyes boiling away, the capillteries in your skin breaking."
|
||||
adjustBruteLoss(5)
|
||||
*/
|
||||
|
||||
if(pressure > HAZARD_HIGH_PRESSURE)
|
||||
|
||||
adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE))
|
||||
|
||||
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
|
||||
if(src.nodamage) return
|
||||
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
|
||||
if(exposed_temperature > bodytemperature)
|
||||
adjustFireLoss(20.0*discomfort)
|
||||
|
||||
else
|
||||
adjustFireLoss(5.0*discomfort)
|
||||
|
||||
handle_chemicals_in_body()
|
||||
// most chemicals will have no effect on amorphs
|
||||
//if(reagents) reagents.metabolize(src)
|
||||
|
||||
if (src.drowsyness)
|
||||
src.drowsyness--
|
||||
src.eye_blurry = max(2, src.eye_blurry)
|
||||
if (prob(5))
|
||||
src.sleeping += 1
|
||||
Paralyse(5)
|
||||
|
||||
confused = max(0, confused - 1)
|
||||
// decrement dizziness counter, clamped to 0
|
||||
if(resting)
|
||||
dizziness = max(0, dizziness - 5)
|
||||
else
|
||||
dizziness = max(0, dizziness - 1)
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = 100 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
|
||||
if(getOxyLoss() > 25) Paralyse(3)
|
||||
|
||||
if(src.sleeping)
|
||||
Paralyse(5)
|
||||
if (prob(1) && health) spawn(0) emote("snore")
|
||||
|
||||
if(src.resting)
|
||||
Weaken(5)
|
||||
|
||||
if(health < config.health_threshold_dead && stat != 2)
|
||||
death()
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
// shuffle around the chemical effects for amorphs a little ;)
|
||||
if(!src.reagents.has_reagent("antitoxin") && src.stat != 2) src.adjustOxyLoss(2)
|
||||
|
||||
if(src.stat != 2) src.stat = 1
|
||||
Paralyse(5)
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
AdjustStunned(-1)
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
AdjustWeakened(-1)
|
||||
src.lying = 1
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
AdjustParalysis(-1)
|
||||
src.blinded = 1
|
||||
src.lying = 1
|
||||
src.stat = 1
|
||||
var/h = src.hand
|
||||
src.hand = 0
|
||||
drop_item()
|
||||
src.hand = 1
|
||||
drop_item()
|
||||
src.hand = h
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.lying = 1
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
if (src.stuttering) src.stuttering--
|
||||
if (src.slurring) src.slurring--
|
||||
|
||||
if (src.eye_blind)
|
||||
src.eye_blind--
|
||||
src.blinded = 1
|
||||
|
||||
if (src.ear_deaf > 0) src.ear_deaf--
|
||||
if (src.ear_damage < 25)
|
||||
src.ear_damage -= 0.05
|
||||
src.ear_damage = max(src.ear_damage, 0)
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if (src.disabilities & 128)
|
||||
src.blinded = 1
|
||||
if (src.disabilities & 32)
|
||||
src.ear_deaf = 1
|
||||
|
||||
if (src.eye_blurry > 0)
|
||||
src.eye_blurry--
|
||||
src.eye_blurry = max(0, src.eye_blurry)
|
||||
|
||||
if (src.druggy > 0)
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2 || (M_XRAY in mutations))
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
else if (src.stat != 2)
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 2
|
||||
src.see_invisible = 0
|
||||
|
||||
if (src.sleep)
|
||||
src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0)
|
||||
src.sleep.overlays = null
|
||||
if(src.sleeping_willingly)
|
||||
src.sleep.overlays += icon(src.sleep.icon, "sleep_willing")
|
||||
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(80 to 100)
|
||||
src.healths.icon_state = "health1"
|
||||
if(60 to 80)
|
||||
src.healths.icon_state = "health2"
|
||||
if(40 to 60)
|
||||
src.healths.icon_state = "health3"
|
||||
if(20 to 40)
|
||||
src.healths.icon_state = "health4"
|
||||
if(0 to 20)
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
else
|
||||
src.healths.icon_state = "health7"
|
||||
|
||||
if (pressure)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if(environment)
|
||||
switch(environment.return_pressure())
|
||||
|
||||
if(HAZARD_HIGH_PRESSURE to INFINITY)
|
||||
pressure.icon_state = "pressure2"
|
||||
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
|
||||
pressure.icon_state = "pressure1"
|
||||
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
|
||||
pressure.icon_state = "pressure0"
|
||||
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
|
||||
pressure.icon_state = "pressure-1"
|
||||
else
|
||||
pressure.icon_state = "pressure-2"
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
|
||||
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
|
||||
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
|
||||
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
|
||||
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
||||
//blame the person who coded them. Temporary fix added.
|
||||
|
||||
if(bodytemp)
|
||||
switch(src.bodytemperature) //310.055 optimal body temp
|
||||
if(345 to INFINITY)
|
||||
src.bodytemp.icon_state = "temp4"
|
||||
if(335 to 345)
|
||||
src.bodytemp.icon_state = "temp3"
|
||||
if(327 to 335)
|
||||
src.bodytemp.icon_state = "temp2"
|
||||
if(316 to 327)
|
||||
src.bodytemp.icon_state = "temp1"
|
||||
if(300 to 316)
|
||||
src.bodytemp.icon_state = "temp0"
|
||||
if(295 to 300)
|
||||
src.bodytemp.icon_state = "temp-1"
|
||||
if(280 to 295)
|
||||
src.bodytemp.icon_state = "temp-2"
|
||||
if(260 to 280)
|
||||
src.bodytemp.icon_state = "temp-3"
|
||||
else
|
||||
src.bodytemp.icon_state = "temp-4"
|
||||
|
||||
src.client.screen -= src.hud_used.blurry
|
||||
src.client.screen -= src.hud_used.druggy
|
||||
src.client.screen -= src.hud_used.vimpaired
|
||||
|
||||
if ((src.blind && src.stat != 2))
|
||||
if ((src.blinded))
|
||||
src.blind.layer = 18
|
||||
else
|
||||
src.blind.layer = 0
|
||||
|
||||
if (src.disabilities & 1)
|
||||
src.client.screen += src.hud_used.vimpaired
|
||||
|
||||
if (src.eye_blurry)
|
||||
src.client.screen += src.hud_used.blurry
|
||||
|
||||
if (src.druggy)
|
||||
src.client.screen += src.hud_used.druggy
|
||||
|
||||
if (src.stat != 2)
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
else
|
||||
if(!client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
return 1
|
||||
|
||||
handle_virus_updates()
|
||||
// amorphs can't come down with human diseases
|
||||
return
|
||||
@@ -1,6 +0,0 @@
|
||||
/mob/living/carbon/amorph/emote(var/act,var/m_type=1,var/message = null)
|
||||
if(act == "me")
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
/mob/living/carbon/amorph/say_quote(var/text)
|
||||
return "[src.say_message], \"[text]\"";
|
||||
@@ -1,596 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
|
||||
|
||||
// === MEMETIC ANOMALY ===
|
||||
// =======================
|
||||
|
||||
/**
|
||||
This life form is a form of parasite that can gain a certain level of control
|
||||
over its host. Its player will share vision and hearing with the host, and it'll
|
||||
be able to influence the host through various commands.
|
||||
**/
|
||||
|
||||
// The maximum amount of points a meme can gather.
|
||||
var/global/const/MAXIMUM_MEME_POINTS = 750
|
||||
|
||||
|
||||
// === PARASITE ===
|
||||
// ================
|
||||
|
||||
// a list of all the parasites in the mob
|
||||
mob/living/carbon/var/list/parasites = list()
|
||||
|
||||
mob/living/parasite
|
||||
var/mob/living/carbon/host // the host that this parasite occupies
|
||||
|
||||
Login()
|
||||
..()
|
||||
|
||||
// make the client see through the host instead
|
||||
client.eye = host
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
|
||||
mob/living/parasite/proc/enter_host(mob/living/carbon/host)
|
||||
// by default, parasites can't share a body with other life forms
|
||||
if(host.parasites.len > 0)
|
||||
return 0
|
||||
|
||||
src.host = host
|
||||
src.loc = host
|
||||
host.parasites.Add(src)
|
||||
|
||||
if(client) client.eye = host
|
||||
|
||||
return 1
|
||||
|
||||
mob/living/parasite/proc/exit_host()
|
||||
src.host.parasites.Remove(src)
|
||||
src.host = null
|
||||
src.loc = null
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
// === MEME ===
|
||||
// ============
|
||||
|
||||
// Memes use points for many actions
|
||||
mob/living/parasite/meme/var/meme_points = 100
|
||||
mob/living/parasite/meme/var/dormant = 0
|
||||
|
||||
// Memes have a list of indoctrinated hosts
|
||||
mob/living/parasite/meme/var/list/indoctrinated = list()
|
||||
|
||||
mob/living/parasite/meme/Life()
|
||||
..()
|
||||
|
||||
if(client)
|
||||
if(blinded) client.eye = null
|
||||
else client.eye = host
|
||||
|
||||
if(!host) return
|
||||
|
||||
// recover meme points slowly
|
||||
var/gain = 3
|
||||
if(dormant) gain = 9 // dormant recovers points faster
|
||||
|
||||
meme_points = min(meme_points + gain, MAXIMUM_MEME_POINTS)
|
||||
|
||||
// if there are sleep toxins in the host's body, that's bad
|
||||
if(host.reagents.has_reagent("stoxin"))
|
||||
src << "\red <b>Something in your host's blood makes you lose consciousness.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
// a host without brain is no good
|
||||
if(!host.mind)
|
||||
src << "\red <b>Your host has no mind.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
if(host.stat == 2)
|
||||
src << "\red <b>Your host has died.. you fade away..</b>"
|
||||
src.death()
|
||||
return
|
||||
|
||||
if(host.blinded && host.stat != 1) src.blinded = 1
|
||||
else src.blinded = 0
|
||||
|
||||
|
||||
mob/living/parasite/meme/death()
|
||||
// make sure the mob is on the actual map before gibbing
|
||||
if(host) src.loc = host.loc
|
||||
src.stat = 2
|
||||
..()
|
||||
del src
|
||||
|
||||
// When a meme speaks, it speaks through its host
|
||||
mob/living/parasite/meme/say(message as text)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(!host)
|
||||
usr << "\red You can't speak without host!"
|
||||
return
|
||||
|
||||
return host.say(message)
|
||||
|
||||
// Same as speak, just with whisper
|
||||
mob/living/parasite/meme/whisper(message as text)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(!host)
|
||||
usr << "\red You can't speak without host!"
|
||||
return
|
||||
|
||||
return host.whisper(message)
|
||||
|
||||
// Make the host do things
|
||||
mob/living/parasite/meme/me_verb(message as text)
|
||||
set name = "Me"
|
||||
|
||||
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
|
||||
if(!host)
|
||||
usr << "\red You can't emote without host!"
|
||||
return
|
||||
|
||||
return host.me_verb(message)
|
||||
|
||||
// A meme understands everything their host understands
|
||||
mob/living/parasite/meme/say_understands(mob/other)
|
||||
if(!host) return 0
|
||||
|
||||
return host.say_understands(other)
|
||||
|
||||
// Try to use amount points, return 1 if successful
|
||||
mob/living/parasite/meme/proc/use_points(amount)
|
||||
if(dormant)
|
||||
usr << "\red You're dormant!"
|
||||
return
|
||||
if(src.meme_points < amount)
|
||||
src << "<b>* You don't have enough meme points(need [amount]).</b>"
|
||||
return 0
|
||||
|
||||
src.meme_points -= round(amount)
|
||||
return 1
|
||||
|
||||
// Let the meme choose one of his indoctrinated mobs as target
|
||||
mob/living/parasite/meme/proc/select_indoctrinated(var/title, var/message)
|
||||
var/list/candidates
|
||||
|
||||
// Can only affect other mobs thant he host if not blinded
|
||||
if(blinded)
|
||||
candidates = list()
|
||||
src << "\red You are blinded, so you can not affect mobs other than your host."
|
||||
else
|
||||
candidates = indoctrinated.Copy()
|
||||
|
||||
candidates.Add(src.host)
|
||||
|
||||
var/mob/target = null
|
||||
if(candidates.len == 1)
|
||||
target = candidates[1]
|
||||
else
|
||||
var/selected
|
||||
|
||||
var/list/text_candidates = list()
|
||||
var/list/map_text_to_mob = list()
|
||||
|
||||
for(var/mob/living/carbon/human/M in candidates)
|
||||
text_candidates += M.real_name
|
||||
map_text_to_mob[M.real_name] = M
|
||||
|
||||
selected = input(message,title) as null|anything in text_candidates
|
||||
if(!selected) return null
|
||||
|
||||
target = map_text_to_mob[selected]
|
||||
|
||||
return target
|
||||
|
||||
|
||||
// A meme can make people hear things with the thought ability
|
||||
mob/living/parasite/meme/verb/Thought()
|
||||
set category = "Meme"
|
||||
set name = "Thought(50)"
|
||||
set desc = "Implants a thought into the target, making them think they heard someone talk."
|
||||
|
||||
if(meme_points < 50)
|
||||
// just call use_points() to give the standard failure message
|
||||
use_points(50)
|
||||
return
|
||||
|
||||
var/list/candidates = indoctrinated.Copy()
|
||||
if(!(src.host in candidates))
|
||||
candidates.Add(src.host)
|
||||
|
||||
var/mob/target = select_indoctrinated("Thought", "Select a target which will hear your thought.")
|
||||
|
||||
if(!target) return
|
||||
|
||||
var/speaker = input("Select the voice in which you would like to make yourself heard.", "Voice") as null|text
|
||||
if(!speaker) return
|
||||
|
||||
var/message = input("What would you like to say?", "Message") as null
|
||||
if(!message) return
|
||||
|
||||
// Use the points at the end rather than the beginning, because the user might cancel
|
||||
if(!use_points(50)) return
|
||||
|
||||
message = say_quote(message)
|
||||
var/rendered = "<span class='game say'><span class='name'>[speaker]</span> <span class='message'>[message]</span></span>"
|
||||
target.show_message(rendered)
|
||||
|
||||
usr << "<i>You make [target] hear:</i> [rendered]"
|
||||
|
||||
// Mutes the host
|
||||
mob/living/parasite/meme/verb/Mute()
|
||||
set category = "Meme"
|
||||
set name = "Mute(250)"
|
||||
set desc = "Prevents your host from talking for a while."
|
||||
|
||||
if(!src.host) return
|
||||
if(!host.speech_allowed)
|
||||
usr << "\red Your host already can't speak.."
|
||||
return
|
||||
if(!use_points(250)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/host = src.host
|
||||
|
||||
host << "\red Your tongue feels numb.. You lose your ability to speak."
|
||||
usr << "\red Your host can't speak anymore."
|
||||
|
||||
host.speech_allowed = 0
|
||||
|
||||
sleep(1200)
|
||||
|
||||
host.speech_allowed = 1
|
||||
host << "\red Your tongue has feeling again.."
|
||||
usr << "\red [host] can speak again."
|
||||
|
||||
// Makes the host unable to emote
|
||||
mob/living/parasite/meme/verb/Paralyze()
|
||||
set category = "Meme"
|
||||
set name = "Paralyze(250)"
|
||||
set desc = "Prevents your host from using emote for a while."
|
||||
|
||||
if(!src.host) return
|
||||
if(!host.use_me)
|
||||
usr << "\red Your host already can't use body language.."
|
||||
return
|
||||
if(!use_points(250)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/host = src.host
|
||||
|
||||
host << "\red Your body feels numb.. You lose your ability to use body language."
|
||||
usr << "\red Your host can't use body language anymore."
|
||||
|
||||
host.use_me = 0
|
||||
|
||||
sleep(1200)
|
||||
|
||||
host.use_me = 1
|
||||
host << "\red Your body has feeling again.."
|
||||
usr << "\red [host] can use body language again."
|
||||
|
||||
|
||||
|
||||
// Cause great agony with the host, used for conditioning the host
|
||||
mob/living/parasite/meme/verb/Agony()
|
||||
set category = "Meme"
|
||||
set name = "Agony(200)"
|
||||
set desc = "Causes significant pain in your host."
|
||||
|
||||
if(!src.host) return
|
||||
if(!use_points(200)) return
|
||||
|
||||
spawn
|
||||
// backup the host incase we switch hosts after using the verb
|
||||
var/mob/host = src.host
|
||||
|
||||
host.paralysis = max(host.paralysis, 2)
|
||||
|
||||
host.flash_weak_pain()
|
||||
host << "\red <font size=5>You feel excrutiating pain all over your body! It is so bad you can't think or articulate yourself properly..</font>"
|
||||
|
||||
usr << "<b>You send a jolt of agonizing pain through [host], they should be unable to concentrate on anything else for half a minute.</b>"
|
||||
|
||||
host.emote("scream")
|
||||
|
||||
for(var/i=0, i<10, i++)
|
||||
host.stuttering = 2
|
||||
sleep(50)
|
||||
if(prob(80)) host.flash_weak_pain()
|
||||
if(prob(10)) host.paralysis = max(host.paralysis, 2)
|
||||
if(prob(15)) host.emote("twitch")
|
||||
else if(prob(15)) host.emote("scream")
|
||||
else if(prob(10)) host.emote("collapse")
|
||||
|
||||
if(i == 10)
|
||||
host << "\red THE PAIN! AGHH, THE PAIN! MAKE IT STOP! ANYTHING TO MAKE IT STOP!"
|
||||
|
||||
host << "\red The pain subsides.."
|
||||
|
||||
// Cause great joy with the host, used for conditioning the host
|
||||
mob/living/parasite/meme/verb/Joy()
|
||||
set category = "Meme"
|
||||
set name = "Joy(200)"
|
||||
set desc = "Causes significant joy in your host."
|
||||
|
||||
if(!src.host) return
|
||||
if(!use_points(200)) return
|
||||
|
||||
spawn
|
||||
var/mob/host = src.host
|
||||
host.druggy = max(host.druggy, 50)
|
||||
host.slurring = max(host.slurring, 10)
|
||||
|
||||
usr << "<b>You stimulate [host.name]'s brain, injecting waves of endorphines and dopamine into the tissue. They should now forget all their worries, particularly relating to you, for around a minute."
|
||||
|
||||
host << "\red You are feeling wonderful! Your head is numb and drowsy, and you can't help forgetting all the worries in the world."
|
||||
|
||||
while(host.druggy > 0)
|
||||
sleep(10)
|
||||
|
||||
host << "\red You are feeling clear-headed again.."
|
||||
|
||||
// Cause the target to hallucinate.
|
||||
mob/living/parasite/meme/verb/Hallucinate()
|
||||
set category = "Meme"
|
||||
set name = "Hallucinate(300)"
|
||||
set desc = "Makes your host hallucinate, has a short delay."
|
||||
|
||||
var/mob/target = select_indoctrinated("Hallucination", "Who should hallucinate?")
|
||||
|
||||
if(!target) return
|
||||
if(!use_points(300)) return
|
||||
|
||||
target.hallucination += 100
|
||||
|
||||
usr << "<b>You make [target] hallucinate.</b>"
|
||||
|
||||
// Jump to a closeby target through a whisper
|
||||
mob/living/parasite/meme/verb/SubtleJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Subtle Jump(350)"
|
||||
set desc = "Move to a closeby human through a whisper."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(1, host)+src))
|
||||
src << "<b>The target is not close enough.</b>"
|
||||
return
|
||||
|
||||
// Find out whether we can speak
|
||||
if (host.silent || (host.disabilities & 64))
|
||||
src << "<b>Your host can't speak..</b>"
|
||||
return
|
||||
|
||||
if(!use_points(350)) return
|
||||
|
||||
for(var/mob/M in view(1, host))
|
||||
M.show_message("<B>[host]</B> whispers something incoherent.",2) // 2 stands for hearable message
|
||||
|
||||
// Find out whether the target can hear
|
||||
if(target.disabilities & 32 || target.ear_deaf)
|
||||
src << "<b>Your target doesn't seem to hear you..</b>"
|
||||
return
|
||||
|
||||
if(target.parasites.len > 0)
|
||||
src << "<b>Your target already is possessed by something..</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// Jump to a distant target through a shout
|
||||
mob/living/parasite/meme/verb/ObviousJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Obvious Jump(750)"
|
||||
set desc = "Move to any mob in view through a shout."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(host)))
|
||||
src << "<b>The target is not close enough.</b>"
|
||||
return
|
||||
|
||||
// Find out whether we can speak
|
||||
if (host.silent || (host.disabilities & 64))
|
||||
src << "<b>Your host can't speak..</b>"
|
||||
return
|
||||
|
||||
if(!use_points(750)) return
|
||||
|
||||
for(var/mob/M in view(host)+src)
|
||||
M.show_message("<B>[host]</B> screams something incoherent!",2) // 2 stands for hearable message
|
||||
|
||||
// Find out whether the target can hear
|
||||
if(target.disabilities & 32 || target.ear_deaf)
|
||||
src << "<b>Your target doesn't seem to hear you..</b>"
|
||||
return
|
||||
|
||||
if(target.parasites.len > 0)
|
||||
src << "<b>Your target already is possessed by something..</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// Jump to an attuned mob for free
|
||||
mob/living/parasite/meme/verb/AttunedJump(mob/living/carbon/human/target as mob in world)
|
||||
set category = "Meme"
|
||||
set name = "Attuned Jump(0)"
|
||||
set desc = "Move to a mob in sight that you have already attuned."
|
||||
|
||||
if(!istype(target, /mob/living/carbon/human) || !target.mind)
|
||||
src << "<b>You can't jump to this creature..</b>"
|
||||
return
|
||||
if(!(target in view(host)))
|
||||
src << "<b>You need to make eye-contact with the target.</b>"
|
||||
return
|
||||
if(!(target in indoctrinated))
|
||||
src << "<b>You need to attune the target first.</b>"
|
||||
return
|
||||
|
||||
src.exit_host()
|
||||
src.enter_host(target)
|
||||
|
||||
usr << "<b>You successfully jumped to [target]."
|
||||
|
||||
log_admin("[src.key] has jumped to [target]")
|
||||
message_admins("[src.key] has jumped to [target]")
|
||||
|
||||
// ATTUNE a mob, adding it to the indoctrinated list
|
||||
mob/living/parasite/meme/verb/Attune()
|
||||
set category = "Meme"
|
||||
set name = "Attune(400)"
|
||||
set desc = "Change the host's brain structure, making it easier for you to manipulate him."
|
||||
|
||||
if(host in src.indoctrinated)
|
||||
usr << "<b>You have already attuned this host.</b>"
|
||||
return
|
||||
|
||||
if(!host) return
|
||||
if(!use_points(400)) return
|
||||
|
||||
src.indoctrinated.Add(host)
|
||||
|
||||
usr << "<b>You successfully indoctrinated [host]."
|
||||
host << "\red Your head feels a bit roomier.."
|
||||
|
||||
log_admin("[src.key] has attuned [host]")
|
||||
message_admins("[src.key] has attuned [host]")
|
||||
|
||||
// Enables the mob to take a lot more damage
|
||||
mob/living/parasite/meme/verb/Analgesic()
|
||||
set category = "Meme"
|
||||
set name = "Analgesic(500)"
|
||||
set desc = "Combat drug that the host to move normally, even under life-threatening pain."
|
||||
|
||||
if(!host) return
|
||||
if(!(host in indoctrinated))
|
||||
usr << "\red You need to attune the host first."
|
||||
return
|
||||
if(!use_points(500)) return
|
||||
|
||||
usr << "<b>You inject drugs into [host]."
|
||||
host << "\red You feel your body strengthen and your pain subside.."
|
||||
host.analgesic = 60
|
||||
while(host.analgesic > 0)
|
||||
sleep(10)
|
||||
host << "\red The dizziness wears off, and you can feel pain again.."
|
||||
|
||||
|
||||
mob/proc/clearHUD()
|
||||
if(client) client.screen.Cut()
|
||||
|
||||
// Take control of the mob
|
||||
mob/living/parasite/meme/verb/Possession()
|
||||
set category = "Meme"
|
||||
set name = "Possession(500)"
|
||||
set desc = "Take direct control of the host for a while."
|
||||
|
||||
if(!host) return
|
||||
if(!(host in indoctrinated))
|
||||
usr << "\red You need to attune the host first."
|
||||
return
|
||||
if(!use_points(500)) return
|
||||
|
||||
usr << "<b>You take control of [host]!</b>"
|
||||
host << "\red Everything goes black.."
|
||||
|
||||
spawn
|
||||
var/mob/dummy = new()
|
||||
dummy.loc = 0
|
||||
dummy.sight = BLIND
|
||||
|
||||
var/datum/mind/host_mind = host.mind
|
||||
var/datum/mind/meme_mind = src.mind
|
||||
|
||||
host_mind.transfer_to(dummy)
|
||||
meme_mind.transfer_to(host)
|
||||
host_mind.current.clearHUD()
|
||||
host.update_clothing()
|
||||
|
||||
dummy << "\blue You feel very drowsy.. Your eyelids become heavy..."
|
||||
|
||||
log_admin("[meme_mind.key] has taken possession of [host]([host_mind.key])")
|
||||
message_admins("[meme_mind.key] has taken possession of [host]([host_mind.key])")
|
||||
|
||||
sleep(600)
|
||||
|
||||
log_admin("[meme_mind.key] has lost possession of [host]([host_mind.key])")
|
||||
message_admins("[meme_mind.key] has lost possession of [host]([host_mind.key])")
|
||||
|
||||
meme_mind.transfer_to(src)
|
||||
host_mind.transfer_to(host)
|
||||
meme_mind.current.clearHUD()
|
||||
host.update_clothing()
|
||||
src << "\red You lose control.."
|
||||
|
||||
del dummy
|
||||
|
||||
// Enter dormant mode, increases meme point gain
|
||||
mob/living/parasite/meme/verb/Dormant()
|
||||
set category = "Meme"
|
||||
set name = "Dormant(100)"
|
||||
set desc = "Speed up point recharging, will force you to cease all actions until all points are recharged."
|
||||
|
||||
if(!host) return
|
||||
if(!use_points(100)) return
|
||||
|
||||
usr << "<b>You enter dormant mode.. You won't be able to take action until all your points have recharged.</b>"
|
||||
|
||||
dormant = 1
|
||||
|
||||
while(meme_points < MAXIMUM_MEME_POINTS)
|
||||
sleep(10)
|
||||
|
||||
dormant = 0
|
||||
|
||||
usr << "\red You have regained all points and exited dormant mode!"
|
||||
|
||||
mob/living/parasite/meme/verb/Show_Points()
|
||||
set category = "Meme"
|
||||
|
||||
usr << "<b>Meme Points: [src.meme_points]/[MAXIMUM_MEME_POINTS]</b>"
|
||||
|
||||
// Stat panel to show meme points, copypasted from alien
|
||||
/mob/living/parasite/meme/Stat()
|
||||
..()
|
||||
|
||||
statpanel("Status")
|
||||
if (client && client.holder)
|
||||
stat(null, "([x], [y], [z])")
|
||||
|
||||
if (client && client.statpanel == "Status")
|
||||
stat(null, "Meme Points: [src.meme_points]")
|
||||
|
||||
// Game mode helpers, used for theft objectives
|
||||
// --------------------------------------------
|
||||
mob/living/parasite/check_contents_for(t)
|
||||
if(!host) return 0
|
||||
|
||||
return host.check_contents_for(t)
|
||||
|
||||
mob/living/parasite/check_contents_for_reagent(t)
|
||||
if(!host) return 0
|
||||
|
||||
return host.check_contents_for_reagent(t)
|
||||
@@ -1,32 +0,0 @@
|
||||
//Clothing
|
||||
/obj/item/clothing/suit/storage/centcomm_jacket
|
||||
name = "Central Command Jacket"
|
||||
desc = "A black jacket embroidered with the Central Command dress print."
|
||||
icon = 'code/WorkInProgress/IndexLP/indexlp_icons.dmi'
|
||||
icon_state = "mob_centcomm_jacket_open"
|
||||
item_state = "mob_centcomm_jacket"
|
||||
sprite_sheets = list(
|
||||
"Human" = 'code/WorkInProgress/IndexLP/indexlp_icons.dmi'
|
||||
)
|
||||
blood_overlay_type = "coat"
|
||||
body_parts_covered = UPPER_TORSO|ARMS
|
||||
|
||||
verb/toggle()
|
||||
set name = "Toggle Coat Buttons"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
return 0
|
||||
|
||||
switch(icon_state)
|
||||
if("mob_centcomm_jacket_open")
|
||||
src.icon_state = "mob_centcomm_jacket"
|
||||
usr << "You button up the jacket."
|
||||
if("mob_centcomm_jacket")
|
||||
src.icon_state = "mob_centcomm_jacket_open"
|
||||
usr << "You unbutton the jacket."
|
||||
else
|
||||
usr << "You attempt to button-up your [src], before promptly realising how retarded you are."
|
||||
return
|
||||
usr.update_inv_wear_suit() //so our overlays update
|
||||
|
Before Width: | Height: | Size: 829 B |
@@ -1,12 +0,0 @@
|
||||
/obj/effect/admin_log_trap
|
||||
name = "Herprpr"
|
||||
desc = "Stepping on this is good."
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x2"
|
||||
anchored = 1.0
|
||||
unacidable = 1
|
||||
invisibility = 101
|
||||
|
||||
/obj/effect/admin_log_trap/HasEntered(AM as mob|obj)
|
||||
if(istype(AM,/mob))
|
||||
message_admins("[AM] ([AM:ckey]) stepped on an alerted tile in [get_area(src)]. <a href=\"byond://?src=%admin_ref%;teleto=\ref[src.loc]\">Jump</a>", admin_ref = 1)
|
||||
@@ -1,84 +0,0 @@
|
||||
//copy pastad freezer
|
||||
//remove this shit when someonething better is done
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "Heat Regulator"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
|
||||
anchored = 1.0
|
||||
|
||||
current_heat_capacity = 1000
|
||||
|
||||
New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
var/temp_text = ""
|
||||
if(air_contents.temperature > (T0C - 20))
|
||||
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
|
||||
else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
temp_text = "<FONT color=black>[air_contents.temperature]</FONT>"
|
||||
else
|
||||
temp_text = "<FONT color=blue>[air_contents.temperature]</FONT>"
|
||||
|
||||
var/dat = {"<B>Cryo gas cooling system</B><BR>
|
||||
Current status: [ on ? "<A href='?src=\ref[src];start=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];start=1'>On</A>"]<BR>
|
||||
Current gas temperature: [temp_text]<BR>
|
||||
Current air pressure: [air_contents.return_pressure()]<BR>
|
||||
Target gas temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=freezer;size=400x500")
|
||||
onclose(user, "freezer")
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["start"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(350, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(150, src.current_temperature+amount)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
@@ -1,65 +0,0 @@
|
||||
/mob/verb/shortcut_changeintent(var/changeto as num)
|
||||
set name = "_changeintent"
|
||||
set hidden = 1
|
||||
if(istype(usr,/mob/living/carbon))
|
||||
if(changeto == 1)
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
|
||||
if("disarm")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small_active"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("hurt")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small_active"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("grab")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small_active"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
else if(changeto == -1)
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small_active"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("disarm")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small_active"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
if("hurt")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
|
||||
if("grab")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
usr.hud_used.hurt_intent.icon_state = "harm_small_active"
|
||||
usr.hud_used.help_intent.icon_state = "help_small"
|
||||
usr.hud_used.grab_intent.icon_state = "grab_small"
|
||||
usr.hud_used.disarm_intent.icon_state = "disarm_small"
|
||||
return
|
||||
@@ -1,53 +0,0 @@
|
||||
/obj/item/weapon/storage/syndie_kit
|
||||
name = "Box"
|
||||
desc = "A sleek, sturdy box"
|
||||
icon_state = "box_of_doom"
|
||||
item_state = "syringe_kit"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom
|
||||
name = "Freedom Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/freedom(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_compress
|
||||
name = "Compressed Matter Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_compress/New()
|
||||
new /obj/item/weapon/implanter/compressed(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive
|
||||
name = "Explosive Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/explosive(O)
|
||||
O.name = "(BIO-HAZARD) BIO-detpack"
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink
|
||||
name = "Uplink Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/uplink(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space
|
||||
name = "Space Suit and Helmet"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space/New()
|
||||
new /obj/item/clothing/suit/space/syndicate(src)
|
||||
new /obj/item/clothing/head/helmet/space/syndicate(src)
|
||||
..()
|
||||
return
|
||||
@@ -1,467 +0,0 @@
|
||||
/*
|
||||
|
||||
SYNDICATE UPLINKS
|
||||
|
||||
TO-DO:
|
||||
Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
|
||||
|
||||
Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
|
||||
|
||||
I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
|
||||
to see how uplinks are assigned and if there are any bugs with those.
|
||||
|
||||
|
||||
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
|
||||
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink
|
||||
var/welcome // Welcoming menu message
|
||||
var/menu_message = "" // The actual menu text
|
||||
var/items // List of items
|
||||
var/list/ItemList // Parsed list of items
|
||||
var/uses // Numbers of crystals
|
||||
var/uplink_data // designated uplink items
|
||||
// List of items not to shove in their hands.
|
||||
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
|
||||
|
||||
New()
|
||||
if(!welcome)
|
||||
welcome = ticker.mode.uplink_welcome
|
||||
if(!uplink_data)
|
||||
uplink_data = ticker.mode.uplink_items
|
||||
|
||||
items = replacetext(uplink_data, "\n", "") // Getting the text string of items
|
||||
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
|
||||
uses = ticker.mode.uplink_uses
|
||||
|
||||
//Let's build a menu!
|
||||
proc/generate_menu()
|
||||
src.menu_message = "<B>[src.welcome]</B><BR>"
|
||||
src.menu_message += "Tele-Crystals left: [src.uses]<BR>"
|
||||
src.menu_message += "<HR>"
|
||||
src.menu_message += "<B>Request item:</B><BR>"
|
||||
src.menu_message += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
|
||||
|
||||
var/cost
|
||||
var/item
|
||||
var/name
|
||||
var/path_obj
|
||||
var/path_text
|
||||
var/category_items = 1 //To prevent stupid :P
|
||||
|
||||
for(var/D in ItemList)
|
||||
var/list/O = stringsplit(D, ":")
|
||||
if(O.len != 3) //If it is not an actual item, make a break in the menu.
|
||||
if(O.len == 1) //If there is one item, it's probably a title
|
||||
src.menu_message += "<b>[O[1]]</b><br>"
|
||||
category_items = 0
|
||||
else //Else, it's a white space.
|
||||
if(category_items < 1) //If there were no itens in the last category...
|
||||
src.menu_message += "<i>We apologize, as you could not afford anything from this category.</i><br>"
|
||||
src.menu_message += "<br>"
|
||||
continue
|
||||
|
||||
path_text = O[1]
|
||||
cost = text2num(O[2])
|
||||
|
||||
if(cost>uses)
|
||||
continue
|
||||
|
||||
path_obj = text2path(path_text)
|
||||
item = new path_obj()
|
||||
name = O[3]
|
||||
del item
|
||||
|
||||
src.menu_message += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
|
||||
category_items++
|
||||
|
||||
// src.menu_message += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
|
||||
src.menu_message += "<HR>"
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if (href_list["buy_item"])
|
||||
/* if(href_list["buy_item"] == "random")
|
||||
var/list/randomItems = list()
|
||||
|
||||
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
|
||||
//Add only items the player can afford:
|
||||
if(uses > 19)
|
||||
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
|
||||
|
||||
if(uses > 9)
|
||||
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
|
||||
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
|
||||
|
||||
//if(uses > 8) //Nothing... yet.
|
||||
//if(uses > 7) //Nothing... yet.
|
||||
|
||||
if(uses > 6)
|
||||
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
|
||||
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
|
||||
|
||||
if(uses > 5)
|
||||
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
|
||||
|
||||
if(uses > 4)
|
||||
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
|
||||
randomItems.Add("/obj/item/device/powersink") //Powersink
|
||||
|
||||
if(uses > 3)
|
||||
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
|
||||
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
|
||||
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
|
||||
|
||||
if(uses > 2)
|
||||
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
|
||||
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
|
||||
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
|
||||
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
|
||||
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
|
||||
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
|
||||
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
|
||||
randomItems.Add("/obj/item/clothing/glasses/thermal") //Thermal Imaging Goggles
|
||||
|
||||
if(uses > 1)
|
||||
/*
|
||||
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
|
||||
var/hasRevolver = 0
|
||||
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
|
||||
if(istype(I,/obj/item/weapon/gun/projectile))
|
||||
hasRevolver = 1
|
||||
|
||||
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
*/
|
||||
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
|
||||
randomItems.Add("/obj/item/weapon/plastique") //C4
|
||||
|
||||
if(uses > 0)
|
||||
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
|
||||
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
|
||||
|
||||
if(!randomItems)
|
||||
del(randomItems)
|
||||
return 0
|
||||
else
|
||||
href_list["buy_item"] = pick(randomItems)
|
||||
|
||||
switch(href_list["buy_item"]) //Ok, this gets a little messy, sorry.
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
uses -= 20
|
||||
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
|
||||
uses -= 10
|
||||
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
|
||||
uses -= 7
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
uses -= 6
|
||||
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
|
||||
uses -= 5
|
||||
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
|
||||
uses -= 4
|
||||
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
|
||||
"/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
|
||||
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal")
|
||||
uses -= 3
|
||||
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
|
||||
uses -= 2
|
||||
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
|
||||
uses -= 1
|
||||
|
||||
del(randomItems)
|
||||
return 1
|
||||
*/
|
||||
|
||||
|
||||
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
|
||||
return 0
|
||||
|
||||
if(usr:mind && ticker.mode.traitors[usr:mind])
|
||||
var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
|
||||
info.spawnlist += href_list["buy_item"]
|
||||
|
||||
uses -= text2num(href_list["cost"])
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
*PDA uplink
|
||||
*/
|
||||
|
||||
//Syndicate uplink hidden inside a traitor PDA
|
||||
//Communicate with traitor through the PDA's note function.
|
||||
|
||||
/obj/item/device/uplink/pda
|
||||
name = "uplink module"
|
||||
desc = "An electronic uplink system of unknown origin."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
var/obj/item/device/pda/hostpda = null
|
||||
|
||||
var/orignote = null //Restore original notes when locked.
|
||||
var/active = 0 //Are we currently active?
|
||||
var/lock_code = "" //The unlocking password.
|
||||
|
||||
proc
|
||||
unlock()
|
||||
if ((isnull(src.hostpda)) || (src.active))
|
||||
return
|
||||
|
||||
src.orignote = src.hostpda.note
|
||||
src.active = 1
|
||||
src.hostpda.mode = 1 //Switch right to the notes program
|
||||
|
||||
src.generate_menu()
|
||||
print_to_host(menu_message)
|
||||
|
||||
for (var/mob/M in viewers(1, src.hostpda.loc))
|
||||
if (M.client && M.machine == src.hostpda)
|
||||
src.hostpda.attack_self(M)
|
||||
|
||||
return
|
||||
|
||||
print_to_host(var/text)
|
||||
if (isnull(hostpda))
|
||||
return
|
||||
hostpda.note = text
|
||||
|
||||
for (var/mob/M in viewers(1, hostpda.loc))
|
||||
if (M.client && M.machine == hostpda)
|
||||
hostpda.attack_self(M)
|
||||
return
|
||||
|
||||
shutdown_uplink()
|
||||
if (isnull(src.hostpda))
|
||||
return
|
||||
active = 0
|
||||
hostpda.note = orignote
|
||||
if (hostpda.mode==1)
|
||||
hostpda.mode = 0
|
||||
hostpda.updateDialog()
|
||||
return
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
src.generate_menu()
|
||||
src.hostpda.note = src.menu_message
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((isnull(src.hostpda)) || (!src.active))
|
||||
return
|
||||
|
||||
if (usr.stat || usr.restrained() || !in_range(src.hostpda, usr))
|
||||
return
|
||||
|
||||
if(..() == 1) // We can afford the item
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/mob/A = src.hostpda.loc
|
||||
var/item = new path_obj(get_turf(src.hostpda))
|
||||
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
|
||||
if(!A.r_hand)
|
||||
item:loc = A
|
||||
A.r_hand = item
|
||||
item:layer = 20
|
||||
else if(!A.l_hand)
|
||||
item:loc = A
|
||||
A.l_hand = item
|
||||
item:layer = 20
|
||||
else
|
||||
item:loc = get_turf(A)
|
||||
usr.update_clothing()
|
||||
usr.client.onBought("[item:name]")
|
||||
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
|
||||
del item*/
|
||||
//HEADFINDBACK
|
||||
src.attack_self(usr)
|
||||
src.hostpda.attack_self(usr)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
*Portable radio uplink
|
||||
*/
|
||||
|
||||
//A Syndicate uplink disguised as a portable radio
|
||||
/obj/item/device/uplink/radio/implanted
|
||||
New()
|
||||
..()
|
||||
uses = 5
|
||||
return
|
||||
|
||||
explode()
|
||||
var/turf/location = get_turf(src.loc)
|
||||
if(location)
|
||||
location.hotspot_expose(700,125)
|
||||
explosion(location, 0, 0, 2, 4, 1)
|
||||
|
||||
var/obj/item/weapon/implant/uplink/U = src.loc
|
||||
var/mob/living/A = U.imp_in
|
||||
var/datum/organ/external/head = A:organs["head"]
|
||||
head.destroyed = 1
|
||||
spawn(2)
|
||||
head.droplimb()
|
||||
del(src.master)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/uplink/radio
|
||||
name = "ship bounced radio"
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "radio"
|
||||
var/temp = null //Temporary storage area for a message offering the option to destroy the radio
|
||||
var/selfdestruct = 0 //Set to 1 while the radio is self destructing itself.
|
||||
var/obj/item/device/radio/origradio = null
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
item_state = "radio"
|
||||
throwforce = 5
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
m_amt = 100
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
var/dat
|
||||
|
||||
if (src.selfdestruct)
|
||||
dat = "Self Destructing..."
|
||||
else
|
||||
if (src.temp)
|
||||
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];clear_selfdestruct=1'>Clear</A>"
|
||||
else
|
||||
src.generate_menu()
|
||||
dat = src.menu_message
|
||||
if (src.origradio) // Checking because sometimes the radio uplink may be spawned by itself, not as a normal unlockable radio
|
||||
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</A><BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='byond://?src=\ref[src];selfdestruct=1'>Self-Destruct</A>"
|
||||
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 1
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || istype(src.loc,/obj/item/weapon/implant/uplink)))
|
||||
usr.machine = src
|
||||
|
||||
if(href_list["buy_item"])
|
||||
if(..() == 1) // We can afford the item
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/item = new path_obj(get_turf(src.loc))
|
||||
var/mob/A = src.loc
|
||||
if(istype(src.loc,/obj/item/weapon/implant/uplink))
|
||||
var/obj/item/weapon/implant/uplink/U = src.loc
|
||||
A = U.imp_in
|
||||
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
|
||||
if(!A.r_hand)
|
||||
item:loc = A
|
||||
A.r_hand = item
|
||||
item:layer = 20
|
||||
else if(!A.l_hand)
|
||||
item:loc = A
|
||||
A.l_hand = item
|
||||
item:layer = 20
|
||||
else
|
||||
item:loc = get_turf(A)
|
||||
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
|
||||
del item*/
|
||||
usr.client.onBought("[item:name]")
|
||||
src.attack_self(usr)
|
||||
return
|
||||
|
||||
else if (href_list["lock"] && src.origradio)
|
||||
// presto chango, a regular radio again! (reset the freq too...)
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=radio")
|
||||
var/obj/item/device/radio/T = src.origradio
|
||||
var/obj/item/device/uplink/radio/R = src
|
||||
R.loc = T
|
||||
T.loc = usr
|
||||
// R.layer = initial(R.layer)
|
||||
R.layer = 0
|
||||
if (usr.client)
|
||||
usr.client.screen -= R
|
||||
if (usr.r_hand == R)
|
||||
usr.u_equip(R)
|
||||
usr.r_hand = T
|
||||
|
||||
else
|
||||
usr.u_equip(R)
|
||||
usr.l_hand = T
|
||||
R.loc = T
|
||||
T.layer = 20
|
||||
T.set_frequency(initial(T.frequency))
|
||||
T.attack_self(usr)
|
||||
return
|
||||
|
||||
else if (href_list["selfdestruct"])
|
||||
src.temp = "<A href='byond://?src=\ref[src];selfdestruct2=1'>Self-Destruct</A>"
|
||||
|
||||
else if (href_list["selfdestruct2"])
|
||||
src.selfdestruct = 1
|
||||
spawn (100)
|
||||
explode()
|
||||
return
|
||||
|
||||
else if (href_list["clear_selfdestruct"])
|
||||
src.temp = null
|
||||
|
||||
attack_self(usr)
|
||||
// if (istype(src.loc, /mob))
|
||||
// attack_self(src.loc)
|
||||
// else
|
||||
// for(var/mob/M in viewers(1, src))
|
||||
// if (M.client)
|
||||
// src.attack_self(M)
|
||||
return
|
||||
|
||||
proc/explode()
|
||||
var/turf/location = get_turf(src.loc)
|
||||
if(location)
|
||||
location.hotspot_expose(700,125)
|
||||
explosion(location, 0, 0, 2, 4, 1)
|
||||
|
||||
del(src.master)
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/shutdown_uplink()
|
||||
if (!src.origradio)
|
||||
return
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if (M.client && M.machine == src)
|
||||
M << browse(null, "window=radio")
|
||||
M.machine = null
|
||||
|
||||
var/obj/item/device/radio/T = src.origradio
|
||||
var/obj/item/device/uplink/radio/R = src
|
||||
var/mob/L = src.loc
|
||||
R.loc = T
|
||||
T.loc = L
|
||||
// R.layer = initial(R.layer)
|
||||
R.layer = 0
|
||||
if (istype(L))
|
||||
if (L.client)
|
||||
L.client.screen -= R
|
||||
if (L.r_hand == R)
|
||||
L.u_equip(R)
|
||||
L.r_hand = T
|
||||
else
|
||||
L.u_equip(R)
|
||||
L.l_hand = T
|
||||
T.layer = 20
|
||||
T.set_frequency(initial(T.frequency))
|
||||
return
|
||||
@@ -1,145 +0,0 @@
|
||||
// Contains: copy machine
|
||||
|
||||
/obj/machinery/copier
|
||||
name = "Copy Machine"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "copier_o"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/num_copies = 1 // number of copies selected, will be maintained between jobs
|
||||
var/copying = 0 // are we copying
|
||||
var/job_num_copies = 0 // number of copies remaining
|
||||
var/obj/item/weapon/template // the paper OR photo being scanned
|
||||
var/max_copies = 10 // MAP EDITOR: can set the number of max copies, possibly to 5 or something for public, more for QM, robutist, etc.
|
||||
|
||||
/obj/machinery/copier/attackby(obj/item/weapon/O as obj, mob/user as mob)
|
||||
if(template)
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo))
|
||||
// put it inside
|
||||
template = O
|
||||
usr.drop_item()
|
||||
O.loc = src
|
||||
update()
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/copier/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/copier/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/copier/attack_hand(mob/user as mob)
|
||||
// da UI
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
if(src.stat)
|
||||
user << "[name] does not seem to be responding to your button mashing."
|
||||
return
|
||||
|
||||
dat = "<HEAD><TITLE>Copy Machine</TITLE></HEAD><TT><b>Xeno Corp. Copying Machine</b><hr>"
|
||||
|
||||
if(copying)
|
||||
dat += "[job_num_copies] copies remaining.<br><br>"
|
||||
dat += "<A href='?src=\ref[src];cancel=1'>Cancel</A>"
|
||||
else
|
||||
if(template)
|
||||
dat += "<A href='?src=\ref[src];open=1'>Open Lid</A>"
|
||||
else
|
||||
dat += "<b>No paper to be copied.<br>"
|
||||
dat += "Please place a paper or photograph on top and close the lid.</b>"
|
||||
|
||||
|
||||
dat += "<br><br>Number of Copies: "
|
||||
dat += "<A href='?src=\ref[src];num=-10'>-</A>"
|
||||
dat += "<A href='?src=\ref[src];num=-1'>-</A>"
|
||||
dat += " [num_copies] "
|
||||
dat += "<A href='?src=\ref[src];num=1'>+</A>"
|
||||
dat += "<A href='?src=\ref[src];num=10'>+</A><br>"
|
||||
|
||||
if(template)
|
||||
dat += "<A href='?src=\ref[src];copy=1'>Copy</a>"
|
||||
|
||||
dat += "</TT>"
|
||||
|
||||
user << browse(dat, "window=copy_machine")
|
||||
onclose(user, "copy_machine")
|
||||
|
||||
/obj/machinery/copier/proc/update()
|
||||
if(template)
|
||||
icon_state = "copier"
|
||||
else
|
||||
icon_state = "copier_o"
|
||||
|
||||
/obj/machinery/copier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
|
||||
if(href_list["num"])
|
||||
num_copies += text2num(href_list["num"])
|
||||
if(num_copies < 1)
|
||||
num_copies = 1
|
||||
else if(num_copies > max_copies)
|
||||
num_copies = max_copies
|
||||
updateDialog()
|
||||
if(href_list["open"])
|
||||
if(copying)
|
||||
return
|
||||
template.loc = src.loc
|
||||
template = null
|
||||
updateDialog()
|
||||
update()
|
||||
if(href_list["copy"])
|
||||
if(copying)
|
||||
return
|
||||
job_num_copies = num_copies
|
||||
spawn(0)
|
||||
do_copy(usr)
|
||||
|
||||
if(href_list["cancel"])
|
||||
job_num_copies = 0
|
||||
|
||||
/obj/machinery/copier/proc/do_copy(mob/user)
|
||||
if(!copying && job_num_copies > 0)
|
||||
copying = 1
|
||||
updateDialog()
|
||||
while(job_num_copies > 0)
|
||||
if(stat)
|
||||
copying = 0
|
||||
return
|
||||
|
||||
// fx
|
||||
flick("copier_s", src)
|
||||
playsound(src, 'sound/items/polaroid1.ogg', 50, 1)
|
||||
|
||||
// dup the file
|
||||
if(istype(template, /obj/item/weapon/paper))
|
||||
// make duplicate paper
|
||||
var/obj/item/weapon/paper/P = new(src.loc)
|
||||
P.name = template.name
|
||||
P.info = template:info
|
||||
P.stamped = template:stamped
|
||||
P.icon_state = template.icon_state
|
||||
P.overlays = null
|
||||
for(var/overlay in template.overlays)
|
||||
P.overlays += overlay
|
||||
else if(istype(template, /obj/item/weapon/photo))
|
||||
// make duplicate photo
|
||||
var/obj/item/weapon/photo/P = new(src.loc)
|
||||
P.name = template.name
|
||||
P.desc = template.desc
|
||||
P.icon = template.icon
|
||||
P.img = template:img
|
||||
|
||||
sleep(30)
|
||||
job_num_copies -= 1
|
||||
updateDialog()
|
||||
for(var/mob/O in hearers(src))
|
||||
O.show_message("[name] beeps happily.", 2)
|
||||
copying = 0
|
||||
updateDialog()
|
||||
@@ -1,23 +0,0 @@
|
||||
/obj/structure/filingcabinet
|
||||
name = "Filing Cabinet"
|
||||
desc = "A large cabinet with drawers."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "filingcabinet"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/filingcabinet/attackby(obj/item/weapon/paper/P,mob/M)
|
||||
if(istype(P))
|
||||
M << "You put the [P] in the [src]."
|
||||
M.drop_item()
|
||||
P.loc = src
|
||||
else
|
||||
M << "You can't put a [P] in the [src]!"
|
||||
|
||||
/obj/structure/filingcabinet/attack_hand(mob/user)
|
||||
if(src.contents.len <= 0)
|
||||
user << "The [src] is empty."
|
||||
return
|
||||
var/obj/item/weapon/paper/P = input(user,"Choose a sheet to take out.","[src]", "Cancel") as null|obj in src.contents
|
||||
if(!isnull(P) && in_range(src,user))
|
||||
P.loc = user.loc
|
||||
@@ -1,208 +0,0 @@
|
||||
/obj/spawner
|
||||
name = "object spawner"
|
||||
|
||||
/obj/spawner/bomb
|
||||
name = "bomb"
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
var/btype = 0 //0 = radio, 1= prox, 2=time
|
||||
var/explosive = 1 // 0= firebomb
|
||||
var/btemp = 500 // bomb temperature (degC)
|
||||
var/active = 0
|
||||
|
||||
/obj/spawner/bomb/radio
|
||||
btype = 0
|
||||
|
||||
/obj/spawner/bomb/proximity
|
||||
btype = 1
|
||||
|
||||
/obj/spawner/bomb/timer
|
||||
btype = 2
|
||||
|
||||
/obj/spawner/bomb/timer/syndicate
|
||||
btemp = 450
|
||||
|
||||
/obj/spawner/bomb/suicide
|
||||
btype = 3
|
||||
|
||||
/obj/spawner/newbomb
|
||||
// Remember to delete it if you use it for anything else other than uplinks. See the commented line in its New() - Abi
|
||||
// Going in depth: the reason we do not do a Del() in its New()is because then we cannot access its properties.
|
||||
// I might be doing this wrong / not knowing of a Byond function. If I'm doing it wrong, let me know please.
|
||||
name = "bomb"
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
var/btype = 0 // 0=radio, 1=prox, 2=time
|
||||
var/btemp1 = 1500
|
||||
var/btemp2 = 1000 // tank temperatures
|
||||
|
||||
/obj/spawner/newbomb/timer
|
||||
btype = 2
|
||||
|
||||
/obj/spawner/newbomb/timer/syndicate
|
||||
name = "Low-Yield Bomb"
|
||||
btemp1 = 1500
|
||||
btemp2 = 1000
|
||||
|
||||
/obj/spawner/newbomb/proximity
|
||||
btype = 1
|
||||
|
||||
/obj/spawner/newbomb/radio
|
||||
btype = 0
|
||||
|
||||
/obj/spawner/bomb/New()
|
||||
..()
|
||||
|
||||
switch (src.btype)
|
||||
// radio
|
||||
if (0)
|
||||
var/obj/item/assembly/r_i_ptank/R = new /obj/item/assembly/r_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R)
|
||||
var/obj/item/device/radio/signaler/p1 = new /obj/item/device/radio/signaler(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
p1.b_stat = 0
|
||||
p2.status = 1
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
|
||||
// proximity
|
||||
if (1)
|
||||
var/obj/item/assembly/m_i_ptank/R = new /obj/item/assembly/m_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R)
|
||||
var/obj/item/device/prox_sensor/p1 = new /obj/item/device/prox_sensor(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
|
||||
if(src.active)
|
||||
R.part1.state = 1
|
||||
R.part1.icon_state = text("motion[]", 1)
|
||||
R.c_state(1, src)
|
||||
|
||||
// timer
|
||||
if (2)
|
||||
var/obj/item/assembly/t_i_ptank/R = new /obj/item/assembly/t_i_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R)
|
||||
var/obj/item/device/timer/p1 = new /obj/item/device/timer(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
R.status = explosive
|
||||
|
||||
p3.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
//bombvest
|
||||
if(3)
|
||||
var/obj/item/clothing/suit/armor/a_i_a_ptank/R = new /obj/item/clothing/suit/armor/a_i_a_ptank(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/p4 = new /obj/item/weapon/tank/plasma(R)
|
||||
var/obj/item/device/healthanalyzer/p1 = new /obj/item/device/healthanalyzer(R)
|
||||
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
||||
var/obj/item/clothing/suit/armor/vest/p3 = new /obj/item/clothing/suit/armor/vest(R)
|
||||
R.part1 = p1
|
||||
R.part2 = p2
|
||||
R.part3 = p3
|
||||
R.part4 = p4
|
||||
p1.master = R
|
||||
p2.master = R
|
||||
p3.master = R
|
||||
p4.master = R
|
||||
R.status = explosive
|
||||
|
||||
p4.air_contents.temperature = btemp + T0C
|
||||
p2.status = 1
|
||||
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/spawner/newbomb/New()
|
||||
..()
|
||||
|
||||
switch (src.btype)
|
||||
// radio
|
||||
if (0)
|
||||
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/radio/signaler/S = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = S
|
||||
|
||||
S.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
|
||||
S.b_stat = 0
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
|
||||
// proximity
|
||||
if (1)
|
||||
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/prox_sensor/P = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = P
|
||||
|
||||
P.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
|
||||
|
||||
// timer
|
||||
if (2)
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/plasma/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
|
||||
var/obj/item/device/timer/T = new(V)
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
V.attached_device = T
|
||||
|
||||
T.master = V
|
||||
PT.master = V
|
||||
OT.master = V
|
||||
T.time = 30
|
||||
|
||||
PT.air_contents.temperature = btemp1 + T0C
|
||||
OT.air_contents.temperature = btemp2 + T0C
|
||||
|
||||
V.update_icon()
|
||||
//del(src)
|
||||
@@ -1,71 +0,0 @@
|
||||
//This looks to be the traitor win tracker code.
|
||||
client/proc/add_roundsjoined()
|
||||
if(!makejson)
|
||||
return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `roundsjoined` (`ckey`) VALUES ('[ckey(src.key)]')")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/add_roundssurvived()
|
||||
if(!makejson)
|
||||
return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `roundsurvived` (`ckey`) VALUES ('[ckey(src.key)]')")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/onDeath()
|
||||
if(!makejson)
|
||||
return
|
||||
roundinfo.deaths++
|
||||
if(!ismob(mob))
|
||||
return
|
||||
var/area = get_area(mob)
|
||||
var/attacker
|
||||
var/tod = time2text(world.realtime)
|
||||
var/health
|
||||
var/last
|
||||
if(ishuman(mob.lastattacker))
|
||||
attacker = mob.lastattacker:name
|
||||
else
|
||||
attacker = "None"
|
||||
health = "Oxy:[mob.oxyloss]Brute:[mob.bruteloss]Burn:[mob.fireloss]Toxins:[mob.toxloss]Brain:[mob.brainloss]"
|
||||
if(mob.attack_log.len >= 1)
|
||||
last = mob.attack_log[mob.attack_log.len]
|
||||
else
|
||||
last = "None"
|
||||
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `deathlog` (`ckey`,`location`,`lastattacker`,`ToD`,`health`,`lasthit`) VALUES ('[ckey]',[dbcon.Quote(area)],[dbcon.Quote(attacker)],'[tod]','[health]',[dbcon.Quote(last)])")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
client/proc/onBought(names)
|
||||
if(!makejson) return
|
||||
if(!names) return
|
||||
var/DBConnection/dbcon = new()
|
||||
|
||||
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
|
||||
if(!dbcon.IsConnected()) return
|
||||
|
||||
var/DBQuery/cquery = dbcon.NewQuery("INSERT INTO `traitorbuy` (`type`) VALUES ([dbcon.Quote(names)])")
|
||||
if(!cquery.Execute()) message_admins(cquery.ErrorMsg())
|
||||
|
||||
datum/roundinfo
|
||||
var/core = 0
|
||||
var/deaths = 0
|
||||
var/revies = 0
|
||||
var/starttime = 0
|
||||
var/endtime = 0
|
||||
var/lenght = 0
|
||||
var/mode = 0
|
||||
@@ -1,164 +0,0 @@
|
||||
// -------------------------------------
|
||||
// Bluespace Belt
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/bluespace
|
||||
name = "Belt of Holding"
|
||||
desc = "The greatest in pants-supporting technology."
|
||||
icon_state = "medicalbelt"
|
||||
item_state = "medical"
|
||||
storage_slots = 14
|
||||
w_class = 4
|
||||
max_w_class = 2
|
||||
max_combined_w_class = 21 // = 14 * 1.5, not 14 * 2. This is deliberate
|
||||
origin_tech = "bluespace=4"
|
||||
can_hold = list()
|
||||
New()
|
||||
if(prob(5))
|
||||
//Sometimes people choose justice.
|
||||
//Sometimes justice chooses you.
|
||||
visible_message("That doesn't look like a normal Toolbelt of Holding...")
|
||||
new /obj/item/weapon/storage/belt/bluespace/owlman(loc)
|
||||
spawn(1)
|
||||
del src
|
||||
return
|
||||
..()
|
||||
|
||||
proc/failcheck(mob/user as mob)
|
||||
if (prob(src.reliability)) return 1 //No failure
|
||||
if (prob(src.reliability))
|
||||
user << "\red The Bluespace portal resists your attempt to add another item." //light failure
|
||||
else
|
||||
user << "\red The Bluespace generator malfunctions!"
|
||||
for (var/obj/O in src.contents) //it broke, delete what was in it
|
||||
del(O)
|
||||
crit_fail = 1
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/storage/belt/bluespace/owlman
|
||||
name = "Owlman's utility belt"
|
||||
desc = "Sometimes people choose justice. Sometimes, justice chooses you..."
|
||||
icon_state = "securitybelt"
|
||||
item_state = "security"
|
||||
storage_slots = 14
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 28 // = 14 * 2
|
||||
origin_tech = "bluespace=4;syndicate=2"
|
||||
allow_quick_empty = 1
|
||||
can_hold = list()
|
||||
New()
|
||||
..()
|
||||
new /obj/item/clothing/mask/gas/owl_mask(src)
|
||||
new /obj/item/clothing/under/owl(src)
|
||||
new /obj/item/weapon/grenade/smokebomb(src)
|
||||
new /obj/item/weapon/grenade/smokebomb(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
|
||||
|
||||
|
||||
// As a last resort, the belt can be used as a plastic explosive with a fixed timer (15 seconds). Naturally, you'll lose all your gear...
|
||||
// Of course, it could be worse. It could spawn a singularity!
|
||||
/obj/item/weapon/storage/belt/bluespace/owlman/afterattack(atom/target as obj|turf, mob/user as mob, flag)
|
||||
if (!flag)
|
||||
return
|
||||
if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage) || istype(target, /obj/structure/table) || istype(target, /obj/structure/closet))
|
||||
return
|
||||
user << "Planting explosives..."
|
||||
user.visible_message("[user.name] is fiddling with their toolbelt.")
|
||||
if(ismob(target))
|
||||
user.attack_log += "\[[time_stamp()]\] <font color='red'> [user.real_name] tried planting [name] on [target:real_name] ([target:ckey])</font>"
|
||||
log_attack("<font color='red'> [user.real_name] ([user.ckey]) tried planting [name] on [target:real_name] ([target:ckey])</font>")
|
||||
user.visible_message("\red [user.name] is trying to strap a belt to [target.name]!")
|
||||
|
||||
|
||||
if(do_after(user, 50) && in_range(user, target))
|
||||
user.drop_item()
|
||||
target = target
|
||||
loc = null
|
||||
var/location
|
||||
if (isturf(target)) location = target
|
||||
if (ismob(target))
|
||||
target:attack_log += "\[[time_stamp()]\]<font color='orange'> Had the [name] planted on them by [user.real_name] ([user.ckey])</font>"
|
||||
user.visible_message("\red [user.name] finished planting an explosive on [target.name]!")
|
||||
target.overlays += image('icons/obj/assemblies.dmi', "plastic-explosive2")
|
||||
user << "You sacrifice your belt for the sake of justice. Timer counting down from 15."
|
||||
spawn(150)
|
||||
if(target)
|
||||
if(ismob(target) || isobj(target))
|
||||
location = target.loc // These things can move
|
||||
explosion(location, -1, -1, 2, 3)
|
||||
if (istype(target, /turf/simulated/wall)) target:dismantle_wall(1)
|
||||
else target.ex_act(1)
|
||||
if (isobj(target))
|
||||
if (target)
|
||||
del(target)
|
||||
if (src)
|
||||
del(src)
|
||||
/obj/item/weapon/storage/belt/bluespace/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/belt/bluespace/admin
|
||||
name = "Admin's Tool-belt"
|
||||
desc = "Holds everything for those that run everything."
|
||||
icon_state = "soulstonebelt"
|
||||
item_state = "soulstonebelt"
|
||||
w_class = 10 // permit holding other storage items
|
||||
storage_slots = 28
|
||||
max_w_class = 10
|
||||
max_combined_w_class = 280
|
||||
can_hold = list()
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/weldingtool/hugetank(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
new /obj/item/stack/cable_coil(src)
|
||||
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/dnainjector/xraymut(src)
|
||||
new /obj/item/weapon/dnainjector/firemut(src)
|
||||
new /obj/item/weapon/dnainjector/telemut(src)
|
||||
new /obj/item/weapon/dnainjector/hulkmut(src)
|
||||
// new /obj/item/weapon/spellbook(src) // for smoke effects, door openings, etc
|
||||
// new /obj/item/weapon/magic/spellbook(src)
|
||||
|
||||
// new/obj/item/weapon/reagent_containers/hypospray/admin(src)
|
||||
|
||||
/obj/item/weapon/storage/belt/bluespace/sandbox
|
||||
name = "Sandbox Mode Toolbelt"
|
||||
desc = "Holds whatever, you can spawn your own damn stuff."
|
||||
w_class = 10 // permit holding other storage items
|
||||
storage_slots = 28
|
||||
max_w_class = 10
|
||||
max_combined_w_class = 280
|
||||
can_hold = list()
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/weldingtool/hugetank(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
new /obj/item/stack/cable_coil(src)
|
||||
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/device/healthanalyzer(src)
|
||||
|
||||
|
||||
//Research for the Bluespace Belt
|
||||
datum/design/bluespace_belt
|
||||
name = "Experimental Bluespace Belt"
|
||||
desc = "An astonishingly complex belt popularized by a rich blue-space technology magnate."
|
||||
id = "bluespace_belt"
|
||||
req_tech = list("bluespace" = 4, "materials" = 6)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$gold" = 1500, "$diamond" = 3000, "$uranium" = 1000)
|
||||
reliability_base = 80
|
||||
build_path = "/obj/item/weapon/storage/belt/bluespace"
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
|
||||
Hey you!
|
||||
You only need to untick maps/tgstation.2.0.9.dmm for this if you download the modified map from:
|
||||
http://tgstation13.googlecode.com/files/tgstation.2.1.0_deptsec.zip
|
||||
|
||||
Everything else can just be ticked on top of the original stuff.
|
||||
*/
|
||||
@@ -1,126 +0,0 @@
|
||||
var/list/sec_departments = list("engineering", "supply", "medical", "science")
|
||||
|
||||
proc/assign_sec_to_department(var/mob/living/carbon/human/H)
|
||||
if(sec_departments.len)
|
||||
var/department = pick(sec_departments)
|
||||
sec_departments -= department
|
||||
var/access = null
|
||||
var/destination = null
|
||||
switch(department)
|
||||
if("supply")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/cargo(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_l_ear)
|
||||
access = list(access_mailsorting, access_mining)
|
||||
destination = /area/security/checkpoint/supply
|
||||
if("engineering")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/engine(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_l_ear)
|
||||
access = list(access_construction, access_engine)
|
||||
destination = /area/security/checkpoint/engineering
|
||||
if("medical")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/med(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_l_ear)
|
||||
access = list(access_medical)
|
||||
destination = /area/security/checkpoint/medical
|
||||
if("science")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/science(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_l_ear)
|
||||
access = list(access_research)
|
||||
destination = /area/security/checkpoint/science
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
|
||||
|
||||
if(destination)
|
||||
var/teleport = 0
|
||||
if(!ticker || ticker.current_state <= GAME_STATE_SETTING_UP)
|
||||
teleport = 1
|
||||
spawn(15)
|
||||
if(H)
|
||||
if(teleport)
|
||||
var/turf/T
|
||||
var/safety = 0
|
||||
while(safety < 25)
|
||||
T = pick(get_area_turfs(destination))
|
||||
if(!H.Move(T))
|
||||
safety += 1
|
||||
continue
|
||||
else
|
||||
break
|
||||
H << "<b>You have been assigned to [department]!</b>"
|
||||
if(locate(/obj/item/weapon/card/id, H))
|
||||
var/obj/item/weapon/card/id/I = locate(/obj/item/weapon/card/id, H)
|
||||
if(I)
|
||||
I.access |= access
|
||||
|
||||
|
||||
/datum/job/officer
|
||||
title = "Security Officer"
|
||||
flag = OFFICER
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 5
|
||||
spawn_positions = 5
|
||||
supervisors = "the head of security, and the head of your assigned department (if applicable)"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
assign_sec_to_department(H)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
return 1
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/New()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/engi
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/supply
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/med
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_med
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/sci
|
||||
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
|
||||
|
||||
/obj/item/clothing/under/rank/security/cargo/New()
|
||||
var/obj/item/clothing/tie/armband/cargo/A = new /obj/item/clothing/tie/armband/cargo
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/engine/New()
|
||||
var/obj/item/clothing/tie/armband/engine/A = new /obj/item/clothing/tie/armband/engine
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/science/New()
|
||||
var/obj/item/clothing/tie/armband/science/A = new /obj/item/clothing/tie/armband/science
|
||||
hastie = A
|
||||
|
||||
/obj/item/clothing/under/rank/security/med/New()
|
||||
var/obj/item/clothing/tie/armband/medgreen/A = new /obj/item/clothing/tie/armband/medgreen
|
||||
hastie = A
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
|
||||
Hey you!
|
||||
You'll need to untick code/game/jobs/access.dm for this to all work correctly!
|
||||
|
||||
Everything else can just be ticked on top of the original stuff.
|
||||
|
||||
You'll also need to download a modified map from http://tgstation13.googlecode.com/files/tgstation.2.0.9_Softcurity.zip.
|
||||
Make sure to untick the original map!
|
||||
*/
|
||||
@@ -1,522 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/var/const/access_security = 1 // Security equipment
|
||||
/var/const/access_brig = 2 // Brig timers and permabrig
|
||||
/var/const/access_armory = 3
|
||||
/var/const/access_forensics_lockers= 4
|
||||
/var/const/access_medical = 5
|
||||
/var/const/access_morgue = 6
|
||||
/var/const/access_tox = 7
|
||||
/var/const/access_tox_storage = 8
|
||||
/var/const/access_genetics = 9
|
||||
/var/const/access_engine = 10
|
||||
/var/const/access_engine_equip= 11
|
||||
/var/const/access_maint_tunnels = 12
|
||||
/var/const/access_external_airlocks = 13
|
||||
/var/const/access_emergency_storage = 14
|
||||
/var/const/access_change_ids = 15
|
||||
/var/const/access_ai_upload = 16
|
||||
/var/const/access_teleporter = 17
|
||||
/var/const/access_eva = 18
|
||||
/var/const/access_heads = 19
|
||||
/var/const/access_captain = 20
|
||||
/var/const/access_all_personal_lockers = 21
|
||||
/var/const/access_chapel_office = 22
|
||||
/var/const/access_tech_storage = 23
|
||||
/var/const/access_atmospherics = 24
|
||||
/var/const/access_bar = 25
|
||||
/var/const/access_janitor = 26
|
||||
/var/const/access_crematorium = 27
|
||||
/var/const/access_kitchen = 28
|
||||
/var/const/access_robotics = 29
|
||||
/var/const/access_rd = 30
|
||||
/var/const/access_cargo = 31
|
||||
/var/const/access_construction = 32
|
||||
/var/const/access_chemistry = 33
|
||||
/var/const/access_cargo_bot = 34
|
||||
/var/const/access_hydroponics = 35
|
||||
/var/const/access_manufacturing = 36
|
||||
/var/const/access_library = 37
|
||||
/var/const/access_lawyer = 38
|
||||
/var/const/access_virology = 39
|
||||
/var/const/access_cmo = 40
|
||||
/var/const/access_qm = 41
|
||||
/var/const/access_court = 42
|
||||
/var/const/access_clown = 43
|
||||
/var/const/access_mime = 44
|
||||
/var/const/access_surgery = 45
|
||||
/var/const/access_theatre = 46
|
||||
/var/const/access_research = 47
|
||||
/var/const/access_mining = 48
|
||||
/var/const/access_mining_office = 49 //not in use
|
||||
/var/const/access_mailsorting = 50
|
||||
/var/const/access_mint = 51
|
||||
/var/const/access_mint_vault = 52
|
||||
/var/const/access_heads_vault = 53
|
||||
/var/const/access_mining_station = 54
|
||||
/var/const/access_xenobiology = 55
|
||||
/var/const/access_ce = 56
|
||||
/var/const/access_hop = 57
|
||||
/var/const/access_hos = 58
|
||||
/var/const/access_RC_announce = 59 //Request console announcements
|
||||
/var/const/access_keycard_auth = 60 //Used for events which require at least two people to confirm them
|
||||
/var/const/access_tcomsat = 61 // has access to the entire telecomms satellite / machinery
|
||||
/var/const/access_gateway = 62
|
||||
/var/const/access_sec_doors = 63 // Security front doors
|
||||
|
||||
//BEGIN CENTCOM ACCESS
|
||||
/*Should leave plenty of room if we need to add more access levels.
|
||||
/var/const/Mostly for admin fun times.*/
|
||||
/var/const/access_cent_general = 101//General facilities.
|
||||
/var/const/access_cent_thunder = 102//Thunderdome.
|
||||
/var/const/access_cent_specops = 103//Special Ops.
|
||||
/var/const/access_cent_medical = 104//Medical/Research
|
||||
/var/const/access_cent_living = 105//Living quarters.
|
||||
/var/const/access_cent_storage = 106//Generic storage areas.
|
||||
/var/const/access_cent_teleporter = 107//Teleporter.
|
||||
/var/const/access_cent_creed = 108//Creed's office.
|
||||
/var/const/access_cent_captain = 109//Captain's office/ID comp/AI.
|
||||
|
||||
//The Syndicate
|
||||
/var/const/access_syndicate = 150//General Syndicate Access
|
||||
|
||||
//MONEY
|
||||
/var/const/access_crate_cash = 200
|
||||
|
||||
/obj/var/list/req_access = null
|
||||
/obj/var/req_access_txt = "0"
|
||||
/obj/var/list/req_one_access = null
|
||||
/obj/var/req_one_access_txt = "0"
|
||||
|
||||
/obj/New()
|
||||
..()
|
||||
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
if(!req_access)
|
||||
req_access = list()
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_access += n
|
||||
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
if(!req_one_access)
|
||||
req_one_access = list()
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_one_access += n
|
||||
|
||||
|
||||
|
||||
//returns 1 if this mob has sufficient access to use this object
|
||||
/obj/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
if(src.check_access(null))
|
||||
return 1
|
||||
if(istype(M, /mob/living/silicon))
|
||||
//AI can do whatever he wants
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
//if they are holding or wearing a card that has access, that works
|
||||
if(src.check_access(H.get_active_hand()) || src.check_access(H.wear_id))
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/alien/humanoid))
|
||||
var/mob/living/carbon/george = M
|
||||
//they can only hold things :(
|
||||
if(george.get_active_hand() && (istype(george.get_active_hand(), /obj/item/weapon/card/id) || istype(george.get_active_hand(), /obj/item/device/pda)) && src.check_access(george.get_active_hand()))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/proc/GetAccess()
|
||||
return list()
|
||||
|
||||
/obj/item/proc/GetID()
|
||||
return null
|
||||
|
||||
/obj/proc/check_access(obj/item/weapon/card/id/I)
|
||||
|
||||
if (istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
|
||||
if(!src.req_access && !src.req_one_access) //no requirements
|
||||
return 1
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
var/list/L = src.req_access
|
||||
if(!L.len && (!src.req_one_access || !src.req_one_access.len)) //no requirements
|
||||
return 1
|
||||
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in I.access) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/proc/check_access_list(var/list/L)
|
||||
if(!src.req_access && !src.req_one_access) return 1
|
||||
if(!istype(src.req_access, /list)) return 1
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in L) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/proc/get_access(job)
|
||||
switch(job)
|
||||
if("Geneticist")
|
||||
return list(access_medical, access_morgue, access_genetics)
|
||||
if("Station Engineer")
|
||||
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction)
|
||||
if("Assistant")
|
||||
if(config.assistant_maint)
|
||||
return list(access_maint_tunnels)
|
||||
else
|
||||
return list()
|
||||
if("Chaplain")
|
||||
return list(access_morgue, access_chapel_office, access_crematorium)
|
||||
if("Detective")
|
||||
return list(access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
if("Medical Doctor")
|
||||
return list(access_medical, access_morgue, access_surgery)
|
||||
if("Botanist") // -- TLE
|
||||
return list(access_hydroponics, access_morgue) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // //Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT //Given Morgue access because they have a viable means of cloning.
|
||||
if("Librarian") // -- TLE
|
||||
return list(access_library)
|
||||
if("Lawyer") //Muskets 160910
|
||||
return list(access_lawyer, access_court, access_sec_doors)
|
||||
if("Captain")
|
||||
return get_all_accesses()
|
||||
if("Crew Supervisor")
|
||||
return list(access_security, access_sec_doors, access_brig, access_court)
|
||||
if("Correctional Advisor")
|
||||
return list(access_security, access_sec_doors, access_brig, access_armory, access_court)
|
||||
if("Scientist")
|
||||
return list(access_tox, access_tox_storage, access_research, access_xenobiology)
|
||||
if("Safety Administrator")
|
||||
return list(access_medical, access_morgue, access_tox, access_tox_storage, access_chemistry, access_genetics, access_court,
|
||||
access_teleporter, access_heads, access_tech_storage, access_security, access_sec_doors, access_brig, access_atmospherics,
|
||||
access_maint_tunnels, access_bar, access_janitor, access_kitchen, access_robotics, access_armory, access_hydroponics,
|
||||
access_theatre, access_research, access_hos, access_RC_announce, access_forensics_lockers, access_keycard_auth, access_gateway)
|
||||
if("Head of Personnel")
|
||||
return list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access_tox, access_tox_storage, access_chemistry, access_medical, access_genetics, access_engine,
|
||||
access_emergency_storage, access_change_ids, access_ai_upload, access_eva, access_heads,
|
||||
access_all_personal_lockers, access_tech_storage, access_maint_tunnels, access_bar, access_janitor,
|
||||
access_crematorium, access_kitchen, access_robotics, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway)
|
||||
if("Atmospheric Technician")
|
||||
return list(access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction)
|
||||
if("Bartender")
|
||||
return list(access_bar)
|
||||
if("Chemist")
|
||||
return list(access_medical, access_chemistry)
|
||||
if("Janitor")
|
||||
return list(access_janitor, access_maint_tunnels)
|
||||
if("Clown")
|
||||
return list(access_clown, access_theatre)
|
||||
if("Mime")
|
||||
return list(access_mime, access_theatre)
|
||||
if("Chef")
|
||||
return list(access_kitchen, access_morgue)
|
||||
if("Roboticist")
|
||||
return list(access_robotics, access_tech_storage, access_morgue) //As a job that handles so many corpses, it makes sense for them to have morgue access.
|
||||
if("Cargo Technician")
|
||||
return list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting)
|
||||
if("Shaft Miner")
|
||||
return list(access_mining, access_mint, access_mining_station)
|
||||
if("Quartermaster")
|
||||
return list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
|
||||
if("Chief Engineer")
|
||||
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
|
||||
access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
|
||||
access_heads, access_ai_upload, access_construction, access_robotics,
|
||||
access_mint, access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_sec_doors)
|
||||
if("Research Director")
|
||||
return list(access_rd, access_heads, access_tox, access_genetics,
|
||||
access_tox_storage, access_teleporter,
|
||||
access_research, access_robotics, access_xenobiology,
|
||||
access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_sec_doors)
|
||||
if("Virologist")
|
||||
return list(access_medical, access_virology)
|
||||
if("Chief Medical Officer")
|
||||
return list(access_medical, access_morgue, access_genetics, access_heads,
|
||||
access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce,
|
||||
access_keycard_auth, access_sec_doors)
|
||||
else
|
||||
return list()
|
||||
|
||||
/proc/get_centcom_access(job)
|
||||
switch(job)
|
||||
if("VIP Guest")
|
||||
return list(access_cent_general)
|
||||
if("Custodian")
|
||||
return list(access_cent_general, access_cent_living, access_cent_storage)
|
||||
if("Thunderdome Overseer")
|
||||
return list(access_cent_general, access_cent_thunder)
|
||||
if("Intel Officer")
|
||||
return list(access_cent_general, access_cent_living)
|
||||
if("Medical Officer")
|
||||
return list(access_cent_general, access_cent_living, access_cent_medical)
|
||||
if("Death Commando")
|
||||
return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)
|
||||
if("Research Officer")
|
||||
return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_teleporter, access_cent_storage)
|
||||
if("BlackOps Commander")
|
||||
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_living, access_cent_storage, access_cent_creed)
|
||||
if("Supreme Commander")
|
||||
return get_all_centcom_access()
|
||||
|
||||
/proc/get_all_accesses()
|
||||
return list(access_security, access_sec_doors, access_brig, access_armory, access_forensics_lockers, access_court,
|
||||
access_medical, access_genetics, access_morgue, access_rd,
|
||||
access_tox, access_tox_storage, access_chemistry, access_engine, access_engine_equip, access_maint_tunnels,
|
||||
access_external_airlocks, access_emergency_storage, access_change_ids, access_ai_upload,
|
||||
access_teleporter, access_eva, access_heads, access_captain, access_all_personal_lockers,
|
||||
access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen,
|
||||
access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_cargo_bot, access_construction,
|
||||
access_hydroponics, access_library, access_manufacturing, access_lawyer, access_virology, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_theatre, access_research, access_mining, access_mailsorting, access_mint_vault, access_mint,
|
||||
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
|
||||
access_keycard_auth, access_tcomsat, access_gateway)
|
||||
|
||||
/proc/get_all_centcom_access()
|
||||
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_creed, access_cent_captain)
|
||||
|
||||
/proc/get_all_syndicate_access()
|
||||
return list(access_syndicate)
|
||||
|
||||
/proc/get_region_accesses(var/code)
|
||||
switch(code)
|
||||
if(0)
|
||||
return get_all_accesses()
|
||||
if(1) //security
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos)
|
||||
if(2) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo)
|
||||
if(3) //research
|
||||
return list(access_research, access_tox, access_tox_storage, access_xenobiology, access_rd)
|
||||
if(4) //engineering and maintenance
|
||||
return list(access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_construction, access_robotics, access_ce)
|
||||
if(5) //command
|
||||
return list(access_heads, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_all_personal_lockers, access_heads_vault, access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_hop, access_captain)
|
||||
if(6) //station general
|
||||
return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_clown, access_mime)
|
||||
if(7) //supply
|
||||
return list(access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_mining, access_mining_station)
|
||||
|
||||
/proc/get_region_accesses_name(var/code)
|
||||
switch(code)
|
||||
if(0)
|
||||
return "All"
|
||||
if(1) //security
|
||||
return "Security"
|
||||
if(2) //medbay
|
||||
return "Medbay"
|
||||
if(3) //research
|
||||
return "Research"
|
||||
if(4) //engineering and maintenance
|
||||
return "Engineering"
|
||||
if(5) //command
|
||||
return "Command"
|
||||
if(6) //station general
|
||||
return "Station General"
|
||||
if(7) //supply
|
||||
return "Supply"
|
||||
|
||||
|
||||
/proc/get_access_desc(A)
|
||||
switch(A)
|
||||
if(access_cargo)
|
||||
return "Cargo Bay"
|
||||
if(access_cargo_bot)
|
||||
return "Cargo Bot Delivery"
|
||||
if(access_security)
|
||||
return "Security"
|
||||
if(access_brig)
|
||||
return "Holding Cells"
|
||||
if(access_court)
|
||||
return "Courtroom"
|
||||
if(access_forensics_lockers)
|
||||
return "Detective's Office"
|
||||
if(access_medical)
|
||||
return "Medical"
|
||||
if(access_genetics)
|
||||
return "Genetics Lab"
|
||||
if(access_morgue)
|
||||
return "Morgue"
|
||||
if(access_tox)
|
||||
return "Research Lab"
|
||||
if(access_tox_storage)
|
||||
return "Toxins Storage"
|
||||
if(access_chemistry)
|
||||
return "Chemistry Lab"
|
||||
if(access_rd)
|
||||
return "RD Private"
|
||||
if(access_bar)
|
||||
return "Bar"
|
||||
if(access_janitor)
|
||||
return "Custodial Closet"
|
||||
if(access_engine)
|
||||
return "Engineering"
|
||||
if(access_engine_equip)
|
||||
return "APCs"
|
||||
if(access_maint_tunnels)
|
||||
return "Maintenance"
|
||||
if(access_external_airlocks)
|
||||
return "External Airlocks"
|
||||
if(access_emergency_storage)
|
||||
return "Emergency Storage"
|
||||
if(access_change_ids)
|
||||
return "ID Computer"
|
||||
if(access_ai_upload)
|
||||
return "AI Upload"
|
||||
if(access_teleporter)
|
||||
return "Teleporter"
|
||||
if(access_eva)
|
||||
return "EVA"
|
||||
if(access_heads)
|
||||
return "Bridge"
|
||||
if(access_captain)
|
||||
return "Captain Private"
|
||||
if(access_all_personal_lockers)
|
||||
return "Personal Lockers"
|
||||
if(access_chapel_office)
|
||||
return "Chapel Office"
|
||||
if(access_tech_storage)
|
||||
return "Technical Storage"
|
||||
if(access_atmospherics)
|
||||
return "Atmospherics"
|
||||
if(access_crematorium)
|
||||
return "Crematorium"
|
||||
if(access_armory)
|
||||
return "Armory"
|
||||
if(access_construction)
|
||||
return "Construction Areas"
|
||||
if(access_kitchen)
|
||||
return "Kitchen"
|
||||
if(access_hydroponics)
|
||||
return "Hydroponics"
|
||||
if(access_library)
|
||||
return "Library"
|
||||
if(access_lawyer)
|
||||
return "Law Office"
|
||||
if(access_robotics)
|
||||
return "Robotics"
|
||||
if(access_virology)
|
||||
return "Virology"
|
||||
if(access_cmo)
|
||||
return "CMO Private"
|
||||
if(access_qm)
|
||||
return "Quartermaster's Office"
|
||||
if(access_clown)
|
||||
return "HONK! Access"
|
||||
if(access_mime)
|
||||
return "Silent Access"
|
||||
if(access_surgery)
|
||||
return "Surgery"
|
||||
if(access_theatre)
|
||||
return "Theatre"
|
||||
if(access_manufacturing)
|
||||
return "Manufacturing"
|
||||
if(access_research)
|
||||
return "Science"
|
||||
if(access_mining)
|
||||
return "Mining"
|
||||
if(access_mining_office)
|
||||
return "Mining Office"
|
||||
if(access_mailsorting)
|
||||
return "Delivery Office"
|
||||
if(access_mint)
|
||||
return "Mint"
|
||||
if(access_mint_vault)
|
||||
return "Mint Vault"
|
||||
if(access_heads_vault)
|
||||
return "Main Vault"
|
||||
if(access_mining_station)
|
||||
return "Mining Station EVA"
|
||||
if(access_xenobiology)
|
||||
return "Xenobiology Lab"
|
||||
if(access_hop)
|
||||
return "HoP Private"
|
||||
if(access_hos)
|
||||
return "HoS Private"
|
||||
if(access_ce)
|
||||
return "CE Private"
|
||||
if(access_RC_announce)
|
||||
return "RC Announcements"
|
||||
if(access_keycard_auth)
|
||||
return "Keycode Auth. Device"
|
||||
if(access_tcomsat)
|
||||
return "Telecommunications"
|
||||
if(access_gateway)
|
||||
return "Gateway"
|
||||
if(access_sec_doors)
|
||||
return "Brig"
|
||||
|
||||
/proc/get_centcom_access_desc(A)
|
||||
switch(A)
|
||||
if(access_cent_general)
|
||||
return "Code Grey"
|
||||
if(access_cent_thunder)
|
||||
return "Code Yellow"
|
||||
if(access_cent_storage)
|
||||
return "Code Orange"
|
||||
if(access_cent_living)
|
||||
return "Code Green"
|
||||
if(access_cent_medical)
|
||||
return "Code White"
|
||||
if(access_cent_teleporter)
|
||||
return "Code Blue"
|
||||
if(access_cent_specops)
|
||||
return "Code Black"
|
||||
if(access_cent_creed)
|
||||
return "Code Silver"
|
||||
if(access_cent_captain)
|
||||
return "Code Gold"
|
||||
|
||||
/proc/get_all_jobs()
|
||||
return list("Assistant", "Captain", "Head of Personnel", "Bartender", "Chef", "Botanist", "Quartermaster", "Cargo Technician",
|
||||
"Shaft Miner", "Clown", "Mime", "Janitor", "Librarian", "Lawyer", "Chaplain", "Chief Engineer", "Station Engineer",
|
||||
"Atmospheric Technician", "Roboticist", "Chief Medical Officer", "Medical Doctor", "Chemist", "Geneticist", "Virologist",
|
||||
"Research Director", "Scientist", "Head of Security", "Warden", "Detective", "Security Officer")
|
||||
|
||||
/proc/get_all_centcom_jobs()
|
||||
return list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer","BlackOps Commander","Supreme Commander")
|
||||
|
||||
/obj/proc/GetJobName()
|
||||
if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id))
|
||||
return
|
||||
|
||||
var/jobName
|
||||
|
||||
if(istype(src, /obj/item/device/pda))
|
||||
if(src:id)
|
||||
jobName = src:id:assignment
|
||||
if(istype(src, /obj/item/weapon/card/id))
|
||||
jobName = src:assignment
|
||||
|
||||
if(jobName in get_all_jobs())
|
||||
return jobName
|
||||
else
|
||||
return "Unknown"
|
||||
@@ -1,33 +0,0 @@
|
||||
/obj/item/clothing/under/rank/administrator
|
||||
name = "safety administrator's jumpsuit"
|
||||
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Safety Administrator\"."
|
||||
icon_state = "hosblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "hosblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/under/rank/advisor
|
||||
name = "correctional advisor's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the words \"Correctional Advisor\" written on the shoulders."
|
||||
icon_state = "wardenblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "wardenblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/under/rank/supervisor
|
||||
name = "crew supervisor's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
|
||||
icon_state = "officerblueclothes"
|
||||
item_state = "ba_suit"
|
||||
color = "officerblueclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
|
||||
|
||||
/obj/item/clothing/shoes/boots
|
||||
name = "boots"
|
||||
desc = "Nanotrasen-issue hard-toe safety boots."
|
||||
icon_state = "secshoes"
|
||||
item_state = "secshoes"
|
||||
color = "hosred"
|
||||
@@ -1,152 +0,0 @@
|
||||
/datum/job/hos
|
||||
title = "Safety Administrator"
|
||||
flag = HOS
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the captain"
|
||||
selection_color = "#ffdddd"
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/administrator(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/taser(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/warden
|
||||
title = "Correctional Advisor"
|
||||
flag = WARDEN
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/advisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/detective
|
||||
title = "Detective"
|
||||
flag = DETECTIVE
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head)
|
||||
var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H)
|
||||
CIG.light("")
|
||||
H.equip_to_slot_or_del(CIG, slot_wear_mask)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(H), slot_l_store)
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack)
|
||||
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/job/officer
|
||||
title = "Crew Supervisor"
|
||||
flag = OFFICER
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 5
|
||||
spawn_positions = 5
|
||||
supervisors = "the safety administrator"
|
||||
selection_color = "#ffeeee"
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/supervisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_r_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
return 1
|
||||
|
||||
/datum/job/hop
|
||||
title = "Head of Personnel"
|
||||
flag = HOP
|
||||
department_flag = CIVILIAN
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the captain"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_l_ear)
|
||||
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack)
|
||||
return 1
|
||||
@@ -1,235 +0,0 @@
|
||||
/obj/structure/closet/secure_closet/captains
|
||||
name = "Captain's Locker"
|
||||
req_access = list(access_captain)
|
||||
icon_state = "capsecure1"
|
||||
icon_closed = "capsecure"
|
||||
icon_locked = "capsecure1"
|
||||
icon_opened = "capsecureopen"
|
||||
icon_broken = "capsecurebroken"
|
||||
icon_off = "capsecureoff"
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
if(prob(50))
|
||||
new /obj/item/weapon/storage/backpack/captain(src)
|
||||
else
|
||||
new /obj/item/weapon/storage/backpack/satchel_cap(src)
|
||||
new /obj/item/clothing/suit/captunic(src)
|
||||
new /obj/item/clothing/head/helmet/cap(src)
|
||||
new /obj/item/clothing/under/rank/captain(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/weapon/cartridge/captain(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/heads/captain(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
|
||||
new /obj/item/clothing/gloves/captain(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/hop
|
||||
name = "Head of Personnel's Locker"
|
||||
req_access = list(access_hop)
|
||||
icon_state = "hopsecure1"
|
||||
icon_closed = "hopsecure"
|
||||
icon_locked = "hopsecure1"
|
||||
icon_opened = "hopsecureopen"
|
||||
icon_broken = "hopsecurebroken"
|
||||
icon_off = "hopsecureoff"
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/under/rank/head_of_personnel(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/head/helmet(src)
|
||||
new /obj/item/weapon/cartridge/hop(src)
|
||||
new /obj/item/device/radio/headset/heads/hop(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/weapon/storage/id_kit( src )
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/hos
|
||||
name = "Safety Administrator's Locker"
|
||||
req_access = list(access_hos)
|
||||
icon_state = "hossecure1"
|
||||
icon_closed = "hossecure"
|
||||
icon_locked = "hossecure1"
|
||||
icon_opened = "hossecureopen"
|
||||
icon_broken = "hossecurebroken"
|
||||
icon_off = "hossecureoff"
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/weapon/cartridge/hos(src)
|
||||
new /obj/item/device/radio/headset/heads/hos(src)
|
||||
new /obj/item/weapon/storage/lockbox/loyalty(src)
|
||||
new /obj/item/weapon/storage/flashbang_kit(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/taser(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/warden
|
||||
name = "Correctional Advisor's Locker"
|
||||
req_access = list(access_armory)
|
||||
icon_state = "wardensecure1"
|
||||
icon_closed = "wardensecure"
|
||||
icon_locked = "wardensecure1"
|
||||
icon_opened = "wardensecureopen"
|
||||
icon_broken = "wardensecurebroken"
|
||||
icon_off = "wardensecureoff"
|
||||
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/clothing/under/rank/advisor(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/weapon/storage/flashbang_kit(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/security
|
||||
name = "Crew Supervisor's Locker"
|
||||
req_access = list(access_security)
|
||||
icon_state = "sec1"
|
||||
icon_closed = "sec"
|
||||
icon_locked = "sec1"
|
||||
icon_opened = "secopen"
|
||||
icon_broken = "secbroken"
|
||||
icon_off = "secoff"
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/weapon/storage/backpack/satchel_sec(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/pepper(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/detective
|
||||
name = "Detective's Cabinet"
|
||||
req_access = list(access_forensics_lockers)
|
||||
icon_state = "cabinetdetective_locked"
|
||||
icon_closed = "cabinetdetective"
|
||||
icon_locked = "cabinetdetective_locked"
|
||||
icon_opened = "cabinetdetective_open"
|
||||
icon_broken = "cabinetdetective_broken"
|
||||
icon_off = "cabinetdetective_broken"
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/under/det(src)
|
||||
new /obj/item/clothing/suit/armor/det_suit(src)
|
||||
new /obj/item/clothing/suit/det_suit(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/head/det_hat(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/weapon/cartridge/detective(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/secure_closet/detective/update_icon()
|
||||
if(broken)
|
||||
icon_state = icon_broken
|
||||
else
|
||||
if(!opened)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
else
|
||||
icon_state = icon_closed
|
||||
else
|
||||
icon_state = icon_opened
|
||||
|
||||
/obj/structure/closet/secure_closet/injection
|
||||
name = "Lethal Injections"
|
||||
req_access = list(access_hos)
|
||||
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
|
||||
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/brig
|
||||
name = "Brig Locker"
|
||||
req_access = list(access_brig)
|
||||
anchored = 1
|
||||
|
||||
New()
|
||||
new /obj/item/clothing/under/color/orange( src )
|
||||
new /obj/item/clothing/shoes/orange( src )
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/courtroom
|
||||
name = "Courtroom Locker"
|
||||
req_access = list(access_court)
|
||||
|
||||
New()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/paper/Court (src)
|
||||
new /obj/item/weapon/pen (src)
|
||||
new /obj/item/clothing/suit/judgerobe (src)
|
||||
new /obj/item/clothing/head/powdered_wig (src)
|
||||
new /obj/item/weapon/storage/briefcase(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/secure_closet/wall
|
||||
name = "wall locker"
|
||||
req_access = list(access_security)
|
||||
icon_state = "wall-locker1"
|
||||
density = 1
|
||||
icon_closed = "wall-locker"
|
||||
icon_locked = "wall-locker1"
|
||||
icon_opened = "wall-lockeropen"
|
||||
icon_broken = "wall-lockerbroken"
|
||||
icon_off = "wall-lockeroff"
|
||||
|
||||
//too small to put a man in
|
||||
large = 0
|
||||
|
||||
/obj/structure/closet/secure_closet/wall/update_icon()
|
||||
if(broken)
|
||||
icon_state = icon_broken
|
||||
else
|
||||
if(!opened)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
else
|
||||
icon_state = icon_closed
|
||||
else
|
||||
icon_state = icon_opened
|
||||
@@ -1,311 +0,0 @@
|
||||
/obj/structure/closet/wardrobe
|
||||
name = "wardrobe"
|
||||
desc = "It's a storage unit for standard-issue Nanotrasen attire."
|
||||
icon_state = "blue"
|
||||
icon_closed = "blue"
|
||||
|
||||
/obj/structure/closet/wardrobe/New()
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/red
|
||||
name = "security wardrobe"
|
||||
icon_state = "red"
|
||||
icon_closed = "red"
|
||||
|
||||
/obj/structure/closet/wardrobe/red/New()
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/under/rank/supervisor(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/shoes/boots(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/pink
|
||||
name = "pink wardrobe"
|
||||
icon_state = "pink"
|
||||
icon_closed = "pink"
|
||||
|
||||
/obj/structure/closet/wardrobe/pink/New()
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/wardrobe/black
|
||||
name = "black wardrobe"
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/black/New()
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/under/color/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
new /obj/item/clothing/head/that(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/chaplain_black
|
||||
name = "chapel wardrobe"
|
||||
desc = "It's a storage unit for Nanotrasen-approved religious attire."
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/chaplain_black/New()
|
||||
new /obj/item/clothing/under/rank/chaplain(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/suit/nun(src)
|
||||
new /obj/item/clothing/head/nun_hood(src)
|
||||
new /obj/item/clothing/suit/chaplain_hoodie(src)
|
||||
new /obj/item/clothing/head/chaplain_hood(src)
|
||||
new /obj/item/clothing/suit/holidaypriest(src)
|
||||
new /obj/item/weapon/storage/backpack/cultpack (src)
|
||||
new /obj/item/weapon/storage/fancy/candle_box(src)
|
||||
new /obj/item/weapon/storage/fancy/candle_box(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/green
|
||||
name = "green wardrobe"
|
||||
icon_state = "green"
|
||||
icon_closed = "green"
|
||||
|
||||
/obj/structure/closet/wardrobe/green/New()
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/orange
|
||||
name = "prison wardrobe"
|
||||
desc = "It's a storage unit for Nanotrasen-regulation prisoner attire."
|
||||
icon_state = "orange"
|
||||
icon_closed = "orange"
|
||||
|
||||
/obj/structure/closet/wardrobe/orange/New()
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/yellow
|
||||
name = "yellow wardrobe"
|
||||
icon_state = "wardrobe-y"
|
||||
icon_closed = "wardrobe-y"
|
||||
|
||||
/obj/structure/closet/wardrobe/yellow/New()
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/atmospherics_yellow
|
||||
name = "atmospherics wardrobe"
|
||||
icon_state = "yellow"
|
||||
icon_closed = "yellow"
|
||||
|
||||
/obj/structure/closet/wardrobe/atmospherics_yellow/New()
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/engineering_yellow
|
||||
name = "engineering wardrobe"
|
||||
icon_state = "yellow"
|
||||
icon_closed = "yellow"
|
||||
|
||||
/obj/structure/closet/wardrobe/engineering_yellow/New()
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/white
|
||||
name = "white wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/white/New()
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/pjs
|
||||
name = "Pajama wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/pjs/New()
|
||||
new /obj/item/clothing/under/pj/red(src)
|
||||
new /obj/item/clothing/under/pj/red(src)
|
||||
new /obj/item/clothing/under/pj/blue(src)
|
||||
new /obj/item/clothing/under/pj/blue(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/toxins_white
|
||||
name = "toxins wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/toxins_white/New()
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/robotics_black
|
||||
name = "robotics wardrobe"
|
||||
icon_state = "black"
|
||||
icon_closed = "black"
|
||||
|
||||
/obj/structure/closet/wardrobe/robotics_black/New()
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/suit/labcoat(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/chemistry_white
|
||||
name = "chemistry wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/chemistry_white/New()
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/chemist(src)
|
||||
new /obj/item/clothing/suit/labcoat/chemist(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/genetics_white
|
||||
name = "genetics wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/genetics_white/New()
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/genetics(src)
|
||||
new /obj/item/clothing/suit/labcoat/genetics(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/virology_white
|
||||
name = "virology wardrobe"
|
||||
icon_state = "white"
|
||||
icon_closed = "white"
|
||||
|
||||
/obj/structure/closet/wardrobe/virology_white/New()
|
||||
new /obj/item/clothing/under/rank/virologist(src)
|
||||
new /obj/item/clothing/under/rank/virologist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/suit/labcoat/virologist(src)
|
||||
new /obj/item/clothing/suit/labcoat/virologist(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/grey
|
||||
name = "grey wardrobe"
|
||||
icon_state = "grey"
|
||||
icon_closed = "grey"
|
||||
|
||||
/obj/structure/closet/wardrobe/grey/New()
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
new /obj/item/clothing/head/soft/grey(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/wardrobe/mixed
|
||||
name = "mixed wardrobe"
|
||||
icon_state = "mixed"
|
||||
icon_closed = "mixed"
|
||||
|
||||
/obj/structure/closet/wardrobe/mixed/New()
|
||||
new /obj/item/clothing/under/color/white(src)
|
||||
new /obj/item/clothing/under/color/blue(src)
|
||||
new /obj/item/clothing/under/color/yellow(src)
|
||||
new /obj/item/clothing/under/color/green(src)
|
||||
new /obj/item/clothing/under/color/orange(src)
|
||||
new /obj/item/clothing/under/color/pink(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
return
|
||||
@@ -1,385 +0,0 @@
|
||||
//UltraLight system, by Sukasa
|
||||
|
||||
|
||||
#define UL_I_FALLOFF_SQUARE 0
|
||||
#define UL_I_FALLOFF_ROUND 1
|
||||
|
||||
#define UL_I_LIT 0
|
||||
#define UL_I_EXTINGUISHED 1
|
||||
#define UL_I_ONZERO 2
|
||||
#define UL_I_CHANGING 3
|
||||
|
||||
#define ul_LightingEnabled 1
|
||||
//#define ul_LightingResolution 2
|
||||
//Uncomment if you want maybe slightly smoother lighting
|
||||
#define ul_Steps 7
|
||||
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
|
||||
#define ul_Layer 10
|
||||
#define ul_TopLuminosity 12 //Maximum brightness an object can have.
|
||||
|
||||
//#define ul_LightLevelChangedUpdates
|
||||
//Uncomment if you have code that you want triggered when the light level on an atom changes.
|
||||
|
||||
|
||||
#define ul_Clamp(Value) min(max(Value, 0), ul_Steps)
|
||||
#define ul_IsLuminous(A) (A.ul_Red || A.ul_Green || A.ul_Blue)
|
||||
#define ul_Luminosity(A) max(A.ul_Red, A.ul_Green, A.ul_Blue)
|
||||
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
var/ul_LightingResolutionSqrt = sqrt(ul_LightingResolution)
|
||||
#endif
|
||||
var/ul_SuppressLightLevelChanges = 0
|
||||
|
||||
|
||||
var/list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7)
|
||||
|
||||
var/list/ul_IconCache = list()
|
||||
|
||||
|
||||
proc/ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src))
|
||||
for(var/atom/Light in ReApply)
|
||||
if(ul_IsLuminous(Light))
|
||||
Light.ul_Illuminate()
|
||||
return
|
||||
|
||||
atom/var/ul_Red = 0
|
||||
atom/var/ul_Green = 0
|
||||
atom/var/ul_Blue = 0
|
||||
atom/var/turf/ul_LastIlluminated
|
||||
|
||||
atom/var/ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
atom/proc/ul_SetLuminosity(var/Red = 0, var/Green = Red, var/Blue = Red)
|
||||
|
||||
if(ul_Extinguished == UL_I_CHANGING) //Changing state, just supress any changes, to prevent glitches.
|
||||
return
|
||||
|
||||
if(ul_Red == min(Red, ul_TopLuminosity) && ul_Green == min(Green, ul_TopLuminosity) && ul_Blue == min(Blue, ul_TopLuminosity))
|
||||
return //No point doing all that work if it won't have any effect anyways...
|
||||
|
||||
if (ul_Extinguished == UL_I_EXTINGUISHED)
|
||||
ul_Red = min(Red,ul_TopLuminosity)
|
||||
ul_Green = min(Green,ul_TopLuminosity)
|
||||
ul_Blue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
return
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
|
||||
ul_Red = min(Red,ul_TopLuminosity)
|
||||
ul_Green = min(Green,ul_TopLuminosity)
|
||||
ul_Blue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Illuminate()
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_Illuminate()
|
||||
if (ul_Extinguished == UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_CHANGING
|
||||
|
||||
luminosity = ul_Luminosity(src)
|
||||
|
||||
for(var/turf/Affected in view(luminosity, src))
|
||||
var/Falloff = ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = ul_Red - Falloff
|
||||
var/DeltaGreen = ul_Green - Falloff
|
||||
var/DeltaBlue = ul_Blue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(!Affected.MaxRed)
|
||||
Affected.MaxRed = list()
|
||||
Affected.MaxRed += DeltaRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(!Affected.MaxGreen)
|
||||
Affected.MaxGreen = list()
|
||||
Affected.MaxGreen += DeltaGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(!Affected.MaxBlue)
|
||||
Affected.MaxBlue = list()
|
||||
Affected.MaxBlue += DeltaBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
|
||||
ul_LastIlluminated = get_turf(src)
|
||||
ul_Extinguished = UL_I_LIT
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_Extinguish()
|
||||
|
||||
if (ul_Extinguished != UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_CHANGING
|
||||
|
||||
for(var/turf/Affected in view(ul_Luminosity(src), ul_LastIlluminated))
|
||||
|
||||
var/Falloff = ul_LastIlluminated.ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = ul_Red - Falloff
|
||||
var/DeltaGreen = ul_Green - Falloff
|
||||
var/DeltaBlue = ul_Blue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(Affected.MaxRed)
|
||||
var/removed_light_source = Affected.MaxRed.Find(DeltaRed)
|
||||
if(removed_light_source)
|
||||
Affected.MaxRed.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxRed.len)
|
||||
del Affected.MaxRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(Affected.MaxGreen)
|
||||
var/removed_light_source = Affected.MaxGreen.Find(DeltaGreen)
|
||||
if(removed_light_source)
|
||||
Affected.MaxGreen.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxGreen.len)
|
||||
del Affected.MaxGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(Affected.MaxBlue)
|
||||
var/removed_light_source = Affected.MaxBlue.Find(DeltaBlue)
|
||||
if(removed_light_source)
|
||||
Affected.MaxBlue.Cut(removed_light_source, removed_light_source+1)
|
||||
if(!Affected.MaxBlue.len)
|
||||
del Affected.MaxBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
|
||||
ul_Extinguished = UL_I_EXTINGUISHED
|
||||
luminosity = 0
|
||||
ul_LastIlluminated = null
|
||||
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
Calculates the correct lighting falloff value (used to calculate what brightness to set the turf to) to use,
|
||||
when called on a luminous atom and passed an atom in the turf to be lit.
|
||||
|
||||
Supports multiple configurations, BS12 uses the circular falloff setting. This setting uses an array lookup
|
||||
to avoid the cost of the square root function.
|
||||
*/
|
||||
atom/proc/ul_FalloffAmount(var/atom/ref)
|
||||
if (ul_FalloffStyle == UL_I_FALLOFF_ROUND)
|
||||
var/delta_x = (ref.x - src.x)
|
||||
var/delta_y = (ref.y - src.y)
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
if (round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt,1) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= round(delta_x*delta_x+delta_y*delta_y*ul_LightingResolutionSqrt,1), i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt, 1) + 1]/ul_LightingResolution
|
||||
|
||||
#else
|
||||
if ((delta_x*delta_x + delta_y*delta_y) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= delta_x*delta_x+delta_y*delta_y, i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[delta_x*delta_x + delta_y*delta_y + 1]
|
||||
|
||||
#endif
|
||||
|
||||
else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE)
|
||||
return get_dist(src, ref)
|
||||
|
||||
return 0
|
||||
|
||||
atom/proc/ul_SetOpacity(var/NewOpacity)
|
||||
if(opacity != NewOpacity)
|
||||
|
||||
var/list/Blanked = ul_BlankLocal()
|
||||
|
||||
opacity = NewOpacity
|
||||
|
||||
ul_UnblankLocal(Blanked)
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_BlankLocal()
|
||||
var/list/Blanked = list( )
|
||||
var/TurfAdjust = isturf(src) ? 1 : 0
|
||||
|
||||
for(var/atom/Affected in view(ul_TopLuminosity, src))
|
||||
if(ul_IsLuminous(Affected) && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= ul_Luminosity(Affected) + TurfAdjust))
|
||||
Affected.ul_Extinguish()
|
||||
Blanked += Affected
|
||||
|
||||
return Blanked
|
||||
|
||||
atom/proc/ul_LightLevelChanged()
|
||||
//Designed for client projects to use. Called on items when the turf they are in has its light level changed
|
||||
return
|
||||
|
||||
atom/New()
|
||||
. = ..()
|
||||
if(ul_IsLuminous(src))
|
||||
spawn(5)
|
||||
ul_Illuminate()
|
||||
|
||||
atom/Del()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
|
||||
atom/movable/Move()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
ul_Illuminate()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
turf/var/list/MaxRed
|
||||
turf/var/list/MaxGreen
|
||||
turf/var/list/MaxBlue
|
||||
|
||||
turf/proc/ul_GetRed()
|
||||
if(MaxRed)
|
||||
return ul_Clamp(max(MaxRed))
|
||||
return 0
|
||||
turf/proc/ul_GetGreen()
|
||||
if(MaxGreen)
|
||||
return ul_Clamp(max(MaxGreen))
|
||||
return 0
|
||||
turf/proc/ul_GetBlue()
|
||||
if(MaxBlue)
|
||||
return ul_Clamp(max(MaxBlue))
|
||||
return 0
|
||||
|
||||
turf/proc/ul_UpdateLight()
|
||||
var/area/CurrentArea = loc
|
||||
|
||||
if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting)
|
||||
return
|
||||
|
||||
var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]"
|
||||
|
||||
if(CurrentArea.tag != LightingTag)
|
||||
var/area/NewArea = locate(LightingTag)
|
||||
|
||||
if(!NewArea)
|
||||
NewArea = new CurrentArea.type()
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
for(var/V in CurrentArea.vars - "contents")
|
||||
if(issaved(CurrentArea.vars[V]))
|
||||
NewArea.vars[V] = CurrentArea.vars[V]
|
||||
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
NewArea.ul_Light(ul_GetRed(), ul_GetGreen(), ul_GetBlue())
|
||||
|
||||
|
||||
NewArea.contents += src
|
||||
|
||||
return
|
||||
|
||||
turf/proc/ul_Recalculate()
|
||||
|
||||
ul_SuppressLightLevelChanges++
|
||||
|
||||
var/list/Lights = ul_BlankLocal()
|
||||
|
||||
ul_UnblankLocal(Lights)
|
||||
|
||||
ul_SuppressLightLevelChanges--
|
||||
|
||||
return
|
||||
|
||||
area/var/ul_Overlay = null
|
||||
area/var/ul_Lighting = 1
|
||||
|
||||
area/var/LightLevelRed = 0
|
||||
area/var/LightLevelGreen = 0
|
||||
area/var/LightLevelBlue = 0
|
||||
area/var/list/LightLevels
|
||||
|
||||
area/proc/ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue)
|
||||
|
||||
if(!src || !src.ul_Lighting)
|
||||
return
|
||||
|
||||
overlays -= ul_Overlay
|
||||
if(LightLevels)
|
||||
if(Red < LightLevels["Red"])
|
||||
Red = LightLevels["Red"]
|
||||
if(Green < LightLevels["Green"])
|
||||
Green = LightLevels["Green"]
|
||||
if(Blue < LightLevels["Blue"])
|
||||
Blue = LightLevels["Blue"]
|
||||
|
||||
LightLevelRed = Red
|
||||
LightLevelGreen = Green
|
||||
LightLevelBlue = Blue
|
||||
|
||||
luminosity = LightLevelRed || LightLevelGreen || LightLevelBlue
|
||||
|
||||
var/ul_CachedOverlay = ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"]
|
||||
if(ul_CachedOverlay)
|
||||
ul_Overlay = ul_CachedOverlay
|
||||
else
|
||||
ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"] = image('icons/effects/ULIcons.dmi', , "[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]", ul_Layer)
|
||||
ul_Overlay = ul_IconCache["[LightLevelRed]-[LightLevelGreen]-[LightLevelBlue]"]
|
||||
|
||||
overlays += ul_Overlay
|
||||
|
||||
return
|
||||
|
||||
area/proc/ul_Prep()
|
||||
|
||||
if(!tag)
|
||||
tag = "[type]"
|
||||
if(ul_Lighting)
|
||||
if(!findtext(tag,":UL"))
|
||||
ul_Light()
|
||||
//world.log << tag
|
||||
|
||||
return
|
||||
|
||||
#undef UL_I_FALLOFF_SQUARE
|
||||
#undef UL_I_FALLOFF_ROUND
|
||||
#undef UL_I_LIT
|
||||
#undef UL_I_EXTINGUISHED
|
||||
#undef UL_I_ONZERO
|
||||
#undef ul_LightingEnabled
|
||||
#undef ul_LightingResolution
|
||||
#undef ul_Steps
|
||||
#undef ul_FalloffStyle
|
||||
#undef ul_Layer
|
||||
#undef ul_TopLuminosity
|
||||
#undef ul_Clamp
|
||||
#undef ul_LightLevelChangedUpdates
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
// MOVED HERE FROM ULTRALIGHT WHICH IS PROBABLY A BAD THING
|
||||
#define UL_I_FALLOFF_SQUARE 0
|
||||
#define UL_I_FALLOFF_ROUND 1
|
||||
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
|
||||
var/list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7)
|
||||
|
||||
atom/proc/ul_FalloffAmount(var/atom/ref)
|
||||
if (ul_FalloffStyle == UL_I_FALLOFF_ROUND)
|
||||
var/delta_x = (ref.x - src.x)
|
||||
var/delta_y = (ref.y - src.y)
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
if (round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt,1) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= round(delta_x*delta_x+delta_y*delta_y*ul_LightingResolutionSqrt,1), i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[round((delta_x*delta_x + delta_y*delta_y)*ul_LightingResolutionSqrt, 1) + 1]/ul_LightingResolution
|
||||
|
||||
#else
|
||||
if ((delta_x*delta_x + delta_y*delta_y) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= delta_x*delta_x+delta_y*delta_y, i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[delta_x*delta_x + delta_y*delta_y + 1]
|
||||
|
||||
#endif
|
||||
|
||||
else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE)
|
||||
return get_dist(src, ref)
|
||||
|
||||
return 0
|
||||
@@ -1,96 +0,0 @@
|
||||
/obj/machinery/coatrack/attack_hand(mob/user as mob)
|
||||
switch(alert("What do you want from the coat rack?",,"Coat","Hat"))
|
||||
if("Coat")
|
||||
if(coat)
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hand(coat)
|
||||
else
|
||||
coat.loc = get_turf(user)
|
||||
coat = null
|
||||
if(!hat)
|
||||
icon_state = "coatrack0"
|
||||
else
|
||||
icon_state = "coatrack1"
|
||||
return
|
||||
else
|
||||
user << "\blue There is no coat to take!"
|
||||
return
|
||||
if("Hat")
|
||||
if(hat)
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hand(hat)
|
||||
else
|
||||
hat.loc = get_turf(user)
|
||||
hat = null
|
||||
if(!coat)
|
||||
icon_state = "coatrack0"
|
||||
else
|
||||
icon_state = "coatrack2"
|
||||
return
|
||||
else
|
||||
user << "\blue There is no hat to take!"
|
||||
return
|
||||
user << "Something went wrong."
|
||||
return
|
||||
|
||||
/obj/machinery/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
var/obj/item/I = user.equipped()
|
||||
if ( istype(I,/obj/item/clothing/head/det_hat) && !hat)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
hat = I
|
||||
if(!coat)
|
||||
icon_state = "coatrack1"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue [user] puts his hat onto the rack."), 2)
|
||||
return
|
||||
if ( istype(I,/obj/item/clothing/suit/storage/det_suit) && !coat)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
coat = I
|
||||
if(!hat)
|
||||
icon_state = "coatrack2"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue [user] puts his coat onto the rack."), 2)
|
||||
return
|
||||
if ( istype(I,/obj/item/clothing/head/det_hat) && hat)
|
||||
user << "There's already a hat on the rack!"
|
||||
return ..()
|
||||
if ( istype(I,/obj/item/clothing/suit/storage/det_suit) && coat)
|
||||
user << "There's already a coat on the rack!"
|
||||
return ..()
|
||||
user << "The coat rack wants none of what you offer."
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if ( istype(mover,/obj/item/clothing/head/det_hat) && !hat)
|
||||
mover.loc = src
|
||||
hat = mover
|
||||
if(!coat)
|
||||
icon_state = "coatrack1"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue The hat lands perfectly atop its hanger!"), 2)
|
||||
return 0
|
||||
if ( istype(mover,/obj/item/clothing/suit/storage/det_suit) && !coat)
|
||||
mover.loc = src
|
||||
coat = mover
|
||||
if(!hat)
|
||||
icon_state = "coatrack2"
|
||||
else
|
||||
icon_state = "coatrack3"
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M.show_message(text("\blue The coat lands perfectly atop its hanger!"), 2)
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
@@ -1,21 +0,0 @@
|
||||
//May expand later, but right now it just repairs lights.
|
||||
/obj/item/device/portalathe
|
||||
name = "portable autolathe"
|
||||
desc = "A device which can repair broken lights instantly. Must be advanced."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "portalathe"
|
||||
|
||||
afterattack(var/atom/target, mob/user as mob)
|
||||
if(!target || !user)
|
||||
return
|
||||
if(!istype(target))
|
||||
return
|
||||
if(!istype(target, /obj/machinery/light))
|
||||
return
|
||||
var/obj/machinery/light/L = target
|
||||
if(L.status > 1) //Burned or broke
|
||||
L.status = 0
|
||||
L.on = 1
|
||||
L.update()
|
||||
user.visible_message("[user] repairs \the [target] on the spot with their [src]!","You repair the lightbulb!","You hear a soft whiiir-pop noise over the sound of flexing glass, followed by the soft hum of an activated [target].")
|
||||
return
|
||||
@@ -1,76 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06
|
||||
|
||||
/obj/item/weapon/stamperaser
|
||||
name = "eraser"
|
||||
desc = "It looks like some kind of eraser."
|
||||
flags = FPRINT | TABLEPASS
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "zippo"
|
||||
item_state = "zippo"
|
||||
w_class = 1.0
|
||||
m_amt = 80
|
||||
/*
|
||||
/obj/item/device/jammer
|
||||
name = "strange device"
|
||||
desc = "It blinks and has an antenna on it. Weird."
|
||||
icon_state = "t-ray0"
|
||||
var/on = 0
|
||||
flags = FPRINT|TABLEPASS
|
||||
w_class = 1
|
||||
var/list/obj/item/device/radio/Old = list()
|
||||
var/list/obj/item/device/radio/Curr = list()
|
||||
var/time_remaining = 5
|
||||
|
||||
/obj/item/device/jammer/New()
|
||||
..()
|
||||
time_remaining = rand(10,20) // ~2-4 BYOND seconds of use.
|
||||
return
|
||||
|
||||
/obj/item/device/jammer/attack_self(mob/user)
|
||||
|
||||
if(time_remaining > 0)
|
||||
on = !on
|
||||
icon_state = "t-ray[on]"
|
||||
|
||||
if(on)
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
on = 0
|
||||
icon_state = "t-ray0"
|
||||
user << "It's fried itself from overuse!"
|
||||
if(Old)
|
||||
for(var/obj/item/device/radio/T in Old)
|
||||
T.scrambleoverride = 0
|
||||
Old = null
|
||||
Curr = null
|
||||
|
||||
|
||||
/obj/item/device/jammer/process()
|
||||
if(!on)
|
||||
processing_objects.Remove(src)
|
||||
return null
|
||||
|
||||
Old = Curr
|
||||
Curr = list()
|
||||
|
||||
for(var/obj/item/device/radio/T in range(3, src.loc) )
|
||||
|
||||
T.scrambleoverride = 1
|
||||
Curr |= T
|
||||
for(var/obj/item/device/radio/V in Old)
|
||||
if(V == T)
|
||||
Old -= V
|
||||
break
|
||||
|
||||
for(var/obj/item/device/radio/T in Old)
|
||||
T.scrambleoverride = 0
|
||||
|
||||
time_remaining--
|
||||
if(time_remaining <= 0)
|
||||
for(var/mob/O in viewers(src))
|
||||
O.show_message("\red You hear a loud pop, like circuits frying.", 1)
|
||||
on = 0
|
||||
icon_state = "t-ray0"
|
||||
|
||||
sleep(2)
|
||||
*/
|
||||
@@ -1,614 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06
|
||||
|
||||
/obj/item/wardrobe
|
||||
name = "\improper Wardrobe"
|
||||
desc = "A standard-issue bag for clothing and equipment. Usually comes sealed, stocked with everything you need for a particular job."
|
||||
icon = 'icons/obj/clothing/suits.dmi'
|
||||
icon_state = "wardrobe_sealed"
|
||||
item_state = "wardrobe"
|
||||
w_class = 4
|
||||
layer = 2.99
|
||||
var/descriptor = "various clothing"
|
||||
var/seal_torn = 0
|
||||
|
||||
attack_self(mob/user)
|
||||
if(!contents.len)
|
||||
user << "It's empty!"
|
||||
else
|
||||
user.visible_message("\blue [user] unwraps the clothing from the [src][seal_torn ? "" : ", tearing the seal"].")
|
||||
seal_torn = 1
|
||||
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = get_turf(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/wardrobe) || istype(I, /obj/item/weapon/evidencebag))
|
||||
return
|
||||
if(contents.len < 20)
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
return
|
||||
user.drop_item()
|
||||
|
||||
if(I)
|
||||
I.loc = src
|
||||
|
||||
update_icon()
|
||||
else
|
||||
user << "\red There's not enough space to fit that!"
|
||||
return
|
||||
|
||||
afterattack(atom/A as obj|turf, mob/user as mob)
|
||||
if(A in user)
|
||||
return
|
||||
if(!istype(A.loc,/turf))
|
||||
user << "It's got to be on the ground to do that!"
|
||||
return
|
||||
var/could_fill = 1
|
||||
for (var/obj/O in locate(A.x,A.y,A.z))
|
||||
if (contents.len < 20)
|
||||
if(istype(O,/obj/item/wardrobe))
|
||||
continue
|
||||
if(O.anchored || O.density || istype(O,/obj/structure))
|
||||
continue
|
||||
contents += O;
|
||||
else
|
||||
could_fill = 0
|
||||
break
|
||||
if(could_fill)
|
||||
user << "\blue You pick up all the items."
|
||||
else
|
||||
user << "\blue You try to pick up all of the items, but run out of space in the bag."
|
||||
user.visible_message("\blue [user] gathers up[could_fill ? " " : " most of "]the pile of items and puts it into [src].")
|
||||
update_icon()
|
||||
|
||||
examine()
|
||||
set src in view()
|
||||
..()
|
||||
if(src in usr)
|
||||
usr << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
|
||||
if(seal_torn && !contents.len)
|
||||
usr << "The seal on the bag is broken."
|
||||
else
|
||||
usr << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
|
||||
return
|
||||
|
||||
update_icon()
|
||||
if(contents.len)
|
||||
icon_state = "wardrobe"
|
||||
else
|
||||
icon_state = "wardrobe_empty"
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
pixel_x = rand(0,4) -2
|
||||
pixel_y = rand(0,4) -2
|
||||
|
||||
/obj/item/wardrobe/assistant
|
||||
name = "\improper Assistant Wardrobe"
|
||||
descriptor = "clothing and basic equipment for an assistant"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/color/grey(src)
|
||||
|
||||
/obj/item/wardrobe/chief_engineer
|
||||
name = "\improper Chief Engineer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chief Engineer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/heads/ce(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/head/helmet/hardhat/white(src)
|
||||
new /obj/item/clothing/head/helmet/welding(src)
|
||||
new /obj/item/weapon/storage/belt/utility/full(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/suit/storage/hazardvest(src)
|
||||
new /obj/item/clothing/gloves/yellow(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/heads/ce(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/chief_engineer(src)
|
||||
|
||||
/obj/item/wardrobe/engineer
|
||||
name = "\improper Station Engineer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Station Engineer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/device/t_scanner(src)
|
||||
new /obj/item/clothing/suit/storage/hazardvest(src)
|
||||
new /obj/item/weapon/storage/belt/utility/full(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/head/helmet/hardhat(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/headset_eng(src)
|
||||
new /obj/item/clothing/shoes/orange(src)
|
||||
new /obj/item/clothing/under/rank/engineer(src)
|
||||
|
||||
/obj/item/wardrobe/atmos
|
||||
name = "\improper Atmospheric Technician Wardrobe"
|
||||
descriptor = "clothing and basic equipment for an Atmospheric Technician"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/device/radio/headset/headset_eng(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/atmospheric_technician(src)
|
||||
|
||||
/obj/item/wardrobe/roboticist
|
||||
name = "\improper Roboticist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Roboticist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/engineering(src)
|
||||
new /obj/item/weapon/storage/toolbox/mechanical(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/device/radio/headset/headset_rob(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/roboticist(src)
|
||||
|
||||
/obj/item/wardrobe/chaplain
|
||||
name = "\improper Chaplain Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chaplain"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/storage/bible(src)
|
||||
new /obj/item/device/pda/chaplain(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/chaplain(src)
|
||||
|
||||
/obj/item/wardrobe/captain
|
||||
name = "\improper Captain Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Captain"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/captain(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/suit/storage/captunic(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/head/caphat(src)
|
||||
new /obj/item/clothing/gloves/captain(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/device/radio/headset/heads/captain(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/captain(src)
|
||||
|
||||
/obj/item/wardrobe/hop
|
||||
name = "\improper Head of Personnel Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Head of Personnel"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/pda/heads/hop(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/gloves/blue(src)
|
||||
new /obj/item/device/radio/headset/heads/hop(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/head_of_personnel(src)
|
||||
|
||||
/obj/item/wardrobe/cmo
|
||||
name = "\improper Chief Medical Officer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chief Medical Officer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/heads/cmo(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/suit/bio_suit/cmo(src)
|
||||
new /obj/item/clothing/head/bio_hood/cmo(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/cmo(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/cmoalt(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/heads/cmo(src)
|
||||
new /obj/item/clothing/under/rank/chief_medical_officer(src)
|
||||
new /obj/item/device/healthanalyzer(src)
|
||||
|
||||
/obj/item/wardrobe/doctor
|
||||
name = "\improper Medical Doctor Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Medical Doctor"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/head/nursehat (src)
|
||||
new /obj/item/weapon/storage/belt/medical(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/device/radio/headset/headset_med(src)
|
||||
new /obj/item/clothing/under/rank/nursesuit (src)
|
||||
new /obj/item/clothing/under/rank/medical(src)
|
||||
new /obj/item/device/healthanalyzer(src)
|
||||
|
||||
/obj/item/wardrobe/geneticist
|
||||
name = "\improper Geneticist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Geneticist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/genetics(src)
|
||||
new /obj/item/device/radio/headset/headset_medsci(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/geneticist(src)
|
||||
|
||||
/obj/item/wardrobe/virologist
|
||||
name = "\improper Virologist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Virologist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/virologist(src)
|
||||
new /obj/item/device/radio/headset/headset_med(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/medical(src)
|
||||
|
||||
/obj/item/wardrobe/rd
|
||||
name = "\improper Research Director Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Research Director"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/device/pda/heads/rd(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/weapon/tank/air(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/suit/bio_suit/scientist(src)
|
||||
new /obj/item/clothing/head/bio_hood/scientist(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/device/radio/headset/heads/rd(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/research_director(src)
|
||||
|
||||
/obj/item/wardrobe/scientist
|
||||
name = "\improper Scientist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Scientist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/toxins(src)
|
||||
new /obj/item/weapon/tank/oxygen(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/science(src)
|
||||
new /obj/item/device/radio/headset/headset_sci(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
|
||||
/obj/item/wardrobe/chemist
|
||||
name = "\improper Chemist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chemist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/radio/headset/headset_medsci(src)
|
||||
new /obj/item/clothing/under/rank/chemist(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/device/pda/toxins(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat/chemist(src)
|
||||
|
||||
/obj/item/wardrobe/hos
|
||||
name = "\improper Head of Security Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Head of Security"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/gun(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/device/pda/heads/hos(src)
|
||||
new /obj/item/clothing/suit/storage/armourrigvest(src)
|
||||
new /obj/item/clothing/suit/armor/hos(src)
|
||||
new /obj/item/clothing/head/helmet/HoS(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/gloves/hos(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/device/radio/headset/heads/hos(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/head_of_security(src)
|
||||
|
||||
/obj/item/wardrobe/warden
|
||||
name = "\improper Warden Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Warden"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/weapon/gun/energy/taser(src)
|
||||
new /obj/item/device/pda/security(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/suit/storage/gearharness(src)
|
||||
new /obj/item/clothing/head/helmet/warden(src)
|
||||
new /obj/item/clothing/gloves/red(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/warden(src)
|
||||
new /obj/item/clothing/suit/armor/vest/warden(src)
|
||||
new /obj/item/weapon/pepperspray(src)
|
||||
|
||||
/obj/item/wardrobe/detective
|
||||
name = "\improper Detective Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Detective"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/fcardholder(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/weapon/clipboard/notebook(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/taperoll/police(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
new /obj/item/device/pda/detective(src)
|
||||
new /obj/item/clothing/suit/storage/det_suit/armor(src)
|
||||
new /obj/item/clothing/suit/storage/det_suit(src)
|
||||
new /obj/item/clothing/gloves/detective(src)
|
||||
new /obj/item/clothing/head/det_hat(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/det(src)
|
||||
new /obj/item/weapon/camera_film(src)
|
||||
|
||||
/obj/item/wardrobe/officer
|
||||
name = "\improper Security Officer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Security Officer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/pepperspray(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
new /obj/item/taperoll/police(src)
|
||||
new /obj/item/weapon/flashbang(src)
|
||||
new /obj/item/device/pda/security(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/suit/storage/gearharness(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/weapon/storage/belt/security(src)
|
||||
new /obj/item/clothing/head/helmet(src)
|
||||
new /obj/item/clothing/head/secsoft(src)
|
||||
new /obj/item/clothing/gloves/red(src)
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/clothing/shoes/jackboots(src)
|
||||
new /obj/item/clothing/under/rank/security(src)
|
||||
|
||||
|
||||
|
||||
/obj/item/wardrobe/bartender
|
||||
name = "\improper Bartender Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Bartender"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/ammo_casing/shotgun/beanbag(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/bartender(src)
|
||||
|
||||
/obj/item/wardrobe/chef
|
||||
name = "\improper Chef Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Chef"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/clothing/suit/storage/chef(src)
|
||||
new /obj/item/clothing/head/chefhat(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/chef(src)
|
||||
|
||||
/obj/item/wardrobe/hydro
|
||||
name = "\improper Botanist Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Botanist"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/analyzer/plant_analyzer(src)
|
||||
new /obj/item/clothing/suit/storage/apron(src)
|
||||
new /obj/item/clothing/gloves/botanic_leather(src)
|
||||
new /obj/item/device/radio/headset(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/hydroponics(src)
|
||||
|
||||
/obj/item/wardrobe/qm
|
||||
name = "\improper Quartermaster Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Quartermaster"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/clipboard(src)
|
||||
new /obj/item/device/pda/quartermaster(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/device/radio/headset/heads/qm(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/clothing/under/rank/cargo(src)
|
||||
|
||||
/obj/item/wardrobe/cargo_tech
|
||||
name = "\improper Cargo Technician Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Cargo Technician"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/quartermaster(src)
|
||||
new /obj/item/device/radio/headset/headset_cargo(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/cargotech(src)
|
||||
new /obj/item/clothing/gloves/fingerless/black(src)
|
||||
|
||||
/obj/item/wardrobe/mining
|
||||
name = "\improper Shaft Miner Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Shaft Miner"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/fingerless/black(src)
|
||||
|
||||
/obj/item/wardrobe/janitor
|
||||
name = "\improper Janitor Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Janitor"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/janitor(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/rank/janitor(src)
|
||||
new /obj/item/device/portalathe(src)
|
||||
|
||||
/obj/item/wardrobe/librarian
|
||||
name = "\improper Librarian Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Librarian"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/weapon/barcodescanner(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/under/suit_jacket/red(src)
|
||||
|
||||
/obj/item/wardrobe/lawyer
|
||||
name = "\improper Lawyer Wardrobe"
|
||||
descriptor = "clothing and basic equipment for a Lawyer"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src)
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/lawyer(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/weapon/storage/briefcase(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
if(prob(50))
|
||||
new /obj/item/clothing/under/lawyer/bluesuit(src)
|
||||
new /obj/item/clothing/suit/storage/lawyer/bluejacket(src)
|
||||
else
|
||||
new /obj/item/clothing/under/lawyer/purpsuit(src)
|
||||
new /obj/item/clothing/suit/storage/lawyer/purpjacket(src)
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,467 +0,0 @@
|
||||
//this is everything i'm going to be using in my outpost zeta map, and possibly future maps.
|
||||
|
||||
turf/unsimulated/desert
|
||||
name = "desert"
|
||||
icon = 'code/WorkInProgress/Susan/desert.dmi'
|
||||
icon_state = "desert"
|
||||
temperature = 393.15
|
||||
luminosity = 5
|
||||
lighting_lumcount = 8
|
||||
|
||||
turf/unsimulated/desert/New()
|
||||
icon_state = "desert[rand(0,4)]"
|
||||
|
||||
turf/simulated/wall/impassable_rock
|
||||
name = "Mountain Wall"
|
||||
|
||||
//so that you can see the impassable sections in the map editor
|
||||
icon_state = "riveted"
|
||||
New()
|
||||
icon_state = "rock"
|
||||
|
||||
/area/awaymission/labs/researchdivision
|
||||
name = "Research"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/militarydivision
|
||||
name = "Military"
|
||||
icon_state = "away2"
|
||||
|
||||
/area/awaymission/labs/gateway
|
||||
name = "Gateway"
|
||||
icon_state = "away1"
|
||||
|
||||
/area/awaymission/labs/command
|
||||
name = "Command"
|
||||
icon_state = "away"
|
||||
|
||||
/area/awaymission/labs/civilian
|
||||
name = "Civilian"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/cargo
|
||||
name = "Cargo"
|
||||
icon_state = "away2"
|
||||
|
||||
/area/awaymission/labs/medical
|
||||
name = "Medical"
|
||||
icon_state = "away1"
|
||||
|
||||
/area/awaymission/labs/security
|
||||
name = "Security"
|
||||
icon_state = "away"
|
||||
|
||||
/area/awaymission/labs/solars
|
||||
name = "Solars"
|
||||
icon_state = "away3"
|
||||
|
||||
/area/awaymission/labs/cave
|
||||
name = "Caves"
|
||||
icon_state = "away2"
|
||||
|
||||
//corpses and possibly other decorative items
|
||||
|
||||
/obj/effect/landmark/corpse/alien
|
||||
mutantrace = "lizard"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/cargo
|
||||
name = "Cargo Technician"
|
||||
corpseuniform = /obj/item/clothing/under/rank/cargo
|
||||
corpseradio = /obj/item/device/radio/headset/headset_cargo
|
||||
corpseid = 1
|
||||
corpseidjob = "Cargo Technician"
|
||||
corpseidaccess = "Quartermaster"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/laborer
|
||||
name = "Laborer"
|
||||
corpseuniform = /obj/item/clothing/under/overalls
|
||||
corpseradio = /obj/item/device/radio/headset/headset_eng
|
||||
corpseback = /obj/item/weapon/storage/backpack/industrial
|
||||
corpsebelt = /obj/item/weapon/storage/belt/utility/full
|
||||
corpsehelmet = /obj/item/clothing/head/hardhat
|
||||
corpseid = 1
|
||||
corpseidjob = "Laborer"
|
||||
corpseidaccess = "Engineer"
|
||||
|
||||
/obj/effect/landmark/corpse/alien/testsubject
|
||||
name = "Unfortunate Test Subject"
|
||||
corpseuniform = /obj/item/clothing/under/color/white
|
||||
corpseid = 0
|
||||
|
||||
/obj/effect/landmark/corpse/overseer
|
||||
name = "Overseer"
|
||||
corpseuniform = /obj/item/clothing/under/rank/navyhead_of_security
|
||||
corpsesuit = /obj/item/clothing/suit/armor/hosnavycoat
|
||||
corpseradio = /obj/item/device/radio/headset/heads/captain
|
||||
corpsegloves = /obj/item/clothing/gloves/black/hos
|
||||
corpseshoes = /obj/item/clothing/shoes/swat
|
||||
corpsehelmet = /obj/item/clothing/head/beret/navyhos
|
||||
corpseglasses = /obj/item/clothing/glasses/eyepatch
|
||||
corpseid = 1
|
||||
corpseidjob = "Facility Overseer"
|
||||
corpseidaccess = "Captain"
|
||||
|
||||
/obj/effect/landmark/corpse/officer
|
||||
name = "Security Officer"
|
||||
corpseuniform = /obj/item/clothing/under/rank/navysecurity
|
||||
corpsesuit = /obj/item/clothing/suit/armor/navysecvest
|
||||
corpseradio = /obj/item/device/radio/headset/headset_sec
|
||||
corpseshoes = /obj/item/clothing/shoes/swat
|
||||
corpsehelmet = /obj/item/clothing/head/beret/navysec
|
||||
corpseid = 1
|
||||
corpseidjob = "Security Officer"
|
||||
corpseidaccess = "Security Officer"
|
||||
|
||||
/*
|
||||
* Weeds
|
||||
*/
|
||||
#define NODERANGE 1
|
||||
|
||||
/obj/effect/alien/flesh/weeds
|
||||
name = "Fleshy Growth"
|
||||
desc = "A pulsating grouping of odd, alien tissues. It's almost like it has a heartbeat..."
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
icon_state = "flesh"
|
||||
|
||||
anchored = 1
|
||||
density = 0
|
||||
var/health = 15
|
||||
var/obj/effect/alien/weeds/node/linked_node = null
|
||||
|
||||
/obj/effect/alien/flesh/weeds/node
|
||||
icon_state = "fleshnode"
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
name = "Throbbing Pustule"
|
||||
desc = "A grotquese, oozing, pimple-like growth. You swear you can see something moving around in the bulb..."
|
||||
luminosity = NODERANGE
|
||||
var/node_range = NODERANGE
|
||||
|
||||
/obj/effect/alien/flesh/weeds/node/New()
|
||||
..(src.loc, src)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/New(pos, node)
|
||||
..()
|
||||
linked_node = node
|
||||
if(istype(loc, /turf/space))
|
||||
del(src)
|
||||
return
|
||||
if(icon_state == "flesh")icon_state = pick("flesh", "flesh1", "flesh2")
|
||||
spawn(rand(150, 200))
|
||||
if(src)
|
||||
Life()
|
||||
return
|
||||
|
||||
/obj/effect/alien/flesh/weeds/proc/Life()
|
||||
set background = 1
|
||||
var/turf/U = get_turf(src)
|
||||
/*
|
||||
if (locate(/obj/movable, U))
|
||||
U = locate(/obj/movable, U)
|
||||
if(U.density == 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
Alien plants should do something if theres a lot of poison
|
||||
if(U.poison> 200000)
|
||||
health -= round(U.poison/200000)
|
||||
update()
|
||||
return
|
||||
*/
|
||||
if (istype(U, /turf/space))
|
||||
del(src)
|
||||
return
|
||||
|
||||
direction_loop:
|
||||
for(var/dirn in cardinal)
|
||||
var/turf/T = get_step(src, dirn)
|
||||
|
||||
if (!istype(T) || T.density || locate(/obj/effect/alien/flesh/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space))
|
||||
continue
|
||||
|
||||
if(!linked_node || get_dist(linked_node, src) > linked_node.node_range)
|
||||
return
|
||||
|
||||
// if (locate(/obj/movable, T)) // don't propogate into movables
|
||||
// continue
|
||||
|
||||
for(var/obj/O in T)
|
||||
if(O.density)
|
||||
continue direction_loop
|
||||
|
||||
new /obj/effect/alien/flesh/weeds(T, linked_node)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/effect/alien/flesh/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if(W.attack_verb.len)
|
||||
visible_message("\red <B>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
|
||||
else
|
||||
visible_message("\red <B>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
|
||||
|
||||
var/damage = W.force / 4.0
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
|
||||
if(WT.remove_fuel(0, user))
|
||||
damage = 15
|
||||
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
health -= damage
|
||||
healthcheck()
|
||||
|
||||
/obj/effect/alien/flesh/weeds/proc/healthcheck()
|
||||
if(health <= 0)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/effect/alien/flesh/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
health -= 5
|
||||
healthcheck()
|
||||
|
||||
/*/obj/effect/alien/weeds/burn(fi_amount)
|
||||
if (fi_amount > 18000)
|
||||
spawn( 0 )
|
||||
del(src)
|
||||
return
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
|
||||
#undef NODERANGE
|
||||
|
||||
//clothing, weapons, and other items that can be worn or used in some way
|
||||
|
||||
/obj/item/clothing/under/rank/navywarden
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the word \"Warden\" written on the shoulders."
|
||||
name = "warden's jumpsuit"
|
||||
icon_state = "wardendnavyclothes"
|
||||
item_state = "wardendnavyclothes"
|
||||
color = "wardendnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/under/rank/navysecurity
|
||||
name = "security officer's jumpsuit"
|
||||
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
|
||||
icon_state = "officerdnavyclothes"
|
||||
item_state = "officerdnavyclothes"
|
||||
color = "officerdnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/under/rank/navyhead_of_security
|
||||
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Head of Security\". It has additional armor to protect the wearer."
|
||||
name = "head of security's jumpsuit"
|
||||
icon_state = "hosdnavyclothes"
|
||||
item_state = "hosdnavyclothes"
|
||||
color = "hosdnavyclothes"
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/suit/armor/hosnavycoat
|
||||
name = "armored coat"
|
||||
desc = "A coat enchanced with a special alloy for some protection and style."
|
||||
icon_state = "hosdnavyjacket"
|
||||
item_state = "armor"
|
||||
armor = list(melee = 65, bullet = 30, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/head/beret/navysec
|
||||
name = "security beret"
|
||||
desc = "A beret with the security insignia emblazoned on it. For officers that are more inclined towards style than safety."
|
||||
icon_state = "officerberet"
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/head/beret/navywarden
|
||||
name = "warden's beret"
|
||||
desc = "A beret with a two-colored security insignia emblazoned on it. For wardens that are more inclined towards style than safety."
|
||||
icon_state = "wardenberet"
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/head/beret/navyhos
|
||||
name = "security head's beret"
|
||||
desc = "A stylish beret bearing a golden insignia that proudly displays the security coat of arms. A commander's must-have."
|
||||
icon_state = "hosberet"
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/suit/armor/navysecvest
|
||||
name = "armored coat"
|
||||
desc = "An armored coat that protects against some damage."
|
||||
icon_state = "officerdnavyjacket"
|
||||
item_state = "armor"
|
||||
flags = FPRINT | TABLEPASS
|
||||
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/suit/armor/navywardenvest
|
||||
name = "Warden's jacket"
|
||||
desc = "An armoured jacket with silver rank pips and livery."
|
||||
icon_state = "wardendnavyjacket"
|
||||
item_state = "armor"
|
||||
flags = FPRINT | TABLEPASS
|
||||
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
//hostile entities or npcs
|
||||
|
||||
/obj/item/projectile/slimeglob
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "toxin"
|
||||
damage = 20
|
||||
damage_type = BRUTE
|
||||
|
||||
/obj/effect/critter/fleshmonster
|
||||
name = "Fleshy Horror"
|
||||
desc = "A grotesque, shambling fleshy horror... was this once a... a person?"
|
||||
icon = 'icons/mob/mob.dmi'
|
||||
icon_state = "horror"
|
||||
/*
|
||||
health = 120
|
||||
max_health = 120
|
||||
aggressive = 1
|
||||
defensive = 1
|
||||
wanderer = 1
|
||||
opensdoors = 1
|
||||
atkcarbon = 1
|
||||
atksilicon = 1
|
||||
atkcritter = 1
|
||||
atksame = 0
|
||||
atkmech = 1
|
||||
firevuln = 0.5
|
||||
brutevuln = 1
|
||||
seekrange = 25
|
||||
armor = 15
|
||||
melee_damage_lower = 12
|
||||
melee_damage_upper = 17
|
||||
angertext = "shambles"
|
||||
attacktext = "slashes"
|
||||
var/ranged = 0
|
||||
var/rapid = 0
|
||||
proc
|
||||
Shoot(var/target, var/start, var/user, var/bullet = 0)
|
||||
OpenFire(var/thing)//bluh ill rename this later or somethin
|
||||
|
||||
|
||||
Die()
|
||||
if (!src.alive) return
|
||||
src.alive = 0
|
||||
walk_to(src,0)
|
||||
src.visible_message("<b>[src]</b> disintegrates into mush!")
|
||||
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
|
||||
var/turf/Ts = get_turf(src)
|
||||
new /obj/effect/decal/cleanable/blood(Ts)
|
||||
del(src)
|
||||
|
||||
seek_target()
|
||||
src.anchored = 0
|
||||
var/T = null
|
||||
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
|
||||
if (src.target)
|
||||
src.task = "chasing"
|
||||
break
|
||||
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
|
||||
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
|
||||
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
|
||||
if(C.health < 0) continue
|
||||
if(istype(C, /mob/living/carbon/) && src.atkcarbon)
|
||||
if(C:mind)
|
||||
if(C:mind:special_role == "H.I.V.E")
|
||||
continue
|
||||
src.attack = 1
|
||||
if(istype(C, /mob/living/silicon/) && src.atksilicon)
|
||||
if(C:mind)
|
||||
if(C:mind:special_role == "H.I.V.E")
|
||||
continue
|
||||
src.attack = 1
|
||||
if(src.attack)
|
||||
T = C
|
||||
break
|
||||
|
||||
if(!src.attack)
|
||||
for(var/obj/effect/critter/C in view(src.seekrange,src))
|
||||
if(istype(C, /obj/effect/critter) && !src.atkcritter) continue
|
||||
if(C.health <= 0) continue
|
||||
if(istype(C, /obj/effect/critter) && src.atkcritter)
|
||||
if((istype(C, /obj/effect/critter/hivebot) && !src.atksame) || (C == src)) continue
|
||||
T = C
|
||||
break
|
||||
|
||||
for(var/obj/mecha/M in view(src.seekrange,src))
|
||||
if(istype(M, /obj/mecha) && !src.atkmech) continue
|
||||
if(M.health <= 0) continue
|
||||
if(istype(M, /obj/mecha) && src.atkmech) src.attack = 1
|
||||
if(src.attack)
|
||||
T = M
|
||||
break
|
||||
|
||||
if(src.attack)
|
||||
src.target = T
|
||||
src.oldtarget_name = T:name
|
||||
if(src.ranged)
|
||||
OpenFire(T)
|
||||
return
|
||||
src.task = "chasing"
|
||||
return
|
||||
|
||||
|
||||
OpenFire(var/thing)
|
||||
src.target = thing
|
||||
src.oldtarget_name = thing:name
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <b>[src]</b> spits a glob at [src.target]!", 1)
|
||||
|
||||
var/tturf = get_turf(target)
|
||||
if(rapid)
|
||||
spawn(1)
|
||||
Shoot(tturf, src.loc, src)
|
||||
spawn(4)
|
||||
Shoot(tturf, src.loc, src)
|
||||
spawn(6)
|
||||
Shoot(tturf, src.loc, src)
|
||||
else
|
||||
Shoot(tturf, src.loc, src)
|
||||
|
||||
src.attack = 0
|
||||
sleep(12)
|
||||
seek_target()
|
||||
src.task = "thinking"
|
||||
return
|
||||
|
||||
|
||||
Shoot(var/target, var/start, var/user, var/bullet = 0)
|
||||
if(target == start)
|
||||
return
|
||||
|
||||
var/obj/item/projectile/slimeglob/A = new /obj/item/projectile/slimeglob(user:loc)
|
||||
playsound(user, 'sound/weapons/bite.ogg', 100, 1)
|
||||
|
||||
if(!A) return
|
||||
|
||||
if (!istype(target, /turf))
|
||||
del(A)
|
||||
return
|
||||
A.current = target
|
||||
A.yo = target:y - start:y
|
||||
A.xo = target:x - start:x
|
||||
spawn( 0 )
|
||||
A.process()
|
||||
return
|
||||
*/
|
||||
|
||||
obj/effect/critter/fleshmonster/fleshslime
|
||||
name = "Flesh Slime"
|
||||
icon = 'code/WorkInProgress/Susan/biocraps.dmi'
|
||||
icon_state = "livingflesh"
|
||||
desc = "A creature that appears to be made out of living tissue strewn together haphazardly. Some kind of liquid bubbles from its maw."
|
||||
//ranged = 1
|
||||
@@ -1,152 +0,0 @@
|
||||
// Contains:
|
||||
// /datum/text_parser/parser/eliza
|
||||
// /datum/text_parser/keyword
|
||||
|
||||
/datum/text_parser/parser/eliza
|
||||
//var/datum/text_parser/reply/replies[] // R(X) 36
|
||||
var/prev_reply = "" // previous reply
|
||||
var/username = ""
|
||||
var/callsign = ""
|
||||
var/yesno_state = ""
|
||||
var/yesno_param = ""
|
||||
|
||||
/datum/text_parser/parser/eliza/new_session()
|
||||
..()
|
||||
for(var/datum/text_parser/keyword/key in keywords)
|
||||
key.eliza = src
|
||||
|
||||
prev_reply = ""
|
||||
username = ""
|
||||
yesno_state = ""
|
||||
yesno_param = ""
|
||||
print("Hi! I'm [callsign], how are you doing? You can talk to me by beginning your statements with \"[callsign],\"")
|
||||
|
||||
/datum/text_parser/parser/eliza/process_line()
|
||||
..()
|
||||
// pad so we can detect initial and final words correctly
|
||||
input_line = " " + src.input_line + " "
|
||||
// remove apostrophes
|
||||
for(var/i = -1, i != 0, i = findtext(input_line, "'"))
|
||||
if(i == -1)
|
||||
continue
|
||||
input_line = copytext(input_line, 1, i) + copytext(input_line, i + 1, 0)
|
||||
|
||||
// did user insult us? (i don't really want cursing in the source code,
|
||||
// so keep it the simple original check from the 70's code :p)
|
||||
if(findtext(input_line, "shut"))
|
||||
// sssh
|
||||
return
|
||||
|
||||
if(input_line == prev_reply)
|
||||
print("Please don't repeat yourself!")
|
||||
|
||||
// find a keyword
|
||||
var/keyphrase = ""
|
||||
var/datum/text_parser/keyword/keyword // the actual keyword
|
||||
var/keypos = 0 // pos of keyword so we can grab extra text after it
|
||||
|
||||
for(var/i = 1, i <= keywords.len, i++)
|
||||
keyword = keywords[i]
|
||||
for(var/j = 1, j <= keyword.phrases.len, j++)
|
||||
keypos = findtext(input_line, " " + keyword.phrases[j])
|
||||
if(keypos != 0)
|
||||
// found it!
|
||||
keyphrase = keyword.phrases[j]
|
||||
break
|
||||
if(keyphrase != "")
|
||||
break
|
||||
|
||||
//world << "keyphrase: " + keyphrase + " " + num2text(keypos)
|
||||
|
||||
var/conjugated = ""
|
||||
// was it not recognized? then make it nokeyfound
|
||||
if(keyphrase == "")
|
||||
keyword = keywords[keywords.len] // nokeyfound
|
||||
else
|
||||
// otherwise, business as usual
|
||||
|
||||
// let's conjugate this mess
|
||||
conjugated = copytext(input_line, 1 + keypos + lentext(keyphrase))
|
||||
|
||||
// go ahead and strip punctuation
|
||||
if(lentext(conjugated) > 0 && copytext(conjugated, lentext(conjugated)) == " ")
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
if(lentext(conjugated) > 0)
|
||||
var/final_punc = copytext(conjugated, lentext(conjugated))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
|
||||
conjugated += " "
|
||||
|
||||
if(keyword.conjugate)
|
||||
// now run through conjugation pairs
|
||||
for(var/i = 1, i <= lentext(conjugated), i++)
|
||||
for(var/x = 1, x <= conjugs.len, x += 2)
|
||||
var/cx = conjugs[x]
|
||||
var/cxa = conjugs[x + 1]
|
||||
if(i + lentext(cx) <= lentext(conjugated) + 1 && cmptext(cx, copytext(conjugated, i, i + lentext(cx))))
|
||||
// world << cx
|
||||
|
||||
conjugated = copytext(conjugated, 1, i) + cxa + copytext(conjugated, i + lentext(cx))
|
||||
i = i + lentext(cx)
|
||||
// don't count right padding
|
||||
if(copytext(cx, lentext(cx)) == " ")
|
||||
i--
|
||||
break
|
||||
else if(i + lentext(cxa) <= lentext(conjugated) + 1 && cmptext(cxa, copytext(conjugated, i, i + lentext(cxa))))
|
||||
// world << cxa
|
||||
|
||||
conjugated = copytext(conjugated, 1, i) + cx + copytext(conjugated, i + lentext(cxa))
|
||||
i = i + lentext(cxa)
|
||||
// don't count right padding
|
||||
if(copytext(cxa, lentext(cxa)) == " ")
|
||||
i--
|
||||
break
|
||||
|
||||
conjugated = copytext(conjugated, 1, lentext(conjugated))
|
||||
|
||||
//world << "Conj: " + conjugated
|
||||
|
||||
// now actually get a reply
|
||||
var/reply = keyword.process(conjugated)
|
||||
print(reply)
|
||||
|
||||
prev_reply = reply
|
||||
|
||||
/datum/text_parser/keyword
|
||||
var/list/phrases = new()
|
||||
var/list/replies = new()
|
||||
var/datum/text_parser/parser/eliza/eliza
|
||||
var/conjugate = 1
|
||||
|
||||
New(p, r)
|
||||
phrases = p
|
||||
replies = r
|
||||
|
||||
proc/process(object)
|
||||
eliza.yesno_state = ""
|
||||
eliza.yesno_param = ""
|
||||
var/reply = pick(replies)
|
||||
if(copytext(reply, lentext(reply)) == "*")
|
||||
// add object of statement (hopefully not actually mess :p)
|
||||
if(object == "")
|
||||
object = pick(generic_objects)
|
||||
// possibly add name or just ?
|
||||
if(eliza.username != "" && rand(3) == 0)
|
||||
object += ", " + eliza.username
|
||||
return copytext(reply, 1, lentext(reply)) + object + "?"
|
||||
else
|
||||
// get punct
|
||||
var/final_punc = ""
|
||||
if(lentext(reply) > 0)
|
||||
final_punc = copytext(reply, lentext(reply))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
reply = copytext(reply, 1, lentext(reply))
|
||||
else
|
||||
final_punc = ""
|
||||
|
||||
// possibly add name or just ?/./!
|
||||
if(eliza.username != "" && rand(2) == 0)
|
||||
reply += ", " + eliza.username
|
||||
|
||||
return reply + final_punc
|
||||
@@ -1,435 +0,0 @@
|
||||
// Contains:
|
||||
// Implementation-specific data for /datum/text_parser/parser/eliza
|
||||
|
||||
/datum/text_parser/keyword
|
||||
// if we have a * reply, but no object from the user
|
||||
var/list/generic_objects = list(
|
||||
" what", " something", "...")
|
||||
|
||||
var/list/object_leaders = list(
|
||||
" is ", "'s ")
|
||||
|
||||
/datum/text_parser/parser/eliza
|
||||
|
||||
// conjugation data
|
||||
var/list/conjugs = list(
|
||||
" are ", " am ", " were ", " was ", " you ", " me ", " you ", " i " , " your ", " my ",
|
||||
" ive ", " youve ", " Im ", " youre ")
|
||||
|
||||
// keywords / replies
|
||||
var/list/keywords = list(
|
||||
new/datum/text_parser/keyword/tell( // NT-like
|
||||
list("tell"),
|
||||
list(
|
||||
"Told *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("can you"),
|
||||
list(
|
||||
"Dont you believe that I can*",
|
||||
"Perhaps you would like to be able to*",
|
||||
"You want me to be able to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("can i"),
|
||||
list(
|
||||
"Perhaps you don't want to*",
|
||||
"Do you want to be able to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("you are", "youre"),
|
||||
list(
|
||||
"What makes you think I am*",
|
||||
"Does it please you to believe that I am*",
|
||||
"Perhaps you would like to be*",
|
||||
"Do you sometimes wish you were*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i dont"),
|
||||
list(
|
||||
"Don't you really*",
|
||||
"Why don't you*",
|
||||
"Do you wish to be able to*",
|
||||
"Does that trouble you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i feel"),
|
||||
list(
|
||||
"Tell me more about such feelings.",
|
||||
"Do you often feel*",
|
||||
"Do you enjoy feeling*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("why dont you"),
|
||||
list(
|
||||
"Do you really believe I don't*",
|
||||
"Perhaps in good time I will*",
|
||||
"Do you want me to*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("why cant i"),
|
||||
list(
|
||||
"Do you think you should be able to*",
|
||||
"Why can't you*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("are you"),
|
||||
list(
|
||||
"Why are you interested in whether or not I am*",
|
||||
"Would you prefer if I were not*",
|
||||
"Perhaps in your fantasies I am*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i cant"),
|
||||
list(
|
||||
"How do you know I can't*",
|
||||
"Have you tried?",
|
||||
"Perhaps you can now*")),
|
||||
new/datum/text_parser/keyword/setparam/username(
|
||||
list("my name", "im called", "am called", "call me"),
|
||||
list(
|
||||
"Your name is *",
|
||||
"You call yourself *",
|
||||
"You're called *")),
|
||||
new/datum/text_parser/keyword/setparam/callsign(
|
||||
list("your name", "call yourself"),
|
||||
list(
|
||||
"My name is *",
|
||||
"I call myself *",
|
||||
"I'm called *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i am", "im"),
|
||||
list(
|
||||
"Did you come to me because you are*",
|
||||
"How long have you been*",
|
||||
"Do you believe it is normal to be*",
|
||||
"Do you enjoy being*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("thanks", "thank you"),
|
||||
list(
|
||||
"You're welcome.",
|
||||
"No problem.",
|
||||
"Thank you!")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("you"),
|
||||
list(
|
||||
"We were discussing you - not me.",
|
||||
"Oh, I*",
|
||||
"You're not really talking about me, are you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("i want","i like"),
|
||||
list(
|
||||
"What would it mean if you got*",
|
||||
"Why do you want*",
|
||||
"Suppose you got*",
|
||||
"What if you never got*",
|
||||
"I sometimes also want*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("what", "how", "who", "where", "when", "why"),
|
||||
list(
|
||||
"Why do you ask?",
|
||||
"Does that question interest you?",
|
||||
"What answer would please you the most?",
|
||||
"What do you think?",
|
||||
"Are such questions on your mind often?",
|
||||
"What is it you really want to know?",
|
||||
"Have you asked anyone else?",
|
||||
"Have you asked such questions before?",
|
||||
"What else comes to mind when you ask that?")),
|
||||
new/datum/text_parser/keyword/paramlist/pick( // NT-like
|
||||
list("pick","choose"),
|
||||
list(
|
||||
"I choose... *",
|
||||
"I prefer *",
|
||||
"My favorite is *")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("name"),
|
||||
list(
|
||||
"Names don't interest me.",
|
||||
"I don't care about names. Go on.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("cause"),
|
||||
list(
|
||||
"Is that a real reason?",
|
||||
"Don't any other reasons come to mind?",
|
||||
"Does that reason explain anything else?",
|
||||
"What other reason might there be?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("sorry"),
|
||||
list(
|
||||
"Please don't apologize.",
|
||||
"Apologies are not necessary.",
|
||||
"What feelings do you get when you apologize?",
|
||||
"Don't be so defensive!")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("dream"),
|
||||
list(
|
||||
"What does that dream suggest to you?",
|
||||
"Do you dream often?",
|
||||
"What persons are in your dreams?",
|
||||
"Are you disturbed by your dreams?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("hello", "hi", "yo", "hiya"),
|
||||
list(
|
||||
"How do you do... Please state your name and problem.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("go away", "bye"),
|
||||
list(
|
||||
"Good bye. I hope to have another session with you soon.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("maybe", "sometimes", "probably", "mostly", "most of the time"),
|
||||
list(
|
||||
"You don't seem quite certain.",
|
||||
"Why the uncertain tone?",
|
||||
"Can't you be more positive?",
|
||||
"You aren't sure?",
|
||||
"Don't you know?")),
|
||||
new/datum/text_parser/keyword/no(
|
||||
list("no", "nope", "nah"),
|
||||
list(
|
||||
"Are you saying that just to be negative?",
|
||||
"You are being a bit negative.",
|
||||
"Why not?",
|
||||
"Are you sure?",
|
||||
"Why no?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("your"),
|
||||
list(
|
||||
"Why are you concerned about my*",
|
||||
"What about your own*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("always"),
|
||||
list(
|
||||
"Can you think of a specific example?",
|
||||
"When?",
|
||||
"What are you thinking of?",
|
||||
"Really, always?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("think"),
|
||||
list(
|
||||
"Do you really think so?",
|
||||
"But you're not sure you*",
|
||||
"Do you doubt you*")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("alike"),
|
||||
list(
|
||||
"In what way?",
|
||||
"What resemblence do you see?",
|
||||
"What does the similarity suggest to you?",
|
||||
"What other connections do you see?",
|
||||
"Count there really be some connection?",
|
||||
"How?",
|
||||
"You seem quite positive.")),
|
||||
new/datum/text_parser/keyword/yes(
|
||||
list("yes", "yep", "yeah", "indeed"),
|
||||
list(
|
||||
"Are you sure?",
|
||||
"I see.",
|
||||
"I understand.")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("friend"),
|
||||
list(
|
||||
"Why do you bring up the topic of friends?",
|
||||
"Why do your friends worry you?",
|
||||
"Do your friends pick on you?",
|
||||
"Are you sure you have any friends?",
|
||||
"Do you impose on your friends?",
|
||||
"Perhaps your love for friends worries you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("computer", "bot", "ai"),
|
||||
list(
|
||||
"Do computers worry you?",
|
||||
"Are you talking about me in particular?",
|
||||
"Are you frightened by machines?",
|
||||
"Why do your mention computers?",
|
||||
"What do you think computers have to do with your problem?",
|
||||
"Don't you think computers can help people?",
|
||||
"What is it about machines that worries you?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("murder", "death", "kill", "dead", "destroy", "traitor", "synd"),
|
||||
list(
|
||||
"Well, that's rather morbid.",
|
||||
"Do you think that caused a trauma with you?",
|
||||
"Have you ever previously spoken to anybody about this?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("bomb", "explosive", "toxin", "plasma"),
|
||||
list(
|
||||
"Do you worry about bombs often?",
|
||||
"Do you work in toxins?",
|
||||
"Do you find it odd to worry about bombs on a toxins research vessel?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("work", "job", "head", "staff", "transen"),
|
||||
list(
|
||||
"Do you like working here?",
|
||||
"What are your feelings on working here?")),
|
||||
new/datum/text_parser/keyword(
|
||||
list("nokeyfound"),
|
||||
list(
|
||||
"Say, do you have any psychological problems?",
|
||||
"What does that suggest to you?",
|
||||
"I see.",
|
||||
"I'm not sure I understand you fully.",
|
||||
"Come elucidate on your thoughts.",
|
||||
"Can you elaborate on that?",
|
||||
"That is quite interesting.")))
|
||||
|
||||
/datum/text_parser/keyword/setparam
|
||||
proc/param(object)
|
||||
|
||||
// drop leading parts
|
||||
for(var/leader in object_leaders)
|
||||
var/i = findtext(object, leader)
|
||||
if(i)
|
||||
object = copytext(object, i + lentext(leader))
|
||||
break
|
||||
|
||||
// trim spaces
|
||||
object = trim(object)
|
||||
|
||||
// trim punctuation
|
||||
if(lentext(object) > 0)
|
||||
var/final_punc = copytext(object, lentext(object))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
object = copytext(object, 1, lentext(object))
|
||||
|
||||
return object
|
||||
|
||||
/datum/text_parser/keyword/paramlist
|
||||
proc/param(object)
|
||||
// drop leading parts
|
||||
for(var/leader in object_leaders)
|
||||
var/i = findtext(object, leader)
|
||||
if(i)
|
||||
object = copytext(object, i + lentext(leader))
|
||||
break
|
||||
|
||||
// trim spaces
|
||||
object = trim(object)
|
||||
|
||||
// trim punctuation
|
||||
if(lentext(object) > 0)
|
||||
var/final_punc = copytext(object, lentext(object))
|
||||
if(final_punc == "." || final_punc == "?" || final_punc == "!")
|
||||
object = copytext(object, 1, lentext(object))
|
||||
|
||||
return dd_text2list(object, ",")
|
||||
|
||||
/datum/text_parser/keyword/setparam/username
|
||||
process(object)
|
||||
object = param(object)
|
||||
|
||||
// handle name
|
||||
if(eliza.username == "")
|
||||
// new name
|
||||
var/t = ..(object)
|
||||
eliza.yesno_state = "username"
|
||||
eliza.yesno_param = object
|
||||
return t
|
||||
else if(cmptext(eliza.username, object))
|
||||
// but wait!
|
||||
return "You already told me your name was [eliza.username]."
|
||||
else
|
||||
eliza.yesno_state = "username"
|
||||
eliza.yesno_param = object
|
||||
return "But you previously told me your name was [eliza.username]. Are you sure you want to be called [object]?"
|
||||
|
||||
/datum/text_parser/keyword/setparam/callsign
|
||||
process(object)
|
||||
object = param(object)
|
||||
|
||||
// handle name
|
||||
if(eliza.callsign == "")
|
||||
// new name
|
||||
var/t = ..(object)
|
||||
eliza.yesno_state = "callsign"
|
||||
eliza.yesno_param = object
|
||||
return t
|
||||
else if(cmptext(eliza.callsign, object))
|
||||
// but wait!
|
||||
return "You already told me that I should answer to [eliza.callsign]."
|
||||
else
|
||||
eliza.yesno_state = "callsign"
|
||||
eliza.yesno_param = object
|
||||
return "But you previously told me my name was [eliza.callsign]. Are you sure you want me to be called [object]?"
|
||||
|
||||
/datum/text_parser/keyword/paramlist/pick
|
||||
process(object)
|
||||
var/choice = pick(param(object))
|
||||
return ..(choice)
|
||||
|
||||
/datum/text_parser/keyword/tell
|
||||
conjugate = 0
|
||||
|
||||
process(object)
|
||||
// get name & message
|
||||
var/i = findtext(object, ",")
|
||||
var/sl = 1
|
||||
if(!i || lentext(object) < i + sl)
|
||||
return "Tell who that you what?"
|
||||
|
||||
var/name = trim(copytext(object, 1, i))
|
||||
object = trim(copytext(object, i + sl))
|
||||
if(!lentext(name) || !lentext(object))
|
||||
return "Tell who that you what?"
|
||||
|
||||
// find PDA
|
||||
var/obj/item/device/pda/pda
|
||||
for (var/obj/item/device/pda/P in world)
|
||||
if (!P.owner)
|
||||
continue
|
||||
else if (P.toff)
|
||||
continue
|
||||
|
||||
if(!cmptext(name, P.owner))
|
||||
continue
|
||||
|
||||
pda = P
|
||||
|
||||
if(!pda || pda.toff)
|
||||
return "I couldn't find [name]'s PDA."
|
||||
|
||||
// send message
|
||||
if(!istype(eliza.speaker.loc.loc, /obj/item/device/pda))//Looking if we are in a PDA
|
||||
pda.tnote += "<i><b>← From [eliza.callsign]:</b></i><br>[object]<br>"
|
||||
|
||||
if(prob(15) && eliza.speaker) //Give the AI a chance of intercepting the message
|
||||
var/who = eliza.speaker
|
||||
if(prob(50))
|
||||
who = "[eliza.speaker:master] via [eliza.speaker]"
|
||||
for(var/mob/living/silicon/ai/ai in world)
|
||||
ai.show_message("<i>Intercepted message from <b>[who]</b>: [object]</i>")
|
||||
|
||||
if (!pda.silent)
|
||||
playsound(pda.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, pda.loc))
|
||||
O.show_message(text("\icon[pda] *[pda.ttone]*"))
|
||||
|
||||
pda.overlays = null
|
||||
pda.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
else
|
||||
var/list/href_list = list()
|
||||
href_list["src"] = "\ref[eliza.speaker.loc.loc]"
|
||||
href_list["choice"] = "Message"
|
||||
href_list["target"] = "\ref[pda]"
|
||||
href_list["pAI_mess"] = "\"[object]\" \[Via pAI Unit\]"
|
||||
var/obj/item/device/pda/pda_im_in = eliza.speaker.loc.loc
|
||||
pda_im_in.Topic("src=\ref[eliza.speaker.loc.loc];choice=Message;target=\ref[pda];pAI_mess=\"[object] \[Via pAI Unit\]",href_list)
|
||||
return "Told [name], [object]."
|
||||
|
||||
/datum/text_parser/keyword/yes
|
||||
process(object)
|
||||
var/reply
|
||||
switch(eliza.yesno_state)
|
||||
if("username")
|
||||
eliza.username = eliza.yesno_param
|
||||
reply = pick(
|
||||
"[eliza.username] - that's a nice name.",
|
||||
"Hello, [eliza.username]!",
|
||||
"You sound nice.")
|
||||
if("callsign")
|
||||
eliza.callsign = eliza.yesno_param
|
||||
eliza.set_name(eliza.callsign)
|
||||
reply = pick(
|
||||
"Oh, alright...",
|
||||
"[eliza.callsign]... I like that.",
|
||||
"OK!")
|
||||
else
|
||||
return ..(object)
|
||||
eliza.yesno_state = ""
|
||||
eliza.yesno_param = ""
|
||||
return reply
|
||||
|
||||
/datum/text_parser/keyword/no
|
||||
process(object)
|
||||
return ..(object)
|
||||
@@ -1,18 +0,0 @@
|
||||
// Contains:
|
||||
// /datum/text_parser/parser
|
||||
|
||||
/datum/text_parser/parser
|
||||
var/input_line = ""
|
||||
var/mob/speaker
|
||||
|
||||
/datum/text_parser/parser/proc/print(line)
|
||||
speaker.say(line)
|
||||
|
||||
/datum/text_parser/parser/proc/set_name(name)
|
||||
speaker.name = name
|
||||
speaker.real_name = name
|
||||
|
||||
/datum/text_parser/parser/proc/new_session()
|
||||
input_line = ""
|
||||
|
||||
/datum/text_parser/parser/proc/process_line()
|
||||
@@ -1,190 +0,0 @@
|
||||
// Base Class
|
||||
/mob/living/simple_animal/livestock
|
||||
desc = "Tasty!"
|
||||
icon = 'icons/mob/livestock.dmi'
|
||||
emote_see = list("shakes its head", "kicks the ground")
|
||||
speak_chance = 1
|
||||
turns_per_move = 15
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "kicks"
|
||||
var/max_nutrition = 100 // different animals get hungry faster, basically number of 5-second steps from full to starving (60 == 5 minutes)
|
||||
var/nutrition_step // cycle step in nutrition system
|
||||
var/obj/movement_target // eating-ing target
|
||||
|
||||
New()
|
||||
if(!nutrition)
|
||||
nutrition = max_nutrition * 0.33 // at 1/3 nutrition
|
||||
|
||||
reagents = new()
|
||||
reagents.my_atom = src
|
||||
|
||||
Life()
|
||||
..()
|
||||
|
||||
if(stat != DEAD)
|
||||
meat_amount = round(nutrition / 50)
|
||||
|
||||
nutrition_step--
|
||||
if(nutrition_step <= 0)
|
||||
// handle animal digesting
|
||||
if(nutrition > 0)
|
||||
nutrition--
|
||||
else
|
||||
health--
|
||||
nutrition_step = 50 // only tick this every 5 seconds
|
||||
|
||||
// handle animal eating (borrowed from Ian code)
|
||||
|
||||
// not hungry if full
|
||||
if(nutrition >= max_nutrition)
|
||||
return
|
||||
|
||||
if((movement_target) && !(isturf(movement_target.loc)))
|
||||
movement_target = null
|
||||
a_intent = "help"
|
||||
turns_per_move = initial(turns_per_move)
|
||||
if( !movement_target || !(movement_target.loc in oview(src, 3)) )
|
||||
movement_target = null
|
||||
a_intent = "help"
|
||||
turns_per_move = initial(turns_per_move)
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in oview(src,3))
|
||||
if(isturf(S.loc) || ishuman(S.loc))
|
||||
movement_target = S
|
||||
break
|
||||
if(movement_target)
|
||||
stop_automated_movement = 1
|
||||
step_to(src,movement_target,1)
|
||||
sleep(3)
|
||||
step_to(src,movement_target,1)
|
||||
sleep(3)
|
||||
step_to(src,movement_target,1)
|
||||
|
||||
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
|
||||
if (movement_target.loc.x < src.x)
|
||||
dir = WEST
|
||||
else if (movement_target.loc.x > src.x)
|
||||
dir = EAST
|
||||
else if (movement_target.loc.y < src.y)
|
||||
dir = SOUTH
|
||||
else if (movement_target.loc.y > src.y)
|
||||
dir = NORTH
|
||||
else
|
||||
dir = SOUTH
|
||||
|
||||
if(isturf(movement_target.loc))
|
||||
movement_target.attack_animal(src)
|
||||
if(istype(movement_target, /obj/item/weapon/reagent_containers/food/snacks))
|
||||
var/obj/item/I = movement_target
|
||||
I.attack(src, src, "mouth") // eat it, if it's food
|
||||
|
||||
if(a_intent == "hurt") // to make raging critter harm, then disarm, then stop
|
||||
a_intent = "disarm"
|
||||
else if(a_intent == "disarm")
|
||||
a_intent = "help"
|
||||
movement_target = null
|
||||
turns_per_move = initial(turns_per_move)
|
||||
else if(ishuman(movement_target.loc))
|
||||
if(prob(20))
|
||||
emote("stares at the [movement_target] that [movement_target.loc] has with a longing expression.")
|
||||
|
||||
proc/rage_at(mob/living/M)
|
||||
movement_target = M // pretty simple
|
||||
turns_per_move = 1
|
||||
emote("becomes enraged")
|
||||
a_intent = "hurt"
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(nutrition < max_nutrition && istype(O,/obj/item/weapon/reagent_containers/food/snacks))
|
||||
O.attack_animal(src)
|
||||
else
|
||||
..(O, user)
|
||||
|
||||
// Cow
|
||||
/mob/living/simple_animal/livestock/cow
|
||||
name = "\improper Cow"
|
||||
icon_state = "cow"
|
||||
icon_living = "cow"
|
||||
icon_dead = "cow_d"
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/cow
|
||||
meat_amount = 10
|
||||
max_nutrition = 1000
|
||||
speak = list("Moo.","Moooo!","Snort.")
|
||||
speak_emote = list("moos")
|
||||
emote_hear = list("moos", "snorts")
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass))
|
||||
var/datum/reagents/R = O:reagents
|
||||
|
||||
R.add_reagent("milk", 50)
|
||||
nutrition -= 50
|
||||
usr << "\blue You milk the cow."
|
||||
else if(O.force > 0 && O.w_class >= 2)
|
||||
rage_at(user)
|
||||
else
|
||||
..(O, user)
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
..()
|
||||
if(user.a_intent == "hurt")
|
||||
rage_at(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/cow
|
||||
name = "Beef"
|
||||
desc = "It's what's for dinner!"
|
||||
|
||||
// Chicken
|
||||
/mob/living/simple_animal/livestock/chicken
|
||||
name = "\improper Chicken"
|
||||
icon_state = "chick"
|
||||
icon_living = "chick"
|
||||
icon_dead = "chick_d"
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/chicken
|
||||
meat_amount = 3
|
||||
max_nutrition = 200
|
||||
speak = list("Bock bock!","Cl-cluck.","Click.")
|
||||
speak_emote = list("bocks","clucks")
|
||||
emote_hear = list("bocks", "clucks", "squawks")
|
||||
|
||||
/mob/living/simple_animal/livestock/chicken/Life()
|
||||
..()
|
||||
|
||||
// go right before cycle elapses, and if animal isn't starving
|
||||
if(stat != DEAD && nutrition_step == 1 && nutrition > max_nutrition / 2)
|
||||
// lay an egg with probability of 5% in 5 second time period
|
||||
if(prob(33))
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/egg(src.loc) // lay an egg
|
||||
nutrition -= 25
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/chicken
|
||||
name = "Chicken"
|
||||
desc = "Tasty!"
|
||||
|
||||
/obj/structure/closet/critter
|
||||
desc = "\improper Critter crate."
|
||||
name = "Critter Crate"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "critter"
|
||||
density = 1
|
||||
icon_opened = "critteropen"
|
||||
icon_closed = "critter"
|
||||
|
||||
/datum/supply_packs/chicken
|
||||
name = "\improper Chicken crate"
|
||||
contains = list("/mob/living/simple_animal/livestock/chicken",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/grown/corn")
|
||||
cost = 10
|
||||
containertype = "/obj/structure/closet/critter"
|
||||
containername = "Chicken crate"
|
||||
//group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/cow
|
||||
name = "\improper Cow crate"
|
||||
contains = list("/mob/living/simple_animal/livestock/cow",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/grown/corn")
|
||||
cost = 50
|
||||
containertype = "/obj/structure/closet/critter"
|
||||
containername = "Cow crate"
|
||||
//group = "Hydroponics"
|
||||
@@ -1,28 +0,0 @@
|
||||
/datum/paiCandidate/chatbot
|
||||
name = "NT Standard Chatbot"
|
||||
description = "NT Standard Issue pAI Unit 13A"
|
||||
role = "Advisor"
|
||||
comments = "This is an actual AI."
|
||||
ready = 1
|
||||
|
||||
/mob/living/silicon/pai/chatbot
|
||||
var/datum/text_parser/parser/eliza/P = new()
|
||||
|
||||
proc/init()
|
||||
P.speaker = src
|
||||
P.callsign = input("What do you want to call me?", "Chatbot Name", "NT") as text
|
||||
P.set_name(P.callsign)
|
||||
P.new_session()
|
||||
|
||||
proc/hear_talk(mob/M, text)
|
||||
if(stat)
|
||||
return
|
||||
|
||||
var/prefix = P.callsign + ","
|
||||
|
||||
if(lentext(text) <= lentext(prefix))
|
||||
return
|
||||
var/i = lentext(prefix) + 1
|
||||
if(cmptext(copytext(text, 1, i), prefix))
|
||||
P.input_line = html_decode(copytext(text, i))
|
||||
P.process_line()
|
||||
@@ -1,231 +0,0 @@
|
||||
// a frame for generic wall-mounted things, such as fire alarm, status display..
|
||||
// combination of apc_frame and machine_frame
|
||||
/obj/machinery/constructable_frame/wallmount_frame
|
||||
icon = 'icons/obj/stock_parts.dmi'
|
||||
icon_state = "wm_0"
|
||||
var/wall_offset = 24
|
||||
density = 0
|
||||
|
||||
/obj/machinery/constructable_frame/wallmount_frame/New()
|
||||
spawn(1)
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red [name] cannot be placed on this spot."
|
||||
new/obj/item/stack/sheet/metal(get_turf(src), 2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
var/turf/obj_ofs = get_step(locate(2,2,1), dir)
|
||||
pixel_x = (obj_ofs.x - 2) * wall_offset
|
||||
pixel_y = (obj_ofs.y - 2) * wall_offset
|
||||
|
||||
var/turf/T = get_step(usr, dir)
|
||||
if(!istype(T, /turf/simulated/wall))
|
||||
usr << "\red [name] must be placed on a wall."
|
||||
new/obj/item/stack/sheet/metal(get_turf(src), 2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
dir = get_dir(T, loc)
|
||||
|
||||
/obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||
if(P.crit_fail)
|
||||
user << "\red This part is faulty, you cannot add this to the machine!"
|
||||
return
|
||||
switch(state)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
if(P:amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You start to add cables to the frame."
|
||||
if(do_after(user, 20))
|
||||
P:amount -= 5
|
||||
if(!P:amount) del(P)
|
||||
user << "\blue You add cables to the frame."
|
||||
state = 2
|
||||
icon_state = "wm_1"
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "\blue You dismantle the frame"
|
||||
new /obj/item/stack/sheet/metal(src.loc, 2)
|
||||
del(src)
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/circuitboard))
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "wallmount")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You add the circuit board to the frame."
|
||||
circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
icon_state = "wm_2"
|
||||
state = 3
|
||||
components = list()
|
||||
req_components = circuit.req_components.Copy()
|
||||
for(var/A in circuit.req_components)
|
||||
req_components[A] = circuit.req_components[A]
|
||||
req_component_names = circuit.req_components.Copy()
|
||||
for(var/A in req_components)
|
||||
var/cp = text2path(A)
|
||||
var/obj/ct = new cp() // have to quickly instantiate it get name
|
||||
req_component_names[A] = ct.name
|
||||
if(circuit.frame_desc)
|
||||
desc = circuit.frame_desc
|
||||
else
|
||||
update_desc()
|
||||
user << desc
|
||||
else
|
||||
user << "\red This frame does not accept circuit boards of this type!"
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cables."
|
||||
state = 1
|
||||
icon_state = "wm_0"
|
||||
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
|
||||
A.amount = 5
|
||||
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
state = 2
|
||||
circuit.loc = src.loc
|
||||
circuit = null
|
||||
if(components.len == 0)
|
||||
user << "\blue You remove the circuit board."
|
||||
else
|
||||
user << "\blue You remove the circuit board and other components."
|
||||
for(var/obj/item/weapon/W in components)
|
||||
W.loc = src.loc
|
||||
desc = initial(desc)
|
||||
req_components = null
|
||||
components = null
|
||||
icon_state = "wm_1"
|
||||
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
var/component_check = 1
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
break
|
||||
if(component_check)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||
new_machine.dir = dir
|
||||
if(istype(circuit, /obj/item/weapon/circuitboard/status_display))
|
||||
new_machine.pixel_x = pixel_x * 1.33
|
||||
new_machine.pixel_y = pixel_y * 1.33
|
||||
else
|
||||
new_machine.pixel_x = pixel_x
|
||||
new_machine.pixel_y = pixel_y
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
del(O)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
||||
O.loc = new_machine
|
||||
else
|
||||
O.loc = null
|
||||
new_machine.component_parts += O
|
||||
if(circuit.contain_parts)
|
||||
circuit.loc = new_machine
|
||||
else
|
||||
circuit.loc = null
|
||||
new_machine.RefreshParts()
|
||||
del(src)
|
||||
|
||||
if(istype(P, /obj/item/weapon))
|
||||
for(var/I in req_components)
|
||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/CP = P
|
||||
if(CP.amount > 1)
|
||||
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
||||
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src)
|
||||
CC.amount = camt
|
||||
CC.update_icon()
|
||||
CP.use(camt)
|
||||
components += CC
|
||||
req_components[I] -= camt
|
||||
update_desc()
|
||||
break
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
components += P
|
||||
req_components[I]--
|
||||
update_desc()
|
||||
break
|
||||
user << desc
|
||||
if(P.loc != src && !istype(P, /obj/item/weapon/cable_coil))
|
||||
user << "\red You cannot add that component to the machine!"
|
||||
|
||||
/obj/item/weapon/circuitboard/firealarm
|
||||
name = "Circuit board (Fire Alarm)"
|
||||
build_path = "/obj/machinery/firealarm"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Capacitor, and 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/capacitor" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/alarm
|
||||
name = "Circuit board (Atmospheric Alarm)"
|
||||
build_path = "/obj/machinery/alarm"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Console Screen, and 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 2)
|
||||
|
||||
/* oh right, not a machine :(
|
||||
/obj/item/weapon/circuitboard/intercom
|
||||
name = "Circuit board (Intercom)"
|
||||
build_path = "/obj/item/device/radio/intercom"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 1 Console Screen, and 2 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 2)
|
||||
*/
|
||||
|
||||
/* too complex to set up the dept for an RC in a way intuitive for the user
|
||||
/obj/item/weapon/circuitboard/requests_console
|
||||
name = "Circuit board (Requests Console)"
|
||||
build_path = "/obj/machinery/requests_console"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 radio, 1 Console Screen, and 1 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/device/radio" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1
|
||||
"/obj/item/weapon/cable_coil" = 1)
|
||||
*/
|
||||
|
||||
/obj/item/weapon/circuitboard/status_display
|
||||
name = "Circuit board (Status Display)"
|
||||
build_path = "/obj/machinery/status_display"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2,programming=2"
|
||||
frame_desc = "Requires 2 Console Screens, and 1 piece of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2,
|
||||
"/obj/item/weapon/cable_coil" = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/light_switch
|
||||
name = "Circuit board (Light Switch)"
|
||||
build_path = "/obj/machinery/light_switch"
|
||||
board_type = "wallmount"
|
||||
origin_tech = "engineering=2"
|
||||
frame_desc = "Requires 2 pieces of cable."
|
||||
contain_parts = 0
|
||||
req_components = list(
|
||||
"/obj/item/weapon/cable_coil" = 2)
|
||||
@@ -1,51 +0,0 @@
|
||||
/obj/item/weapon/weldpack
|
||||
name = "Welding kit"
|
||||
desc = "A heavy-duty, portable welding fluid carrier."
|
||||
slot_flags = SLOT_BACK
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "welderpack"
|
||||
w_class = 4.0
|
||||
var/max_fuel = 350
|
||||
|
||||
/obj/item/weapon/weldpack/New()
|
||||
var/datum/reagents/R = new/datum/reagents(max_fuel) //Lotsa refills
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("fuel", max_fuel)
|
||||
|
||||
/obj/item/weapon/weldpack/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/T = W
|
||||
if(T.welding & prob(50))
|
||||
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
|
||||
log_game("[key_name(user)] triggered a fueltank explosion.")
|
||||
user << "\red That was stupid of you."
|
||||
explosion(get_turf(src),-1,0,2)
|
||||
if(src)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
if(T.welding)
|
||||
user << "\red That was close!"
|
||||
src.reagents.trans_to(W, T.max_fuel)
|
||||
user << "\blue Welder refilled!"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
user << "\blue The tank scoffs at your insolence. It only provides services to welders."
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldpack/afterattack(obj/O as obj, mob/user as mob)
|
||||
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.reagents.total_volume < max_fuel)
|
||||
O.reagents.trans_to(src, max_fuel)
|
||||
user << "\blue You crack the cap off the top of the pack and fill it back up again from the tank."
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
else if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.reagents.total_volume == max_fuel)
|
||||
user << "\blue The pack is already full!"
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldpack/examine()
|
||||
set src in usr
|
||||
usr << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume)
|
||||
..()
|
||||
return
|
||||
@@ -1,30 +0,0 @@
|
||||
//Mime's Hardsuit
|
||||
/obj/item/clothing/head/helmet/space/eva/mime
|
||||
name = "mime eva helmet"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "An eva helmet specifically designed for the mime."
|
||||
icon_state = "spacemimehelmet"
|
||||
item_state = "spacemimehelmet"
|
||||
|
||||
obj/item/clothing/suit/space/eva/mime
|
||||
name = "mime eva suit"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "An EVA suit specifically designed for the mime."
|
||||
icon_state = "spacemime_suit"
|
||||
item_state = "spacemime_items"
|
||||
allowed = list(/obj/item/weapon/tank)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/eva/clown
|
||||
name = "clown eva helmet"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "An EVA helmet specifically designed for the clown. SPESSHONK!"
|
||||
icon_state = "clownhelmet"
|
||||
item_state = "clownhelmet"
|
||||
|
||||
obj/item/clothing/suit/space/eva/clown
|
||||
name = "clown eva suit"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "An EVA suit specifically designed for the clown. SPESSHONK!"
|
||||
icon_state = "spaceclown_suit"
|
||||
item_state = "spaceclown_items"
|
||||
allowed = list(/obj/item/weapon/tank)
|
||||
@@ -1 +0,0 @@
|
||||
replaces code/modules/mobs/living/carbon/metroid/powers.dm
|
||||
@@ -1,277 +0,0 @@
|
||||
/mob/living/carbon/slime/verb/Feed()
|
||||
set category = "Abilities"
|
||||
set desc = "This will let you feed on any valid creature in the surrounding area. This should also be used to halt the feeding process."
|
||||
if(Victim)
|
||||
Feedstop()
|
||||
return
|
||||
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/mob/living/C in view(1,src))
|
||||
if(C!=src && !istype(C,/mob/living/carbon/slime) && Adjacent(C))
|
||||
choices += C
|
||||
|
||||
var/mob/living/carbon/M = pick(choices)
|
||||
if(!M) return
|
||||
if(Adjacent(M))
|
||||
|
||||
if(!istype(src, /mob/living/carbon/brain))
|
||||
if(!istype(M, /mob/living/carbon/slime))
|
||||
if(stat != 2)
|
||||
if(health > -70)
|
||||
|
||||
for(var/mob/living/carbon/slime/met in view())
|
||||
if(met.Victim == M && met != src)
|
||||
src << "<i>The [met.name] is already feeding on this subject...</i>"
|
||||
return
|
||||
src << "\blue <i>I have latched onto the subject and begun feeding...</i>"
|
||||
M << "\red <b>The [src.name] has latched onto your head!</b>"
|
||||
Feedon(M)
|
||||
|
||||
else
|
||||
src << "<i>This subject does not have a strong enough life energy...</i>"
|
||||
else
|
||||
src << "<i>This subject does not have an edible life energy...</i>"
|
||||
else
|
||||
src << "<i>I must not feed on my brothers...</i>"
|
||||
else
|
||||
src << "<i>This subject does not have an edible life energy...</i>"
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime/proc/Feedon(var/mob/living/carbon/M)
|
||||
Victim = M
|
||||
src.loc = M.loc
|
||||
canmove = 0
|
||||
anchored = 1
|
||||
var/lastnut = nutrition
|
||||
//if(M.client) M << "\red You legs become paralyzed!"
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
icon_state = "[colour] adult slime eat"
|
||||
else
|
||||
icon_state = "[colour] baby slime eat"
|
||||
|
||||
while(Victim && M.health > -70 && stat != 2)
|
||||
// M.canmove = 0
|
||||
canmove = 0
|
||||
|
||||
if(Adjacent(M))
|
||||
loc = M.loc
|
||||
|
||||
if(prob(15) && M.client && istype(M, /mob/living/carbon))
|
||||
M << "\red [pick("You can feel your body becoming weak!", \
|
||||
"You feel like you're about to die!", \
|
||||
"You feel every part of your body screaming in agony!", \
|
||||
"A low, rolling pain passes through your body!", \
|
||||
"Your body feels as if it's falling apart!", \
|
||||
"You feel extremely weak!", \
|
||||
"A sharp, deep pain bathes every inch of your body!")]"
|
||||
|
||||
if(istype(M, /mob/living/carbon))
|
||||
Victim.adjustCloneLoss(rand(1,10))
|
||||
Victim.adjustToxLoss(rand(1,2))
|
||||
if(Victim.health <= 0)
|
||||
Victim.adjustToxLoss(rand(2,4))
|
||||
|
||||
// Heal yourself
|
||||
adjustToxLoss(-10)
|
||||
adjustOxyLoss(-10)
|
||||
adjustBruteLoss(-10)
|
||||
adjustFireLoss(-10)
|
||||
adjustCloneLoss(-10)
|
||||
|
||||
if(Victim)
|
||||
for(var/mob/living/carbon/slime/slime in view(1,M))
|
||||
if(slime.Victim == M && slime != src)
|
||||
slime.Feedstop()
|
||||
|
||||
nutrition += rand(10,25)
|
||||
if(nutrition >= lastnut + 50)
|
||||
if(prob(80))
|
||||
lastnut = nutrition
|
||||
powerlevel++
|
||||
if(powerlevel > 10)
|
||||
powerlevel = 10
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(nutrition > 1200)
|
||||
nutrition = 1200
|
||||
else
|
||||
if(nutrition > 1000)
|
||||
nutrition = 1000
|
||||
|
||||
Victim.updatehealth()
|
||||
updatehealth()
|
||||
|
||||
else
|
||||
if(prob(25))
|
||||
src << "\red <i>[pick("This subject is incompatable", \
|
||||
"This subject does not have a life energy", "This subject is empty", \
|
||||
"I am not satisified", "I can not feed from this subject", \
|
||||
"I do not feel nourished", "This subject is not food")]...</i>"
|
||||
|
||||
sleep(rand(15,45))
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
if(stat == 2)
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
icon_state = "[colour] baby slime dead"
|
||||
|
||||
else
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
icon_state = "[colour] adult slime"
|
||||
else
|
||||
icon_state = "[colour] baby slime"
|
||||
|
||||
canmove = 1
|
||||
anchored = 0
|
||||
|
||||
if(M)
|
||||
if(M.health <= -70)
|
||||
M.canmove = 0
|
||||
if(!client)
|
||||
if(Victim && !rabid && !attacked)
|
||||
if(Victim.LAssailant && Victim.LAssailant != Victim)
|
||||
if(prob(50))
|
||||
if(!(Victim.LAssailant in Friends))
|
||||
Friends.Add(Victim.LAssailant) // no idea why i was using the |= operator
|
||||
|
||||
if(M.client && istype(src, /mob/living/carbon/human))
|
||||
if(prob(85))
|
||||
rabid = 1 // UUUNNBGHHHH GONNA EAT JUUUUUU
|
||||
|
||||
if(client) src << "<i>This subject does not have a strong enough life energy anymore...</i>"
|
||||
else
|
||||
M.canmove = 1
|
||||
|
||||
if(client) src << "<i>I have stopped feeding...</i>"
|
||||
else
|
||||
if(client) src << "<i>I have stopped feeding...</i>"
|
||||
|
||||
Victim = null
|
||||
|
||||
/mob/living/carbon/slime/proc/Feedstop()
|
||||
if(Victim)
|
||||
if(Victim.client) Victim << "[src] has let go of your head!"
|
||||
Victim = null
|
||||
|
||||
/mob/living/carbon/slime/proc/UpdateFeed(var/mob/M)
|
||||
if(Victim)
|
||||
if(Victim == M)
|
||||
loc = M.loc // simple "attach to head" effect!
|
||||
|
||||
|
||||
/mob/living/carbon/slime/verb/Evolve()
|
||||
set category = "Abilities"
|
||||
set desc = "This will let you evolve from baby to adult slime."
|
||||
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
if(amount_grown >= 10)
|
||||
var/mob/living/carbon/slime/adult/new_slime = new adulttype(loc)
|
||||
new_slime.nutrition = nutrition
|
||||
new_slime.powerlevel = max(0, powerlevel-1)
|
||||
new_slime.a_intent = "harm"
|
||||
new_slime.key = key
|
||||
new_slime.universal_speak = universal_speak
|
||||
new_slime << "<B>You are now an adult slime.</B>"
|
||||
del(src)
|
||||
else
|
||||
src << "<i>I am not ready to evolve yet...</i>"
|
||||
else
|
||||
src << "<i>I have already evolved...</i>"
|
||||
|
||||
/mob/living/carbon/slime/verb/Reproduce()
|
||||
set category = "Abilities"
|
||||
set desc = "This will make you split into four Slimes. NOTE: this will KILL you, but you will be transferred into one of the babies."
|
||||
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(amount_grown >= 10)
|
||||
//if(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced slime.") in list("Yes","No")=="Yes")
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
|
||||
var/list/babies = list()
|
||||
var/new_nutrition = round(nutrition * 0.9)
|
||||
var/new_powerlevel = round(powerlevel / 4)
|
||||
for(var/i=1,i<=4,i++)
|
||||
if(prob(80))
|
||||
var/mob/living/carbon/slime/M = new primarytype(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
else
|
||||
var/mutations = pick("one","two","three","four")
|
||||
switch(mutations)
|
||||
if("one")
|
||||
var/mob/living/carbon/slime/M = new mutationone(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("two")
|
||||
var/mob/living/carbon/slime/M = new mutationtwo(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("three")
|
||||
var/mob/living/carbon/slime/M = new mutationthree(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("four")
|
||||
var/mob/living/carbon/slime/M = new mutationfour(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
|
||||
var/mob/living/carbon/slime/new_slime = pick_n_take(babies)
|
||||
new_slime.a_intent = "harm"
|
||||
new_slime.universal_speak = universal_speak
|
||||
new_slime.key = key
|
||||
|
||||
new_slime << "<B>You are now a slime!</B>"
|
||||
|
||||
if(new_slime.client)
|
||||
if(babies.len)
|
||||
var/list/candidates = get_candidates(BE_SLIME)
|
||||
if(candidates.len)
|
||||
var/mob/dead/observer/picked = pick(candidates)
|
||||
var/mob/living/carbon/slime/S = pick(babies)
|
||||
S.key = picked
|
||||
S.a_intent = "harm"
|
||||
S.universal_speak = universal_speak
|
||||
S << "<B>You are now a slime!</B>"
|
||||
|
||||
|
||||
else
|
||||
new_slime << "<i>You're an only child!</i>"
|
||||
else
|
||||
src << "<i>I am not ready to reproduce yet...</i>"
|
||||
else
|
||||
src << "<i>I am not old enough to reproduce yet...</i>"
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime/verb/ventcrawl()
|
||||
set name = "Crawl through Vent"
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Abilities"
|
||||
if(Victim) return
|
||||
handle_ventcrawl()
|
||||
@@ -1,297 +0,0 @@
|
||||
/*
|
||||
* File Updated to match /tg/station code standards on the 28/12/2013 (UK/GMT) by RobRichards
|
||||
*/
|
||||
|
||||
/obj/item/clothing/suit/space/powered
|
||||
name = "Powered armor suit"
|
||||
desc = "Not for rookies."
|
||||
icon_state = "power_armour"
|
||||
item_state = "swat"
|
||||
w_class = 4//bulky item
|
||||
|
||||
|
||||
flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE
|
||||
body_parts_covered = UPPER_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 = 5
|
||||
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/space/powered/helm
|
||||
|
||||
var/glovesrequired = 1
|
||||
var/obj/item/clothing/gloves/powered/gloves
|
||||
|
||||
var/shoesrequired = 1
|
||||
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
|
||||
|
||||
/obj/item/clothing/suit/space/powered/New()
|
||||
verbs += /obj/item/clothing/suit/space/powered/proc/poweron
|
||||
|
||||
/obj/item/clothing/suit/space/powered/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 << "<span class='danger'>This suit was engineered for human use only.</span>"
|
||||
return
|
||||
|
||||
if(user.wear_suit!=src)
|
||||
user << "<span class='danger'>The suit functions best if you are inside of it.</span>"
|
||||
return
|
||||
|
||||
if(helmrequired && !istype(user.head, /obj/item/clothing/head/space/powered))
|
||||
user << "<span class='danger'>Helmet missing, unable to initiate power-on procedure.</span>"
|
||||
return
|
||||
|
||||
if(glovesrequired && !istype(user.gloves, /obj/item/clothing/gloves/powered))
|
||||
user << "<span class='danger'>Gloves missing, unable to initiate power-on procedure.</span>"
|
||||
return
|
||||
|
||||
if(shoesrequired && !istype(user.shoes, /obj/item/clothing/shoes/powered))
|
||||
user << "<span class='danger'>Shoes missing, unable to initiate power-on procedure.</span>"
|
||||
return
|
||||
|
||||
if(active)
|
||||
user << "<span class='danger'>The suit is already on, you can't turn it on twice.</span>"
|
||||
return
|
||||
|
||||
if(!power || !power.checkpower())
|
||||
user << "<span class='danger'>Powersource missing or depleted.</span>"
|
||||
return
|
||||
|
||||
verbs -= /obj/item/clothing/suit/space/powered/proc/poweron
|
||||
|
||||
user << "<span class='notice'>Suit interlocks engaged.</span>"
|
||||
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 << "<span class='notice'>All systems online.</span>"
|
||||
active = 1
|
||||
power.process()
|
||||
|
||||
verbs += /obj/item/clothing/suit/space/powered/proc/poweroff
|
||||
|
||||
|
||||
/obj/item/clothing/suit/space/powered/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
|
||||
|
||||
/obj/item/clothing/suit/space/powered/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/space/powered/proc/poweroff
|
||||
|
||||
if(sudden)
|
||||
user << "<span class='danger'><B>Your armor loses power!</B></span>"
|
||||
|
||||
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)
|
||||
var/obj/item/powerarmor/atmoseal/optional/Atmo_seal = atmoseal
|
||||
Atmo_seal.helmtoggle(sudden)
|
||||
atmoseal.toggle(sudden)
|
||||
|
||||
sleep(delay)
|
||||
|
||||
if(!sudden)
|
||||
usr << "<span class='notice'>Suit interlocks disengaged.</span>"
|
||||
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 << "<span class='notice'>All systems disengaged.</span>"
|
||||
|
||||
active = 0
|
||||
verbs += /obj/item/clothing/suit/space/powered/proc/poweron
|
||||
|
||||
|
||||
|
||||
/obj/item/clothing/suit/space/powered/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(power && istype(power,/obj/item/powerarmor/power/plasma))
|
||||
var/obj/item/powerarmor/power/plasma/Plasma_power = power
|
||||
switch(W.type)
|
||||
if(/obj/item/stack/sheet/mineral/plasma)
|
||||
var/obj/item/stack/sheet/mineral/plasma/P = W
|
||||
if(fuel < 50)
|
||||
user << "<span class='notice'>You feed some refined plasma into the armor's generator.</span>"
|
||||
Plasma_power.fuel += 25
|
||||
P.amount--
|
||||
if (P.amount <= 0)
|
||||
del(P)
|
||||
return
|
||||
else
|
||||
user << "<span class='danger'>The generator already has plenty of plasma.</span>"
|
||||
return
|
||||
|
||||
if(/obj/item/weapon/ore/plasma) //raw plasma has impurities, so it doesn't provide as much fuel. --NEO
|
||||
if(fuel < 50)
|
||||
user << "<span class='notice'>You feed some plasma into the armor's generator.</span>"
|
||||
Plasma_power.fuel += 15
|
||||
del(W)
|
||||
return
|
||||
else
|
||||
user << "<span class='danger'>The generator already has plenty of plasma.</span>"
|
||||
return
|
||||
|
||||
if(!servos)
|
||||
if(istype(W,/obj/item/powerarmor/servos))
|
||||
servos = W
|
||||
W.loc = src
|
||||
servos.parent = src
|
||||
user << "<span class='notice'>You add some servos to the armor.</span>"
|
||||
if(!reactive)
|
||||
if(istype(W,/obj/item/powerarmor/reactive))
|
||||
reactive = W
|
||||
W.loc = src
|
||||
reactive.parent = src
|
||||
user << "<span class='notice'>You add some reactive plating to the armor.</span>"
|
||||
if(!atmoseal)
|
||||
if(istype(W,/obj/item/powerarmor/atmoseal))
|
||||
atmoseal = W
|
||||
W.loc = src
|
||||
atmoseal.parent = src
|
||||
user << "<span class='notice'>You add an atmospheric seals to the armor.</span>"
|
||||
if(!power)
|
||||
if(istype(W,/obj/item/powerarmor/power))
|
||||
power = W
|
||||
W.loc = src
|
||||
power.parent = src
|
||||
user << "<span class='notice'>You add a power module to the armor.</span>"
|
||||
else
|
||||
user << "<span class='danger'>The armor already contains a module of that type..</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/space/powered
|
||||
name = "Powered armor helmet"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | BLOCKHAIR
|
||||
icon_state = "power_armour_helmet"
|
||||
item_state = "swat"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
var/obj/item/clothing/suit/space/powered/parent
|
||||
slowdown = 1
|
||||
|
||||
/obj/item/clothing/head/space/powered/proc/atmotoggle()
|
||||
set category = "Object"
|
||||
set name = "Toggle helmet seals"
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
|
||||
if(!istype(user))
|
||||
user << "<span class='danger'>This helmet is engineered for human use.</span>"
|
||||
return
|
||||
if(user.head != src)
|
||||
user << "<span class='danger'>Can't engage the seals without wearing the helmet.</span>"
|
||||
return
|
||||
|
||||
if(!user.wear_suit || !istype(user.wear_suit,/obj/item/clothing/suit/space/powered))
|
||||
user << "<span class='danger'>This helmet can only couple with powered armor.</span>"
|
||||
return
|
||||
|
||||
var/obj/item/clothing/suit/space/powered/armor = user.wear_suit
|
||||
|
||||
if(!armor.atmoseal || !istype(armor.atmoseal, /obj/item/powerarmor/atmoseal/optional))
|
||||
user << "<span class='danger'>This armor's atmospheric seals are missing or incompatible.</span>"
|
||||
return
|
||||
|
||||
armor.atmoseal:helmtoggle(0,1)
|
||||
|
||||
|
||||
|
||||
/obj/item/clothing/gloves/powered
|
||||
name = "Powered armor gloves"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS
|
||||
icon_state = "power_armour_gloves"
|
||||
item_state = "power_armour_gloves"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
slowdown = 1
|
||||
|
||||
/obj/item/clothing/shoes/powered
|
||||
name = "Powered armor boots"
|
||||
desc = "Not for rookies."
|
||||
flags = FPRINT | TABLEPASS
|
||||
icon_state = "power_armour_boots"
|
||||
item_state = "swat"
|
||||
armor = list(melee = 40, bullet = 30, laser = 20,energy = 15, bomb = 25, bio = 10, rad = 10)
|
||||
slowdown = 2
|
||||
|
||||
obj/item/clothing/suit/space/powered/spawnable/regular/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(src)
|
||||
atmoseal.parent = src
|
||||
power = new /obj/item/powerarmor/power/powercell(src)
|
||||
power.parent = src
|
||||
|
||||
verbs += /obj/item/clothing/suit/space/powered/proc/poweron
|
||||
|
||||
var/obj/item/clothing/head/space/powered/helm = new /obj/item/clothing/head/space/powered(src.loc)
|
||||
helm.verbs += /obj/item/clothing/head/space/powered/proc/atmotoggle
|
||||
@@ -1,261 +0,0 @@
|
||||
/*
|
||||
* File Updated to match /tg/station code standards on the 28/12/2013 (UK/GMT) by RobRichards
|
||||
*/
|
||||
|
||||
/obj/item/powerarmor
|
||||
name = "Generic power armor component"
|
||||
desc = "This is the base object, you should never see one."
|
||||
icon = 'icons/obj/stock_parts.dmi'
|
||||
var/obj/item/clothing/suit/space/powered/parent //so the component knows which armor it belongs to.
|
||||
slowdown = 0 //how much the component slows down the wearer
|
||||
|
||||
/obj/item/powerarmor/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."
|
||||
|
||||
/obj/item/powerarmor/process()
|
||||
return
|
||||
|
||||
/obj/item/powerarmor/proc/checkpower()
|
||||
return 1
|
||||
|
||||
/obj/item/powerarmor/power/plasma
|
||||
name = "Miniaturized plasma generator"
|
||||
desc = "Runs on plasma."
|
||||
icon_state = "plasma"
|
||||
slowdown = 1
|
||||
var/fuel = 0
|
||||
|
||||
/obj/item/powerarmor/power/plasma/process()
|
||||
if (fuel > 0 && parent.active)
|
||||
fuel--
|
||||
spawn(50)
|
||||
process()
|
||||
return
|
||||
else if (parent.active)
|
||||
parent.powerdown(1)
|
||||
return
|
||||
|
||||
/obj/item/powerarmor/power/plasma/checkpower()
|
||||
return fuel
|
||||
|
||||
/obj/item/powerarmor/power/powercell
|
||||
name = "Powercell interface"
|
||||
desc = "Boring, but reliable."
|
||||
icon_state = "powercell_interface"
|
||||
var/obj/item/weapon/cell/cell
|
||||
slowdown = 0.5
|
||||
|
||||
/obj/item/powerarmor/power/powercell/process()
|
||||
if (cell && cell.charge > 0 && parent.active)
|
||||
cell.use(500)
|
||||
spawn(50)
|
||||
process()
|
||||
return
|
||||
else if (parent.active)
|
||||
parent.powerdown(1)
|
||||
return
|
||||
|
||||
/obj/item/powerarmor/power/powercell/checkpower()
|
||||
return max(cell.charge, 0)
|
||||
|
||||
/obj/item/powerarmor/power/nuclear
|
||||
name = "Miniaturized nuclear generator"
|
||||
desc = "For all your radioactive needs."
|
||||
icon_state = "nuclear"
|
||||
slowdown = 1.5
|
||||
|
||||
/obj/item/powerarmor/power/nuclear/process()
|
||||
if(!crit_fail)
|
||||
if(prob(src.reliability)) return 1 //No failure
|
||||
if(prob(src.reliability))
|
||||
for (var/mob/living/M in range(0,src.parent)) //Only a minor failure, enjoy your radiation.
|
||||
if(src.parent in M.contents)
|
||||
M << "<span class='danger'>Your armor feels pleasantly warm for a moment.</span>"
|
||||
else
|
||||
M << "<span class='danger'>You feel a warm sensation.</span>"
|
||||
M.apply_effect(-rand(1,40),IRRADIATE,0)
|
||||
else
|
||||
for (var/mob/living/M in range(rand(1,4),src.parent)) //Big failure, TIME FOR RADIATION BITCHES
|
||||
if (src.parent in M.contents)
|
||||
M << "<span class='danger'><B>Your armor's reactor overloads!</B></span>"
|
||||
M << "<span class='danger'>You feel a wave of heat wash over you.</span>"
|
||||
M.apply_effect(100,IRRADIATE,0)
|
||||
crit_fail = 1 //broken~
|
||||
parent.powerdown(1)
|
||||
spawn(50)
|
||||
process()
|
||||
|
||||
/obj/item/powerarmor/power/nuclear/checkpower()
|
||||
return !crit_fail
|
||||
|
||||
/obj/item/powerarmor/reactive
|
||||
name = "Centcom power armor reactive plating"
|
||||
desc = "Pretty effective against everything, not perfect though."
|
||||
var/list/togglearmor = list(melee = 90, bullet = 70, laser = 60,energy = 40, bomb = 75, bio = 75, rad = 75)
|
||||
slowdown = 2
|
||||
|
||||
/obj/item/powerarmor/reactive/toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "<span class='notice'>Reactive armor systems disengaged.</span>"
|
||||
if(0)
|
||||
usr << "<span class='notice'>Reactive armor systems engaged.</span>"
|
||||
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]
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/powerarmor/servos
|
||||
name = "Power armor movement servos"
|
||||
desc = "Help with moving in the the bulky armor."
|
||||
icon_state = "servos"
|
||||
var/toggleslowdown = 9
|
||||
|
||||
/obj/item/powerarmor/servos/toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "<span class='notice'>Movement assist servos disengaged.</span>"
|
||||
parent.slowdown += toggleslowdown
|
||||
if(0)
|
||||
usr << "<span class='notice'>Movement assist servos engaged.</span>"
|
||||
parent.slowdown -= toggleslowdown
|
||||
|
||||
/obj/item/powerarmor/atmoseal
|
||||
name = "Power armor atmospheric seals"
|
||||
desc = "Keeps the bad stuff out."
|
||||
icon_state = "atmosseal"
|
||||
slowdown = 1
|
||||
var/sealed = 0
|
||||
|
||||
/obj/item/powerarmor/atmoseal/toggle(sudden = 0)
|
||||
switch(parent.active)
|
||||
if(1)
|
||||
if(!sudden)
|
||||
usr << "<span class='notice'>Atmospheric seals disengaged.</span>"
|
||||
parent.gas_transfer_coefficient = 1
|
||||
parent.permeability_coefficient = 1
|
||||
if(parent.helmrequired)
|
||||
parent.helm.gas_transfer_coefficient = 1
|
||||
parent.helm.permeability_coefficient = 1
|
||||
parent.helm.cold_protection = initial(parent.helm.cold_protection)
|
||||
parent.helm.min_cold_protection_temperature = initial(parent.helm.min_cold_protection_temperature)
|
||||
parent.helm.heat_protection = initial(parent.helm.heat_protection)
|
||||
parent.helm.max_heat_protection_temperature = initial(parent.helm.max_heat_protection_temperature)
|
||||
if(parent.glovesrequired)
|
||||
parent.gloves.gas_transfer_coefficient = 1
|
||||
parent.gloves.permeability_coefficient = 1
|
||||
parent.gloves.cold_protection = initial(parent.gloves.cold_protection)
|
||||
parent.gloves.min_cold_protection_temperature = initial(parent.gloves.min_cold_protection_temperature)
|
||||
parent.gloves.heat_protection = initial(parent.gloves.heat_protection)
|
||||
parent.gloves.max_heat_protection_temperature = initial(parent.gloves.max_heat_protection_temperature)
|
||||
if(parent.shoesrequired)
|
||||
parent.shoes.gas_transfer_coefficient = 1
|
||||
parent.shoes.permeability_coefficient = 1
|
||||
parent.shoes.cold_protection = initial(parent.shoes.cold_protection)
|
||||
parent.shoes.min_cold_protection_temperature = initial(parent.shoes.min_cold_protection_temperature)
|
||||
parent.shoes.heat_protection = initial(parent.shoes.heat_protection)
|
||||
parent.shoes.max_heat_protection_temperature = initial(parent.shoes.max_heat_protection_temperature)
|
||||
sealed = 0
|
||||
|
||||
if(0)
|
||||
usr << "<span class='notice'>Atmospheric seals engaged.</span>"
|
||||
parent.gas_transfer_coefficient = 0.01
|
||||
parent.permeability_coefficient = 0.02
|
||||
if(parent.helmrequired)
|
||||
parent.helm.gas_transfer_coefficient = 0.01
|
||||
parent.helm.permeability_coefficient = 0.02
|
||||
parent.helm.cold_protection = HEAD
|
||||
parent.helm.min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
|
||||
parent.helm.heat_protection = HEAD
|
||||
parent.helm.max_heat_protection_temperature = SPACE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE
|
||||
if(parent.glovesrequired)
|
||||
parent.gloves.gas_transfer_coefficient = 0.01
|
||||
parent.gloves.permeability_coefficient = 0.02
|
||||
parent.gloves.cold_protection = HANDS
|
||||
parent.gloves.min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE
|
||||
parent.gloves.heat_protection = HANDS
|
||||
parent.gloves.max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
|
||||
if(parent.shoesrequired)
|
||||
parent.shoes.gas_transfer_coefficient = 0.01
|
||||
parent.shoes.permeability_coefficient = 0.02
|
||||
parent.shoes.cold_protection = FEET
|
||||
parent.shoes.min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE
|
||||
parent.shoes.heat_protection = FEET
|
||||
parent.shoes.max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
|
||||
sealed = 1
|
||||
|
||||
/obj/item/powerarmor/atmoseal/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."
|
||||
|
||||
|
||||
/obj/item/powerarmor/atmoseal/optional/proc/helmtoggle(sudden = 0, manual = 0)
|
||||
var/mob/living/carbon/human/user = usr
|
||||
var/obj/item/clothing/head/space/powered/helm
|
||||
if(user.head && istype(user.head,/obj/item/clothing/head/space/powered))
|
||||
helm = user.head
|
||||
|
||||
if(!sealed)
|
||||
user << "<span class='danger'>Unable to initialize helmet seal, armor seals not active.</span>"
|
||||
return
|
||||
if(!helm.parent)
|
||||
user << "<span class='notice'>Helmet locked.</span>"
|
||||
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.cold_protection = HEAD
|
||||
parent.helm.min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
|
||||
parent.helm.heat_protection = HEAD
|
||||
parent.helm.max_heat_protection_temperature = SPACE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE
|
||||
|
||||
user << "<span class='notice'>Helmet atmospheric seals engaged.</span>"
|
||||
if(manual)
|
||||
for (var/armorvar in helm.armor)
|
||||
helm.armor[armorvar] = parent.armor[armorvar]
|
||||
return
|
||||
else
|
||||
if(manual)
|
||||
user << "<span class='notice'>Helmet atmospheric seals disengaged.</span>"
|
||||
parent.helm.gas_transfer_coefficient = 1
|
||||
parent.helm.permeability_coefficient = 1
|
||||
parent.helm.cold_protection = initial(parent.helm.cold_protection)
|
||||
parent.helm.min_cold_protection_temperature = initial(parent.helm.min_cold_protection_temperature)
|
||||
parent.helm.heat_protection = initial(parent.helm.heat_protection)
|
||||
parent.helm.max_heat_protection_temperature = initial(parent.helm.max_heat_protection_temperature)
|
||||
if(manual)
|
||||
for (var/armorvar in helm.armor)
|
||||
helm.armor[armorvar] = parent.reactive.togglearmor[armorvar]
|
||||
if(!sudden)
|
||||
if(manual)
|
||||
sleep(20)
|
||||
user << "<span class='notice'>Helmet unlocked.</span>"
|
||||
helm.canremove = 1
|
||||
parent.helm = null
|
||||
helm.parent = null
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||