Merge remote-tracking branch 'upstream/dev' into APC

Conflicts:
	code/game/gamemodes/events/power_failure.dm
	code/modules/power/smes.dm
This commit is contained in:
PsiOmega
2014-11-11 14:13:02 +01:00
382 changed files with 5618 additions and 4585 deletions

View File

@@ -164,7 +164,11 @@
#include "code\datums\spells\trigger.dm"
#include "code\datums\spells\turf_teleport.dm"
#include "code\datums\spells\wizard.dm"
#include "code\datums\wires\airlock.dm"
#include "code\datums\wires\alarm.dm"
#include "code\datums\wires\apc.dm"
#include "code\datums\wires\camera.dm"
#include "code\datums\wires\robot.dm"
#include "code\datums\wires\smartfridge.dm"
#include "code\datums\wires\suit_storage_unit.dm"
#include "code\datums\wires\vending.dm"
@@ -312,6 +316,7 @@
#include "code\game\machinery\holosign.dm"
#include "code\game\machinery\igniter.dm"
#include "code\game\machinery\iv_drip.dm"
#include "code\game\machinery\jukebox.dm"
#include "code\game\machinery\lightswitch.dm"
#include "code\game\machinery\machinery.dm"
#include "code\game\machinery\magnet.dm"
@@ -357,7 +362,6 @@
#include "code\game\machinery\camera\motion.dm"
#include "code\game\machinery\camera\presets.dm"
#include "code\game\machinery\camera\tracking.dm"
#include "code\game\machinery\camera\wires.dm"
#include "code\game\machinery\computer\ai_core.dm"
#include "code\game\machinery\computer\aifixer.dm"
#include "code\game\machinery\computer\arcade.dm"
@@ -393,6 +397,7 @@
#include "code\game\machinery\doors\checkForMultipleDoors.dm"
#include "code\game\machinery\doors\door.dm"
#include "code\game\machinery\doors\firedoor.dm"
#include "code\game\machinery\doors\firedoor_assembly.dm"
#include "code\game\machinery\doors\multi_tile.dm"
#include "code\game\machinery\doors\poddoor.dm"
#include "code\game\machinery\doors\shutters.dm"
@@ -684,7 +689,6 @@
#include "code\game\turfs\unsimulated\beach.dm"
#include "code\game\turfs\unsimulated\floor.dm"
#include "code\game\turfs\unsimulated\walls.dm"
#include "code\game\verbs\atom_verbs.dm"
#include "code\game\verbs\ooc.dm"
#include "code\game\verbs\suicide.dm"
#include "code\game\verbs\who.dm"
@@ -1060,7 +1064,6 @@
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
#include "code\modules\mob\living\silicon\robot\wires.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_abilities.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_console.dm"

View File

@@ -67,8 +67,8 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
return omni_icons[state]
if("underlay")
return underlays[state + dir + color]
//if("underlay_intact")
// return underlays_intact[state + dir + color]
// if("underlay_intact")
// return underlays_intact[state + dir + color]
// if("underlay_exposed")
// return underlays_exposed[state + dir + color]
// if("underlay_down")
@@ -194,6 +194,11 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
I.color = pipe_colors[pipe_color]
underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I
/*
Leaving the old icon manager code commented out for now, as we may want to rewrite the new code to cleanly
separate the newpipe icon caching (speshul supply and scrubber lines) from the rest of the pipe code.
*/
/*
/datum/pipe_icon_manager/proc/gen_underlay_icons()
if(!underlays_intact)

View File

@@ -200,12 +200,9 @@
if(frequency)
set_frequency(frequency)
/obj/machinery/atmospherics/binary/dp_vent_pump/examine()
set src in oview(1)
..()
if (get_dist(usr, src) <= 1)
usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
if(..(user, 1))
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat

View File

@@ -190,9 +190,11 @@
if(!istype(T))
return
if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
//pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down")
else
pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node))
//pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node))
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact")
return list("on_icon" = ic_on, "off_icon" = ic_off, "pipe_icon" = pipe_state)

View File

@@ -196,7 +196,7 @@
..()
/obj/machinery/atmospherics/unary/freezer/examine()
..()
/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
..(user)
if (opened)
usr << "The maintenance hatch is open."
user << "The maintenance hatch is open."

View File

@@ -179,7 +179,7 @@
..()
/obj/machinery/atmospherics/unary/heater/examine()
..()
/obj/machinery/atmospherics/unary/heater/examine(mob/user)
..(user)
if (opened)
usr << "The maintenance hatch is open."
user << "The maintenance hatch is open."

View File

@@ -375,15 +375,13 @@
else
..()
/obj/machinery/atmospherics/unary/vent_pump/examine()
set src in oview(1)
..()
if (get_dist(usr, src) <= 1)
usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
if(..(user, 1))
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
usr << "You are too far away to read the gauge."
user << "You are too far away to read the gauge."
if(welded)
usr << "It seems welded shut."
user << "It seems welded shut."
/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat

View File

@@ -260,13 +260,11 @@
new /obj/item/pipe(loc, make_from=src)
del(src)
/obj/machinery/atmospherics/unary/vent_scrubber/examine()
set src in oview(1)
..()
if (get_dist(usr, src) <= 1)
usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
if(..(user, 1))
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
usr << "You are too far away to read the gauge."
user << "You are too far away to read the gauge."
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
if(initial_loc)

View File

@@ -6,7 +6,7 @@
var/volume = 0
force = 20
//layer = 2.4 //under wires with their 2.44
layer = 2.4 //under wires with their 2.44
use_power = 0
var/alert_pressure = 80*ONE_ATMOSPHERE
@@ -256,9 +256,9 @@
del(meter)
del(src)
else if(node1 && node2)
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "intact" + icon_connect_type)
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]")
else
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "exposed[node1?1:0][node2?1:0]" + icon_connect_type)
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]")
/obj/machinery/atmospherics/pipe/simple/update_underlays()
return
@@ -911,29 +911,21 @@
/obj/machinery/atmospherics/pipe/cap
name = "pipe endcap"
desc = "An endcap for pipes"
icon = 'icons/obj/pipes.dmi'
icon_state = "cap"
icon = 'icons/atmos/pipes.dmi'
icon_state = ""
level = 2
layer = 2.4 //under wires with their 2.44
volume = 35
dir = SOUTH
initialize_directions = NORTH
initialize_directions = SOUTH
var/obj/machinery/atmospherics/node
/obj/machinery/atmospherics/pipe/cap/New()
..()
switch(dir)
if(SOUTH)
initialize_directions = NORTH
if(NORTH)
initialize_directions = SOUTH
if(WEST)
initialize_directions = EAST
if(EAST)
initialize_directions = WEST
initialize_directions = dir
/obj/machinery/atmospherics/pipe/cap/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
@@ -964,11 +956,20 @@
..()
/obj/machinery/atmospherics/pipe/cap/update_icon()
overlays = new()
/obj/machinery/atmospherics/pipe/cap/change_color(var/new_color)
..()
//for updating connected atmos device pipes (i.e. vents, manifolds, etc)
if(node)
node.update_underlays()
icon_state = "cap[invisibility ? "-f" : ""]"
return
/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0)
if(!check_icon_cache())
return
alpha = 255
overlays.Cut()
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap")
/obj/machinery/atmospherics/pipe/cap/initialize()
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
@@ -1008,7 +1009,8 @@
/obj/machinery/atmospherics/pipe/cap/hidden
level = 1
icon_state = "cap-f"
icon_state = "cap"
alpha = 128
/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers
name = "scrubbers pipe endcap"

View File

@@ -16,12 +16,12 @@
else
return temp_access
/obj/item/weapon/card/id/guest/examine()
..()
/obj/item/weapon/card/id/guest/examine(mob/user)
..(user)
if (world.time < expiration_time)
usr << "<span class='notice'>This pass expires at [worldtime2text(expiration_time)].</span>"
user << "<span class='notice'>This pass expires at [worldtime2text(expiration_time)].</span>"
else
usr << "<span class='warning'>It expired at [worldtime2text(expiration_time)].</span>"
user << "<span class='warning'>It expired at [worldtime2text(expiration_time)].</span>"
/obj/item/weapon/card/id/guest/read()
if (world.time > expiration_time)

View File

@@ -63,16 +63,13 @@
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
examine(mob/user)
..(user)
user << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
if(seal_torn && !contents.len)
user << "The seal on the bag is broken."
else
user << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
update_icon()
if(contents.len)

View File

@@ -46,8 +46,7 @@
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)
..()
/obj/item/weapon/weldpack/examine(mob/user)
..(user)
user << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume)
return

View File

@@ -131,8 +131,6 @@
for(var/typekey in spawn_files)
hdd.addfile(new typekey,1)
if(program)
program.execute(os)
update_icon()

View File

@@ -43,7 +43,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
if(M.z == 1 && !istype(M.loc, /turf/space))
if(M.z in config.station_levels && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
if(T.malfunction)

View File

@@ -163,8 +163,10 @@
R.ResetSecurityCodes()
else
message_admins("\blue [key_name_admin(usr)] detonated [R.name]!")
log_game("\blue [key_name_admin(usr)] detonated [R.name]!")
message_admins("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
log_game("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
if(R.connected_ai)
R.connected_ai << "<br><br><span class='alert'>ALERT - Cyborg kill-switch activated: [R.name]</span><br>"
R.self_destruct()
else
usr << "\red Access Denied."
@@ -176,16 +178,14 @@
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm")
if(R && istype(R))
message_admins("\blue [key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
message_admins("<span class='notice'>[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!</span>")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R.name)]!")
R.canmove = !R.canmove
if (R.lockcharge)
// R.cell.charge = R.lockcharge
R.lockcharge = !R.lockcharge
R << "Your lockdown has been lifted!"
else
R.lockcharge = !R.lockcharge
// R.cell.charge = 0
R << "You have been locked down!"
else

View File

@@ -138,6 +138,9 @@
usr << "You can't reach it."
return
close_laptop(usr)
proc/close_laptop(mob/user = null)
if(istype(loc,/obj/item/device/laptop))
testing("Close closed computer")
return
@@ -146,7 +149,8 @@
return
if(stat&BROKEN)
usr << "\The [src] is broken! You can't quite get it closed."
if(user)
user << "\The [src] is broken! You can't quite get it closed."
return
if(!portable)
@@ -157,7 +161,8 @@
portable.loc = loc
loc = portable
stat |= MAINT
usr << "You close \the [src]."
if(user)
user << "You close \the [src]."
auto_use_power()
if(stat&MAINT)

View File

@@ -263,7 +263,7 @@
choose_progs(C)
vend()
popup.close()
newlap.close_computer()
newlap.close_laptop()
newlap = null
cardreader = 0
floppy = 0

View File

@@ -143,10 +143,5 @@ proc/announce_newscaster_news(datum/news_announcement/news)
sendto.is_admin_channel = 1
news_network.network_channels += sendto
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = news.author ? news.author : sendto.author
newMsg.is_admin_message = !news.can_be_redacted
newMsg.body = news.message
newMsg.message_type = news.message_type
news_network.insert_message_in_channel(sendto, newMsg)
var/author = news.author ? news.author : sendto.author
news_network.SubmitArticle(news.message, author, news.channel_name, null, !news.can_be_redacted, news.message_type)

View File

@@ -45,8 +45,20 @@
return heard
/proc/isStationLevel(var/level)
return level in config.station_levels
/proc/isNotStationLevel(var/level)
return !isStationLevel()
/proc/isPlayerLevel(var/level)
return level in config.player_levels
/proc/isAdminLevel(var/level)
return level in config.admin_levels
/proc/isNotAdminLevel(var/level)
return !isAdminLevel(level)
//Magic constants obtained by using linear regression on right-angled triangles of sides 0<x<1, 0<y<1
//They should approximate pythagoras theorem well enough for our needs.

View File

@@ -28,6 +28,9 @@ var/global/list/whitelisted_species = list("Human")
// Posters
var/global/list/datum/poster/poster_designs = typesof(/datum/poster) - /datum/poster
// Uplinks
var/list/obj/item/device/uplink/world_uplinks = list()
//Preferences stuff
//Hairstyles
var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name
@@ -100,7 +103,7 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
for(var/T in paths)
var/datum/language/L = new T
all_languages[L.name] = L
for (var/language_name in all_languages)
var/datum/language/L = all_languages[language_name]
language_keys[":[lowertext(L.key)]"] = L

View File

@@ -430,6 +430,29 @@ proc/listclearnulls(list/list)
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
// Insert an object into a sorted list, preserving sortedness
/proc/dd_insertObjectList(var/list/L, var/O)
var/min = 1
var/max = L.len
var/Oval = O:dd_SortValue()
while(1)
var/mid = min+round((max-min)/2)
if(mid == max)
L.Insert(mid, O)
return
var/Lmid = L[mid]
var/midval = Lmid:dd_SortValue()
if(Oval == midval)
L.Insert(mid, O)
return
else if(Oval < midval)
max = mid
else
min = mid+1
/*
proc/dd_sortedObjectList(list/incoming)
/*

View File

@@ -116,4 +116,8 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
/proc/Wrap(val, min, max)
var/d = max - min
var/t = Floor((val - min) / d)
return val - (t * d)
return val - (t * d)
proc/RaiseToPower(num, power)
if(!power) return 1
return (power-- > 1 ? num * RaiseToPower(num, power) : num)

View File

@@ -97,3 +97,21 @@ proc/RoundHealth(health)
else
return "health-100"
return "0"
/*
Proc for attack log creation, because really why not
1 argument is the actor
2 argument is the target of action
3 is the description of action(like punched, throwed, or any other verb)
4 should it make adminlog note or not
5 is the tool with which the action was made(usually item) 5 and 6 are very similar(5 have "by " before it, that it) and are separated just to keep things in a bit more in order
6 is additional information, anything that needs to be added
*/
/proc/add_logs(mob/user, mob/target, what_done, var/admin=1, var/object=null, var/addition=null)
if(user && ismob(user))
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</font>")
if(target && ismob(target))
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</font>")
if(admin)
log_attack("<font color='red'>[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</font>")

View File

@@ -192,6 +192,12 @@ proc/tg_list2text(list/list, glue=",")
. += copytext(text, last_found, found)
last_found = found + delim_len
while(found)
/proc/text2numlist(text, delimiter="\n")
var/list/num_list = list()
for(var/x in text2list(text, delimiter))
num_list += text2num(x)
return num_list
//Case Sensitive!
/proc/text2listEx(text, delimiter="\n")

View File

@@ -228,9 +228,12 @@ Turf and target are seperate in case you want to teleport some distance from a t
if (findtext(key, "Guest-", 1, 7) != 1) //was findtextEx
return 0
var/i, ch, len = length(key)
var/i = 7, ch, len = length(key)
for (i = 7, i <= len, ++i)
if(copytext(key, 7, 8) == "W") //webclient
i++
for (, i <= len, ++i)
ch = text2ascii(key, i)
if (ch < 48 || ch > 57)
return 0

View File

@@ -106,9 +106,9 @@
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
Topic(src, list("src"= "\ref[src]", "aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
Topic(src, list("src"= "\ref[src]", "aiDisable"="7"), 1)
return
/atom/proc/AICtrlClick()
@@ -116,17 +116,15 @@
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
Topic(src, list("src"= "\ref[src]", "aiEnable"="4"), 1)// 1 meaning no window (consistency!)
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)
Topic(src, list("src"= "\ref[src]", "aiDisable"="4"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
Topic("breaker=1", list("breaker"="1"), 1) // 0 meaning window (consistency! wait...)
Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!)
/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
if(!ailock)
src.enabled = !src.enabled
src.updateTurrets()
Topic(src, list("src"= "\ref[src]", "toggleOn"="1", 1)) // 1 meaning no window (consistency!)
/atom/proc/AIAltClick(var/atom/A)
AltClick(A)
@@ -134,25 +132,23 @@
/obj/machinery/door/airlock/AIAltClick() // Electrifies doors.
if(!secondsElectrified)
// permanent shock
Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
Topic(src, list("src"= "\ref[src]", "aiEnable"="6"), 1) // 1 meaning no window (consistency!)
else
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
Topic(src, list("src"= "\ref[src]", "aiDisable"="5"), 1)
return
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
if(!ailock)
src.lethal = !src.lethal
src.updateTurrets()
Topic(src, list("src"= "\ref[src]", "toggleLethal"="1", 1)) // 1 meaning no window (consistency!)
/atom/proc/AIMiddleClick()
return
/obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights.
if(!src.lights)
Topic("aiEnable=10", list("aiEnable"="10"), 1) // 1 meaning no window (consistency!)
Topic(src, list("src"= "\ref[src]", "aiEnable"="10"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=10", list("aiDisable"="10"), 1)
Topic(src, list("src"= "\ref[src]", "aiDisable"="10"), 1)
return
//

View File

@@ -227,8 +227,7 @@
return
/atom/proc/ShiftClick(var/mob/user)
if(user.client && user.client.eye == user)
examine()
user.face_atom(src)
user.examinate(src)
return
/*
@@ -304,7 +303,6 @@
// Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(var/atom/A)
// Snowflake for space vines.
var/is_buckled = 0
if(buckled)
@@ -313,8 +311,7 @@
is_buckled = 1
else
is_buckled = 0
if( stat || is_buckled || !A || !x || !y || !A.x || !A.y ) return
if( is_buckled || !A || !x || !y || !A.x || !A.y || (stat && !isobserver(src))) return
var/dx = A.x - x
var/dy = A.y - y
if(!dx && !dy) return
@@ -326,7 +323,7 @@
else
if(dx > 0) direction = EAST
else direction = WEST
usr.dir = direction
dir = direction
if(buckled && buckled.movable)
buckled.dir = direction
buckled.handle_rotation()

View File

@@ -41,7 +41,7 @@
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
if(user.client && user.client.inquisitive_ghost)
examine()
user.examinate(src)
return
// ---------------------------------------

View File

@@ -75,6 +75,7 @@ Radio:
1341 - death squad
1443 - Confession Intercom
1347 - Cargo techs
1349 - Service people
Devices:
1451 - tracking implant
@@ -109,6 +110,7 @@ var/const/ENG_FREQ = 1357
var/const/SCI_FREQ = 1351
var/const/MED_FREQ = 1355
var/const/SUP_FREQ = 1347
var/const/SRV_FREQ = 1349
var/list/radiochannels = list(
"Common" = PUB_FREQ,
@@ -121,6 +123,7 @@ var/list/radiochannels = list(
"Special Ops" = DTH_FREQ,
"Mercenary" = SYND_FREQ,
"Supply" = SUP_FREQ,
"Service" = SRV_FREQ,
"AI Private" = AI_FREQ
)
@@ -131,11 +134,43 @@ var/list/CENT_FREQS = list(ERT_FREQ, DTH_FREQ)
var/list/ANTAG_FREQS = list(SYND_FREQ)
//depenging helpers
var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ)
var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, SRV_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ)
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1
/proc/frequency_span_class(var/frequency)
// Antags!
if (frequency in ANTAG_FREQS)
return "syndradio"
// centcomm channels (deathsquid and ert)
else if(frequency in CENT_FREQS)
return "centradio"
// command channel
else if(frequency == COMM_FREQ)
return "comradio"
// AI private channel
else if(frequency == AI_FREQ)
return "airadio"
// department radio formatting (poorly optimized, ugh)
else if(frequency == SEC_FREQ)
return "secradio"
else if (frequency == ENG_FREQ)
return "engradio"
else if(frequency == SCI_FREQ)
return "sciradio"
else if(frequency == MED_FREQ)
return "medradio"
else if(frequency == SUP_FREQ) // cargo
return "supradio"
else if(frequency == SRV_FREQ) // service
return "srvradio"
// If all else fails and it's a dept_freq, color me purple!
else if(frequency in DEPT_FREQS)
return "deptradio"
return "radio"
/* filters */
//When devices register with the radio controller, they might register under a certain filter.
//Other devices can then choose to send signals to only those devices that belong to a particular filter.

View File

@@ -69,7 +69,7 @@
var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds...
var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active.
var/character_slots = 10 // The number of available character slots
var/max_maint_drones = 5 //This many drones can spawn,
@@ -151,6 +151,25 @@
var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge.
var/use_overmap = 0
var/list/station_levels = list(1) // Defines which Z-levels the station exists on.
var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle
var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect
var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach
var/const/minutes_to_ticks = 60 * 10
// Event settings
var/expected_round_length = 60 * 3 * minutes_to_ticks // 3 hours
// If the first delay has a custom start time
// No custom time, no custom time, between 80 to 100 minutes respectively.
var/list/event_first_run = list(EVENT_LEVEL_MUNDANE = null, EVENT_LEVEL_MODERATE = null, EVENT_LEVEL_MAJOR = list("lower" = 48000, "upper" = 60000))
// The lowest delay until next event
// 10, 30, 50 minutes respectively
var/list/event_delay_lower = list(EVENT_LEVEL_MUNDANE = 6000, EVENT_LEVEL_MODERATE = 18000, EVENT_LEVEL_MAJOR = 30000)
// The upper delay until next event
// 15, 45, 70 minutes respectively
var/list/event_delay_upper = list(EVENT_LEVEL_MUNDANE = 9000, EVENT_LEVEL_MODERATE = 27000, EVENT_LEVEL_MAJOR = 42000)
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
@@ -495,7 +514,7 @@
if("req_cult_ghostwriter")
config.cult_ghostwriter_req_cultists = text2num(value)
if("character_slots")
config.character_slots = text2num(value)
@@ -511,6 +530,45 @@
if("use_overmap")
config.use_overmap = 1
if("station_levels")
config.station_levels = text2numlist(value, ";")
if("admin_levels")
config.admin_levels = text2numlist(value, ";")
if("contact_levels")
config.contact_levels = text2numlist(value, ";")
if("player_levels")
config.player_levels = text2numlist(value, ";")
if("expected_round_length")
config.expected_round_length = text2num(value) * minutes_to_ticks
if("event_custom_start_mundane")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MUNDANE] = list("lower" = values[1] * minutes_to_ticks, "upper" = values[2] * minutes_to_ticks)
if("event_custom_start_moderate")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MODERATE] = list("lower" = values[1] * minutes_to_ticks, "upper" = values[2] * minutes_to_ticks)
if("event_custom_start_major")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MAJOR] = list("lower" = values[1] * minutes_to_ticks, "upper" = values[2] * minutes_to_ticks)
if("event_delay_lower")
var/values = text2numlist(value, ";")
config.event_delay_lower[EVENT_LEVEL_MUNDANE] = values[1] * minutes_to_ticks
config.event_delay_lower[EVENT_LEVEL_MODERATE] = values[2] * minutes_to_ticks
config.event_delay_lower[EVENT_LEVEL_MAJOR] = values[3] * minutes_to_ticks
if("event_delay_upper")
var/values = text2numlist(value, ";")
config.event_delay_upper[EVENT_LEVEL_MUNDANE] = values[1] * minutes_to_ticks
config.event_delay_upper[EVENT_LEVEL_MODERATE] = values[2] * minutes_to_ticks
config.event_delay_upper[EVENT_LEVEL_MAJOR] = values[3] * minutes_to_ticks
else
log_misc("Unknown setting in configuration: '[name]'")

View File

@@ -120,6 +120,9 @@ datum/controller/game_controller/proc/setup_objects()
//Set up spawn points.
populate_spawn_points()
// Sort the machinery list so it doesn't cause a lagspike at roundstart
process_machines_sort()
world << "\red \b Initializations complete."
sleep(-1)
@@ -319,6 +322,7 @@ datum/controller/game_controller/proc/process_pipenets()
Powernet.reset()
datum/controller/game_controller/proc/process_nano()
last_thing_processed = /datum/nanoui
var/i = 1
while(i<=nanomanager.processing_uis.len)
var/datum/nanoui/ui = nanomanager.processing_uis[i]
@@ -330,15 +334,7 @@ datum/controller/game_controller/proc/process_nano()
datum/controller/game_controller/proc/process_events()
last_thing_processed = /datum/event
var/i = 1
while(i<=events.len)
var/datum/event/Event = events[i]
if(Event)
Event.process()
i++
continue
events.Cut(i,i+1)
checkEvent()
event_manager.process()
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"

View File

@@ -48,7 +48,7 @@
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
return
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data"))
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
@@ -102,6 +102,9 @@
feedback_add_details("admin_verb","DAutovoter")
if("Gas Data")
debug_variables(gas_data)
feedback_add_details("admin_verv","DGasdata")
feedback_add_details("admin_verb","DGasdata")
if("Event")
debug_variables(event_manager)
feedback_add_details("admin_verb", "DEvent")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
return

View File

@@ -48,11 +48,11 @@ datum/controller/vote
voting.Cut()
proc/autotransfer()
initiate_vote("crew_transfer","the server")
initiate_vote("crew_transfer","the server", 1)
log_debug("The server has called a crew transfer vote")
proc/autogamemode()
initiate_vote("gamemode","the server")
initiate_vote("gamemode","the server", 1)
log_debug("The server has called a gamemode vote")
proc/reset()
@@ -197,9 +197,9 @@ datum/controller/vote
return vote
return 0
proc/initiate_vote(var/vote_type, var/initiator_key)
proc/initiate_vote(var/vote_type, var/initiator_key, var/automatic = 0)
if(!mode)
if(started_time != null && !check_rights(R_ADMIN))
if(started_time != null && !(check_rights(R_ADMIN) || automatic))
var/next_allowed_time = (started_time + config.vote_delay)
if(next_allowed_time > world.time)
return 0

View File

@@ -0,0 +1,195 @@
// Wires for airlocks
/datum/wires/airlock/secure
random = 1
wire_count = 14
/datum/wires/airlock
holder_type = /obj/machinery/door/airlock
wire_count = 12
window_y = 570
var/const/AIRLOCK_WIRE_IDSCAN = 1
var/const/AIRLOCK_WIRE_MAIN_POWER1 = 2
var/const/AIRLOCK_WIRE_MAIN_POWER2 = 4
var/const/AIRLOCK_WIRE_DOOR_BOLTS = 8
var/const/AIRLOCK_WIRE_BACKUP_POWER1 = 16
var/const/AIRLOCK_WIRE_BACKUP_POWER2 = 32
var/const/AIRLOCK_WIRE_OPEN_DOOR = 64
var/const/AIRLOCK_WIRE_AI_CONTROL = 128
var/const/AIRLOCK_WIRE_ELECTRIFY = 256
var/const/AIRLOCK_WIRE_SAFETY = 512
var/const/AIRLOCK_WIRE_SPEED = 1024
var/const/AIRLOCK_WIRE_LIGHT = 2048
/datum/wires/airlock/CanUse(var/mob/living/L)
var/obj/machinery/door/airlock/A = holder
if(!istype(L, /mob/living/silicon))
if(A.isElectrified())
if(A.shock(L, 100))
return 0
if(A.p_open)
return 1
return 0
/datum/wires/airlock/GetInteractWindow()
var/obj/machinery/door/airlock/A = holder
. += ..()
. += text("<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
(A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"),
((A.hasPower()) ? "The test light is on." : "The test light is off!"),
((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
(A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
(A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
(A.aiDisabledIdScanner==0 ? "The IDScan light is on." : "The IDScan light is off."))
/datum/wires/airlock/UpdateCut(var/index, var/mended)
var/obj/machinery/door/airlock/A = holder
switch(index)
if(AIRLOCK_WIRE_IDSCAN)
A.aiDisabledIdScanner = !mended
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
if(!mended)
//Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user.
A.loseMainPower()
A.shock(usr, 50)
else
if((!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER2)))
A.regainMainPower()
A.shock(usr, 50)
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
if(!mended)
//Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user.
A.loseBackupPower()
A.shock(usr, 50)
else
if((!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER2)))
A.regainBackupPower()
A.shock(usr, 50)
if(AIRLOCK_WIRE_DOOR_BOLTS)
if(!mended)
//Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present)
if(A.locked!=1)
A.locked = 1
A.update_icon()
if(AIRLOCK_WIRE_AI_CONTROL)
if(!mended)
//one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
//aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
if(A.aiControlDisabled == 0)
A.aiControlDisabled = 1
else if(A.aiControlDisabled == -1)
A.aiControlDisabled = 2
else
if(A.aiControlDisabled == 1)
A.aiControlDisabled = 0
else if(A.aiControlDisabled == 2)
A.aiControlDisabled = -1
if(AIRLOCK_WIRE_ELECTRIFY)
if(!mended)
//Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted.
if(A.secondsElectrified != -1)
A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]")
A.secondsElectrified = -1
else
if(A.secondsElectrified == -1)
A.secondsElectrified = 0
return // Don't update the dialog.
if (AIRLOCK_WIRE_SAFETY)
A.safe = mended
if(AIRLOCK_WIRE_SPEED)
A.autoclose = mended
if(mended)
if(!A.density)
A.close()
if(AIRLOCK_WIRE_LIGHT)
A.lights = mended
A.update_icon()
/datum/wires/airlock/UpdatePulsed(var/index)
var/obj/machinery/door/airlock/A = holder
switch(index)
if(AIRLOCK_WIRE_IDSCAN)
//Sending a pulse through flashes the red light on the door (if the door has power).
if(A.hasPower() && A.density)
A.do_animate("deny")
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
//Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter).
A.loseMainPower()
if(AIRLOCK_WIRE_DOOR_BOLTS)
//one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not),
//raises them if they are down (only if power's on)
if(!A.locked)
A.locked = 1
A.audible_message("You hear a click from the bottom of the door.", null, 1)
else
if(A.hasPower()) //only can raise bolts if power's on
A.locked = 0
A.audible_message("You hear a click from the bottom of the door.", null, 1)
A.update_icon()
if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
//two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
A.loseBackupPower()
if(AIRLOCK_WIRE_AI_CONTROL)
if(A.aiControlDisabled == 0)
A.aiControlDisabled = 1
else if(A.aiControlDisabled == -1)
A.aiControlDisabled = 2
spawn(10)
if(A)
if(A.aiControlDisabled == 1)
A.aiControlDisabled = 0
else if(A.aiControlDisabled == 2)
A.aiControlDisabled = -1
if(AIRLOCK_WIRE_ELECTRIFY)
//one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.
if(A.secondsElectrified==0)
A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]")
A.secondsElectrified = 30
spawn(10)
if(A)
//TODO: Move this into process() and make pulsing reset secondsElectrified to 30
while (A.secondsElectrified>0)
A.secondsElectrified-=1
if(A.secondsElectrified<0)
A.secondsElectrified = 0
sleep(10)
return
if(AIRLOCK_WIRE_OPEN_DOOR)
//tries to open the door without ID
//will succeed only if the ID wire is cut or the door requires no access and it's not emagged
if(A.emagged) return
if(!A.requiresID() || A.check_access(null))
if(A.density) A.open()
else A.close()
if(AIRLOCK_WIRE_SAFETY)
A.safe = !A.safe
if(!A.density)
A.close()
if(AIRLOCK_WIRE_SPEED)
A.normalspeed = !A.normalspeed
if(AIRLOCK_WIRE_LIGHT)
A.lights = !A.lights
A.update_icon()

View File

@@ -0,0 +1,93 @@
/datum/wires/alarm
holder_type = /obj/machinery/alarm
wire_count = 5
var/const/AALARM_WIRE_IDSCAN = 1
var/const/AALARM_WIRE_POWER = 2
var/const/AALARM_WIRE_SYPHON = 4
var/const/AALARM_WIRE_AI_CONTROL = 8
var/const/AALARM_WIRE_AALARM = 16
/datum/wires/alarm/CanUse(var/mob/living/L)
var/obj/machinery/alarm/A = holder
if(A.wiresexposed)
return 1
return 0
/datum/wires/alarm/GetInteractWindow()
var/obj/machinery/alarm/A = holder
. += ..()
. += text("<br>\n[(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]<br>\n[((A.shorted || (A.stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]<br>\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
/datum/wires/alarm/UpdateCut(var/index, var/mended)
var/obj/machinery/alarm/A = holder
switch(index)
if(AALARM_WIRE_IDSCAN)
if(!mended)
A.locked = 1
//world << "Idscan wire cut"
if(AALARM_WIRE_POWER)
A.shock(usr, 50)
A.shorted = !mended
A.update_icon()
//world << "Power wire cut"
if (AALARM_WIRE_AI_CONTROL)
if (A.aidisabled == !mended)
A.aidisabled = mended
//world << "AI Control Wire Cut"
if(AALARM_WIRE_SYPHON)
if(!mended)
A.mode = 3 // AALARM_MODE_PANIC
A.apply_mode()
//world << "Syphon Wire Cut"
if(AALARM_WIRE_AALARM)
if (A.alarm_area.atmosalert(2))
A.post_alert(2)
A.update_icon()
/datum/wires/alarm/UpdatePulsed(var/index)
var/obj/machinery/alarm/A = holder
switch(index)
if(AALARM_WIRE_IDSCAN)
A.locked = !A.locked
// world << "Idscan wire pulsed"
if (AALARM_WIRE_POWER)
// world << "Power wire pulsed"
if(A.shorted == 0)
A.shorted = 1
A.update_icon()
spawn(12000)
if(A.shorted == 1)
A.shorted = 0
A.update_icon()
if (AALARM_WIRE_AI_CONTROL)
// world << "AI Control wire pulsed"
if (A.aidisabled == 0)
A.aidisabled = 1
A.updateDialog()
spawn(100)
if (A.aidisabled == 1)
A.aidisabled = 0
if(AALARM_WIRE_SYPHON)
// world << "Syphon wire pulsed"
if(A.mode == 1) // AALARM_MODE_SCRUB
A.mode = 3 // AALARM_MODE_PANIC
else
A.mode = 1 // AALARM_MODE_SCRUB
A.apply_mode()
if(AALARM_WIRE_AALARM)
// world << "Aalarm wire pulsed"
if (A.alarm_area.atmosalert(0))
A.post_alert(0)
A.update_icon()

View File

@@ -2,10 +2,10 @@
holder_type = /obj/machinery/power/apc
wire_count = 4
var/const/APC_WIRE_IDSCAN = 1
var/const/APC_WIRE_MAIN_POWER1 = 2
var/const/APC_WIRE_MAIN_POWER2 = 4
var/const/APC_WIRE_AI_CONTROL = 8
#define APC_WIRE_IDSCAN 1
#define APC_WIRE_MAIN_POWER1 2
#define APC_WIRE_MAIN_POWER2 4
#define APC_WIRE_AI_CONTROL 8
/datum/wires/apc/GetInteractWindow()
var/obj/machinery/power/apc/A = holder
@@ -31,7 +31,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(300)
if(A)
A.locked = 1
A.updateDialog()
if (APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(A.shorted == 0)
@@ -40,7 +39,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(1200)
if(A && !IsIndexCut(APC_WIRE_MAIN_POWER1) && !IsIndexCut(APC_WIRE_MAIN_POWER2))
A.shorted = 0
A.updateDialog()
if (APC_WIRE_AI_CONTROL)
if (A.aidisabled == 0)
@@ -49,9 +47,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(10)
if(A && !IsIndexCut(APC_WIRE_AI_CONTROL))
A.aidisabled = 0
A.updateDialog()
A.updateDialog()
/datum/wires/apc/UpdateCut(var/index, var/mended)
var/obj/machinery/power/apc/A = holder
@@ -75,4 +70,3 @@ var/const/APC_WIRE_AI_CONTROL = 8
else
if (A.aidisabled == 1)
A.aidisabled = 0
A.updateDialog()

View File

@@ -0,0 +1,74 @@
// Wires for cameras.
/datum/wires/camera
random = 1
holder_type = /obj/machinery/camera
wire_count = 6
/datum/wires/camera/GetInteractWindow()
. = ..()
var/obj/machinery/camera/C = holder
. += "<br>\n[(C.view_range == initial(C.view_range) ? "The focus light is on." : "The focus light is off.")]"
. += "<br>\n[(C.can_use() ? "The power link light is on." : "The power link light is off.")]"
. += "<br>\n[(C.light_disabled ? "The camera light is off." : "The camera light is on.")]"
. += "<br>\n[(C.alarm_on ? "The alarm light is on." : "The alarm light is off.")]"
return .
/datum/wires/camera/CanUse(var/mob/living/L)
var/obj/machinery/camera/C = holder
return C.panel_open
var/const/CAMERA_WIRE_FOCUS = 1
var/const/CAMERA_WIRE_POWER = 2
var/const/CAMERA_WIRE_LIGHT = 4
var/const/CAMERA_WIRE_ALARM = 8
var/const/CAMERA_WIRE_NOTHING1 = 16
var/const/CAMERA_WIRE_NOTHING2 = 32
/datum/wires/camera/UpdateCut(var/index, var/mended)
var/obj/machinery/camera/C = holder
switch(index)
if(CAMERA_WIRE_FOCUS)
var/range = (mended ? initial(C.view_range) : C.short_range)
C.setViewRange(range)
if(CAMERA_WIRE_POWER)
if(C.status && !mended || !C.status && mended)
C.deactivate(usr, 1)
if(CAMERA_WIRE_LIGHT)
C.light_disabled = !mended
if(CAMERA_WIRE_ALARM)
if(!mended)
C.triggerCameraAlarm()
else
C.cancelCameraAlarm()
return
/datum/wires/camera/UpdatePulsed(var/index)
var/obj/machinery/camera/C = holder
if(IsIndexCut(index))
return
switch(index)
if(CAMERA_WIRE_FOCUS)
var/new_range = (C.view_range == initial(C.view_range) ? C.short_range : initial(C.view_range))
C.setViewRange(new_range)
if(CAMERA_WIRE_POWER)
C.deactivate(null) // Deactivate the camera
if(CAMERA_WIRE_LIGHT)
C.light_disabled = !C.light_disabled
if(CAMERA_WIRE_ALARM)
C.visible_message("\icon[C] *beep*", "\icon[C] *beep*")
return
/datum/wires/camera/proc/CanDeconstruct()
if(IsIndexCut(CAMERA_WIRE_POWER) && IsIndexCut(CAMERA_WIRE_FOCUS) && IsIndexCut(CAMERA_WIRE_LIGHT) && IsIndexCut(CAMERA_WIRE_NOTHING1) && IsIndexCut(CAMERA_WIRE_NOTHING2))
return 1
else
return 0

103
code/datums/wires/robot.dm Normal file
View File

@@ -0,0 +1,103 @@
/datum/wires/robot
random = 1
holder_type = /mob/living/silicon/robot
wire_count = 5
var/const/BORG_WIRE_LAWCHECK = 1
var/const/BORG_WIRE_MAIN_POWER = 2 // The power wires do nothing whyyyyyyyyyyyyy
var/const/BORG_WIRE_LOCKED_DOWN = 4
var/const/BORG_WIRE_AI_CONTROL = 8
var/const/BORG_WIRE_CAMERA = 16
/datum/wires/robot/GetInteractWindow()
. = ..()
var/mob/living/silicon/robot/R = holder
. += text("<br>\n[(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]")
. += text("<br>\n[(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
. += text("<br>\n[((!isnull(R.camera) && R.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")]")
. += text("<br>\n[(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]")
return .
/datum/wires/robot/UpdateCut(var/index, var/mended)
var/mob/living/silicon/robot/R = holder
switch(index)
if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
if(!mended)
if (R.lawupdate == 1)
R << "LawSync protocol engaged."
R.show_laws()
else
if (R.lawupdate == 0 && !R.emagged)
R.lawupdate = 1
if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(!mended)
if (R.connected_ai)
R.connected_ai = null
if (BORG_WIRE_CAMERA)
if(!isnull(R.camera) && !R.scrambledcodes)
R.camera.status = mended
R.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh
if (R.lawupdate)
R.lawsync()
if(BORG_WIRE_LOCKED_DOWN)
R.SetLockdown(!mended)
/datum/wires/robot/UpdatePulsed(var/index)
var/mob/living/silicon/robot/R = holder
switch(index)
if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(!R.emagged)
var/new_ai = select_active_ai(R)
if(new_ai && (new_ai != R.connected_ai))
R.connected_ai = new_ai
R.notify_ai(1)
var/numberer = 1 // Send images the Cyborg has taken to the AI's album upon sync.
for(var/datum/picture/z in R.aiCamera.aipictures)
if(R.connected_ai.aiCamera.aipictures.len == 0)
var/datum/picture/p = new/datum/picture()
p = z
p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])"
R.connected_ai.aiCamera.aipictures += p
numberer++
continue
for(var/datum/picture/t in R.connected_ai.aiCamera.aipictures) //Hopefully to prevent someone spamming images to silicons, by spamming this wire
if((z.fields["pixel_y"] != t.fields["pixel_y"]) && (z.fields["pixel_x"] != t.fields["pixel_x"])) //~2.26 out of 1000 chance this will stop something it shouldn't
var/datum/picture/p = new/datum/picture()
p = z
p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])"
R.connected_ai.aiCamera.aipictures += p
else
continue
numberer++
if(R.aiCamera.aipictures.len > 0)
R << "<span class='notice'>Locally saved images synced with AI. Images were retained in local database in case of loss of connection with the AI.</span>"
if (BORG_WIRE_CAMERA)
if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes)
R.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera.
R.visible_message("[R]'s camera lense focuses loudly.")
R << "Your camera lense focuses loudly."
if(BORG_WIRE_LOCKED_DOWN)
R.SetLockdown(!R.lockcharge) // Toggle
/datum/wires/robot/CanUse(var/mob/living/L)
var/mob/living/silicon/robot/R = holder
if(R.wiresexposed)
return 1
return 0
/datum/wires/robot/proc/IsCameraCut()
return wires_status & BORG_WIRE_CAMERA
/datum/wires/robot/proc/LockedCut()
return wires_status & BORG_WIRE_LOCKED_DOWN

View File

@@ -2,6 +2,10 @@
holder_type = /obj/machinery/smartfridge
wire_count = 3
/datum/wires/smartfridge/secure
random = 1
wire_count = 4
var/const/SMARTFRIDGE_WIRE_ELECTRIFY = 1
var/const/SMARTFRIDGE_WIRE_THROW = 2
var/const/SMARTFRIDGE_WIRE_IDSCAN = 4
@@ -16,11 +20,6 @@ var/const/SMARTFRIDGE_WIRE_IDSCAN = 4
return 1
return 0
/datum/wires/smartfridge/Interact(var/mob/living/user)
if(CanUse(user))
var/obj/machinery/smartfridge/S = holder
S.attack_hand(user)
/datum/wires/smartfridge/GetInteractWindow()
var/obj/machinery/smartfridge/S = holder
. += ..()

View File

@@ -16,11 +16,6 @@ var/const/SUIT_STORAGE_WIRE_LOCKED = 4
return 1
return 0
/datum/wires/suit_storage_unit/Interact(var/mob/living/user)
if(CanUse(user))
var/obj/machinery/suit_cycler/S = holder
S.attack_hand(user)
/datum/wires/suit_storage_unit/GetInteractWindow()
var/obj/machinery/suit_cycler/S = holder
. += ..()

View File

@@ -6,8 +6,8 @@
#define MAX_FLAG 65535
var/list/same_wires = list()
// 12 colours, if you're adding more than 12 wires then add more colours here
var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink")
// 14 colours, if you're adding more than 14 wires then add more colours here
var/list/wireColours = list("red", "blue", "green", "white", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink", "black", "yellow")
/datum/wires

View File

@@ -7,7 +7,7 @@
var/log = 0
var/sound
var/newscast = 0
var/channel_name = "Public Station Announcements"
var/channel_name = "Station Announcements"
var/announcement_type = "Announcement"
/datum/announcement/New(var/do_log = 0, var/new_sound = null, var/do_newscast = 0)

View File

@@ -51,27 +51,26 @@
return TELECOMMS_RECEPTION_RECEIVER
return TELECOMMS_RECEPTION_NONE
/proc/get_reception(var/atom/sender, var/receiver, var/message = "")
/proc/get_reception(var/atom/sender, var/receiver, var/message = "", var/do_sleep = 1)
var/datum/reception/reception = new
// check if telecomms I/O route 1459 is stable
//var/telecomms_intact = telecomms_process(P.owner, owner, t)
reception.message_server = get_message_server()
var/datum/signal/signal = sender.telecomms_process() // Be aware that this proc calls sleep, to simulate transmition delays
var/datum/signal/signal = sender.telecomms_process(do_sleep) // Be aware that this proc calls sleep, to simulate transmition delays
reception.telecomms_reception |= get_sender_reception(sender, signal)
reception.telecomms_reception |= get_receiver_reception(receiver, signal)
reception.message = signal && signal.data["compression"] > 0 ? Gibberish(message, signal.data["compression"] + 50) : message
return reception
/proc/get_receptions(var/atom/sender, var/list/atom/receivers)
/proc/get_receptions(var/atom/sender, var/list/atom/receivers, var/do_sleep = 1)
var/datum/receptions/receptions = new
receptions.message_server = get_message_server()
var/datum/signal/signal
if(sender)
signal = sender.telecomms_process()
signal = sender.telecomms_process(do_sleep)
receptions.sender_reception = get_sender_reception(sender, signal)
for(var/atom/receiver in receivers)

View File

@@ -55,6 +55,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/air_doors_activated = 0
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
var/sound/forced_ambience = null
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
@@ -65,7 +66,7 @@ var/list/teleportlocs = list()
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
if(teleportlocs.Find(AR.name)) continue
var/turf/picked = pick(get_area_turfs(AR.type))
if (picked.z == 1)
if (picked.z in config.station_levels)
teleportlocs += AR.name
teleportlocs[AR.name] = AR
@@ -82,7 +83,7 @@ var/list/ghostteleportlocs = list()
ghostteleportlocs += AR.name
ghostteleportlocs[AR.name] = AR
var/turf/picked = pick(get_area_turfs(AR.type))
if (picked.z == 1 || picked.z == 3 || picked.z == 4 || picked.z == 5)
if (picked.z in config.player_levels)
ghostteleportlocs += AR.name
ghostteleportlocs[AR.name] = AR
@@ -716,6 +717,10 @@ var/list/ghostteleportlocs = list()
name = "\improper Incinerator"
icon_state = "disposal"
/area/maintenance/library
name = "Library Maintenance"
icon_state = "maint_library"
/area/maintenance/locker
name = "Locker Room Maintenance"
icon_state = "maint_locker"
@@ -725,11 +730,11 @@ var/list/ghostteleportlocs = list()
icon_state = "maint_medbay"
/area/maintenance/research_port
name = "Port Research Maintenance"
name = "Research Maintenance - Port"
icon_state = "maint_research_port"
/area/maintenance/research_starboard
name = "Starboard Research Maintenance"
name = "Research Maintenance - Starboard"
icon_state = "maint_research_starboard"
/area/maintenance/research_shuttle
@@ -737,11 +742,11 @@ var/list/ghostteleportlocs = list()
icon_state = "maint_research_shuttle"
/area/maintenance/security_port
name = "Port Security Maintenance"
name = "Security Maintenance - Port"
icon_state = "maint_security_port"
/area/maintenance/security_starboard
name = "Starboard Security Maintenance"
name = "Security Maintenance - Starboard"
icon_state = "maint_security_starboard"
/area/maintenance/storage
@@ -813,9 +818,21 @@ var/list/ghostteleportlocs = list()
name = "\improper Construction Area"
icon_state = "construction"
/area/hallway/secondary/entry
name = "\improper Arrival Shuttle Hallway"
icon_state = "entry"
/area/hallway/secondary/entry/fore
name = "\improper Arrival Shuttle Hallway - Fore"
icon_state = "entry_1"
/area/hallway/secondary/entry/port
name = "\improper Arrival Shuttle Hallway - Port"
icon_state = "entry_2"
/area/hallway/secondary/entry/starboard
name = "\improper Arrival Shuttle Hallway - Starboard"
icon_state = "entry_3"
/area/hallway/secondary/entry/aft
name = "\improper Arrival Shuttle Hallway - Aft"
icon_state = "entry_4"
//Command
@@ -887,8 +904,16 @@ var/list/ghostteleportlocs = list()
name = "\improper Engineering Washroom"
icon_state = "toilet"
/area/crew_quarters/sleep/bedrooms
name = "\improper Dormitory Bedroom"
/area/crew_quarters/sleep/bedrooms/one
name = "\improper Dormitory Bedroom One"
icon_state = "Sleep"
/area/crew_quarters/sleep/bedrooms/two
name = "\improper Dormitory Bedroom Two"
icon_state = "Sleep"
/area/crew_quarters/sleep/bedrooms/three
name = "\improper Dormitory Bedroom Three"
icon_state = "Sleep"
/area/crew_quarters/sleep/cryo
@@ -1166,7 +1191,7 @@ var/list/ghostteleportlocs = list()
/area/assembly/robotics
name = "\improper Robotics Lab"
icon_state = "ass_line"
icon_state = "robotics"
/area/assembly/assembly_line //Derelict Assembly Line
name = "\improper Assembly Line"
@@ -1196,21 +1221,26 @@ var/list/ghostteleportlocs = list()
//MedBay
/area/medical/medbay
name = "\improper Medbay"
name = "\improper Medbay Hallway - Port"
icon_state = "medbay"
music = 'sound/ambience/signal.ogg'
//Medbay is a large area, these additional areas help level out APC load.
/area/medical/medbay2
name = "\improper Medbay"
name = "\improper Medbay Hallway - Starboard"
icon_state = "medbay2"
music = 'sound/ambience/signal.ogg'
/area/medical/medbay3
name = "\improper Medbay"
name = "\improper Medbay Hallway - Fore"
icon_state = "medbay3"
music = 'sound/ambience/signal.ogg'
/area/medical/medbay4
name = "\improper Medbay Hallway - Aft"
icon_state = "medbay4"
music = 'sound/ambience/signal.ogg'
/area/medical/biostorage
name = "\improper Secondary Storage"
icon_state = "medbay2"

View File

@@ -281,10 +281,9 @@
master.used_environ += amount
/area/Entered(A)
var/musVolume = 25
var/sound = 'sound/ambience/ambigen1.ogg'
var/list/mob/living/forced_ambiance_list = new
/area/Entered(A)
if(!istype(A,/mob/living)) return
var/mob/living/L = A
@@ -299,18 +298,28 @@
L.make_floating(0)
L.lastarea = newarea
play_ambience(L)
/area/proc/play_ambience(var/mob/living/L)
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
if(!(L && L.client && (L.client.prefs.toggles & SOUND_AMBIENCE))) return
// If we previously were in an area with force-played ambiance, stop it.
if(L in forced_ambiance_list)
L << sound(null, channel = 1)
forced_ambiance_list -= L
if(!L.client.ambience_playing)
L.client.ambience_playing = 1
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
if(src.ambience.len && prob(35))
sound = pick(ambience)
if(world.time > L.client.played + 600)
if(forced_ambience)
forced_ambiance_list += L
L << forced_ambience
else if(src.ambience.len && prob(35))
if((world.time >= L.client.played + 600))
var/musVolume = 25
var/sound = pick(ambience)
L << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1)
L.client.played = world.time

View File

@@ -187,18 +187,22 @@ its easier to just keep the beam vertical.
//All atoms
/atom/verb/examine()
set name = "Examine"
set category = "IC"
set src in view(usr.client) //If it can be seen, it can be examined.
/atom/proc/examine(mob/user, var/distance = -1)
//This reformat names to get a/an properly working on item descriptions when they are bloody
var/f_name = "\a [src]."
if(src.blood_DNA && !istype(src, /obj/effect/decal))
if(gender == PLURAL)
f_name = "some "
else
f_name = "a "
f_name += "<span class='danger'>blood-stained</span> [name]!"
if (!( usr ))
return
usr << "That's \a [src]." //changed to "That's" from "This is" because "This is some metal sheets" sounds dumb compared to "That's some metal sheets" ~Carn
usr << desc
// *****RM
//usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
return
user << "\icon[src] That's [f_name]"
if(desc)
user << desc
return distance == -1 || (get_dist(src, user) <= distance)
// called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set.
// see code/modules/mob/mob_movement.dm for more.
@@ -244,7 +248,7 @@ its easier to just keep the beam vertical.
src.fingerprintslast = M.key
return
/atom/proc/add_fingerprint(mob/living/M as mob)
/atom/proc/add_fingerprint(mob/living/M as mob, ignoregloves = 0)
if(isnull(M)) return
if(isAI(M)) return
if(isnull(M.key)) return
@@ -280,11 +284,12 @@ its easier to just keep the beam vertical.
H.gloves.add_fingerprint(M)
//Deal with gloves the pass finger/palm prints.
if(H.gloves != src)
if(prob(75) && istype(H.gloves, /obj/item/clothing/gloves/latex))
return 0
else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex))
return 0
if(!ignoregloves)
if(H.gloves != src)
if(prob(75) && istype(H.gloves, /obj/item/clothing/gloves/latex))
return 0
else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex))
return 0
//More adminstuffz
if(fingerprintslast != H.key)

View File

@@ -82,7 +82,7 @@ var/list/blob_nodes = list()
sleep(-1)
if(!blobs.len) break
var/obj/effect/blob/B = pick(blobs)
if(B.z != 1)
if(isNotStationLevel(B.z))
continue
B.Life()

View File

@@ -7,12 +7,12 @@
return 1
for(var/obj/effect/blob/B in blob_cores)
if(B && B.z != 1) continue
if(B && isNotStationLevel(B.z)) continue
return 0
var/nodes = 0
for(var/obj/effect/blob/B in blob_nodes)
if(B && B.z != 1) continue
if(B && isNotStationLevel(B.z)) continue
nodes++
if(nodes > 4)//Perhapse make a new core with a low prob
return 0
@@ -62,7 +62,7 @@
if (istype(T, /turf/space))
numSpace += 1
else if(istype(T, /turf))
if (M.z!=1)
if (isNotStationLevel(M.z))
numOffStation += 1
else
numAlive += 1

View File

@@ -21,7 +21,7 @@
var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in machines)
if(bomb && bomb.r_code)
if(bomb.z == 1)
if(bomb.z in station_levels)
nukecode = bomb.r_code
interceptname = "Directive 7-12"
intercepttext += "<FONT size = 3><B>NanoTrasen Update</B>: Biohazard Alert.</FONT><HR>"
@@ -62,7 +62,7 @@
proc/count()
for(var/turf/T in world)
if(T.z != 1)
if(isNotStationLevel(T.z)
continue
if(istype(T,/turf/simulated/floor))
@@ -84,7 +84,7 @@
src.r_wall += 1
for(var/obj/O in world)
if(O.z != 1)
if(isNotStationLevel(O.z))
continue
if(istype(O, /obj/structure/window))

View File

@@ -82,6 +82,14 @@
return 1
/datum/game_mode/calamity/post_setup()
// Reduce the interval between moderate/major events
event_manager.delay_modifier[EVENT_LEVEL_MODERATE] = 0.5
event_manager.delay_modifier[EVENT_LEVEL_MAJOR] = 0.75
// Add the cortical borer event
var/list/moderate_event_list = event_manager.available_events[EVENT_LEVEL_MODERATE]
var/event = new /datum/event_meta(EVENT_LEVEL_MODERATE, "Borer Infestation", /datum/event/borer_infestation, 400)
moderate_event_list.Add(event)
if(chosen_atypes)
for(var/atype in chosen_atypes)
@@ -245,9 +253,9 @@
var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
var/nuke_code = "[rand(10000, 99999)]"
var/leader_selected = 0
var/spawnpos = 1
var/datum/mind/leader = null
for(var/datum/mind/player in candidates)
syndicates |= player
@@ -264,9 +272,9 @@
greet_syndicate(player)
equip_syndicate(player.current)
if(!leader_selected)
if(!leader)
prepare_syndicate_leader(player, nuke_code)
leader_selected = 1
leader = player
spawnpos++
update_synd_icons_added(player)
@@ -275,6 +283,8 @@
if(uplinkdevice)
var/obj/item/device/radio/uplink/U = new(uplinkdevice.loc)
if(leader)
U.hidden_uplink.uplink_owner = leader
U.hidden_uplink.uses = 40
if(nuke_spawn && synd_spawn.len > 0)
var/obj/machinery/nuclearbomb/the_bomb = new /obj/machinery/nuclearbomb(nuke_spawn.loc)

View File

@@ -20,7 +20,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
runewords-=cultwords[word]
/obj/effect/rune
desc = ""
desc = "A strange collection of symbols drawn in blood."
anchored = 1
icon = 'icons/obj/rune.dmi'
icon_state = "1"
@@ -68,26 +68,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
for(var/mob/living/silicon/ai/AI in player_list)
AI.client.images += blood
examine()
set src in view(2)
if(!iscultist(usr))
usr << "A strange collection of symbols drawn in blood."
return
/* Explosions... really?
if(desc && !usr.stat)
usr << "It reads: <i>[desc]</i>."
sleep(30)
explosion(src.loc, 0, 2, 5, 5)
if(src)
del(src)
*/
if(!desc)
usr << "A spell circle drawn in blood. It reads: <i>[word1] [word2] [word3]</i>."
else
usr << "Explosive Runes inscription in blood. It reads: <i>[desc]</i>."
return
examine(mob/user)
..()
if(iscultist(user))
user << "This spell circle reads: <i>[word1] [word2] [word3]</i>."
attackby(I as obj, user as mob)
@@ -346,7 +330,8 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
if(istype(M,/mob/dead))
M.invisibility = 0
var/mob/dead/D = M
D.manifest()
user.visible_message( \
"\red [user] drags the ghost to our plan of reality!", \
"\red You drag the ghost to our plan of reality!" \
@@ -510,12 +495,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
user << "You copy the translation notes from your tome."
examine()
set src in usr
if(!iscultist(usr))
usr << "An old, dusty tome with frayed edges and a sinister looking cover."
examine(mob/user)
if(!iscultist(user))
user << "An old, dusty tome with frayed edges and a sinister looking cover."
else
usr << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though."
user << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though."
/obj/item/weapon/book/tome/imbued //admin tome, spawns working runes without waiting
w_class = 2.0

View File

@@ -12,7 +12,7 @@ var/list/sacrificed = list()
for(var/obj/effect/rune/R in world)
if(R == src)
continue
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && R.z != 2)
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z))
index++
allrunesloc.len = index
allrunesloc[index] = R.loc

View File

@@ -3,13 +3,6 @@
var/imbue = null
var/uses = 0
examine()
set src in view(2)
..()
return
attack_self(mob/living/user as mob)
if(iscultist(user))
var/delete = 1

View File

@@ -57,7 +57,7 @@
var/list/turfs = new
var/turf/picked
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
if(T.z in station_levels)
turfs += T
for(var/turf/simulated/floor/T in turfs)
if(prob(20))
@@ -151,7 +151,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
if(T.z != 1)
if(isNotStationLevel(T.z))
continue
for(var/datum/disease/D in H.viruses)
foundAlready = 1
@@ -185,7 +185,7 @@
//world << sound('sound/AI/aliens.ogg')
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)
if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels)
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
@@ -211,7 +211,7 @@
/* // Haha, this is way too laggy. I'll keep the prison break though.
for(var/obj/machinery/light/L in world)
if(L.z != 1) continue
if(isNotStationLevel(L.z)) continue
L.flicker(50)
sleep(100)
@@ -220,7 +220,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
if(T.z != 1)
if(isNotStationLevel(T.z))
continue
if(istype(H,/mob/living/carbon/human))
H.apply_effect((rand(15,75)),IRRADIATE,0)
@@ -237,7 +237,7 @@
var/turf/T = get_turf(M)
if(!T)
continue
if(T.z != 1)
if(isNotStationLevel(T.z))
continue
M.apply_effect((rand(15,75)),IRRADIATE,0)
sleep(100)
@@ -444,21 +444,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0)
world << "Started processing APCs"
for (var/obj/machinery/power/apc/APC in world)
if(APC.z == 1)
if(APC.z in station_levels)
APC.ion_act()
apcnum++
world << "Finished processing APCs. Processed: [apcnum]"
spawn(0)
world << "Started processing SMES"
for (var/obj/machinery/power/smes/SMES in world)
if(SMES.z == 1)
if(SMES.z in station_levels)
SMES.ion_act()
smesnum++
world << "Finished processing SMES. Processed: [smesnum]"
spawn(0)
world << "Started processing AIRLOCKS"
for (var/obj/machinery/door/airlock/D in world)
if(D.z == 1)
if(D.z in station_levels)
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
airlocknum++
spawn(0)
@@ -467,7 +467,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0)
world << "Started processing FIREDOORS"
for (var/obj/machinery/door/firedoor/D in world)
if(D.z == 1)
if(D.z in station_levels)
firedoornum++;
spawn(0)
D.ion_act()

View File

@@ -78,8 +78,8 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
walk_towards(immrod, end,1)
sleep(1)
while (immrod)
if (immrod.z != 1)
immrod.z = 1
if (isNotStationLevel(immrod.z))
immrod.z = pick(config.station_levels)
if(immrod.loc == end)
del(immrod)
sleep(10)

View File

@@ -83,7 +83,7 @@ The "dust" will damage the hull of the station causin minor hull breaches.
var/goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
src.z = 1
src.z = pick(config.station_levels)
spawn(0)
walk_towards(src, goal, 1)
return

View File

@@ -1,6 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
if(xmas.z != 1) continue
if(isNotStationLevel(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)

View File

@@ -171,7 +171,7 @@ var/global/Holiday = null
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
if(S.z != 1) continue
if(isNotStationLevel(S.z)) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/

View File

@@ -21,7 +21,7 @@
sleep(-1)
if(!blob_cores.len) break
var/obj/effect/blob/B = pick(blob_cores)
if(B.z != 1)
if(isNotStationLevel(B.z))
continue
B.Life()
spawn(30)

View File

@@ -911,9 +911,8 @@ ________________________________________________________________________________
U.drop_item()
return 0
/obj/item/clothing/suit/space/space_ninja/examine()
set src in view()
..()
/obj/item/clothing/suit/space/space_ninja/examine(mob/user)
..(user)
if(s_initialized)
var/mob/living/carbon/human/U = affecting
if(s_control)
@@ -1168,9 +1167,8 @@ ________________________________________________________________________________
U << "You <b>[candrain?"disable":"enable"]</b> special interaction."
candrain=!candrain
/obj/item/clothing/gloves/space_ninja/examine()
set src in view()
..()
/obj/item/clothing/gloves/space_ninja/examine(mob/user)
..(user)
if(!canremove)
var/mob/living/carbon/human/U = loc
U << "The energy drain mechanism is: <B>[candrain?"active":"inactive"]</B>."
@@ -1306,12 +1304,11 @@ ________________________________________________________________________________
var/mob/U = loc
U << "Switching mode to <B>[ninja_vision.mode]</B>."
/obj/item/clothing/mask/gas/voice/space_ninja/examine()
set src in view()
..()
/obj/item/clothing/mask/gas/voice/space_ninja/examine(mob/user)
..(user)
usr << "<B>[ninja_vision.mode]</B> is active."//Leaving usr here since it may be on the floor or on a person.
usr << "Voice mimicking algorithm is set <B>[!vchange?"inactive":"active"]</B>."
user << "<B>[ninja_vision.mode]</B> is active."
user << "Voice mimicking algorithm is set <B>[!vchange?"inactive":"active"]</B>."
/*
===================================================================================

View File

@@ -7,7 +7,7 @@
for(var/obj/machinery/power/smes/S in world)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || S.z != 1)
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
continue
S.last_charge = S.charge
S.last_output_attempt = S.output_attempt
@@ -20,7 +20,7 @@
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
if(C.cell && C.z in config.station_levels)
C.cell.charge = 0
/proc/power_restore(var/announce = 1)
@@ -29,11 +29,11 @@
if(announce)
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
if(C.cell && C.z in config.station_levels)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || S.z != 1)
if(current_area.type in skipped_areas || isNotStationLevel(S.z))
continue
S.charge = S.last_charge
S.output_attempt = S.last_output_attempt
@@ -46,10 +46,10 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
if(isNotStationLevel(S.z))
continue
S.charge = S.capacity
S.output_level = 200000
S.output_level = S.output_level_max
S.output_attempt = 1
S.input_attempt = 1
S.update_icon()

View File

@@ -2,7 +2,7 @@
spawn()
var/list/pick_turfs = list()
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
if(T.z in config.station_levels)
pick_turfs += T
if(pick_turfs.len)

View File

@@ -514,7 +514,7 @@ proc/get_nt_opposed()
obj_count++
/datum/game_mode/proc/printplayer(var/datum/mind/ply)
var/role = "\improper[ply.assigned_role]"
var/role = ply.assigned_role == "MODE" ? "\improper[ply.special_role]" : "\improper[ply.assigned_role]"
var/text = "<br><b>[ply.name]</b>(<b>[ply.key]</b>) as \a <b>[role]</b> ("
if(ply.current)
if(ply.current.stat == DEAD)
@@ -527,4 +527,16 @@ proc/get_nt_opposed()
text += "body destroyed"
text += ")"
var/TC_uses = 0
var/uplink_true = 0
var/purchases = ""
for(var/obj/item/device/uplink/H in world_uplinks)
if(H && H.uplink_owner && H.uplink_owner == ply)
TC_uses += H.used_TC
uplink_true = 1
for(var/log in H.purchase_log)
purchases += "<BIG>[log]</BIG>"
if(uplink_true)
text += " (used [TC_uses] TC) [purchases]"
return text

View File

@@ -201,7 +201,7 @@ var/global/datum/controller/gameticker/ticker
switch(M.z)
if(0) //inside a crate or something
var/turf/T = get_turf(M)
if(T && T.z==1) //we don't use M.death(0) because it calls a for(/mob) loop and
if(T && T.z in config.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and
M.health = 0
M.stat = DEAD
if(1) //on a z-level 1 turf.
@@ -261,7 +261,7 @@ var/global/datum/controller/gameticker/ticker
world << sound('sound/effects/explosionfar.ogg')
cinematic.icon_state = "summary_selfdes"
for(var/mob/living/M in living_mob_list)
if(M.loc.z == 1)
if(M.loc.z in config.station_levels)
M.death()//No mercy
//If its actually the end of the round, wait for it to end.
//Otherwise if its a verb it will continue on afterwards.
@@ -274,7 +274,7 @@ var/global/datum/controller/gameticker/ticker
proc/create_characters()
for(var/mob/new_player/player in player_list)
if(player.ready && player.mind)
if(player && player.ready && player.mind)
if(player.mind.assigned_role=="AI")
player.close_spawn_windows()
player.AIize()
@@ -382,11 +382,11 @@ var/global/datum/controller/gameticker/ticker
if(Player.stat != DEAD)
var/turf/playerTurf = get_turf(Player)
if(emergency_shuttle.departed && emergency_shuttle.evac)
if(playerTurf.z != 2)
if(isNotAdminLevel(playerTurf.z))
Player << "<font color='blue'><b>You managed to survive, but were marooned on [station_name()] as [Player.real_name]...</b></font>"
else
Player << "<font color='green'><b>You managed to survive the events on [station_name()] as [Player.real_name].</b></font>"
else if(playerTurf.z == 2)
else if(isAdminLevel(playerTurf.z))
Player << "<font color='green'><b>You successfully underwent crew transfer after events on [station_name()] as [Player.real_name].</b></font>"
else if(issilicon(Player))
Player << "<font color='green'><b>You remain operational after the events on [station_name()] as [Player.real_name].</b></font>"

View File

@@ -99,7 +99,7 @@
return
..()
/obj/machinery/emergency_authentication_device/examine()
usr << {"
/obj/machinery/emergency_authentication_device/examine(mob/user)
user << {"
This is a specialized communications device that is able to instantly send a message to <b>NanoTrasen High Command</b> via quantum entanglement with a sister device at CentCom.
The EAD's status is [get_status()]."}

View File

@@ -25,14 +25,14 @@
icon_state = "pinoff"
usr << "\blue You switch \the [src] off."
/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine()
/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine(mob/user)
switch(mode)
if (1)
usr << "Is is calibrated for the Captain's Authentication Key."
user << "Is is calibrated for the Captain's Authentication Key."
if (2)
usr << "It is calibrated for the Emergency Secondary Authentication Key."
user << "It is calibrated for the Emergency Secondary Authentication Key."
else
usr << "It is switched off."
user << "It is switched off."
/datum/supply_packs/key_pinpointer
name = "Authentication Key Pinpointer crate"

View File

@@ -1404,7 +1404,7 @@ datum
var/turf/T = get_turf(target.current)
if(target.current.stat == 2)
return 1
else if((T) && (T.z != 1))//If they leave the station they count as dead for this
else if((T) && (isNotStationLevel(T.z)))//If they leave the station they count as dead for this
return 2
else
return 0

View File

@@ -126,7 +126,7 @@ var/global/list/turf/synd_spawn = list()
var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
var/nuke_code = "[rand(10000, 99999)]"
var/leader_selected = 0
var/datum/mind/leader = null
var/spawnpos = 1
for(var/datum/mind/synd_mind in syndicates)
@@ -142,9 +142,9 @@ var/global/list/turf/synd_spawn = list()
greet_syndicate(synd_mind)
equip_syndicate(synd_mind.current)
if(!leader_selected)
if(!leader)
prepare_syndicate_leader(synd_mind, nuke_code)
leader_selected = 1
leader = synd_mind
spawnpos++
update_synd_icons_added(synd_mind)
@@ -153,6 +153,8 @@ var/global/list/turf/synd_spawn = list()
if(uplinkdevice)
var/obj/item/device/radio/uplink/U = new(uplinkdevice.loc)
if(leader)
U.hidden_uplink.uplink_owner = leader
U.hidden_uplink.uses = 40
if(nuke_spawn && synd_spawn.len > 0)
var/obj/machinery/nuclearbomb/the_bomb = new /obj/machinery/nuclearbomb(nuke_spawn.loc)
@@ -333,18 +335,7 @@ var/global/list/turf/synd_spawn = list()
var/text = "<FONT size = 2><B>The mercenaries were:</B></FONT>"
for(var/datum/mind/syndicate in syndicates)
text += "<br>[syndicate.key] was [syndicate.name] ("
if(syndicate.current)
if(syndicate.current.stat == DEAD)
text += "died"
else
text += "survived"
if(syndicate.current.real_name != syndicate.name)
text += " as [syndicate.current.real_name]"
else
text += "body destroyed"
text += ")"
text += printplayer(syndicate)
world << text
return 1

View File

@@ -396,7 +396,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
var/off_station = 0
var/turf/bomb_location = get_turf(src)
if( bomb_location && (bomb_location.z == 1) )
if(bomb_location && (bomb_location.z in config.station_levels))
if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) )
off_station = 1
else

View File

@@ -42,11 +42,11 @@
icon_state = "pinonfar"
spawn(5) .()
examine()
..()
examine(mob/user)
..(user)
for(var/obj/machinery/nuclearbomb/bomb in world)
if(bomb.timing)
usr << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
/obj/item/weapon/pinpointer/advpinpointer

View File

@@ -88,7 +88,7 @@ datum/objective/mutiny
if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey)
return 1
var/turf/T = get_turf(target.current)
if(T && (T.z != 1)) //If they leave the station they count as dead for this
if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this
return 2
return 0
return 1
@@ -123,7 +123,7 @@ datum/objective/mutiny/rp
if(target in ticker.mode:head_revolutionaries)
return 1
var/turf/T = get_turf(target.current)
if(T && (T.z != 1)) //If they leave the station they count as dead for this
if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this
rval = 2
return 0
return rval

View File

@@ -134,7 +134,7 @@
/datum/game_mode/anti_revolution/proc/check_crew_victory()
for(var/datum/mind/head_mind in heads)
var/turf/T = get_turf(head_mind.current)
if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z == 1) && !head_mind.is_brigged(600))
if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z in station_levels) && !head_mind.is_brigged(600))
if(ishuman(head_mind.current))
return 0
return 1

View File

@@ -337,7 +337,7 @@
/datum/game_mode/revolution/proc/check_heads_victory()
for(var/datum/mind/rev_mind in head_revolutionaries)
var/turf/T = get_turf(rev_mind.current)
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && T && (T.z == 1))
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && T && (T.z in config.station_levels))
if(ishuman(rev_mind.current))
return 0
return 1
@@ -367,7 +367,7 @@
if(headrev.current)
if(headrev.current.stat == DEAD)
text += "died"
else if(headrev.current.z != 1)
else if(isNotStationLevel(headrev.current.z))
text += "fled the station"
else
text += "survived the revolution"
@@ -390,7 +390,7 @@
if(rev.current)
if(rev.current.stat == DEAD)
text += "died"
else if(rev.current.z != 1)
else if(isNotStationLevel(rev.current.z))
text += "fled the station"
else
text += "survived the revolution"
@@ -415,7 +415,7 @@
if(head.current)
if(head.current.stat == DEAD)
text += "died"
else if(head.current.z != 1)
else if(isNotStationLevel(head.current.z))
text += "fled the station"
else
text += "survived the revolution"

View File

@@ -123,7 +123,7 @@
// probably wanna export this stuff into a separate function for use by both
// revs and heads
//assume that only carbon mobs can become rev heads for now
if(!rev_mind.current:handcuffed && T && T.z == 1)
if(!rev_mind.current:handcuffed && T && T.z in config.station_levels)
return 0
return 1

View File

@@ -273,6 +273,7 @@
freq = freqlist[rand(1, freqlist.len)]
var/obj/item/device/uplink/hidden/T = new(R)
T.uplink_owner = traitor_mob.mind
target_radio.hidden_uplink = T
target_radio.traitor_frequency = freq
traitor_mob << "A portable object teleportation relay has been installed in your [R.name] [loc]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features."
@@ -282,6 +283,7 @@
var/pda_pass = "[rand(100,999)] [pick("Alpha","Bravo","Delta","Omega")]"
var/obj/item/device/uplink/hidden/T = new(R)
T.uplink_owner = traitor_mob.mind
R.hidden_uplink = T
var/obj/item/device/pda/P = R
P.lock_code = pda_pass

View File

@@ -34,7 +34,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack)
captain_announcement.Announce("All hands, captain [H.real_name] on deck!")
var/sound/announce_sound = (ticker.current_state <= GAME_STATE_SETTING_UP)? null : sound('sound/misc/boatswain.ogg', volume=20)
captain_announcement.Announce("All hands, Captain [H.real_name] on deck!", new_sound=announce_sound)
H.implant_loyalty(src)

View File

@@ -18,6 +18,7 @@
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/bartender(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/pda/bar(H), slot_belt)
@@ -56,6 +57,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
@@ -85,6 +87,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/hydroponics(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/botanic_leather(H), slot_gloves)
@@ -286,6 +289,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt)

View File

@@ -70,4 +70,43 @@
if(!isnum(minimal_player_age))
return 0
return max(0, minimal_player_age - C.player_age)
return max(0, minimal_player_age - C.player_age)
/datum/job/proc/apply_fingerprints(var/mob/living/carbon/human/H)
if(!istype(H))
return
if(H.back)
H.back.add_fingerprint(H,1) //The 1 sets a flag to ignore gloves
for(var/obj/item/I in H.back.contents)
I.add_fingerprint(H,1)
if(H.wear_id)
H.wear_id.add_fingerprint(H,1)
if(H.w_uniform)
H.w_uniform.add_fingerprint(H,1)
if(H.wear_suit)
H.wear_suit.add_fingerprint(H,1)
if(H.wear_mask)
H.wear_mask.add_fingerprint(H,1)
if(H.head)
H.head.add_fingerprint(H,1)
if(H.shoes)
H.shoes.add_fingerprint(H,1)
if(H.gloves)
H.gloves.add_fingerprint(H,1)
if(H.l_ear)
H.l_ear.add_fingerprint(H,1)
if(H.r_ear)
H.r_ear.add_fingerprint(H,1)
if(H.glasses)
H.glasses.add_fingerprint(H,1)
if(H.belt)
H.belt.add_fingerprint(H,1)
for(var/obj/item/I in H.belt.contents)
I.add_fingerprint(H,1)
if(H.s_store)
H.s_store.add_fingerprint(H,1)
if(H.l_store)
H.l_store.add_fingerprint(H,1)
if(H.r_store)
H.r_store.add_fingerprint(H,1)
return 1

View File

@@ -341,6 +341,7 @@ var/global/datum/controller/occupations/job_master
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
player.ready = 0
player.new_player_panel_proc()
unassigned -= player
return 1
@@ -385,6 +386,7 @@ var/global/datum/controller/occupations/job_master
//Equip job items.
job.equip(H)
job.apply_fingerprints(H)
else
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."

View File

@@ -2,32 +2,6 @@
//CONTAINS: Air Alarms and Fire Alarms//
////////////////////////////////////////
/proc/RandomAAlarmWires()
//to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
var/list/AAlarmwires = list(0, 0, 0, 0, 0)
AAlarmIndexToFlag = list(0, 0, 0, 0, 0)
AAlarmIndexToWireColor = list(0, 0, 0, 0, 0)
AAlarmWireColorToIndex = list(0, 0, 0, 0, 0)
var/flagIndex = 1
for (var/flag=1, flag<32, flag+=flag)
var/valid = 0
while (!valid)
var/colorIndex = rand(1, 5)
if (AAlarmwires[colorIndex]==0)
valid = 1
AAlarmwires[colorIndex] = flag
AAlarmIndexToFlag[flagIndex] = flag
AAlarmIndexToWireColor[flagIndex] = colorIndex
AAlarmWireColorToIndex[colorIndex] = flagIndex
flagIndex+=1
return AAlarmwires
#define AALARM_WIRE_IDSCAN 1 //Added wires
#define AALARM_WIRE_POWER 2
#define AALARM_WIRE_SYPHON 3
#define AALARM_WIRE_AI_CONTROL 4
#define AALARM_WIRE_AALARM 5
#define AALARM_MODE_SCRUBBING 1
#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster.
#define AALARM_MODE_PANIC 3 //constantly sucks all air
@@ -79,9 +53,10 @@
var/locked = 1
var/wiresexposed = 0 // If it's been screwdrivered open.
var/aidisabled = 0
var/AAlarmwires = 31
var/shorted = 0
var/datum/wires/alarm/wires
var/mode = AALARM_MODE_SCRUBBING
var/screen = AALARM_SCREEN_MAIN
var/area_uid
@@ -153,6 +128,9 @@
if (name == "alarm")
name = "[alarm_area.name] Air Alarm"
if(!wires)
wires = new(src)
// breathable air according to human/Life()
TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
@@ -482,125 +460,6 @@
frequency.post_signal(src, alert_signal)
///////////
//HACKING//
///////////
/obj/machinery/alarm/proc/isWireColorCut(var/wireColor)
var/wireFlag = AAlarmWireColorToFlag[wireColor]
return ((AAlarmwires & wireFlag) == 0)
/obj/machinery/alarm/proc/isWireCut(var/wireIndex)
var/wireFlag = AAlarmIndexToFlag[wireIndex]
return ((AAlarmwires & wireFlag) == 0)
/obj/machinery/alarm/proc/allWiresCut()
var/i = 1
while(i<=5)
if(AAlarmwires & AAlarmIndexToFlag[i])
return 0
i++
return 1
/obj/machinery/alarm/proc/cut(var/wireColor)
var/wireFlag = AAlarmWireColorToFlag[wireColor]
var/wireIndex = AAlarmWireColorToIndex[wireColor]
AAlarmwires &= ~wireFlag
switch(wireIndex)
if(AALARM_WIRE_IDSCAN)
locked = 1
if(AALARM_WIRE_POWER)
shock(usr, 50)
shorted = 1
update_icon()
if (AALARM_WIRE_AI_CONTROL)
if (aidisabled == 0)
aidisabled = 1
if(AALARM_WIRE_SYPHON)
mode = AALARM_MODE_PANIC
apply_mode()
if(AALARM_WIRE_AALARM)
if (alarm_area.atmosalert(2))
apply_danger_level(2)
spawn(1)
updateUsrDialog()
update_icon()
updateDialog()
return
/obj/machinery/alarm/proc/mend(var/wireColor)
var/wireFlag = AAlarmWireColorToFlag[wireColor]
var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function
AAlarmwires |= wireFlag
switch(wireIndex)
if(AALARM_WIRE_IDSCAN)
if(AALARM_WIRE_POWER)
shorted = 0
shock(usr, 50)
update_icon()
if(AALARM_WIRE_AI_CONTROL)
if (aidisabled == 1)
aidisabled = 0
updateDialog()
return
/obj/machinery/alarm/proc/pulse(var/wireColor)
//var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function
var/wireIndex = AAlarmWireColorToIndex[wireColor]
switch(wireIndex)
if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears
locked = 0
spawn(300)
locked = 1
if (AALARM_WIRE_POWER)
if(shorted == 0)
shorted = 1
update_icon()
spawn(1200)
if(shorted == 1)
shorted = 0
update_icon()
if (AALARM_WIRE_AI_CONTROL)
if (aidisabled == 0)
aidisabled = 1
updateDialog()
spawn(10)
if (aidisabled == 1)
aidisabled = 0
updateDialog()
if(AALARM_WIRE_SYPHON)
mode = AALARM_MODE_REPLACEMENT
apply_mode()
if(AALARM_WIRE_AALARM)
if (alarm_area.atmosalert(0))
apply_danger_level(0)
spawn(1)
updateUsrDialog()
update_icon()
updateDialog()
return
///////////////
//END HACKING//
///////////////
/obj/machinery/alarm/attack_ai(mob/user)
return interact(user)
@@ -616,7 +475,7 @@
if(buildstage!=2)
return
if ( (get_dist(src, user) > 1 ))
if((get_dist(src, user) > 1 ))
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=air_alarm")
@@ -629,30 +488,8 @@
user << browse(null, "window=air_alarm")
return
if(wiresexposed && (!istype(user, /mob/living/silicon)))
var/t1 = text("<html><head><title>[alarm_area.name] Air Alarm Wires</title></head><body><B>Access Panel</B><br>\n")
var/list/wirecolors = list(
"Orange" = 1,
"Dark red" = 2,
"White" = 3,
"Yellow" = 4,
"Black" = 5,
)
for(var/wiredesc in wirecolors)
var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[wirecolors[wiredesc]]
t1 += "[wiredesc] wire: "
if(!is_uncut)
t1 += "<a href='?src=\ref[src];AAlarmwires=[wirecolors[wiredesc]]'>Mend</a>"
else
t1 += "<a href='?src=\ref[src];AAlarmwires=[wirecolors[wiredesc]]'>Cut</a> "
t1 += "<a href='?src=\ref[src];pulse=[wirecolors[wiredesc]]'>Pulse</a> "
t1 += "<br>"
t1 += text("<br>\n[(locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]<br>\n[((shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]<br>\n[(aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
t1 += text("<p><a href='?src=\ref[src];close2=1'>Close</a></p></body></html>")
user << browse(t1, "window=AAlarmwires")
onclose(user, "AAlarmwires")
if(wiresexposed && (!istype(user, /mob/living/silicon/ai)))
wires.Interact(user)
if(!shorted)
user << browse(return_text(user),"window=air_alarm")
@@ -1055,35 +892,6 @@ table tr:first-child th:first-child { border: none;}
mode = text2num(href_list["mode"])
apply_mode()
// hrefs that need the AA wires exposed, note that borgs should be in range here too -walter0o
if(wiresexposed && Adjacent(usr))
if (href_list["AAlarmwires"])
var/t1 = text2num(href_list["AAlarmwires"])
if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if (isWireColorCut(t1))
mend(t1)
else
cut(t1)
if (AAlarmwires == 0)
usr << "<span class='notice'>You cut last of wires inside [src]</span>"
update_icon()
buildstage = 1
return
else if (href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.equipped(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if (isWireColorCut(t1))
usr << "You can't pulse a cut wire."
return
else
pulse(t1)
updateUsrDialog()
@@ -1115,7 +923,7 @@ table tr:first-child th:first-child { border: none;}
user << "It does nothing"
return
else
if(allowed(usr) && !isWireCut(AALARM_WIRE_IDSCAN))
if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
locked = !locked
user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface."
updateUsrDialog()
@@ -1168,12 +976,12 @@ table tr:first-child th:first-child { border: none;}
spawn(rand(0,15))
update_icon()
/obj/machinery/alarm/examine()
..()
/obj/machinery/alarm/examine(mob/user)
..(user)
if (buildstage < 2)
usr << "It is not wired."
user << "It is not wired."
if (buildstage < 1)
usr << "The circuit is missing."
user << "The circuit is missing."
/*
AIR ALARM CIRCUIT
Just a object used in constructing air alarms
@@ -1489,7 +1297,8 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
if(z == 1 || z == 5)
/obj/machinery/firealarm/initialize()
if(z in config.contact_levels)
if(security_level)
src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
else

View File

@@ -65,10 +65,10 @@
)
radio_connection.post_signal(src, signal)
/obj/machinery/meter/examine()
/obj/machinery/meter/examine(mob/user)
var/t = "A gas flow meter. "
if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead)))
if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/dead)))
t += "\blue <B>You are too far away to read it.</B>"
else if(stat & (NOPOWER|BROKEN))
@@ -83,12 +83,12 @@
else
t += "The connect error light is blinking."
usr << t
user << t
/obj/machinery/meter/Click()
if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine
examine()
usr.examinate(src)
return 1
return ..()

View File

@@ -43,14 +43,13 @@
emagged = 2
log_and_message_admins("emagged [src]'s inner circuits")
/obj/machinery/bot/examine()
set src in view()
..()
/obj/machinery/bot/examine(mob/user)
..(user)
if (src.health < maxhealth)
if (src.health > maxhealth/3)
usr << "<span class='warning'>[src]'s parts look loose.</span>"
user << "<span class='warning'>[src]'s parts look loose.</span>"
else
usr << "<span class='danger'>[src]'s parts look very loose!</span>"
user << "<span class='danger'>[src]'s parts look very loose!</span>"
return
/obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob)

View File

@@ -93,7 +93,6 @@
suffix = "#[count]"
name = "Mulebot ([suffix])"
verbs -= /atom/movable/verb/pull
// set up the wire colours in random order

View File

@@ -19,11 +19,7 @@
var/obj/item/weapon/camera_assembly/assembly = null
// WIRES
var/wires = 63 // 0b111111
var/list/IndexToFlag = list()
var/list/IndexToWireColor = list()
var/list/WireColorToIndex = list()
var/list/WireColorToFlag = list()
var/datum/wires/camera/wires = null // Wires datum
//OTHER
@@ -35,7 +31,7 @@
var/busy = 0
/obj/machinery/camera/New()
WireColorToFlag = randomCameraWires()
wires = new(src)
assembly = new(src)
assembly.state = 4
/* // Use this to look for cameras that have the same c_tag.
@@ -115,7 +111,7 @@
else if((iswirecutter(W) || ismultitool(W)) && panel_open)
interact(user)
else if(iswelder(W) && canDeconstruct())
else if(iswelder(W) && wires.CanDeconstruct())
if(weld(W, user))
if(assembly)
assembly.loc = src.loc
@@ -283,4 +279,11 @@
return 0
return 1
busy = 0
return 0
return 0
/obj/machinery/camera/interact(mob/living/user as mob)
if(!panel_open || istype(user, /mob/living/silicon/ai))
return
user.set_machine(src)
wires.Interact(user)

View File

@@ -1,169 +0,0 @@
#define CAMERA_WIRE_FOCUS 1
#define CAMERA_WIRE_POWER 2
#define CAMERA_WIRE_LIGHT 3
#define CAMERA_WIRE_ALARM 4
#define CAMERA_WIRE_NOTHING1 5
#define CAMERA_WIRE_NOTHING2 6
/obj/machinery/camera/proc/randomCameraWires()
//to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
var/list/wires = list(0, 0, 0, 0, 0, 0)
IndexToFlag = list(0, 0, 0, 0, 0, 0)
IndexToWireColor = list(0, 0, 0, 0, 0, 0)
WireColorToIndex = list(0, 0, 0, 0, 0, 0)
var/flagIndex = 1
//I think it's easier to read this way, also doesn't rely on the random number generator to land on a new wire.
var/list/colorIndexList = list(CAMERA_WIRE_FOCUS, CAMERA_WIRE_POWER, CAMERA_WIRE_LIGHT, CAMERA_WIRE_ALARM, CAMERA_WIRE_NOTHING1, CAMERA_WIRE_NOTHING2)
for (var/flag=1, flag<=32, flag+=flag)
var/colorIndex = pick(colorIndexList)
if (wires[colorIndex]==0)
wires[colorIndex] = flag
IndexToFlag[flagIndex] = flag
IndexToWireColor[flagIndex] = colorIndex
WireColorToIndex[colorIndex] = flagIndex
colorIndexList -= colorIndex // Shortens the list.
//world.log << "Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]"
flagIndex+=1
return wires
/obj/machinery/camera/proc/isWireColorCut(var/wireColor)
var/wireFlag = WireColorToFlag[wireColor]
return ((src.wires & wireFlag) == 0)
/obj/machinery/camera/proc/isWireCut(var/wireIndex)
var/wireFlag = IndexToFlag[wireIndex]
return ((src.wires & wireFlag) == 0)
/obj/machinery/camera/proc/canDeconstruct()
if(isWireCut(CAMERA_WIRE_POWER) && isWireCut(CAMERA_WIRE_FOCUS) && isWireCut(CAMERA_WIRE_LIGHT) && isWireCut(CAMERA_WIRE_NOTHING1) && isWireCut(CAMERA_WIRE_NOTHING2))
return 1
else
return 0
/obj/machinery/camera/proc/cut(var/wireColor)
var/wireFlag = WireColorToFlag[wireColor]
var/wireIndex = WireColorToIndex[wireColor]
wires &= ~wireFlag
switch(wireIndex)
if(CAMERA_WIRE_FOCUS)
setViewRange(short_range)
if(CAMERA_WIRE_POWER)
deactivate(usr, 1)
if(CAMERA_WIRE_LIGHT)
light_disabled = 1
if(CAMERA_WIRE_ALARM)
triggerCameraAlarm()
src.interact(usr)
/obj/machinery/camera/proc/mend(var/wireColor)
var/wireFlag = WireColorToFlag[wireColor]
var/wireIndex = WireColorToIndex[wireColor]
wires |= wireFlag
switch(wireIndex)
if(CAMERA_WIRE_FOCUS)
setViewRange(initial(view_range))
if(CAMERA_WIRE_POWER)
deactivate(usr, 1)
if(CAMERA_WIRE_LIGHT)
light_disabled = 0
if(CAMERA_WIRE_ALARM)
cancelCameraAlarm()
src.interact(usr)
/obj/machinery/camera/proc/pulse(var/wireColor)
var/wireIndex = WireColorToIndex[wireColor]
switch(wireIndex)
if(CAMERA_WIRE_FOCUS)
var/new_range = (view_range == initial(view_range) ? short_range : initial(view_range))
setViewRange(new_range)
if(CAMERA_WIRE_POWER)
deactivate(usr, 0) // Kicks anyone watching the camera
if(CAMERA_WIRE_LIGHT)
light_disabled = !light_disabled
if(CAMERA_WIRE_ALARM)
src.visible_message("\icon[src] *beep*", "\icon[src] *beep*")
src.interact(usr)
/obj/machinery/camera/interact(mob/living/user as mob)
if(!panel_open)
return
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
var/list/wires = list(
"Orange" = 1,
"Dark red" = 2,
"White" = 3,
"Yellow" = 4,
"Blue" = 5,
"Pink" = 6
)
for(var/wiredesc in wires)
var/is_uncut = src.wires & WireColorToFlag[wires[wiredesc]]
t1 += "[wiredesc] wire: "
if(!is_uncut)
t1 += "<a href='?src=\ref[src];wires=[wires[wiredesc]]'>Mend</a>"
else
t1 += "<a href='?src=\ref[src];wires=[wires[wiredesc]]'>Cut</a> "
t1 += "<a href='?src=\ref[src];pulse=[wires[wiredesc]]'>Pulse</a> "
t1 += "<br>"
t1 += "<br>\n[(src.view_range == initial(view_range) ? "The focus light is on." : "The focus light is off.")]"
t1 += "<br>\n[(src.can_use() ? "The power link light is on." : "The power link light is off.")]"
t1 += "<br>\n[(light_disabled ? "The camera light is off." : "The camera light is on.")]"
t1 += "<br>\n[(alarm_on ? "The alarm light is on." : "The alarm light is off.")]"
t1 += "<p><a href='?src=\ref[src];close2=1'>Close</a></p>\n"
user << browse(t1, "window=wires")
onclose(user, "wires")
/obj/machinery/camera/Topic(href, href_list)
..()
if (in_range(src, usr) && istype(src.loc, /turf))
usr.set_machine(src)
if (href_list["wires"])
var/t1 = text2num(href_list["wires"])
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if (src.isWireColorCut(t1))
src.mend(t1)
else
src.cut(t1)
else if (href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if (src.isWireColorCut(t1))
usr << "You can't pulse a cut wire."
return
else
src.pulse(t1)
else if (href_list["close2"])
usr << browse(null, "window=wires")
usr.unset_machine()
return
#undef CAMERA_WIRE_FOCUS
#undef CAMERA_WIRE_POWER
#undef CAMERA_WIRE_LIGHT
#undef CAMERA_WIRE_ALARM
#undef CAMERA_WIRE_NOTHING1
#undef CAMERA_WIRE_NOTHING2

View File

@@ -28,12 +28,13 @@
else
overlays.Cut()
/obj/machinery/cell_charger/examine()
set src in oview(5)
..()
usr << "There's [charging ? "a" : "no"] cell in the charger."
/obj/machinery/cell_charger/examine(mob/user)
if(!..(user, 5))
return
user << "There's [charging ? "a" : "no"] cell in the charger."
if(charging)
usr << "Current charge: [charging.charge]"
user << "Current charge: [charging.charge]"
/obj/machinery/cell_charger/attackby(obj/item/weapon/W, mob/user)
if(stat & BROKEN)

View File

@@ -96,10 +96,9 @@
src.read_only = !src.read_only
user << "You flip the write-protect tab to [src.read_only ? "protected" : "unprotected"]."
/obj/item/weapon/disk/data/examine()
set src in oview(5)
..()
usr << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].")
/obj/item/weapon/disk/data/examine(mob/user)
..(user)
user << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].")
return
//Health Tracker Implant

View File

@@ -36,7 +36,7 @@
if (src.occupant)
var/laws
dat += "Stored AI: [src.occupant.name]<br>System integrity: [(src.occupant.health+100)/2]%<br>"
dat += "Stored AI: [src.occupant.name]<br>System integrity: [src.occupant.system_integrity()]%<br>"
for (var/law in occupant.laws.ion)
if(law)

View File

@@ -49,7 +49,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
if(M.z == 1 && !istype(M.loc, /turf/space))
if(M.z in config.station_levels && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
if(T.malfunction)

View File

@@ -288,9 +288,9 @@ obj/item/weapon/circuitboard/rdserver
user.visible_message("\blue \The [user] adjusts the jumper on the [src]'s port configuration pins.", "\blue You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].")
return
/obj/item/weapon/circuitboard/unary_atmos/examine()
..()
usr << "The jumper is connecting the [dir2text(machine_dir)] pins."
/obj/item/weapon/circuitboard/unary_atmos/examine(mob/user)
..(user)
user << "The jumper is connecting the [dir2text(machine_dir)] pins."
/obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U)
//TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up.

View File

@@ -1,76 +1,3 @@
#define AIRLOCK_WIRE_IDSCAN 1
#define AIRLOCK_WIRE_MAIN_POWER1 2
#define AIRLOCK_WIRE_MAIN_POWER2 3
#define AIRLOCK_WIRE_DOOR_BOLTS 4
#define AIRLOCK_WIRE_BACKUP_POWER1 5
#define AIRLOCK_WIRE_BACKUP_POWER2 6
#define AIRLOCK_WIRE_OPEN_DOOR 7
#define AIRLOCK_WIRE_AI_CONTROL 8
#define AIRLOCK_WIRE_ELECTRIFY 9
#define AIRLOCK_WIRE_SAFETY 10
#define AIRLOCK_WIRE_SPEED 11
#define AIRLOCK_WIRE_LIGHT 12
/*
New methods:
pulse - sends a pulse into a wire for hacking purposes
cut - cuts a wire and makes any necessary state changes
mend - mends a wire and makes any necessary state changes
isWireColorCut - returns 1 if that color wire is cut, or 0 if not
isWireCut - returns 1 if that wire (e.g. AIRLOCK_WIRE_DOOR_BOLTS) is cut, or 0 if not
canAIControl - 1 if the AI can control the airlock, 0 if not (then check canAIHack to see if it can hack in)
canAIHack - 1 if the AI can hack into the airlock to recover control, 0 if not. Also returns 0 if the AI does not *need* to hack it.
arePowerSystemsOn - 1 if the main or backup power are functioning, 0 if not. Does not check whether the power grid is charged or an APC has equipment on or anything like that. (Check (stat & NOPOWER) for that)
requiresIDs - 1 if the airlock is requiring IDs, 0 if not
isAllPowerCut - 1 if the main and backup power both have cut wires.
regainMainPower - handles the effect of main power coming back on.
loseMainPower - handles the effect of main power going offline. Usually (if one isn't already running) spawn a thread to count down how long it will be offline - counting down won't happen if main power was completely cut along with backup power, though, the thread will just sleep.
loseBackupPower - handles the effect of backup power going offline.
regainBackupPower - handles the effect of main power coming back on.
shock - has a chance of electrocuting its target.
*/
//This generates the randomized airlock wire assignments for the game.
/proc/RandomAirlockWires()
var/list/wire_assignments = CreateRandomAirlockWires()
globalAirlockIndexToFlag = wire_assignments[2]
globalAirlockIndexToWireColor = wire_assignments[3]
globalAirlockWireColorToIndex = wire_assignments[4]
return wire_assignments[1]
/proc/CreateRandomAirlockWires()
//to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
var/list/wires = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var/airlockIndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var/airlockIndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var/airlockWireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var/flagIndex = 1
for (var/flag=1, flag<4096, flag+=flag)
var/valid = 0
var/list/colorList = list(AIRLOCK_WIRE_IDSCAN, AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2, AIRLOCK_WIRE_DOOR_BOLTS,
AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2, AIRLOCK_WIRE_OPEN_DOOR, AIRLOCK_WIRE_AI_CONTROL, AIRLOCK_WIRE_ELECTRIFY,
AIRLOCK_WIRE_SAFETY, AIRLOCK_WIRE_SPEED, AIRLOCK_WIRE_LIGHT)
while (!valid)
var/colorIndex = pick(colorList)
if(wires[colorIndex]==0)
valid = 1
wires[colorIndex] = flag
airlockIndexToFlag[flagIndex] = flag
airlockIndexToWireColor[flagIndex] = colorIndex
airlockWireColorToIndex[colorIndex] = flagIndex
colorList -= colorIndex
flagIndex+=1
return list(wires, airlockIndexToFlag, airlockIndexToWireColor, airlockWireColorToIndex)
/* Example:
Airlock wires color -> flag are { 64, 128, 256, 2, 16, 4, 8, 32, 1 }.
Airlock wires color -> index are { 7, 8, 9, 2, 5, 3, 4, 6, 1 }.
Airlock index -> flag are { 1, 2, 4, 8, 16, 32, 64, 128, 256 }.
Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
*/
/obj/machinery/door/airlock
name = "Airlock"
icon = 'icons/obj/doors/Doorint.dmi'
@@ -86,13 +13,11 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
var/welded = null
var/locked = 0
var/lights = 1 // bolt lights show by default
var/wires = 4095
secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it.
var/aiDisabledIdScanner = 0
var/aiHacking = 0
var/obj/machinery/door/airlock/closeOther = null
var/closeOtherId = null
var/list/signalers[12]
var/lockdownbyai = 0
autoclose = 1
var/assembly_type = /obj/structure/door_assembly
@@ -103,10 +28,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
var/obj/item/weapon/airlock_electronics/electronics = null
var/hasShocked = 0 //Prevents multiple shocks from happening
var/secured_wires = 0 //for mapping use
var/list/airlockIndexToFlag
var/list/airlockWireColorToFlag
var/list/airlockIndexToWireColor
var/list/airlockWireColorToIndex
var/security_bolts = 0 //if 1, door bolts when broken
var/datum/wires/airlock/wires = null
/obj/machinery/door/airlock/command
name = "Airlock"
@@ -141,6 +64,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
glass = 1
@@ -153,6 +78,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
name = "Vault"
icon = 'icons/obj/doors/vault.dmi'
opacity = 1
security_bolts = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites.
/obj/machinery/door/airlock/freezer
@@ -176,6 +102,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_command
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorcomglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_com
glass = 1
@@ -183,6 +111,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_engineering
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorengglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_eng
glass = 1
@@ -190,6 +120,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_security
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorsecglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_sec
glass = 1
@@ -197,6 +129,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_medical
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doormedglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_med
glass = 1
@@ -219,6 +153,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_research
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorresearchglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_research
glass = 1
@@ -227,6 +163,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_mining
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorminingglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_min
glass = 1
@@ -234,6 +172,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/glass_atmos
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Dooratmoglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_atmo
glass = 1
@@ -321,6 +261,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
/obj/machinery/door/airlock/highsecurity
name = "High Tech Security Airlock"
icon = 'icons/obj/doors/hightechsecurity.dmi'
security_bolts = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity
/*
@@ -360,176 +301,14 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/bumpopen(mob/living/simple_animal/user as mob)
..(user)
/obj/machinery/door/airlock/proc/pulse(var/wireColor)
//var/wireFlag = airlockWireColorToFlag[wireColor] //not used in this function
var/wireIndex = airlockWireColorToIndex[wireColor]
switch(wireIndex)
if(AIRLOCK_WIRE_IDSCAN)
//Sending a pulse through this flashes the red light on the door (if the door has power).
if((src.arePowerSystemsOn()) && (!(stat & NOPOWER)))
do_animate("deny")
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
//Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter).
src.loseMainPower()
if(AIRLOCK_WIRE_DOOR_BOLTS)
//one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not),
//raises them if they are down (only if power's on)
if(!src.locked)
src.lock()
else
src.unlock()
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
//two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
src.loseBackupPower()
if(AIRLOCK_WIRE_AI_CONTROL)
if(src.aiControlDisabled == 0)
src.aiControlDisabled = 1
else if(src.aiControlDisabled == -1)
src.aiControlDisabled = 2
src.updateDialog()
spawn(10)
if(src.aiControlDisabled == 1)
src.aiControlDisabled = 0
else if(src.aiControlDisabled == 2)
src.aiControlDisabled = -1
src.updateDialog()
if(AIRLOCK_WIRE_ELECTRIFY)
//one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.
if(src.secondsElectrified==0)
shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Electrified the [name] at [x] [y] [z]</font>")
src.secondsElectrified = 30
spawn(10)
//TODO: Move this into process() and make pulsing reset secondsElectrified to 30
while (src.secondsElectrified>0)
src.secondsElectrified-=1
if(src.secondsElectrified<0)
src.secondsElectrified = 0
// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite
sleep(10)
if(AIRLOCK_WIRE_OPEN_DOOR)
//tries to open the door without ID
//will succeed only if the ID wire is cut or the door requires no access
if(!src.requiresID() || src.check_access(null))
if(density) open()
else close()
if(AIRLOCK_WIRE_SAFETY)
safe = !safe
if(!src.density)
close()
src.updateUsrDialog()
if(AIRLOCK_WIRE_SPEED)
normalspeed = !normalspeed
src.updateUsrDialog()
if(AIRLOCK_WIRE_LIGHT)
lights = !lights
src.updateUsrDialog()
/obj/machinery/door/airlock/proc/cut(var/wireColor)
var/wireFlag = airlockWireColorToFlag[wireColor]
var/wireIndex = airlockWireColorToIndex[wireColor]
wires &= ~wireFlag
switch(wireIndex)
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
//Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user.
src.loseMainPower()
src.shock(usr, 50)
src.updateUsrDialog()
if(AIRLOCK_WIRE_DOOR_BOLTS)
//Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present)
src.lock()
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
//Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user.
src.loseBackupPower()
src.shock(usr, 50)
src.updateUsrDialog()
if(AIRLOCK_WIRE_AI_CONTROL)
//one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
//aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
if(src.aiControlDisabled == 0)
src.aiControlDisabled = 1
else if(src.aiControlDisabled == -1)
src.aiControlDisabled = 2
src.updateUsrDialog()
if(AIRLOCK_WIRE_ELECTRIFY)
//Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted.
if(src.secondsElectrified != -1)
shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Electrified the [name] at [x] [y] [z]</font>")
src.secondsElectrified = -1
if (AIRLOCK_WIRE_SAFETY)
safe = 0
src.updateUsrDialog()
if(AIRLOCK_WIRE_SPEED)
autoclose = 0
src.updateUsrDialog()
if(AIRLOCK_WIRE_LIGHT)
lights = 0
src.updateUsrDialog()
/obj/machinery/door/airlock/proc/mend(var/wireColor)
var/wireFlag = airlockWireColorToFlag[wireColor]
var/wireIndex = airlockWireColorToIndex[wireColor] //not used in this function
wires |= wireFlag
switch(wireIndex)
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
src.regainMainPower()
src.shock(usr, 50)
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)))
src.regainBackupPower()
src.shock(usr, 50)
src.updateUsrDialog()
if(AIRLOCK_WIRE_AI_CONTROL)
//one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
//aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
if(src.aiControlDisabled == 1)
src.aiControlDisabled = 0
else if(src.aiControlDisabled == 2)
src.aiControlDisabled = -1
src.updateUsrDialog()
if(AIRLOCK_WIRE_ELECTRIFY)
if(src.secondsElectrified == -1)
src.secondsElectrified = 0
if (AIRLOCK_WIRE_SAFETY)
safe = 1
src.updateUsrDialog()
if(AIRLOCK_WIRE_SPEED)
autoclose = 1
if(!src.density)
close()
src.updateUsrDialog()
if(AIRLOCK_WIRE_LIGHT)
lights = 1
src.updateUsrDialog()
/obj/machinery/door/airlock/proc/isElectrified()
if(src.secondsElectrified != 0)
return 1
return 0
/obj/machinery/door/airlock/proc/isWireColorCut(var/wireColor)
var/wireFlag = airlockWireColorToFlag[wireColor]
return ((src.wires & wireFlag) == 0)
/obj/machinery/door/airlock/proc/isWireCut(var/wireIndex)
var/wireFlag = airlockIndexToFlag[wireIndex]
return ((src.wires & wireFlag) == 0)
// You can find the wires in the datum folder.
return wires.IsIndexCut(wireIndex)
/obj/machinery/door/airlock/proc/canAIControl()
return ((src.aiControlDisabled!=1) && (!src.isAllPowerLoss()));
@@ -546,7 +325,7 @@ About the new airlock wires panel:
return !(src.isWireCut(AIRLOCK_WIRE_IDSCAN) || aiDisabledIdScanner)
/obj/machinery/door/airlock/proc/isAllPowerLoss()
if(stat & NOPOWER)
if(stat & (NOPOWER|BROKEN))
return 1
if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) || src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))
if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) || src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))
@@ -619,10 +398,19 @@ About the new airlock wires panel:
overlays = list()
if(p_open)
overlays += image(icon, "panel_open")
if (!(stat & NOPOWER))
if(stat & BROKEN)
overlays += image(icon, "sparks_broken")
else if (health < maxhealth * 3/4)
overlays += image(icon, "sparks_damaged")
if(welded)
overlays += image(icon, "welded")
else if (health < maxhealth * 3/4 && !(stat & NOPOWER))
overlays += image(icon, "sparks_damaged")
else
icon_state = "door_open"
if((stat & BROKEN) && !(stat & NOPOWER))
overlays += image(icon, "sparks_open")
return
@@ -633,19 +421,24 @@ About the new airlock wires panel:
if(p_open)
spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond.
flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking
update_icon()
else
flick("door_opening", src)
flick("door_opening", src)//[stat ? "_stat":]
update_icon()
if("closing")
if(overlays) overlays.Cut()
if(p_open)
flick("o_door_closing", src)
spawn(2)
flick("o_door_closing", src)
update_icon()
else
flick("door_closing", src)
update_icon()
if("spark")
if(density)
flick("door_spark", src)
if("deny")
if(density)
if(density && !(stat & (BROKEN|NOPOWER)))
flick("door_deny", src)
return
@@ -808,7 +601,7 @@ About the new airlock wires panel:
if (src.isElectrified())
if (istype(mover, /obj/item))
var/obj/item/i = mover
if (i.matter["metal"])
if (i.matter && ("metal" in i.matter) && i.matter["metal"] > 0)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
@@ -842,44 +635,7 @@ About the new airlock wires panel:
if(src.p_open)
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
//t1 += text("[]: ", airlockFeatureNames[airlockWireColorToIndex[9]])
var/list/wires = list(
"Orange" = 1,
"Dark red" = 2,
"White" = 3,
"Yellow" = 4,
"Red" = 5,
"Blue" = 6,
"Green" = 7,
"Grey" = 8,
"Black" = 9,
"Gold" = 10,
"Aqua" = 11,
"Pink" = 12
)
for(var/wiredesc in wires)
var/is_uncut = src.wires & airlockWireColorToFlag[wires[wiredesc]]
t1 += "[wiredesc] wire: "
if(!is_uncut)
t1 += "<a href='?src=\ref[src];wires=[wires[wiredesc]]'>Mend</a>"
else
t1 += "<a href='?src=\ref[src];wires=[wires[wiredesc]]'>Cut</a> "
t1 += "<a href='?src=\ref[src];pulse=[wires[wiredesc]]'>Pulse</a> "
if(src.signalers[wires[wiredesc]])
t1 += "<a href='?src=\ref[src];remove-signaler=[wires[wiredesc]]'>Detach signaler</a>"
else
t1 += "<a href='?src=\ref[src];signaler=[wires[wiredesc]]'>Attach signaler</a>"
t1 += "<br>"
t1 += text("<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]", (src.locked ? "The door bolts have fallen!" : "The door bolts look up."), (src.lights ? "The door bolt lights are on." : "The door bolt lights are off!"), ((src.arePowerSystemsOn()) ? "The test light is on." : "The test light is off!"), (src.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), (src.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), (src.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."))
t1 += text("<p><a href='?src=\ref[];close=1'>Close</a></p>\n", src)
user << browse(t1, "window=airlock")
onclose(user, "airlock")
wires.Interact(user)
else
..(user)
return
@@ -900,69 +656,21 @@ About the new airlock wires panel:
return 1
/obj/machinery/door/airlock/Topic(href, href_list, var/nowindow = 0)
if(!nowindow)
..()
if(usr.stat || usr.restrained()|| usr.small)
return
add_fingerprint(usr)
if(..())
return 1
if(href_list["close"])
usr << browse(null, "window=airlock")
if(usr.machine==src)
usr.unset_machine()
return
return 1
if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open)
usr.set_machine(src)
if(href_list["wires"])
var/t1 = text2num(href_list["wires"])
if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if(src.isWireColorCut(t1))
src.mend(t1)
else
src.cut(t1)
else if(href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if(src.isWireColorCut(t1))
usr << "You can't pulse a cut wire."
return
else
src.pulse(t1)
else if(href_list["signaler"])
var/wirenum = text2num(href_list["signaler"])
if(!istype(usr.get_active_hand(), /obj/item/device/assembly/signaler))
usr << "You need a signaller!"
return
if(src.isWireColorCut(wirenum))
usr << "You can't attach a signaller to a cut wire."
return
var/obj/item/device/assembly/signaler/R = usr.get_active_hand()
if(R.secured)
usr << "This radio can't be attached!"
return
var/mob/M = usr
M.drop_item()
R.loc = src
R.airlock_wire = wirenum
src.signalers[wirenum] = R
else if(href_list["remove-signaler"])
var/wirenum = text2num(href_list["remove-signaler"])
if(!(src.signalers[wirenum]))
usr << "There's no signaller attached to that wire!"
return
var/obj/item/device/assembly/signaler/R = src.signalers[wirenum]
R.loc = usr.loc
R.airlock_wire = null
src.signalers[wirenum] = null
if(istype(usr, /mob/living/silicon))
if (!check_synth_access(usr))
return
return 1
//AI
//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed
@@ -998,8 +706,8 @@ About the new airlock wires panel:
else if(src.locked)
usr << "The door bolts are already dropped."
else
src.lock()
usr << "The door bolts have been dropped."
if(src.lock())
usr << "The door bolts have been dropped."
if(5)
//un-electrify door
if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
@@ -1138,7 +846,7 @@ About the new airlock wires panel:
update_icon()
if(!nowindow)
updateUsrDialog()
return
return 0
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
@@ -1162,7 +870,13 @@ About the new airlock wires panel:
else
return
else if(istype(C, /obj/item/weapon/screwdriver))
src.p_open = !( src.p_open )
if (src.p_open)
if (stat & BROKEN)
usr << "The airlock control panel is too damaged to be closed!"
else
src.p_open = 0
else
src.p_open = 1
src.update_icon()
else if(istype(C, /obj/item/weapon/wirecutters))
return src.attack_hand(user)
@@ -1173,7 +887,7 @@ About the new airlock wires panel:
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
else if(istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/twohanded/fireaxe) )
else if(istype(C, /obj/item/weapon/crowbar))
var/beingcrowbarred = null
if(istype(C, /obj/item/weapon/crowbar) )
beingcrowbarred = 1 //derp, Agouri
@@ -1219,29 +933,32 @@ About the new airlock wires panel:
del(src)
return
else if(arePowerSystemsOn())
else if(arePowerSystemsOn() && !(stat & BROKEN))
user << "\blue The airlock's motors resist your efforts to force it."
else if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
else if( !welded && !operating )
if(density)
if(beingcrowbarred == 0) //being fireaxe'd
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
spawn(0) open(1)
else
user << "\red You need to be wielding the Fire axe to do that."
else
spawn(0) open(1)
spawn(0) open(1)
else
if(beingcrowbarred == 0)
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
spawn(0) close(1)
else
user << "\red You need to be wielding the Fire axe to do that."
spawn(0) close(1)
else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && (!arePowerSystemsOn() || (stat & BROKEN)))
if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
else if( !welded && !operating )
if(density)
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
spawn(0) open(1)
else
user << "\red You need to be wielding the Fire axe to do that."
else
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
spawn(0) close(1)
else
user << "\red You need to be wielding the Fire axe to do that."
else
..()
@@ -1252,6 +969,22 @@ About the new airlock wires panel:
ignite(is_hot(C))
..()
/obj/machinery/door/airlock/set_broken()
src.p_open = 1
stat |= BROKEN
if (src.security_bolts)
lock()
for (var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("[src.name]'s control panel bursts open, sparks spewing out!")
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
update_icon()
return
/obj/machinery/door/airlock/open(var/forced=0)
if( operating || welded || locked )
return 0
@@ -1313,12 +1046,13 @@ About the new airlock wires panel:
return
/obj/machinery/door/airlock/proc/lock(var/forced=0)
if (operating || src.locked) return
if (operating || src.locked) return 0
src.locked = 1
for(var/mob/M in range(1,src))
M.show_message("You hear a click from the bottom of the door.", 2)
update_icon()
return 1
/obj/machinery/door/airlock/proc/unlock(var/forced=0)
if (operating || !src.locked) return
@@ -1335,13 +1069,10 @@ About the new airlock wires panel:
..()
//wires
if (!secured_wires)
airlockWireColorToFlag = globalAirlockWireColorToFlag
airlockIndexToFlag = globalAirlockIndexToFlag
airlockIndexToWireColor = globalAirlockIndexToWireColor
airlockWireColorToIndex = globalAirlockWireColorToIndex
if (secured_wires)
wires = new/datum/wires/airlock/secure(src)
else
randomize_wires()
wires = new/datum/wires/airlock(src)
if(src.closeOtherId != null)
spawn (5)
@@ -1350,12 +1081,12 @@ About the new airlock wires panel:
src.closeOther = A
break
/obj/machinery/door/airlock/proc/randomize_wires()
var/wire_assignments = CreateRandomAirlockWires()
airlockWireColorToFlag = wire_assignments[1]
airlockIndexToFlag = wire_assignments[2]
airlockIndexToWireColor = wire_assignments[3]
airlockWireColorToIndex = wire_assignments[4]
/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason
..()
update_icon()
/obj/machinery/door/airlock/proc/hasPower()
return ((src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) && !(stat & NOPOWER))
/obj/machinery/door/airlock/proc/prison_open()
src.unlock()

View File

@@ -23,6 +23,10 @@
var/normalspeed = 1
var/heat_proof = 0 // For glass airlocks/opacity firedoors
var/air_properties_vary_with_direction = 0
var/maxhealth = 500
var/health
var/min_force = 10 //minimum amount of force needed to damage the door with a melee weapon
var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon
//Multi-tile doors
dir = EAST
@@ -47,6 +51,8 @@
bound_width = world.icon_size
bound_height = width * world.icon_size
health = maxhealth
update_nearby_tiles(need_rebuild=1)
return
@@ -120,6 +126,24 @@
src.open()
return
/obj/machinery/door/bullet_act(var/obj/item/projectile/Proj)
if(Proj.damage)
take_damage(round(Proj.damage * 4))
..()
/obj/machinery/door/hitby(AM as mob|obj)
..()
visible_message("\red <B>[src.name] was hit by [AM].</B>", 1)
var/tforce = 0
if(ismob(AM))
tforce = 15
else
tforce = AM:throwforce
playsound(src.loc, hitsound, 100, 1)
take_damage(tforce)
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
/obj/machinery/door/attack_ai(mob/user as mob)
return src.attack_hand(user)
@@ -146,22 +170,69 @@
user = null
if(!src.requiresID())
user = null
if(istype(I, /obj/item/stack/sheet/metal))
if(stat & BROKEN)
user << "\blue [src.name] is damaged beyond repair and must be reconstructed!"
return
if(health >= maxhealth)
user << "\blue Nothing to fix!"
return
var/obj/item/stack/sheet/metal/metalstack = I
var/health_per_sheet = 50
var/initialhealth = health
src.health = min(maxhealth, health + 100, health + (metalstack.amount * health_per_sheet))
user.visible_message("\The [user] patches some dents on \the [src] with \the [metalstack].")
metalstack.use(round((health - initialhealth)/health_per_sheet))
return
if(src.density && ((operable() && istype(I, /obj/item/weapon/card/emag)) || istype(I, /obj/item/weapon/melee/energy/blade)))
flick("door_spark", src)
sleep(6)
open()
operating = -1
return 1
if(src.allowed(user))
if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
var/obj/item/weapon/W = I
if(W.damtype == BRUTE || W.damtype == BURN)
if(W.force < min_force)
user.visible_message("\red <B>\The [user] hits \the [src] with \the [W] with no visible effect.</B>" )
else
user.visible_message("\red <B>\The [user] forcefully slams \the [src] with \the [W]!</B>" )
playsound(src.loc, hitsound, 100, 1)
take_damage(W.force)
return
if(src.allowed(user) && operable())
if(src.density)
open()
else
close()
return
if(src.density)
if(src.density && !(stat & (NOPOWER|BROKEN)))
flick("door_deny", src)
return
/obj/machinery/door/proc/take_damage(var/damage)
var/initialhealth = src.health
src.health = max(0, src.health - damage)
if(src.health <= 0 && initialhealth > 0)
src.set_broken()
else if(src.health < src.maxhealth / 4 && initialhealth >= src.maxhealth / 4)
visible_message("\The [src] looks like it's about to break!" )
else if(src.health < src.maxhealth / 2 && initialhealth >= src.maxhealth / 2)
visible_message("\The [src] looks seriously damaged!" )
else if(src.health < src.maxhealth * 3/4 && initialhealth >= src.maxhealth * 3/4)
visible_message("\The [src] shows signs of damage!" )
update_icon()
return
/obj/machinery/door/proc/set_broken()
stat |= BROKEN
for (var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("[src.name] breaks!" )
update_icon()
return
/obj/machinery/door/blob_act()
if(prob(40))
@@ -187,11 +258,15 @@
if(2.0)
if(prob(25))
del(src)
else
take_damage(300)
if(3.0)
if(prob(80))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 1, src)
s.start()
else
take_damage(150)
return
@@ -293,7 +368,7 @@
/obj/machinery/door/proc/autoclose()
var/obj/machinery/door/airlock/A = src
if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose)
if(!A.density && !A.operating && !A.locked && !A.welded && !(A.stat & (BROKEN|NOPOWER)) && A.autoclose)
close()
return

View File

@@ -2,7 +2,7 @@
/var/const/CLOSED = 2
#define FIREDOOR_MAX_PRESSURE_DIFF 25 // kPa
#define FIREDOOR_MAX_TEMP 50 // <EFBFBD>C
#define FIREDOOR_MAX_TEMP 50 // °C
#define FIREDOOR_MIN_TEMP 0
// Bitflags
@@ -32,6 +32,8 @@
var/list/users_to_open = new
var/next_process_time = 0
var/hatch_open = 0
power_channel = ENVIRON
use_power = 1
idle_power_usage = 5
@@ -70,17 +72,14 @@
. = ..()
/obj/machinery/door/firedoor/examine()
set src in view()
. = ..()
if(get_dist(src, usr) > 1 && !isAI(usr))
/obj/machinery/door/firedoor/examine(mob/user)
if(!..(user, 1) && !isAI(user))
return
if(pdiff >= FIREDOOR_MAX_PRESSURE_DIFF)
usr << "<span class='warning'>WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!</span>"
user << "<span class='warning'>WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!</span>"
usr << "<b>Sensor readings:</b>"
user << "<b>Sensor readings:</b>"
for(var/index = 1; index <= tile_info.len; index++)
var/o = "&nbsp;&nbsp;"
switch(index)
@@ -94,7 +93,7 @@
o += "WEST: "
if(tile_info[index] == null)
o += "<span class='warning'>DATA UNAVAILABLE</span>"
usr << o
user << o
continue
var/celsius = convert_k2c(tile_info[index][1])
var/pressure = tile_info[index][2]
@@ -105,14 +104,14 @@
o += "[celsius]&deg;C</span> "
o += "<span style='color:blue'>"
o += "[pressure]kPa</span></li>"
usr << o
user << o
if(islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
usr << "These people have opened \the [src] during an alert: [users_to_open_string]."
user << "These people have opened \the [src] during an alert: [users_to_open_string]."
/obj/machinery/door/firedoor/Bumped(atom/AM)
if(p_open || operating)
@@ -166,8 +165,6 @@
if(alarmed)
// Accountability!
users_to_open |= user.name
log_admin("[user]([user.ckey]) has opened an alarming emergency shutter.")
message_admins("[user]([user.ckey]) has opened an alarming emergency shutter.")
needs_to_close = 1
spawn()
open()
@@ -199,6 +196,33 @@
update_icon()
return
if(density && istype(C, /obj/item/weapon/screwdriver))
hatch_open = !hatch_open
user.visible_message("<span class='danger'>[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.</span>",
"You have [hatch_open ? "opened" : "closed"] the [src] maintenance hatch.")
update_icon()
return
if(blocked && istype(C, /obj/item/weapon/crowbar))
if(!hatch_open)
user << "<span class='danger'>You must open the maintenance hatch first!</span>"
else
user.visible_message("<span class='danger'>[user] is removing the electronics from \the [src].</span>",
"You start to remove the electronics from [src].")
if(do_after(user,30))
if(blocked && density && hatch_open)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("<span class='danger'>[user] has removed the electronics from \the [src].</span>",
"You have removed the electronics from [src].")
new/obj/item/weapon/airalarm_electronics(src.loc)
var/obj/structure/firedoor_assembly/FA = new/obj/structure/firedoor_assembly(src.loc)
FA.anchored = 1
FA.density = 1
FA.update_icon()
del(src)
return
if(blocked)
user << "<span class='danger'>\The [src] is welded solid!</span>"
return
@@ -302,6 +326,11 @@
return ..()
/obj/machinery/door/firedoor/open(var/forced = 0)
if(hatch_open)
hatch_open = 0
visible_message("The maintenance hatch of \the [src] closes.")
update_icon()
if(!forced)
if(stat & (BROKEN|NOPOWER))
return //needs power to open unless it was forced
@@ -326,6 +355,8 @@
overlays.Cut()
if(density)
icon_state = "door_closed"
if(hatch_open)
overlays += "hatch"
if(blocked)
overlays += "welded"
if(pdiff_alert)

View File

@@ -0,0 +1,48 @@
obj/structure/firedoor_assembly
name = "\improper emergency shutter assembly"
desc = "It can save lives."
icon = 'icons/obj/doors/DoorHazard.dmi'
icon_state = "door_construction"
anchored = 0
opacity = 0
density = 0
obj/structure/firedoor_assembly/update_icon()
if(anchored)
icon_state = "door_anchored"
else
icon_state = "door_construction"
obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
if(istype(C, /obj/item/weapon/airalarm_electronics))
if(anchored)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user.visible_message("<span class='warning'>[user] has inserted a circuit into \the [src]!</span>",
"You have inserted the circuit into \the [src]!")
new /obj/machinery/door/firedoor(src.loc)
del(C)
del(src)
else
user << "<span class='warning'>You must secure \the [src] first!</span>"
else if(istype(C, /obj/item/weapon/wrench))
anchored = !anchored
density = !density
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message("<span class='warning'>[user] has [anchored ? "" : "un" ]secured \the [src]!</span>",
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
else if(!anchored && istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
user.visible_message("<span class='warning'>[user] dissassembles \the [src].</span>",
"You start to dissassemble \the [src].")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user.visible_message("<span class='warning'>[user] has dissassembled \the [src].</span>",
"You have dissassembled \the [src].")
new /obj/item/stack/sheet/metal(src.loc, 2)
del (src)
else
user << "<span class='notice'>You need more welding fuel.</span>"
else
..(C, user)

View File

@@ -4,7 +4,10 @@
icon = 'icons/obj/doors/windoor.dmi'
icon_state = "left"
var/base_state = "left"
var/health = 150.0 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file
min_force = 4
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file
health
visible = 0.0
use_power = 0
flags = ON_BORDER
@@ -122,7 +125,7 @@
src.operating = 0
return 1
/obj/machinery/door/window/proc/take_damage(var/damage)
/obj/machinery/door/window/take_damage(var/damage)
src.health = max(0, src.health - damage)
if (src.health <= 0)
new /obj/item/weapon/shard(src.loc)
@@ -149,27 +152,6 @@
del(src)
return
/obj/machinery/door/window/bullet_act(var/obj/item/projectile/Proj)
if(Proj.damage)
take_damage(round(Proj.damage / 2))
..()
//When an object is thrown at the window
/obj/machinery/door/window/hitby(AM as mob|obj)
..()
visible_message("\red <B>The glass door was hit by [AM].</B>", 1)
var/tforce = 0
if(ismob(AM))
tforce = 40
else
tforce = AM:throwforce
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
take_damage(tforce)
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
/obj/machinery/door/window/attack_ai(mob/user as mob)
return src.attack_hand(user)

View File

@@ -146,12 +146,11 @@
mode = !mode
usr << "The IV drip is now [mode ? "injecting" : "taking blood"]."
/obj/machinery/iv_drip/examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
/obj/machinery/iv_drip/examine(mob/user)
..(user)
if (!(user in view(2)) && user!=src.loc) return
usr << "The IV drip is [mode ? "injecting" : "taking blood"]."
user << "The IV drip is [mode ? "injecting" : "taking blood"]."
if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)

View File

@@ -0,0 +1,207 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
datum/track
var/title
var/sound
datum/track/New(var/title_name, var/audio)
title = title_name
sound = audio
/obj/machinery/media/jukebox/
name = "space jukebox"
icon = 'icons/obj/jukebox.dmi'
icon_state = "jukebox2-nopower"
var/state_base = "jukebox2"
anchored = 1
density = 1
power_channel = EQUIP
var/playing = 0
var/datum/track/current_track
var/list/datum/track/tracks = list(
new/datum/track("Beyond", 'sound/ambience/ambispace.ogg'),
new/datum/track("Clouds of Fire", 'sound/music/clouds.s3m'),
new/datum/track("D`Bert", 'sound/music/title2.ogg'),
new/datum/track("D`Fort", 'sound/ambience/song_game.ogg'),
new/datum/track("Floating", 'sound/music/main.ogg'),
new/datum/track("Endless Space", 'sound/music/space.ogg'),
new/datum/track("Part A", 'sound/misc/TestLoop1.ogg'),
new/datum/track("Scratch", 'sound/music/title1.ogg'),
new/datum/track("Trai`Tor", 'sound/music/traitor.ogg'),
)
/obj/machinery/media/jukebox/Del()
StopPlaying()
/obj/machinery/media/jukebox/power_change()
if(!powered(power_channel) || !anchored)
stat |= NOPOWER
else
stat &= ~NOPOWER
if(stat & (NOPOWER|BROKEN) && playing)
StopPlaying()
update_icon()
/obj/machinery/media/jukebox/update_icon()
overlays.Cut()
if(stat & (NOPOWER|BROKEN) || !anchored)
if(stat & BROKEN)
icon_state = "[state_base]-broken"
else
icon_state = "[state_base]-nopower"
return
icon_state = state_base
if(playing)
if(emagged)
overlays += "[state_base]-emagged"
else
overlays += "[state_base]-running"
/obj/machinery/media/jukebox/Topic(href, href_list)
if(..() || !(Adjacent(usr) || istype(usr, /mob/living/silicon)))
return
if(!anchored)
usr << "<span class='warning'>You must secure \the [src] first.</span>"
return
if(stat & (NOPOWER|BROKEN))
usr << "\the [src] doesn't appear to function."
return
if(href_list["change_track"])
for(var/datum/track/T in tracks)
if(T.title == href_list["title"])
current_track = T
StartPlaying()
break
else if(href_list["stop"])
StopPlaying()
else if(href_list["play"])
if(emagged)
playsound(src.loc, 'sound/items/AirHorn.ogg', 100, 1)
for(var/mob/living/carbon/M in ohearers(6, src))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs))
continue
M.sleeping = 0
M.stuttering += 20
M.ear_deaf += 30
M.Weaken(3)
if(prob(30))
M.Stun(10)
M.Paralyse(4)
else
M.make_jittery(500)
spawn(15)
explode()
else if(current_track == null)
usr << "No track selected."
else
StartPlaying()
return 1
/obj/machinery/media/jukebox/interact(mob/user)
if(stat & (NOPOWER|BROKEN))
usr << "\the [src] doesn't appear to function."
return
ui_interact(user)
/obj/machinery/media/jukebox/ui_interact(mob/user, ui_key = "jukebox", var/datum/nanoui/ui = null, var/force_open = 1)
var/title = "RetroBox - Space Style"
var/data[0]
if(!(stat & (NOPOWER|BROKEN)))
data["current_track"] = current_track != null ? current_track.title : ""
data["playing"] = playing
var/list/nano_tracks = new
for(var/datum/track/T in tracks)
nano_tracks[++nano_tracks.len] = list("track" = T.title)
data["tracks"] = nano_tracks
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "jukebox.tmpl", title, 450, 600)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
/obj/machinery/media/jukebox/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/media/jukebox/attack_hand(var/mob/user as mob)
interact(user)
/obj/machinery/media/jukebox/proc/explode()
walk_to(src,0)
src.visible_message("<span class='danger'>\the [src] blows apart!</span>", 1)
explosion(src.loc, 0, 0, 1, rand(1,2), 1)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/blood/oil(src.loc)
del(src)
/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user)
if(istype(W, /obj/item/weapon/wrench))
if(playing)
StopPlaying()
user.visible_message("<span class='warning'>[user] has [anchored ? "un" : ""]secured \the [src].</span>", "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>")
anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
power_change()
update_icon()
return
if(istype(W, /obj/item/weapon/card/emag))
if(!emagged)
emagged = 1
StopPlaying()
visible_message("<span class='danger'>\the [src] makes a fizzling sound.</span>")
log_and_message_admins("emagged \the [src]")
update_icon()
return
return ..()
/obj/machinery/media/jukebox/proc/StopPlaying()
var/area/A = get_area(src)
// Always kill the current sound
for(var/mob/living/M in mobs_in_area(A))
M << sound(null, channel = 1)
A.forced_ambience = null
playing = 0
update_icon()
/obj/machinery/media/jukebox/proc/StartPlaying()
StopPlaying()
if(!current_track)
return
var/area/A = get_area(src)
A.forced_ambience = sound(current_track.sound, channel = 1, repeat = 1, volume = 25)
for(var/mob/living/M in mobs_in_area(A))
if(M.mind)
A.play_ambience(M)
playing = 1
update_icon()

View File

@@ -23,13 +23,22 @@
var/locked = 0
var/panel_open = 0 //Hacking a smartfridge
var/scan_id = 1
var/is_secure = 0
var/datum/wires/smartfridge/wires = null
/obj/machinery/smartfridge/secure/
is_secure = 1
/obj/machinery/smartfridge/New()
wires = new(src)
..()
if(is_secure)
wires = new/datum/wires/smartfridge/secure(src)
else
wires = new/datum/wires/smartfridge(src)
/obj/machinery/smartfridge/Del()
del(wires) // qdel
..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
@@ -217,12 +226,7 @@
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
if(!ispowered) return
if(seconds_electrified != 0)
if(shock(user, 100))
return
if(panel_open)
wires.Interact(user)
wires.Interact(user)
ui_interact(user)
/*******************
@@ -232,12 +236,8 @@
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/is_secure = istype(src,/obj/machinery/smartfridge/secure)
var/data[0]
data["contents"] = null
data["wires"] = null
data["panel_open"] = panel_open
data["electrified"] = seconds_electrified > 0
data["shoot_inventory"] = shoot_inventory
data["locked"] = locked

View File

@@ -37,10 +37,9 @@
else
icon_state = "light0"
/obj/machinery/light_switch/examine()
set src in oview(1)
if(usr && !usr.stat)
usr << "A light switch. It is [on? "on" : "off"]."
/obj/machinery/light_switch/examine(mob/user)
if(..(user, 1))
user << "A light switch. It is [on? "on" : "off"]."
/obj/machinery/light_switch/attack_paw(mob/user)

View File

@@ -113,8 +113,11 @@ Class Procs:
/obj/machinery/New()
..()
machines += src
machinery_sort_required = 1
if(!machinery_sort_required && ticker)
dd_insertObjectList(machines, src)
else
machines += src
machinery_sort_required = 1
/obj/machinery/Del()
machines -= src
@@ -178,7 +181,8 @@ Class Procs:
return (stat & (NOPOWER|BROKEN|additional_flags))
/obj/machinery/Topic(href, href_list)
..()
if(..())
return 1
if(inoperable())
return 1
if(usr.restrained() || usr.lying || usr.stat)

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