Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into powernet-sensors-mk2

This commit is contained in:
Atlantiscze
2014-11-20 10:55:33 +01:00
99 changed files with 783 additions and 569 deletions
@@ -1,6 +1,7 @@
/obj/item/device/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys"
var/radio_desc = ""
icon_state = "headset"
item_state = "headset"
matter = list("metal" = 75)
@@ -17,7 +18,14 @@
/obj/item/device/radio/headset/New()
..()
keyslot1 = new /obj/item/device/encryptionkey/
recalculateChannels()
recalculateChannels(1)
/obj/item/device/radio/headset/examine(mob/user)
if(!(..(user, 1) && radio_desc))
return
user << "The following channels are built-in:"
user << radio_desc
/obj/item/device/radio/headset/handle_message_mode(mob/living/M as mob, message, channel)
if (channel == "special")
@@ -47,7 +55,7 @@
del(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/syndicate
syndie = 1
recalculateChannels()
recalculateChannels(1)
/obj/item/device/radio/headset/binary
origin_tech = "syndicate=3"
@@ -55,60 +63,60 @@
..()
del(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/binary
recalculateChannels()
recalculateChannels(1)
/obj/item/device/radio/headset/headset_sec
name = "security radio headset"
desc = "This is used by your elite security force. To access the security channel, use :s."
desc = "This is used by your elite security force."
icon_state = "sec_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_sec
/obj/item/device/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls. To access the engineering channel, use :e. "
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
/obj/item/device/radio/headset/headset_rob
name = "robotics radio headset"
desc = "Made specifically for the roboticists who cannot decide between departments. To access the engineering channel, use :e. For research, use :n."
desc = "Made specifically for the roboticists who cannot decide between departments."
icon_state = "rob_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_rob
/obj/item/device/radio/headset/headset_med
name = "medical radio headset"
desc = "A headset for the trained staff of the medbay. To access the medical channel, use :m."
desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_med
/obj/item/device/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual. To access the science channel, use :n."
desc = "A sciency headset. Like usual."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
/obj/item/device/radio/headset/headset_medsci
name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science. To access the medical channel, use :m. For science, use :n."
desc = "A headset that is a result of the mating between medical and science."
icon_state = "med_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_medsci
/obj/item/device/radio/headset/headset_com
name = "command radio headset"
desc = "A headset with a commanding channel. To access the command channel, use :c."
desc = "A headset with a commanding channel."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_com
/obj/item/device/radio/headset/heads/captain
name = "captain's headset"
desc = "The headset of the boss. Channels are as follows: :c - command, :s - security, :e - engineering, :u - supply, :v - service, :m - medical, :n - science."
desc = "The headset of the boss."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/captain
@@ -130,35 +138,35 @@
/obj/item/device/radio/headset/heads/rd
name = "Research Director's headset"
desc = "Headset of the researching God. To access the science channel, use :n. For command, use :c."
desc = "Headset of the researching God."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/rd
/obj/item/device/radio/headset/heads/hos
name = "head of security's headset"
desc = "The headset of the man who protects your worthless lifes. To access the security channel, use :s. For command, use :c."
desc = "The headset of the man who protects your worthless lifes."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/hos
/obj/item/device/radio/headset/heads/ce
name = "chief engineer's headset"
desc = "The headset of the guy who is in charge of morons. To access the engineering channel, use :e. For command, use :c."
desc = "The headset of the guy who is in charge of morons"
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/ce
/obj/item/device/radio/headset/heads/cmo
name = "chief medical officer's headset"
desc = "The headset of the highly trained medical chief. To access the medical channel, use :m. For command, use :c."
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/cmo
/obj/item/device/radio/headset/heads/hop
name = "head of personnel's headset"
desc = "The headset of the guy who will one day be captain. Channels are as follows: :u - supply, :v - service, :c - command, :s - security"
desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/hop
@@ -179,21 +187,21 @@
*/
/obj/item/device/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the QM and his slaves. To access the supply channel, use :u."
desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
/obj/item/device/radio/headset/headset_service
name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean. To access the service channel, use :v."
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset"
item_state = "headset"
keyslot2 = new /obj/item/device/encryptionkey/headset_service
/obj/item/device/radio/headset/ert
name = "CentCom Response Team headset"
desc = "The headset of the boss's boss. Channels are as follows: :h - Response Team :c - command, :s - security, :e - engineering, :d - mining, :u - cargo, :v - service, :m - medical, :n - science."
desc = "The headset of the boss's boss."
icon_state = "com_headset"
item_state = "headset"
freerange = 1
@@ -255,7 +263,7 @@
return
/obj/item/device/radio/headset/proc/recalculateChannels()
/obj/item/device/radio/headset/proc/recalculateChannels(var/setDescription = 0)
src.channels = list()
src.translate_binary = 0
src.translate_hive = 0
@@ -303,4 +311,18 @@
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
return
if(setDescription)
setupRadioDescription()
return
/obj/item/device/radio/headset/proc/setupRadioDescription()
var/radio_text = ""
for(var/i = 1 to channels.len)
var/channel = channels[i]
var/key = get_radio_key_from_channel(channel)
radio_text += "[key] - [channel]"
if(i != channels.len)
radio_text += ", "
radio_desc = radio_text
+1 -18
View File
@@ -135,23 +135,6 @@
A.ai_actual_track(target)
return
else if (href_list["faketrack"])
var/mob/target = locate(href_list["track"])
var/mob/living/silicon/ai/A = locate(href_list["track2"])
if(A && target)
A:cameraFollow = target
A << text("Now tracking [] on camera.", target.name)
if (usr.machine == null)
usr.machine = usr
while (usr:cameraFollow == target)
usr << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)."
sleep(40)
continue
return
else if (href_list["freq"])
var/new_frequency = (frequency + text2num(href_list["freq"]))
if (!freerange || (frequency < 1200 || frequency > 1600))
@@ -491,7 +474,7 @@
/obj/item/device/radio/examine(mob/user)
..(user)
. = ..()
if ((in_range(src, user) || loc == user))
if (b_stat)
user.show_message("\blue \the [src] can be attached and modified!")
+54 -144
View File
@@ -18,6 +18,8 @@
matter = list("glass" = 3750)
origin_tech = "materials=1"
var/created_window = /obj/structure/window/basic
var/is_reinforced = 0
var/list/construction_options = list("One Direction", "Full Window")
/obj/item/stack/sheet/glass/cyborg
name = "glass"
@@ -32,19 +34,24 @@
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user)
..()
if(istype(W,/obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
user << "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass.</span>"
return
CC.use(5)
use(1)
user << "<span class='notice'>You attach wire to the [name].</span>"
new /obj/item/stack/light_w(user.loc)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && get_amount() >= 1)
var/obj/item/stack/sheet/rglass/RG = new (user.loc)
if(!is_reinforced)
if(istype(W,/obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
user << "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass.</span>"
return
CC.use(5)
use(1)
user << "<span class='notice'>You attach wire to the [name].</span>"
new /obj/item/stack/light_w(user.loc)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() < 1 || get_amount() < 1)
user << "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass.</span>"
return
var/obj/item/stack/sheet/glass/reinforced/RG = new (user.loc)
RG.add_fingerprint(user)
RG.add_to_stacks(user)
var/obj/item/stack/sheet/glass/G = src
@@ -54,20 +61,15 @@
G.use(1)
if (!G && replace)
user.put_in_hands(RG)
else
user << "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass.</span>"
return
else
return ..()
/obj/item/stack/sheet/glass/proc/construct_window(mob/user as mob)
if(!user || !src) return 0
if(!istype(user.loc,/turf)) return 0
if(!user.IsAdvancedToolUser())
return 0
var/title = "Sheet-Glass"
var/title = "Sheet-[name]"
title += " ([src.amount] sheet\s left)"
switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null))
switch(input(title, "What would you like to construct?") as null|anything in construction_options)
if("One Direction")
if(!src) return 1
if(src.loc != user) return 1
@@ -80,7 +82,7 @@
user << "\red There are too many windows in this location."
return 1
directions-=win.dir
if(!(win.ini_dir in cardinal))
if(!(win.dir in cardinal))
user << "\red Can't let you do that."
return 1
@@ -94,112 +96,23 @@
if(!found)
dir_to_set = direction
break
var/obj/structure/window/W
W = new created_window( user.loc, 0 )
W.dir = dir_to_set
W.ini_dir = W.dir
W.anchored = 0
new created_window( user.loc, dir_to_set, 1 )
src.use(1)
if("Full Window")
if(!src) return 1
if(src.loc != user) return 1
if(src.amount < 2)
if(src.amount < 4)
user << "\red You need more glass to do that."
return 1
if(locate(/obj/structure/window) in user.loc)
user << "\red There is a window in the way."
return 1
var/obj/structure/window/W
W = new created_window( user.loc, 0 )
W.dir = SOUTHWEST
W.ini_dir = SOUTHWEST
W.anchored = 0
src.use(2)
return 0
/*
* Reinforced glass sheets
*/
/obj/item/stack/sheet/rglass
name = "reinforced glass"
desc = "Glass which seems to have rods or something stuck in them."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
matter = list("metal" = 1875,"glass" = 3750)
origin_tech = "materials=2"
/obj/item/stack/sheet/rglass/cyborg
name = "reinforced glass"
desc = "Glass which seems to have rods or something stuck in them."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
/obj/item/stack/sheet/rglass/attack_self(mob/user as mob)
construct_window(user)
/obj/item/stack/sheet/rglass/proc/construct_window(mob/user as mob)
if(!user || !src) return 0
if(!istype(user.loc,/turf)) return 0
if(!user.IsAdvancedToolUser())
return 0
var/title = "Sheet Reinf. Glass"
title += " ([src.amount] sheet\s left)"
switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel"))
if("One Direction")
if(!src) return 1
if(src.loc != user) return 1
var/list/directions = new/list(cardinal)
var/i = 0
for (var/obj/structure/window/win in user.loc)
i++
if(i >= 4)
user << "\red There are too many windows in this location."
return 1
directions-=win.dir
if(!(win.ini_dir in cardinal))
user << "\red Can't let you do that."
return 1
//Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc.
var/dir_to_set = 2
for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
var/found = 0
for(var/obj/structure/window/WT in user.loc)
if(WT.dir == direction)
found = 1
if(!found)
dir_to_set = direction
break
var/obj/structure/window/W
W = new /obj/structure/window/reinforced( user.loc, 1 )
W.state = 0
W.dir = dir_to_set
W.ini_dir = W.dir
W.anchored = 0
src.use(1)
if("Full Window")
if(!src) return 1
if(src.loc != user) return 1
if(src.amount < 2)
user << "\red You need more glass to do that."
return 1
if(locate(/obj/structure/window) in user.loc)
user << "\red There is a window in the way."
return 1
var/obj/structure/window/W
W = new /obj/structure/window/reinforced( user.loc, 1 )
W.state = 0
W.dir = SOUTHWEST
W.ini_dir = SOUTHWEST
W.anchored = 0
src.use(2)
new created_window( user.loc, SOUTHWEST, 1 )
src.use(4)
if("Windoor")
if(!is_reinforced) return 1
if(!src || src.loc != user) return 1
if(isturf(user.loc) && locate(/obj/structure/windoor_assembly/, user.loc))
@@ -214,31 +127,33 @@
user << "\red You need more glass to do that."
return 1
var/obj/structure/windoor_assembly/WD
WD = new /obj/structure/windoor_assembly(user.loc)
WD.state = "01"
WD.anchored = 0
new /obj/structure/windoor_assembly(user.loc, user.dir, 1)
src.use(5)
switch(user.dir)
if(SOUTH)
WD.dir = SOUTH
WD.ini_dir = SOUTH
if(EAST)
WD.dir = EAST
WD.ini_dir = EAST
if(WEST)
WD.dir = WEST
WD.ini_dir = WEST
else//If the user is facing northeast. northwest, southeast, southwest or north, default to north
WD.dir = NORTH
WD.ini_dir = NORTH
else
return 1
return 0
/*
* Reinforced glass sheets
*/
/obj/item/stack/sheet/glass/reinforced
name = "reinforced glass"
desc = "Glass which has been reinforced with metal rods."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
matter = list("metal" = 1875,"glass" = 3750)
origin_tech = "materials=2"
created_window = /obj/structure/window/reinforced
is_reinforced = 1
construction_options = list("One Direction", "Full Window", "Windoor")
/obj/item/stack/sheet/glass/reinforced/cyborg
name = "reinforced glass"
desc = "Glass which has been reinforced with metal rods."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
/*
* Phoron Glass sheets
@@ -252,9 +167,6 @@
origin_tech = "materials=3;phorontech=2"
created_window = /obj/structure/window/phoronbasic
/obj/item/stack/sheet/glass/phoronglass/attack_self(mob/user as mob)
construct_window(user)
/obj/item/stack/sheet/glass/phoronglass/attackby(obj/item/W, mob/user)
..()
if( istype(W, /obj/item/stack/rods) )
@@ -277,13 +189,11 @@
*/
/obj/item/stack/sheet/glass/phoronrglass
name = "reinforced phoron glass"
desc = "Phoron glass which seems to have rods or something stuck in them."
desc = "Phoron glass which has been reinforced with metal rods."
singular_name = "reinforced phoron glass sheet"
icon_state = "sheet-phoronrglass"
matter = list("glass" = 7500,"metal" = 1875)
origin_tech = "materials=4;phorontech=2"
created_window = /obj/structure/window/phoronreinforced
/obj/item/stack/sheet/glass/phoronrglass/attack_self(mob/user as mob)
construct_window(user)
is_reinforced = 1
+47
View File
@@ -472,3 +472,50 @@
else
return ..()
/obj/item/weapon/combitool
name = "combi-tool"
desc = "It even has one of those nubbins for doing the thingy."
icon = 'icons/obj/items.dmi'
icon_state = "combitool"
var/list/spawn_tools = list(
/obj/item/weapon/screwdriver,
/obj/item/weapon/wrench,
/obj/item/weapon/wirecutters,
/obj/item/weapon/kitchen/utensil/knife,
/obj/item/weapon/kitchen/utensil/fork,
/obj/item/weapon/hatchet
)
var/list/tools = list()
var/current_tool = 1
/obj/item/weapon/combitool/examine()
..()
if(loc == usr && tools.len)
usr << "It has the following fittings:"
for(var/obj/item/tool in tools)
usr << "\icon[tool] - [tool.name][tools[current_tool]==tool?" (selected)":""]"
/obj/item/weapon/combitool/New()
..()
for(var/type in spawn_tools)
tools |= new type(src)
/obj/item/weapon/combitool/attack_self(mob/user as mob)
if(++current_tool > tools.len) current_tool = 1
var/obj/item/tool = tools[current_tool]
if(!tool)
user << "You can't seem to find any fittings in \the [src]."
else
user << "You switch \the [src] to the [tool.name] fitting."
return 1
/obj/item/weapon/combitool/attack(var/atom/target, var/mob/living/user)
var/obj/item/tool = tools[current_tool]
if(!tool)
return ..()
var/resolved = target.attackby(tool,user)
if(!resolved && tool && target)
tool.afterattack(target,user,1)
return 1