"
dat += "Metal amount: [src.m_amount] / [max_m_amount] cm3 "
dat += "Glass amount: [src.g_amount] / [max_g_amount] cm3"
@@ -290,6 +315,32 @@
dat += "
"
return dat
+
+/obj/machinery/autolathe/proc/search_win(mob/user)
+ var/dat = "Return to main menu"
+ dat += "
Search results:
"
+ dat += "Metal amount: [src.m_amount] / [max_m_amount] cm3 "
+ dat += "Glass amount: [src.g_amount] / [max_g_amount] cm3"
+
+ for(var/datum/design/D in matching_designs)
+ if(disabled || !can_build(D))
+ dat += "[D.name]"
+ else
+ dat += "[D.name]"
+
+ if(ispath(D.build_path, /obj/item/stack))
+ var/max_multiplier = min(50, D.materials["$metal"] ?round(m_amount/D.materials["$metal"]):INFINITY,D.materials["$glass"]?round(g_amount/D.materials["$glass"]):INFINITY)
+ if (max_multiplier>10 && !disabled)
+ dat += " x10"
+ if (max_multiplier>25 && !disabled)
+ dat += " x25"
+ if(max_multiplier > 0 && !disabled)
+ dat += " x[max_multiplier]"
+
+ dat += "[get_design_cost(D)] "
+
+ dat += "
"
+ return dat
/obj/machinery/autolathe/proc/can_build(var/datum/design/D)
var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index f834719c9e0..0a9eca25078 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -298,7 +298,7 @@
/obj/machinery/biogenerator/Topic(href, href_list)
if(..() || panel_open)
- return
+ return 1
usr.set_machine(src)
diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm
index 6fb65f8a705..8e6855a8dbf 100644
--- a/code/game/machinery/bots/ed209bot.dm
+++ b/code/game/machinery/bots/ed209bot.dm
@@ -665,7 +665,7 @@ Auto Patrol[]"},
user << "Taser gun attached."
if(9)
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
build_step++
user << "You complete the ED-209."
var/turf/T = get_turf(src)
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index bd1ee21a88c..f9016a1061f 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -43,7 +43,7 @@ var/global/mulebot_count = 0
var/auto_pickup = 1 // true if auto-pickup at beacon
var/report_delivery = 1 // true if bot will announce an arrival to a location.
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/datum/wires/mulebot/wires = null
// the installed power cell
@@ -96,8 +96,8 @@ var/global/mulebot_count = 0
if(toggle_lock(user))
user << "Controls [(locked ? "locked" : "unlocked")]."
updateUsrDialog()
- else if(istype(I,/obj/item/weapon/cell) && open && !cell)
- var/obj/item/weapon/cell/C = I
+ else if(istype(I,/obj/item/weapon/stock_parts/cell) && open && !cell)
+ var/obj/item/weapon/stock_parts/cell/C = I
user.drop_item()
C.loc = src
cell = C
@@ -286,7 +286,7 @@ var/global/mulebot_count = 0
if("cellinsert")
if(open && !cell)
- var/obj/item/weapon/cell/C = usr.get_active_hand()
+ var/obj/item/weapon/stock_parts/cell/C = usr.get_active_hand()
if(istype(C))
usr.drop_item()
cell = C
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 16c39585dfa..5a9822d6531 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -8,7 +8,7 @@
idle_power_usage = 5
active_power_usage = 60
power_channel = EQUIP
- var/obj/item/weapon/cell/charging = null
+ var/obj/item/weapon/stock_parts/cell/charging = null
var/chargelevel = -1
proc
updateicon()
@@ -38,7 +38,7 @@
if(stat & BROKEN)
return
- if(istype(W, /obj/item/weapon/cell) && anchored)
+ if(istype(W, /obj/item/weapon/stock_parts/cell) && anchored)
if(charging)
user << "\red There is already a cell in the charger."
return
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index bfd979025be..9f73b206443 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -73,7 +73,7 @@
/obj/machinery/computer/operating/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
return
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 7a45f1a8114..febf071bfb5 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -79,7 +79,7 @@
/obj/machinery/computer/aifixer/Topic(href, href_list)
if(..())
- return
+ return 1
if (href_list["fix"])
src.active = 1
src.overlays += image('icons/obj/computer.dmi', "ai-fixer-on")
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index a3402129d88..972d3e6a2ca 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -144,7 +144,7 @@
/obj/machinery/computer/arcade/battle/Topic(href, href_list)
if(..())
- return
+ return 1
if (!src.blocked && !src.gameover)
if (href_list["attack"])
@@ -405,7 +405,7 @@
/obj/machinery/computer/arcade/orion_trail/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["close"])
usr.unset_machine()
usr << browse(null, "window=arcade")
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index 9a0ff286700..a24ca549dce 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -98,7 +98,7 @@
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["priority_clear"])
var/removing_zone = href_list["priority_clear"]
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index df9a3cbef9e..fb3c74e292d 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -115,7 +115,7 @@
//a bunch of this is copied from atmos alarms
/obj/machinery/computer/atmoscontrol/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["reset"])
current = null
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index c8ae03e2c26..e197042437f 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -155,7 +155,7 @@
/obj/machinery/computer/cloning/Topic(href, href_list)
if(..())
- return
+ return 1
if(loading)
return
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index e4ecdb12efa..3ac81dfa985 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -60,7 +60,7 @@ var/shuttle_call/shuttle_calls[0]
/obj/machinery/computer/communications/Topic(href, href_list)
if(..(href, href_list))
- return
+ return 1
if (!(src.z in list(STATION_Z,CENTCOMM_Z)))
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index a007c324ac4..c459b3d1e1a 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -42,7 +42,8 @@
/obj/machinery/computer/crew/Topic(href, href_list)
- if(..()) return
+ if(..())
+ return 1
if (src.z > 6)
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
return 0
diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm
index e57aa56fe78..ecb3ba58b3d 100644
--- a/code/game/machinery/computer/hologram.dm
+++ b/code/game/machinery/computer/hologram.dm
@@ -57,7 +57,7 @@
/obj/machinery/computer/hologram_comp/Topic(href, href_list)
if(..())
- return
+ return 1
if (in_range(src, usr))
flick("holo_console1", src)
if (href_list["power"])
diff --git a/code/game/machinery/computer/honkputer.dm b/code/game/machinery/computer/honkputer.dm
index a5efb1dd2a9..9efed74b7c9 100644
--- a/code/game/machinery/computer/honkputer.dm
+++ b/code/game/machinery/computer/honkputer.dm
@@ -16,7 +16,7 @@
/obj/machinery/computer/HONKputer/Topic(href, href_list)
if(..())
- return
+ return 1
if (src.z > 1)
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
return
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 1d9cee6a55b..23a8c3ed16f 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -128,7 +128,7 @@
/obj/machinery/computer/med_data/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(src.active1) ))
src.active1 = null
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 73c469d6db4..37ab61fc857 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -274,7 +274,7 @@
/obj/machinery/computer/message_monitor/Topic(href, href_list)
if(..())
- return
+ return 1
if(stat & (NOPOWER|BROKEN))
return
if(!istype(usr, /mob/living))
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index 2f408817802..94636091dde 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -163,7 +163,7 @@
/obj/machinery/computer/pod/Topic(href, href_list)
if(..())
- return
+ return 1
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["power"])
diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm
index 65eb7ce4bc3..e4c51cc8dab 100644
--- a/code/game/machinery/computer/power.dm
+++ b/code/game/machinery/computer/power.dm
@@ -133,7 +133,8 @@
/obj/machinery/power/monitor/Topic(href, href_list)
- ..()
+ if(..())
+ return 1
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.unset_machine()
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 35552231640..632fe6aae60 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -106,7 +106,7 @@
/obj/machinery/computer/robotics/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
diff --git a/code/game/machinery/computer/salvage_ship.dm b/code/game/machinery/computer/salvage_ship.dm
index a54340da4de..a67868fe3de 100644
--- a/code/game/machinery/computer/salvage_ship.dm
+++ b/code/game/machinery/computer/salvage_ship.dm
@@ -75,6 +75,8 @@
/obj/machinery/computer/salvage_ship/Topic(href, href_list)
+ if(..())
+ return 1
if(!isliving(usr)) return
var/mob/living/user = usr
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index ce9b239da49..de83237918c 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -208,7 +208,7 @@ I can't be bothered to look more of the actual code outside of switch but that p
What a mess.*/
/obj/machinery/computer/secure_data/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(active1) ))
active1 = null
if (!( data_core.security.Find(active2) ))
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index 3b6a530f490..9a2372edd9a 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -151,7 +151,7 @@ I can't be bothered to look more of the actual code outside of switch but that p
What a mess.*/
/obj/machinery/computer/skills/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(active1) ))
active1 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm
index bdfa06eeba4..7a90e1de8b1 100644
--- a/code/game/machinery/computer/specops_shuttle.dm
+++ b/code/game/machinery/computer/specops_shuttle.dm
@@ -287,7 +287,7 @@ var/specops_shuttle_timeleft = 0
/obj/machinery/computer/specops_shuttle/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
diff --git a/code/game/machinery/computer/store.dm b/code/game/machinery/computer/store.dm
index 31981544e62..9ab45f15d94 100644
--- a/code/game/machinery/computer/store.dm
+++ b/code/game/machinery/computer/store.dm
@@ -128,7 +128,7 @@ td.cost.toomuch {
/obj/machinery/computer/merch/Topic(href, href_list)
if(..())
- return
+ return 1
//testing(href)
diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm
index a095dc495f0..a6ae2e3628a 100644
--- a/code/game/machinery/computer/syndicate_specops_shuttle.dm
+++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm
@@ -220,7 +220,7 @@ var/syndicate_elite_shuttle_timeleft = 0
/obj/machinery/computer/syndicate_elite_shuttle/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm
index ae076b34349..4e49e677901 100644
--- a/code/game/machinery/computer/telecrystalconsoles.dm
+++ b/code/game/machinery/computer/telecrystalconsoles.dm
@@ -106,7 +106,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
/obj/machinery/computer/telecrystals/uplinker/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["donate1"])
donateTC(1)
diff --git a/code/game/machinery/computer/xenos_shuttle.dm b/code/game/machinery/computer/xenos_shuttle.dm
index 1944274965a..5d5f921fdba 100644
--- a/code/game/machinery/computer/xenos_shuttle.dm
+++ b/code/game/machinery/computer/xenos_shuttle.dm
@@ -123,6 +123,9 @@
/obj/machinery/computer/xenos_station/Topic(href, href_list)
+ if(..())
+ return 1
+
if(!isliving(usr)) return
var/mob/living/user = usr
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index c108e02822c..0d3dddbba8b 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -289,7 +289,7 @@ to destroy them and players will be able to make replacements.
frame_desc = "Requires 5 pieces of cable, 5 Power Cells and 1 Capacitor."
req_components = list(
/obj/item/stack/cable_coil = 5,
- /obj/item/weapon/cell = 5,
+ /obj/item/weapon/stock_parts/cell = 5,
/obj/item/weapon/stock_parts/capacitor = 1)
@@ -361,7 +361,7 @@ to destroy them and players will be able to make replacements.
/obj/item/weapon/stock_parts/capacitor = 1,
/obj/item/weapon/stock_parts/manipulator = 1,
/obj/item/weapon/stock_parts/console_screen = 1,
- /obj/item/weapon/cell = 1)
+ /obj/item/weapon/stock_parts/cell = 1)
/obj/item/weapon/circuitboard/destructive_analyzer
name = "Circuit board (Destructive Analyzer)"
@@ -583,7 +583,7 @@ obj/item/weapon/circuitboard/rdserver
frame_desc = "Requires 2 Capacitors, 1 Power Cell and 1 Manipulator."
req_components = list(
/obj/item/weapon/stock_parts/capacitor = 2,
- /obj/item/weapon/cell = 1,
+ /obj/item/weapon/stock_parts/cell = 1,
/obj/item/weapon/stock_parts/manipulator = 1)
// Telecomms circuit boards:
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index dc738ad2139..3a393c866bb 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -5,6 +5,7 @@
density = 1
anchored = 1.0
layer = 2.8
+ interact_offline = 1
var/on = 0
var/temperature_archived
@@ -77,7 +78,7 @@
return
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.resting) //are you cuffed, dying, lying, stunned or other
return
- if(O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
+ if(get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
return
if(!ismob(O)) //humans only
return
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 91dbbae40b3..6f7018c1cf4 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -65,9 +65,8 @@
onclose(user, "cryopod_console")
/obj/machinery/computer/cryopod/Topic(href, href_list)
-
if(..())
- return
+ return 1
var/mob/user = usr
@@ -200,7 +199,7 @@
/obj/item/clothing/shoes/magboots,
/obj/item/blueprints,
/obj/item/clothing/head/helmet/space,
- /obj/item/weapon/tank
+ /obj/item/weapon/storage/internal
)
/obj/machinery/cryopod/right
@@ -469,7 +468,7 @@
return
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.resting) //are you cuffed, dying, lying, stunned or other
return
- if(O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
+ if(get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
return
if(!ismob(O)) //humans only
return
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 9ec64ff61c5..19980597308 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -695,16 +695,13 @@ About the new airlock wires panel:
//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, 11 emergency access
//aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door, 8 door safties, 9 door speed, 11 emergency access
- 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)
@@ -753,7 +750,7 @@ About the new airlock wires panel:
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
@@ -943,7 +940,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)
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index b7203be245d..419b5f7b664 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -6,7 +6,7 @@
icon_state = "flood00"
density = 1
var/on = 0
- var/obj/item/weapon/cell/high/cell = null
+ var/obj/item/weapon/stock_parts/cell/high/cell = null
var/use = 5
var/unlocked = 0
var/open = 0
@@ -83,7 +83,7 @@
open = 1
user << "You remove the battery panel."
- if (istype(W, /obj/item/weapon/cell))
+ if (istype(W, /obj/item/weapon/stock_parts/cell))
if(open)
if(cell)
user << "There is a power cell already installed."
diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm
index ee93ac74799..7acdc9e6fe2 100644
--- a/code/game/machinery/guestpass.dm
+++ b/code/game/machinery/guestpass.dm
@@ -105,7 +105,7 @@
/obj/machinery/computer/guestpass/Topic(href, href_list)
if(..())
- return
+ return 1
usr.set_machine(src)
if (href_list["mode"])
mode = text2num(href_list["mode"])
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 5e69e5701af..7d9eb50d44b 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -184,37 +184,65 @@ Class Procs:
use_power(active_power_usage,power_channel, 1)
return 1
-/obj/machinery/Topic(href, href_list)
- ..()
- if(!interact_offline && stat & (NOPOWER|BROKEN))
+/obj/machinery/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1)
+ if(..())
return 1
- if(usr.restrained() || usr.lying || usr.stat)
+ if(!can_be_used_by(usr, be_close = checkrange))
return 1
- if ( ! (istype(usr, /mob/living/carbon/human) || \
- istype(usr, /mob/living/silicon) || \
- istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
- usr << "\red You don't have the dexterity to do this!"
- return 1
-
- var/norange = 0
- if(istype(usr, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = usr
- if(istype(H.l_hand, /obj/item/tk_grab))
- norange = 1
- else if(istype(H.r_hand, /obj/item/tk_grab))
- norange = 1
-
- if(!norange)
- if ((!in_range(src, usr) || !istype(src.loc, /turf)) && !istype(usr, /mob/living/silicon))
- return 1
-
- src.add_fingerprint(usr)
-
- var/area/A = get_area(src)
- A.powerupdate = 1
-
+ add_fingerprint(usr)
return 0
+/obj/machinery/proc/can_be_used_by(mob/user, be_close = 1)
+ if(!interact_offline && stat & (NOPOWER|BROKEN))
+ return 0
+ if(!user.canUseTopic(src, be_close))
+ return 0
+ return 1
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
+/mob/proc/canUseTopic(atom/movable/M, be_close = 1)
+ return
+
+/mob/dead/observer/canUseTopic(atom/movable/M, be_close = 1)
+ if(check_rights(R_ADMIN, 0))
+ return
+
+/mob/living/canUseTopic(atom/movable/M, be_close = 1, no_dextery = 0)
+ if(no_dextery)
+ src << "You don't have the dexterity to do this!"
+ return 0
+ return be_close && !in_range(M, src)
+
+/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close = 1)
+ if(restrained() || lying || stat || stunned || weakened)
+ return
+ if(be_close && !in_range(M, src))
+ if(M_TK in mutations)
+ var/mob/living/carbon/human/H = M
+ if(istype(H.l_hand, /obj/item/tk_grab) || istype(H.r_hand, /obj/item/tk_grab))
+ return 1
+ return
+ if(!isturf(M.loc) && M.loc != src)
+ return
+ return 1
+
+/mob/living/silicon/ai/canUseTopic(atom/movable/M)
+ if(stat)
+ return
+ //stop AIs from leaving windows open and using then after they lose vision
+ //apc_override is needed here because AIs use their own APC when powerless
+ if(cameranet && !cameranet.checkTurfVis(get_turf(M)) && !apc_override)
+ return
+ return 1
+
+/mob/living/silicon/robot/canUseTopic(atom/movable/M)
+ if(stat || lockcharge || stunned || weakened)
+ return
+ return 1
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
/obj/machinery/attack_ai(var/mob/user as mob)
if(isAI(user))
var/mob/living/silicon/ai/A = user
@@ -351,22 +379,6 @@ Class Procs:
user << "[A.name] replaced with [B.name]."
shouldplaysound = 1
break
- // Power cell snowflake
- for(var/obj/item/weapon/cell/A in component_parts)
- for(var/D in CB.req_components)
- if(ispath(A.type, D))
- P = D
- break
- for(var/obj/item/weapon/cell/B in W.contents)
- if(istype(B, P) && istype(A, P))
- if(B.rating > A.rating)
- W.remove_from_storage(B, src)
- W.handle_item_insertion(A, 1)
- component_parts -= A
- component_parts += B
- B.loc = null
- user << "[A.name] replaced with [B.name]."
- break
RefreshParts()
else
user << "Following parts detected in the machine:"
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index fcb2412c122..1c7f8ee64a0 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -460,7 +460,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["set_channel_name"])
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 84d6915556c..31da7e13203 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -233,7 +233,7 @@ Status: [] "},
/obj/machinery/porta_turret/Topic(href, href_list)
if (..())
- return
+ return 1
usr.set_machine(src)
src.add_fingerprint(usr)
if ((href_list["power"]) && (src.allowed(usr)))
diff --git a/code/game/machinery/programmable_unloader.dm b/code/game/machinery/programmable_unloader.dm
index c481d6fa32c..e7039af7f64 100644
--- a/code/game/machinery/programmable_unloader.dm
+++ b/code/game/machinery/programmable_unloader.dm
@@ -144,7 +144,7 @@
/obj/machinery/programmable/Topic(href, href_list)
if(..())
- return
+ return 1
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index eea611886da..f339132dca6 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -19,17 +19,20 @@
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
- component_parts += new /obj/item/weapon/cell/high(src)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(src)
RefreshParts()
build_icon()
/obj/machinery/recharge_station/upgraded/New()
..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/cyborgrecharger(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor/super(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor/super(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(src)
- component_parts += new /obj/item/weapon/cell/hyper(src)
+ component_parts += new /obj/item/weapon/stock_parts/cell/hyper(src)
RefreshParts()
+ build_icon()
/obj/machinery/recharge_station/RefreshParts()
recharge_speed = 0
@@ -38,7 +41,7 @@
recharge_speed += C.rating * 100
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
repairs += M.rating - 1
- for(var/obj/item/weapon/cell/C in component_parts)
+ for(var/obj/item/weapon/stock_parts/cell/C in component_parts)
recharge_speed *= C.maxcharge / 10000
/obj/machinery/recharge_station/process()
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 9a6849dcdf4..de3cf6964d6 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -5,7 +5,7 @@
icon_state = "sheater0"
name = "space heater"
desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire."
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/on = 0
var/open = 0
var/set_temperature = 50 // in celcius, add T0C for kelvin
@@ -52,14 +52,14 @@
..(severity)
attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/cell))
+ if(istype(I, /obj/item/weapon/stock_parts/cell))
if(open)
if(cell)
user << "There is already a power cell inside."
return
else
// insert cell
- var/obj/item/weapon/cell/C = usr.get_active_hand()
+ var/obj/item/weapon/stock_parts/cell/C = usr.get_active_hand()
if(istype(C))
user.drop_item()
cell = C
@@ -120,8 +120,8 @@
Topic(href, href_list)
- if (usr.stat)
- return
+ if (..())
+ return 1
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
@@ -144,7 +144,7 @@
if("cellinstall")
if(open && !cell)
- var/obj/item/weapon/cell/C = usr.get_active_hand()
+ var/obj/item/weapon/stock_parts/cell/C = usr.get_active_hand()
if(istype(C))
usr.drop_item()
cell = C
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 0b81ccabbeb..1b05e84fe9f 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -153,7 +153,7 @@
/obj/machinery/suit_storage_unit/Topic(href, href_list) //I fucking HATE this proc
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.set_machine(src)
if (href_list["toggleUV"])
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index a4cc791bff9..8cc2408c46c 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -39,6 +39,8 @@
onclose(user, "syndbeacon")
Topic(href, href_list)
+ if(..())
+ return 1
if(href_list["betraitor"])
if(charges < 1)
src.updateUsrDialog()
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 9e18e2ce265..1aabc4b6d6d 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -93,7 +93,7 @@
/obj/machinery/computer/teleporter/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["eject"])
eject()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 507d0c1dfe7..4f77d7d7c70 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -462,7 +462,7 @@
/obj/machinery/turretid/Topic(href, href_list)
if(..())
- return
+ return 1
if (src.locked)
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 348456523eb..a2b95fed050 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -397,7 +397,7 @@
/obj/machinery/vending/Topic(href, href_list)
if(..())
- return
+ return 1
if(istype(usr,/mob/living/silicon))
if(istype(usr,/mob/living/silicon/robot))
@@ -919,7 +919,7 @@
/obj/item/clothing/head/helmet/gladiator = 1,/obj/item/clothing/under/gimmick/rank/captain/suit = 1,/obj/item/clothing/head/flatcap = 1,
/obj/item/clothing/suit/storage/labcoat/mad = 1,/obj/item/clothing/glasses/gglasses = 1,/obj/item/clothing/shoes/jackboots = 1,
/obj/item/clothing/under/schoolgirl = 1,/obj/item/clothing/head/kitty = 1,/obj/item/clothing/under/blackskirt = 1,/obj/item/clothing/head/beret = 1,
- /obj/item/clothing/tie/waistcoat = 1,/obj/item/clothing/under/suit_jacket = 1,/obj/item/clothing/head/that =1,/obj/item/clothing/under/kilt = 1,/obj/item/clothing/head/beret = 1,/obj/item/clothing/tie/waistcoat = 1,
+ /obj/item/clothing/accessory/waistcoat = 1,/obj/item/clothing/under/suit_jacket = 1,/obj/item/clothing/head/that =1,/obj/item/clothing/under/kilt = 1,/obj/item/clothing/head/beret = 1,/obj/item/clothing/accessory/waistcoat = 1,
/obj/item/clothing/glasses/monocle =1,/obj/item/clothing/head/bowlerhat = 1,/obj/item/weapon/cane = 1,/obj/item/clothing/under/sl_suit = 1,
/obj/item/clothing/mask/fakemoustache = 1,/obj/item/clothing/suit/bio_suit/plaguedoctorsuit = 1,/obj/item/clothing/head/plaguedoctorhat = 1,/obj/item/clothing/mask/gas/plaguedoctor = 1,
/obj/item/clothing/under/owl = 1,/obj/item/clothing/mask/gas/owl_mask = 1,/obj/item/clothing/suit/apron = 1,/obj/item/clothing/under/waiter = 1,
@@ -930,7 +930,7 @@
/obj/item/clothing/suit/wizrobe/fake = 1,/obj/item/clothing/head/wizard/fake = 1,/obj/item/weapon/staff = 3,/obj/item/clothing/mask/gas/sexyclown = 1,
/obj/item/clothing/under/sexyclown = 1,/obj/item/clothing/mask/gas/sexymime = 1,/obj/item/clothing/under/sexymime = 1,/obj/item/clothing/suit/apron/overalls = 1,
/obj/item/clothing/head/rabbitears =1, /obj/item/clothing/head/sombrero = 1, /obj/item/clothing/suit/poncho = 1,
- /obj/item/clothing/suit/poncho/green = 1, /obj/item/clothing/suit/poncho/red = 1, /obj/item/clothing/tie/blue = 1, /obj/item/clothing/tie/red = 1, /obj/item/clothing/tie/black = 1, /obj/item/clothing/tie/horrible = 1,
+ /obj/item/clothing/suit/poncho/green = 1, /obj/item/clothing/suit/poncho/red = 1, /obj/item/clothing/accessory/blue = 1, /obj/item/clothing/accessory/red = 1, /obj/item/clothing/accessory/black = 1, /obj/item/clothing/accessory/horrible = 1,
/obj/item/clothing/under/maid = 1, /obj/item/clothing/under/janimaid = 1)
contraband = list(/obj/item/clothing/suit/judgerobe = 1,/obj/item/clothing/head/powdered_wig = 1,/obj/item/weapon/gun/magic/wand = 1)
premium = list(/obj/item/clothing/suit/hgpirate = 1, /obj/item/clothing/head/hgpiratecap = 1, /obj/item/clothing/head/helmet/roman = 1, /obj/item/clothing/head/helmet/roman/legionaire = 1, /obj/item/clothing/under/roman = 1, /obj/item/clothing/shoes/roman = 1)
@@ -979,8 +979,8 @@
icon_state = "engivend"
icon_deny = "engivend-deny"
req_access_txt = "11" //Engineering Equipment access
- products = list(/obj/item/clothing/glasses/meson = 2,/obj/item/device/multitool = 4,/obj/item/weapon/airlock_electronics = 10,/obj/item/weapon/module/power_control = 10,/obj/item/weapon/airalarm_electronics = 10,/obj/item/weapon/cell/high = 10)
- contraband = list(/obj/item/weapon/cell/potato = 3)
+ products = list(/obj/item/clothing/glasses/meson = 2,/obj/item/device/multitool = 4,/obj/item/weapon/airlock_electronics = 10,/obj/item/weapon/module/power_control = 10,/obj/item/weapon/airalarm_electronics = 10,/obj/item/weapon/stock_parts/cell/high = 10)
+ contraband = list(/obj/item/weapon/stock_parts/cell/potato = 3)
premium = list(/obj/item/weapon/storage/belt/utility = 3)
//This one's from bay12
@@ -993,7 +993,7 @@
products = list(/obj/item/clothing/under/rank/chief_engineer = 4,/obj/item/clothing/under/rank/engineer = 4,/obj/item/clothing/shoes/orange = 4,/obj/item/clothing/head/hardhat = 4,
/obj/item/weapon/storage/belt/utility = 4,/obj/item/clothing/glasses/meson = 4,/obj/item/clothing/gloves/yellow = 4, /obj/item/weapon/screwdriver = 12,
/obj/item/weapon/crowbar = 12,/obj/item/weapon/wirecutters = 12,/obj/item/device/multitool = 12,/obj/item/weapon/wrench = 12,/obj/item/device/t_scanner = 12,
- /obj/item/stack/cable_coil/heavyduty = 8, /obj/item/weapon/cell = 8, /obj/item/weapon/weldingtool = 8,/obj/item/clothing/head/welding = 8,
+ /obj/item/stack/cable_coil/heavyduty = 8, /obj/item/weapon/stock_parts/cell = 8, /obj/item/weapon/weldingtool = 8,/obj/item/clothing/head/welding = 8,
/obj/item/weapon/light/tube = 10,/obj/item/clothing/suit/fire = 4, /obj/item/weapon/stock_parts/scanning_module = 5,/obj/item/weapon/stock_parts/micro_laser = 5,
/obj/item/weapon/stock_parts/matter_bin = 5,/obj/item/weapon/stock_parts/manipulator = 5,/obj/item/weapon/stock_parts/console_screen = 5)
// There was an incorrect entry (cablecoil/power). I improvised to cablecoil/heavyduty.
@@ -1008,7 +1008,7 @@
icon_deny = "robotics-deny"
req_access_txt = "29"
products = list(/obj/item/clothing/suit/storage/labcoat = 4,/obj/item/clothing/under/rank/roboticist = 4,/obj/item/stack/cable_coil = 4,/obj/item/device/flash = 4,
- /obj/item/weapon/cell/high = 12, /obj/item/device/assembly/prox_sensor = 3,/obj/item/device/assembly/signaler = 3,/obj/item/device/healthanalyzer = 3,
+ /obj/item/weapon/stock_parts/cell/high = 12, /obj/item/device/assembly/prox_sensor = 3,/obj/item/device/assembly/signaler = 3,/obj/item/device/healthanalyzer = 3,
/obj/item/weapon/scalpel = 2,/obj/item/weapon/circular_saw = 2,/obj/item/weapon/tank/anesthetic = 2,/obj/item/clothing/mask/breath/medical = 5,
/obj/item/weapon/screwdriver = 5,/obj/item/weapon/crowbar = 5)
//everything after the power cell had no amounts, I improvised. -Sayu
@@ -1097,11 +1097,11 @@
/obj/item/clothing/under/pants/camo = 1,/obj/item/clothing/under/pants/blackjeans=2,/obj/item/clothing/under/pants/khaki=2,
/obj/item/clothing/under/pants/white=2,/obj/item/clothing/under/pants/red=1,/obj/item/clothing/under/pants/black=2,
/obj/item/clothing/under/pants/tan=2,/obj/item/clothing/under/pants/blue=1,/obj/item/clothing/under/pants/track=1,
- /obj/item/clothing/tie/scarf/red=1,/obj/item/clothing/tie/scarf/green=1,/obj/item/clothing/tie/scarf/darkblue=1,
- /obj/item/clothing/tie/scarf/purple=1,/obj/item/clothing/tie/scarf/yellow=1,/obj/item/clothing/tie/scarf/orange=1,
- /obj/item/clothing/tie/scarf/lightblue=1,/obj/item/clothing/tie/scarf/white=1,/obj/item/clothing/tie/scarf/black=1,
- /obj/item/clothing/tie/scarf/zebra=1,/obj/item/clothing/tie/scarf/christmas=1,/obj/item/clothing/tie/stripedredscarf=1,
- /obj/item/clothing/tie/stripedbluescarf=1,/obj/item/clothing/tie/stripedgreenscarf=1,/obj/item/clothing/tie/waistcoat=1,
+ /obj/item/clothing/accessory/scarf/red=1,/obj/item/clothing/accessory/scarf/green=1,/obj/item/clothing/accessory/scarf/darkblue=1,
+ /obj/item/clothing/accessory/scarf/purple=1,/obj/item/clothing/accessory/scarf/yellow=1,/obj/item/clothing/accessory/scarf/orange=1,
+ /obj/item/clothing/accessory/scarf/lightblue=1,/obj/item/clothing/accessory/scarf/white=1,/obj/item/clothing/accessory/scarf/black=1,
+ /obj/item/clothing/accessory/scarf/zebra=1,/obj/item/clothing/accessory/scarf/christmas=1,/obj/item/clothing/accessory/stripedredscarf=1,
+ /obj/item/clothing/accessory/stripedbluescarf=1,/obj/item/clothing/accessory/stripedgreenscarf=1,/obj/item/clothing/accessory/waistcoat=1,
/obj/item/clothing/under/sundress=2,/obj/item/clothing/under/stripeddress = 1, /obj/item/clothing/under/sailordress = 1, /obj/item/clothing/under/redeveninggown = 1, /obj/item/clothing/under/blacktango=1,/obj/item/clothing/suit/jacket=3,
/obj/item/clothing/glasses/regular=2,/obj/item/clothing/head/sombrero=1,/obj/item/clothing/suit/poncho=1,
/obj/item/clothing/suit/ianshirt=1,/obj/item/clothing/shoes/laceup=2,/obj/item/clothing/shoes/black=4,
diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm
index 2c723a2e530..26d9d066fd8 100644
--- a/code/game/mecha/combat/gygax.dm
+++ b/code/game/mecha/combat/gygax.dm
@@ -53,7 +53,7 @@
ME.attach(src)
return
-/obj/mecha/combat/gygax/dark/add_cell(var/obj/item/weapon/cell/C=null)
+/obj/mecha/combat/gygax/dark/add_cell(var/obj/item/weapon/stock_parts/cell/C=null)
if(C)
C.forceMove(src)
cell = C
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index d34d2bb0f2e..e62872c9664 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -29,7 +29,7 @@
var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
//the values in this list show how much damage will pass through, not how much will be absorbed.
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/state = 0
var/list/log = new
var/last_message = 0
@@ -115,7 +115,7 @@
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank
-/obj/mecha/proc/add_cell(var/obj/item/weapon/cell/C=null)
+/obj/mecha/proc/add_cell(var/obj/item/weapon/stock_parts/cell/C=null)
if(C)
C.forceMove(src)
cell = C
@@ -781,7 +781,7 @@
user << "You screw the cell in place"
return
- else if(istype(W, /obj/item/weapon/cell))
+ else if(istype(W, /obj/item/weapon/stock_parts/cell))
if(state==4)
if(!src.cell)
user << "You install the powercell"
@@ -1231,6 +1231,8 @@
/////////////////////////
/obj/mecha/proc/operation_allowed(mob/living/carbon/human/H)
+ if(!ishuman(H))
+ return 0
for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt))
if(src.check_access(ID,src.operation_req_access))
return 1
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index 37e1c1ee13e..223f6d4aa24 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -91,7 +91,7 @@
const_holder.icon_state = "ripley0"
const_holder.density = 1
const_holder.overlays.len = 0
- qdel(src)
+ del(src)
return
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index cedc2e47cd8..21179bd93dd 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -480,6 +480,19 @@
if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
return 1
return 0
+ if(slot_tie)
+ if(!H.w_uniform)
+ if(!disable_warning)
+ H << "You need a jumpsuit before you can attach this [name]."
+ return 0
+ var/obj/item/clothing/under/uniform = H.w_uniform
+ if(uniform.accessories.len && !uniform.can_attach_accessory(src))
+ if (!disable_warning)
+ H << "You already have an accessory of this type attached to your [uniform]."
+ return 0
+ if( !(slot_flags & SLOT_TIE) )
+ return 0
+ return 1
return 0 //Unsupported slot
//END HUMAN
@@ -551,7 +564,7 @@
if( src in usr )
attack_self(usr)
return
- else if(istype(src, /obj/item/clothing/tie))
+ else if(istype(src, /obj/item/clothing/accessory))
if(istype(src.loc,/obj/item/clothing/under))
attack_self(usr)
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index 9ef170a7d9b..f4dfd0bf245 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -17,7 +17,7 @@
var/on = 0 //is it turned on?
var/cover_open = 0 //is the cover open?
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/max_cooling = 12 //in degrees per second - probably don't need to mess with heat capacity here
var/charge_consumption = 16.6 //charge per second at max_cooling
var/thermostat = T20C
@@ -25,7 +25,7 @@
//TODO: make it heat up the surroundings when not in space
/obj/item/device/suit_cooling_unit/New()
- cell = new/obj/item/weapon/cell() //comes with the crappy default power cell - high-capacity ones shouldn't be hard to find
+ cell = new/obj/item/weapon/stock_parts/cell() //comes with the crappy default power cell - high-capacity ones shouldn't be hard to find
cell.loc = src
/obj/item/device/suit_cooling_unit/proc/cool_mob(mob/M)
@@ -132,7 +132,7 @@
updateicon()
return
- if (istype(W, /obj/item/weapon/cell))
+ if (istype(W, /obj/item/weapon/stock_parts/cell))
if(cover_open)
if(cell)
user << "There is a [cell] already installed here."
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 744d5999ff7..b1f5a1570fd 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -49,7 +49,7 @@
construction_time = 350
construction_cost = list("metal"=40000)
var/wires = 0.0
- var/obj/item/weapon/cell/cell = null
+ var/obj/item/weapon/stock_parts/cell/cell = null
/obj/item/robot_parts/head
name = "robot head"
@@ -251,7 +251,7 @@
/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob)
..()
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(src.cell)
user << "\blue You have already inserted a cell!"
return
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 5a608dc8abe..0fb733cad2a 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -80,7 +80,7 @@
/obj/item/device/lightreplacer,
/obj/item/device/taperecorder,
/obj/item/device/hailer,
- /obj/item/clothing/tie/holobadge,
+ /obj/item/clothing/accessory/holobadge,
/obj/structure/closet/crate/secure,
/obj/structure/closet/secure_closet,
/obj/machinery/librarycomp,
@@ -444,4 +444,4 @@
decal_name = "cryptographic sequencer"
decal_desc = "It's a card with a magnetic strip attached to some circuitry."
decal_icon_state = "emag"
- override_name = 1
\ No newline at end of file
+ override_name = 1
diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm
index f9a347df9ac..b65a1904116 100644
--- a/code/game/objects/items/weapons/defib.dm
+++ b/code/game/objects/items/weapons/defib.dm
@@ -19,7 +19,8 @@
var/safety = 1 //if you can zap people with the defibs on harm mode
var/powered = 0 //if there's a cell in the defib with enough power for a revive, blocks paddles from reviving otherwise
var/obj/item/weapon/twohanded/shockpaddles/paddles
- var/obj/item/weapon/cell/high/bcell = null
+ var/obj/item/weapon/stock_parts/cell/high/bcell = null
+ var/combat = 0 //can we revive through space suits?
/obj/item/weapon/defibrillator/New() //starts without a cell for rnd
..()
@@ -67,7 +68,7 @@
overlays += "defibunit-charge[ratio]"
/obj/item/weapon/defibrillator/CheckParts()
- bcell = locate(/obj/item/weapon/cell) in contents
+ bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
update_icon()
/obj/item/weapon/defibrillator/ui_action_click()
@@ -78,8 +79,8 @@
return
/obj/item/weapon/defibrillator/attackby(obj/item/weapon/W, mob/user)
- if(istype(W, /obj/item/weapon/cell))
- var/obj/item/weapon/cell/C = W
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
+ var/obj/item/weapon/stock_parts/cell/C = W
if(bcell)
user << "[src] already has a cell."
else
@@ -195,6 +196,49 @@
paddles.cooldown = 0
paddles.update_icon()
update_icon()
+
+/obj/item/weapon/defibrillator/compact
+ name = "compact defibrillator"
+ desc = "A belt-equipped defibrillator that can be rapidly deployed."
+ icon_state = "defibcompact"
+ item_state = "defibcompact"
+ w_class = 3
+ slot_flags = SLOT_BELT
+ origin_tech = "biotech=4"
+
+/obj/item/weapon/defibrillator/compact/ui_action_click()
+ if(usr.get_item_by_slot(slot_belt) == src)
+ toggle_paddles()
+ else
+ usr << "Strap the defibrillator's belt on first!"
+ return
+
+/obj/item/weapon/defibrillator/compact/loaded/New()
+ ..()
+ paddles = make_paddles()
+ bcell = new(src)
+ update_icon()
+ return
+
+/obj/item/weapon/defibrillator/compact/combat
+ name = "combat defibrillator"
+ desc = "A belt-equipped blood-red defibrillator that can be rapidly deployed. Does not have the restrictions or safeties of conventional defibrillators and can revive through space suits."
+ combat = 1
+ safety = 0
+
+/obj/item/weapon/defibrillator/compact/combat/loaded/New()
+ ..()
+ paddles = make_paddles()
+ bcell = new /obj/item/weapon/stock_parts/cell/infinite(src)
+ update_icon()
+ return
+
+/obj/item/weapon/defibrillator/compact/combat/attackby(obj/item/weapon/W, mob/user)
+ if(W == paddles)
+ paddles.unwield()
+ toggle_paddles()
+ update_icon()
+ return
//paddles
@@ -254,7 +298,7 @@
else
return 1
-/obj/item/weapon/twohanded/shockpaddles/attack(mob/M as mob, mob/user as mob)
+/obj/item/weapon/twohanded/shockpaddles/attack(mob/M, mob/user)
var/tobehealed
var/threshold = -config.health_threshold_dead
var/mob/living/carbon/human/H = M
@@ -300,18 +344,19 @@
playsound(get_turf(src), 'sound/weapons/flash.ogg', 50, 0)
var/mob/dead/observer/ghost = H.get_ghost()
var/tplus = world.time - H.timeofdeath
- var/tlimit = 3000 //past this much time the patient is unrecoverable (in deciseconds)
- var/tloss = 900 //brain damage starts setting in on the patient after some time left rotting
+ var/tlimit = 6000 //past this much time the patient is unrecoverable (in deciseconds)
+ var/tloss = 3000 //brain damage starts setting in on the patient after some time left rotting
var/total_burn = 0
var/total_brute = 0
if(do_after(user, 20)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
for(var/obj/item/carried_item in H.contents)
- if((istype(carried_item, /obj/item/clothing/suit/armor)) || (istype(carried_item, /obj/item/clothing/suit/space)))
- user.visible_message("[defib] buzzes: Patient's chest is obscured. Operation aborted.")
- playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 50, 0)
- busy = 0
- update_icon()
- return
+ if(istype(carried_item, /obj/item/clothing/suit/space))
+ if(!defib.combat)
+ user.visible_message("[defib] buzzes: Patient's chest is obscured. Operation aborted.")
+ playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 50, 0)
+ busy = 0
+ update_icon()
+ return
if(H.stat == 2)
var/health = H.health
M.visible_message("[M]'s body convulses a bit.")
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 8176d23258d..84be7792502 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -66,7 +66,7 @@
/obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag)
if (!flag)
return
- if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/machinery/door/airlock/hatch/gamma))
+ if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage) || istype(target, /obj/item/clothing/accessory/storage) || istype(target, /obj/item/clothing/under))
return
user << "Planting explosives..."
diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm
index a08ca995574..0af739fdccd 100644
--- a/code/game/objects/items/weapons/gift_wrappaper.dm
+++ b/code/game/objects/items/weapons/gift_wrappaper.dm
@@ -104,7 +104,7 @@
/obj/item/device/paicard,
/obj/item/device/violin,
/obj/item/weapon/storage/belt/utility/full,
- /obj/item/clothing/tie/horrible)
+ /obj/item/clothing/accessory/horrible)
if(!ispath(gift_type,/obj/item)) return
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index e98c641c363..2c68041fb16 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -54,7 +54,7 @@
/obj/item/weapon/melee/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R)
if(R.cell)
- var/obj/item/weapon/cell/C = R.cell
+ var/obj/item/weapon/stock_parts/cell/C = R.cell
if(active && !(C.use(hitcost)))
attack_self()
R << "It's out of charge!"
diff --git a/code/game/objects/items/weapons/power_cells.dm b/code/game/objects/items/weapons/power_cells.dm
index cf9abda162f..5a4b7a98d9d 100644
--- a/code/game/objects/items/weapons/power_cells.dm
+++ b/code/game/objects/items/weapons/power_cells.dm
@@ -1,4 +1,4 @@
-/obj/item/weapon/cell
+/obj/item/weapon/stock_parts/cell
name = "power cell"
desc = "A rechargable electrochemical power cell."
icon = 'icons/obj/power.dmi'
@@ -13,7 +13,7 @@
w_class = 3.0
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 10000
- var/rating = 1
+ rating = 1
m_amt = 700
g_amt = 50
var/rigged = 0 // true if rigged to explode
@@ -25,7 +25,7 @@
viewers(user) << "[user] is licking the electrodes of the [src.name]! It looks like \he's trying to commit suicide."
return (FIRELOSS)
-/obj/item/weapon/cell/crap
+/obj/item/weapon/stock_parts/cell/crap
name = "\improper Nanotrasen brand rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = "powerstorage=0"
@@ -33,22 +33,22 @@
rating = 2
g_amt = 40
-/obj/item/weapon/cell/crap/empty/New()
+/obj/item/weapon/stock_parts/cell/crap/empty/New()
..()
charge = 0
-/obj/item/weapon/cell/secborg
+/obj/item/weapon/stock_parts/cell/secborg
name = "\improper Security borg rechargable D battery"
origin_tech = "powerstorage=0"
maxcharge = 6000 //6000 max charge / 1000 charge per shot = six shots
rating = 2.5
g_amt = 40
-/obj/item/weapon/cell/secborg/empty/New()
+/obj/item/weapon/stock_parts/cell/secborg/empty/New()
..()
charge = 0
-/obj/item/weapon/cell/high
+/obj/item/weapon/stock_parts/cell/high
name = "high-capacity power cell"
origin_tech = "powerstorage=2"
icon_state = "hcell"
@@ -56,11 +56,11 @@
rating = 3
g_amt = 60
-/obj/item/weapon/cell/high/empty/New()
+/obj/item/weapon/stock_parts/cell/high/empty/New()
..()
charge = 0
-/obj/item/weapon/cell/super
+/obj/item/weapon/stock_parts/cell/super
name = "super-capacity power cell"
origin_tech = "powerstorage=5"
icon_state = "scell"
@@ -69,11 +69,11 @@
rating = 4
construction_cost = list("metal"=750,"glass"=100)
-/obj/item/weapon/cell/super/empty/New()
+/obj/item/weapon/stock_parts/cell/super/empty/New()
..()
charge = 0
-/obj/item/weapon/cell/hyper
+/obj/item/weapon/stock_parts/cell/hyper
name = "hyper-capacity power cell"
origin_tech = "powerstorage=6"
icon_state = "hpcell"
@@ -82,11 +82,11 @@
g_amt = 80
construction_cost = list("metal"=500,"glass"=150,"gold"=200,"silver"=200)
-/obj/item/weapon/cell/hyper/empty/New()
+/obj/item/weapon/stock_parts/cell/hyper/empty/New()
..()
charge = 0
-/obj/item/weapon/cell/infinite
+/obj/item/weapon/stock_parts/cell/infinite
name = "infinite-capacity power cell!"
icon_state = "icell"
origin_tech = null
@@ -96,7 +96,7 @@
use()
return 1
-/obj/item/weapon/cell/potato
+/obj/item/weapon/stock_parts/cell/potato
name = "potato battery"
desc = "A rechargable starch based power cell."
origin_tech = "powerstorage=1"
@@ -110,7 +110,7 @@
minor_fault = 1
-/obj/item/weapon/cell/slime
+/obj/item/weapon/stock_parts/cell/slime
name = "charged slime core"
desc = "A yellow slime core infused with plasma, it crackles with power."
origin_tech = "powerstorage=2;biotech=4"
diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm
index bf36677777a..56c02a49bdf 100644
--- a/code/game/objects/items/weapons/storage/firstaid.dm
+++ b/code/game/objects/items/weapons/storage/firstaid.dm
@@ -121,8 +121,8 @@
/obj/item/weapon/storage/firstaid/tactical/New()
..()
if (empty) return
- new /obj/item/clothing/tie/stethoscope( src )
- new /obj/item/weapon/surgicaldrill(src)
+ new /obj/item/clothing/accessory/stethoscope( src )
+ new /obj/item/weapon/defibrillator/compact/combat/loaded(src)
new /obj/item/weapon/reagent_containers/hypospray/combat(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm
new file mode 100644
index 00000000000..082002a5b9a
--- /dev/null
+++ b/code/game/objects/items/weapons/storage/internal.dm
@@ -0,0 +1,85 @@
+//A storage item intended to be used by other items to provide storage functionality.
+//Types that use this should consider overriding emp_act() and hear_talk(), unless they shield their contents somehow.
+/obj/item/weapon/storage/internal
+ var/obj/item/master_item
+
+/obj/item/weapon/storage/internal/New(obj/item/MI)
+ master_item = MI
+ loc = master_item
+ name = master_item.name
+ verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up.
+ ..()
+
+/obj/item/weapon/storage/internal/attack_hand()
+ return //make sure this is never picked up
+
+/obj/item/weapon/storage/internal/mob_can_equip()
+ return 0 //make sure this is never picked up
+
+//Helper procs to cleanly implement internal storages - storage items that provide inventory slots for other items.
+//These procs are completely optional, it is up to the master item to decide when it's storage get's opened by calling open()
+//However they are helpful for allowing the master item to pretend it is a storage item itself.
+//If you are using these you will probably want to override attackby() as well.
+//See /obj/item/clothing/suit/storage for an example.
+
+//items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour.
+//returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of
+//doing it without the ability to call another proc's parent, really.
+/obj/item/weapon/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj)
+ if (ishuman(user) || ismonkey(user)) //so monkeys can take off their backpacks -- Urist
+
+ if (istype(user.loc,/obj/mecha)) // stops inventory actions in a mech
+ return 0
+
+ if(over_object == user && Adjacent(user)) // this must come before the screen objects only block
+ src.open(user)
+ return 0
+
+ if (!( istype(over_object, /obj/screen) ))
+ return 1
+
+ //makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away.
+ //there's got to be a better way of doing this...
+ if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user))
+ return 0
+
+ if (!( user.restrained() ) && !( user.stat ))
+ switch(over_object.name)
+ if("r_hand")
+ user.u_equip(master_item)
+ user.put_in_r_hand(master_item)
+ if("l_hand")
+ user.u_equip(master_item)
+ user.put_in_l_hand(master_item)
+ master_item.add_fingerprint(user)
+ return 0
+ return 0
+
+//items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour.
+//returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise.
+//It's strange, but no other way of doing it without the ability to call another proc's parent, really.
+/obj/item/weapon/storage/internal/proc/handle_attack_hand(mob/user as mob)
+
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ if(H.l_store == master_item && !H.get_active_hand()) //Prevents opening if it's in a pocket.
+ H.put_in_hands(master_item)
+ H.l_store = null
+ return 0
+ if(H.r_store == master_item && !H.get_active_hand())
+ H.put_in_hands(master_item)
+ H.r_store = null
+ return 0
+
+ src.add_fingerprint(user)
+ if (master_item.loc == user)
+ src.open(user)
+ return 0
+
+ for(var/mob/M in range(1, master_item.loc))
+ if (M.s_active == src)
+ src.close(M)
+ return 1
+
+/obj/item/weapon/storage/internal/Adjacent(var/atom/neighbor)
+ return master_item.Adjacent(neighbor)
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index f42ea800745..7caa4e9b0dc 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -104,12 +104,12 @@
New()
..()
- new /obj/item/clothing/tie/medal/gold/heroism(src)
- new /obj/item/clothing/tie/medal/silver/security(src)
- new /obj/item/clothing/tie/medal/silver/valor(src)
- new /obj/item/clothing/tie/medal/nobel_science(src)
- new /obj/item/clothing/tie/medal/bronze_heart(src)
- new /obj/item/clothing/tie/medal/conduct(src)
- new /obj/item/clothing/tie/medal/conduct(src)
- new /obj/item/clothing/tie/medal/conduct(src)
- new /obj/item/clothing/tie/medal/gold/captain(src)
+ new /obj/item/clothing/accessory/medal/gold/heroism(src)
+ new /obj/item/clothing/accessory/medal/silver/security(src)
+ new /obj/item/clothing/accessory/medal/silver/valor(src)
+ new /obj/item/clothing/accessory/medal/nobel_science(src)
+ new /obj/item/clothing/accessory/medal/bronze_heart(src)
+ new /obj/item/clothing/accessory/medal/conduct(src)
+ new /obj/item/clothing/accessory/medal/conduct(src)
+ new /obj/item/clothing/accessory/medal/conduct(src)
+ new /obj/item/clothing/accessory/medal/gold/captain(src)
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index c9df562f289..2b7661cc702 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -22,6 +22,7 @@
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
+ var/use_sound = "rustle" //sound played when used. null for no sound.
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
@@ -100,6 +101,15 @@
if(user.s_active == src)
user.s_active = null
return
+
+/obj/item/weapon/storage/proc/open(mob/user as mob)
+ if (src.use_sound)
+ playsound(src.loc, src.use_sound, 50, 1, -5)
+
+ orient2hud(user)
+ if (user.s_active)
+ user.s_active.close(user)
+ show_to(user)
/obj/item/weapon/storage/proc/close(mob/user as mob)
@@ -450,6 +460,39 @@
del(src)
//BubbleWrap END
+//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
+//Returns -1 if the atom was not found on container.
+/atom/proc/storage_depth(atom/container)
+ var/depth = 0
+ var/atom/cur_atom = src
+
+ while (cur_atom && !(cur_atom in container.contents))
+ if (isarea(cur_atom))
+ return -1
+ if (istype(cur_atom.loc, /obj/item/weapon/storage))
+ depth++
+ cur_atom = cur_atom.loc
+
+ if (!cur_atom)
+ return -1 //inside something with a null loc.
+
+ return depth
-
-
+//Like storage depth, but returns the depth to the nearest turf
+//Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow).
+/atom/proc/storage_depth_turf()
+ var/depth = 0
+ var/atom/cur_atom = src
+
+ while (cur_atom && !isturf(cur_atom))
+ if (isarea(cur_atom))
+ return -1
+ if (istype(cur_atom.loc, /obj/item/weapon/storage))
+ depth++
+ cur_atom = cur_atom.loc
+
+ if (!cur_atom)
+ return -1 //inside something with a null loc.
+
+ return depth
+
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index 2e9ed7b70c9..8a33f542f4c 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -12,7 +12,7 @@
attack_verb = list("beaten")
var/stunforce = 7
var/status = 0
- var/obj/item/weapon/cell/high/bcell = null
+ var/obj/item/weapon/stock_parts/cell/high/bcell = null
var/hitcost = 1500
/obj/item/weapon/melee/baton/suicide_act(mob/user)
@@ -25,7 +25,7 @@
return
/obj/item/weapon/melee/baton/CheckParts()
- bcell = locate(/obj/item/weapon/cell) in contents
+ bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
update_icon()
/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed.
@@ -61,8 +61,8 @@
user <<"The baton does not have a power source installed."
/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user)
- if(istype(W, /obj/item/weapon/cell))
- var/obj/item/weapon/cell/C = W
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
+ var/obj/item/weapon/stock_parts/cell/C = W
if(bcell)
user << "[src] already has a cell."
else
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index a2cec2ac512..e50de9f2d44 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -20,6 +20,12 @@
// What reagents should be logged when transferred TO this object?
// Reagent ID => friendly name
var/list/reagents_to_log=list()
+
+/obj/Topic(href, href_list, var/nowindow = 0)
+ // Calling Topic without a corresponding window open causes runtime errors
+ if(nowindow)
+ return 0
+ return ..()
/obj/Destroy()
machines -= src
diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm
index 832227b12d7..5c66dd46bcb 100644
--- a/code/game/objects/random/random.dm
+++ b/code/game/objects/random/random.dm
@@ -56,11 +56,11 @@
icon = 'icons/obj/power.dmi'
icon_state = "cell"
item_to_spawn()
- return pick(prob(10);/obj/item/weapon/cell/crap,\
- prob(40);/obj/item/weapon/cell,\
- prob(40);/obj/item/weapon/cell/high,\
- prob(9);/obj/item/weapon/cell/super,\
- prob(1);/obj/item/weapon/cell/hyper)
+ return pick(prob(10);/obj/item/weapon/stock_parts/cell/crap,\
+ prob(40);/obj/item/weapon/stock_parts/cell,\
+ prob(40);/obj/item/weapon/stock_parts/cell/high,\
+ prob(9);/obj/item/weapon/stock_parts/cell/super,\
+ prob(1);/obj/item/weapon/stock_parts/cell/hyper)
/obj/random/bomb_supply
diff --git a/code/game/objects/storage/coat.dm b/code/game/objects/storage/coat.dm
deleted file mode 100644
index e5151ae5ded..00000000000
--- a/code/game/objects/storage/coat.dm
+++ /dev/null
@@ -1,224 +0,0 @@
-/obj/item/clothing/suit/storage
- var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
- var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
- var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
- var/max_combined_w_class = 4 //The sum of the w_classes of all the items in this storage item.
- var/storage_slots = 2 //The number of storage slots in this container.
- var/obj/screen/storage/boxes = null
- var/obj/screen/close/closer = null
-
-/obj/item/clothing/suit/storage/proc/return_inv()
-
- var/list/L = list( )
-
- L += src.contents
-
- for(var/obj/item/weapon/storage/S in src)
- L += S.return_inv()
- for(var/obj/item/weapon/gift/G in src)
- L += G.gift
- if (istype(G.gift, /obj/item/weapon/storage))
- L += G.gift:return_inv()
- return L
-
-/obj/item/clothing/suit/storage/proc/show_to(mob/user as mob)
- user.client.screen -= src.boxes
- user.client.screen -= src.closer
- user.client.screen -= src.contents
- user.client.screen += src.boxes
- user.client.screen += src.closer
- user.client.screen += src.contents
- user.s_active = src
- return
-
-/obj/item/clothing/suit/storage/proc/hide_from(mob/user as mob)
-
- if(!user.client)
- return
- user.client.screen -= src.boxes
- user.client.screen -= src.closer
- user.client.screen -= src.contents
- return
-
-/obj/item/clothing/suit/storage/proc/close(mob/user as mob)
-
- src.hide_from(user)
- user.s_active = null
- return
-
-//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
-//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
-/obj/item/clothing/suit/storage/proc/orient_objs(tx, ty, mx, my)
- var/cx = tx
- var/cy = ty
- src.boxes.screen_loc = text("[tx]:,[ty] to [mx],[my]")
- for(var/obj/O in src.contents)
- O.screen_loc = text("[cx],[cy]")
- O.layer = 20
- cx++
- if (cx > mx)
- cx = tx
- cy--
- src.closer.screen_loc = text("[mx+1],[my]")
- return
-
-//This proc draws out the inventory and places the items on it. It uses the standard position.
-/obj/item/clothing/suit/storage/proc/standard_orient_objs(var/rows,var/cols)
- var/cx = 4
- var/cy = 2+rows
- src.boxes.screen_loc = text("4:16,2:16 to [4+cols]:16,[2+rows]:16")
- for(var/obj/O in src.contents)
- O.screen_loc = text("[cx]:16,[cy]:16")
- O.layer = 20
- cx++
- if (cx > (4+cols))
- cx = 4
- cy--
- src.closer.screen_loc = text("[4+cols+1]:16,2:16")
- return
-
-//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
-/obj/item/clothing/suit/storage/proc/orient2hud(mob/user as mob)
- //var/mob/living/carbon/human/H = user
- var/row_num = 0
- var/col_count = min(7,storage_slots) -1
- if (contents.len > 7)
- row_num = round((contents.len-1) / 7) // 7 is the maximum allowed width.
- src.standard_orient_objs(row_num,col_count)
- return
-
-//This proc is called when you want to place an item into the storage item.
-/obj/item/clothing/suit/storage/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W,/obj/item/weapon/evidencebag) && src.loc != user)
- return
-
- ..()
- if(isrobot(user))
- user << "\blue You're a robot. No."
- return //Robots can't interact with storage items.
-
- if(src.loc == W)
- return //Means the item is already in the storage item
-
- if(contents.len >= storage_slots)
- user << "\red \The [src] is full, make some space."
- return //Storage item is full
-
- if(can_hold.len)
- var/ok = 0
- for(var/A in can_hold)
- if(istype(W, text2path(A) ))
- ok = 1
- break
- if(!ok)
- user << "\red \The [src] cannot hold \the [W]."
- return
-
- for(var/A in cant_hold) //Check for specific items which this container can't hold.
- if(istype(W, text2path(A) ))
- user << "\red \The [src] cannot hold \the [W]."
- return
-
- if (W.w_class > max_w_class)
- user << "\red \The [W] is too big for \the [src]"
- return
-
- var/sum_w_class = W.w_class
- for(var/obj/item/I in contents)
- sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
-
- if(sum_w_class > max_combined_w_class)
- user << "\red \The [src] is full, make some space."
- return
-
- if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage)))
- if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
- user << "\red \The [src] cannot hold \the [W] as it's a storage item of the same size."
- return //To prevent the stacking of the same sized items.
-
- user.u_equip(W)
- playsound(src.loc, "rustle", 50, 1, -5)
- W.loc = src
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- src.orient2hud(user)
- W.dropped(user)
- add_fingerprint(user)
- show_to(user)
-
-
-/obj/item/weapon/storage/dropped(mob/user as mob)
- return
-
-/obj/item/clothing/suit/storage/MouseDrop(atom/over_object)
- if(ishuman(usr))
- var/mob/living/carbon/human/M = usr
- if (!( istype(over_object, /obj/screen) ))
- return ..()
- playsound(src.loc, "rustle", 50, 1, -5)
- if ((!( M.restrained() ) && !( M.stat ) && M.wear_suit == src))
- if (over_object.name == "r_hand")
- M.u_equip(src)
- M.put_in_r_hand(src)
- // if (!( M.r_hand ))
- // M.u_equip(src)
- // M.r_hand = src
- else if (over_object.name == "l_hand")
- M.u_equip(src)
- M.put_in_l_hand(src)
- // if (!( M.l_hand ))
- // M.u_equip(src)
- // M.l_hand = src
- M.update_inv_wear_suit()
- src.add_fingerprint(usr)
- return
- if( (over_object == usr && in_range(src, usr) || usr.contents.Find(src)) && usr.s_active)
- usr.s_active.close(usr)
- src.show_to(usr)
- return
-
-/obj/item/clothing/suit/storage/attack_paw(mob/user as mob)
- //playsound(src.loc, "rustle", 50, 1, -5) // what
- return src.attack_hand(user)
-
-/obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
- playsound(src.loc, "rustle", 50, 1, -5)
- src.orient2hud(user)
- if (src.loc == user)
- if (user.s_active)
- user.s_active.close(user)
- src.show_to(user)
- else
- ..()
- for(var/mob/M in range(1))
- if (M.s_active == src)
- src.close(M)
- src.add_fingerprint(user)
- return
-
-/obj/item/clothing/suit/storage/New()
-
- src.boxes = new /obj/screen/storage( )
- src.boxes.name = "storage"
- src.boxes.master = src
- src.boxes.icon_state = "block"
- src.boxes.screen_loc = "7,7 to 10,8"
- src.boxes.layer = 19
- src.closer = new /obj/screen/close( )
- src.closer.master = src
- src.closer.icon_state = "x"
- src.closer.layer = 20
- orient2hud()
- return
-
-/obj/item/clothing/suit/emp_act(severity)
- if(!istype(src.loc, /mob/living))
- for(var/obj/O in contents)
- O.emp_act(severity)
- ..()
-
-/obj/item/clothing/suit/hear_talk(mob/M, var/msg)
- for (var/atom/A in src)
- if(istype(A,/obj/))
- var/obj/O = A
- O.hear_talk(M, msg)
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets/malfunction.dm b/code/game/objects/structures/crates_lockers/closets/malfunction.dm
index 7cfb4f18e2f..3bf64ba34d8 100644
--- a/code/game/objects/structures/crates_lockers/closets/malfunction.dm
+++ b/code/game/objects/structures/crates_lockers/closets/malfunction.dm
@@ -13,5 +13,5 @@
new /obj/item/clothing/head/helmet/space/nasavoid(src)
new /obj/item/clothing/suit/space/nasavoid(src)
new /obj/item/weapon/crowbar(src)
- new /obj/item/weapon/cell(src)
+ new /obj/item/weapon/stock_parts/cell(src)
new /obj/item/device/multitool(src)
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
index 9e0ffec3dd8..fcd8dafd77f 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
@@ -148,7 +148,7 @@
new /obj/item/clothing/shoes/brown (src)
new /obj/item/device/radio/headset/heads/cmo(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
- new /obj/item/weapon/defibrillator/loaded(src)
+ new /obj/item/weapon/defibrillator/compact/loaded(src)
new /obj/item/weapon/storage/belt/medical(src)
new /obj/item/device/flash(src)
new /obj/item/weapon/reagent_containers/hypospray/CMO(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index f48a0e69e4f..01505311c9b 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -75,10 +75,14 @@
else if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
src.locked = !( src.locked )
- if(src.locked) src.icon_state = src.icon_locked
- else src.icon_state = src.icon_closed
+ if(src.locked)
+ src.icon_state = src.icon_locked
+ else
+ src.icon_state = src.icon_closed
+ registered_name = null
+ desc = initial(desc)
- if(!src.registered_name)
+ if(!src.registered_name && src.locked)
src.registered_name = I.registered_name
src.desc = "Owned by [I.registered_name]."
else
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index 7bc09593e5e..282afb599e2 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -248,7 +248,8 @@
new /obj/item/clothing/under/rank/centcom_officer(src)
new /obj/item/clothing/suit/armor/vest/fluff/deus_blueshield(src)
new /obj/item/clothing/shoes/centcom(src)
- new /obj/item/clothing/tie/blue(src)
+ new /obj/item/clothing/accessory/holster(src)
+ new /obj/item/clothing/accessory/blue(src)
return
/obj/structure/closet/secure_closet/ntrep
@@ -281,7 +282,7 @@
New()
..()
- new /obj/item/clothing/tie/armband/cargo(src)
+ new /obj/item/clothing/accessory/armband/cargo(src)
new /obj/item/device/encryptionkey/headset_cargo(src)
return
@@ -289,7 +290,7 @@
New()
..()
- new /obj/item/clothing/tie/armband/engine(src)
+ new /obj/item/clothing/accessory/armband/engine(src)
new /obj/item/device/encryptionkey/headset_eng(src)
return
@@ -297,7 +298,7 @@
New()
..()
- new /obj/item/clothing/tie/armband/science(src)
+ new /obj/item/clothing/accessory/armband/science(src)
new /obj/item/device/encryptionkey/headset_sci(src)
return
@@ -305,7 +306,7 @@
New()
..()
- new /obj/item/clothing/tie/armband/medgreen(src)
+ new /obj/item/clothing/accessory/armband/medgreen(src)
new /obj/item/device/encryptionkey/headset_med(src)
return
@@ -339,7 +340,7 @@
new /obj/item/ammo_box/c38(src)
new /obj/item/weapon/gun/projectile/revolver/detective(src)
new /obj/item/taperoll/police(src)
- new /obj/item/clothing/tie/holster/armpit(src)
+ new /obj/item/clothing/accessory/holster/armpit(src)
return
/obj/structure/closet/secure_closet/detective/update_icon()
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index 00946b8678c..7a7d16c2eb0 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -90,7 +90,7 @@ FLOOR SAFES
var/mob/living/carbon/human/user = usr
var/canhear = 0
- if(istype(user.l_hand, /obj/item/clothing/tie/stethoscope) || istype(user.r_hand, /obj/item/clothing/tie/stethoscope))
+ if(istype(user.l_hand, /obj/item/clothing/accessory/stethoscope) || istype(user.r_hand, /obj/item/clothing/accessory/stethoscope))
canhear = 1
if(href_list["open"])
@@ -155,7 +155,7 @@ FLOOR SAFES
user << "[I] won't fit in [src]."
return
else
- if(istype(I, /obj/item/clothing/tie/stethoscope))
+ if(istype(I, /obj/item/clothing/accessory/stethoscope))
user << "Hold [I] in one of your hands while you manipulate the dial."
return
diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm
index ef7c9e94f17..a20fb422aeb 100644
--- a/code/game/turfs/simulated.dm
+++ b/code/game/turfs/simulated.dm
@@ -42,8 +42,8 @@
/turf/simulated/Entered(atom/A, atom/OL)
- if (istype(A,/mob/living/carbon))
- var/mob/living/carbon/M = A
+ if (istype(A,/mob/living/carbon/human))
+ var/mob/living/carbon/human/M = A
if(M.lying) return
if(prob(80))
dirt++
@@ -121,7 +121,7 @@
switch (src.wet)
if(1)
if(istype(M, /mob/living/carbon/human)) // Added check since monkeys don't have shoes
- if ((M.m_intent == "run") && !(istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP))
+ if ((M.m_intent == "run") && !(istype(M:shoes, /obj/item/clothing/shoes) && M.shoes.flags&NOSLIP))
M.stop_pulling()
step(M, M.dir)
M << "\blue You slipped on the wet floor!"
@@ -131,7 +131,7 @@
else
M.inertia_dir = 0
return
- else if(!istype(M, (/mob/living/carbon/slime || /mob/living/carbon/human/slime)) || (M:species.bodyflags & FEET_NOSLIP))
+ else if(!istype(M, (/mob/living/carbon/human/slime)) || (M.species.bodyflags & FEET_NOSLIP))
if (M.m_intent == "run")
M.stop_pulling()
step(M, M.dir)
diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm
index 7d81ba1ebbd..ca3b4e50c6e 100644
--- a/code/game/vehicles/spacepods/spacepod.dm
+++ b/code/game/vehicles/spacepods/spacepod.dm
@@ -14,8 +14,8 @@
var/mob/living/carbon/occupant
var/mob/living/carbon/occupant2 //two seaters
var/datum/spacepod/equipment/equipment_system
- var/battery_type = "/obj/item/weapon/cell/high"
- var/obj/item/weapon/cell/battery
+ var/battery_type = "/obj/item/weapon/stock_parts/cell/high"
+ var/obj/item/weapon/stock_parts/cell/battery
var/datum/gas_mixture/cabin_air
var/obj/machinery/portable_atmospherics/canister/internal_tank
var/datum/effect/effect/system/ion_trail_follow/space_trail/ion_trail
@@ -158,7 +158,7 @@
if(iscrowbar(W))
hatch_open = !hatch_open
user << "You [hatch_open ? "open" : "close"] the maintenance hatch."
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(!hatch_open)
return ..()
if(battery)
diff --git a/code/game/vehicles/vehicle.dm b/code/game/vehicles/vehicle.dm
index 3ec73f3eeb9..9924fea07d0 100644
--- a/code/game/vehicles/vehicle.dm
+++ b/code/game/vehicles/vehicle.dm
@@ -16,7 +16,7 @@
//var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
//the values in this list show how much damage will pass through, not how much will be absorbed.
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
- var/obj/item/weapon/cell/cell //Our power source
+ var/obj/item/weapon/stock_parts/cell/cell //Our power source
var/state = 0
var/list/log = new
var/last_message = 0
@@ -93,7 +93,7 @@
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank*/
-/obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null)
+/obj/vehicle/proc/add_cell(var/obj/item/weapon/stock_parts/cell/C=null)
if(C)
C.forceMove(src)
cell = C
diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm
index fcf219db147..f0fa25224b5 100644
--- a/code/modules/admin/DB ban/functions.dm
+++ b/code/modules/admin/DB ban/functions.dm
@@ -307,7 +307,11 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += ""
for(var/j in nonhuman_positions)
output += ""
- for(var/j in list("traitor","changeling","operative","revolutionary","cultist","wizard"))
+ for(var/j in list("Dionaea","NPC","AntagHUD","Emergency Response Team"))
+ output += ""
+ for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
+ output += ""
+ for(var/j in list("Syndicate","traitor","changeling","operative","revolutionary","cultist","wizard","alien","ninja","raider","mutineer","blob"))
output += ""
output += ""
output += "Reason:
"
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 9f3e9474fab..6574a027f3e 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -331,31 +331,49 @@ BLIND // can't see anything
2 = Report detailed damages
3 = Report location
*/
- var/obj/item/clothing/tie/hastie = null
+ var/list/accessories = list()
var/displays_id = 1
var/rolled_down = 0
var/basecolor
+/obj/item/clothing/under/proc/can_attach_accessory(obj/item/clothing/accessory/A)
+ if(istype(A))
+ .=1
+ else
+ return 0
+ if(accessories.len && (A.slot in list("utility","armband")))
+ for(var/obj/item/clothing/accessory/AC in accessories)
+ if (AC.slot == A.slot)
+ return 0
/obj/item/clothing/under/attackby(obj/item/I, mob/user)
- if(!hastie && istype(I, /obj/item/clothing/tie))
- user.drop_item()
- hastie = I
- I.loc = src
- user << "You attach [I] to [src]."
+ if(istype(I, /obj/item/clothing/accessory))
+ var/obj/item/clothing/accessory/A = I
+ if(can_attach_accessory(A))
+ user.drop_item()
+ accessories += A
+ A.on_attached(src, user)
- if(istype(loc, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = loc
- H.update_inv_w_uniform()
+ if(istype(loc, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = loc
+ H.update_inv_w_uniform()
+ return
+ else
+ user << "You cannot attach more accessories of this type to [src]."
+
+ if(accessories.len)
+ for(var/obj/item/clothing/accessory/A in accessories)
+ A.attackby(I, user)
return
..()
/obj/item/clothing/under/attack_hand(mob/user as mob)
//only forward to the attached accessory if the clothing is equipped (not in a storage)
- if(hastie && src.loc == user)
- removetie()
+ if(accessories.len && src.loc == user)
+ for(var/obj/item/clothing/accessory/A in accessories)
+ A.attack_hand(user)
return
if ((ishuman(usr) || ismonkey(usr)) && src.loc == user) //make it harder to accidentally undress yourself
@@ -369,7 +387,7 @@ BLIND // can't see anything
if (!(src.loc == usr))
return
- if (!( usr.restrained() ) && !( usr.stat ))
+ if (!( usr.restrained() ) && !( usr.stat ) && ( over_object ))
switch(over_object.name)
if("r_hand")
usr.u_equip(src)
@@ -393,8 +411,9 @@ BLIND // can't see anything
usr << "Its vital tracker appears to be enabled."
if(3)
usr << "Its vital tracker and tracking beacon appear to be enabled."
- if(hastie)
- usr << "\A [hastie] is clipped to it."
+ if(accessories.len)
+ for(var/obj/item/clothing/accessory/A in accessories)
+ usr << "\A [A] is attached to it."
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"
@@ -439,30 +458,35 @@ BLIND // can't see anything
else
usr << "You cannot roll down the uniform!"
-/obj/item/clothing/under/proc/removetie()
+/obj/item/clothing/under/proc/remove_accessory(mob/user, obj/item/clothing/accessory/A)
+ if(!(A in accessories))
+ return
+
+ A.on_removed(user)
+ accessories -= A
+ usr.update_inv_w_uniform()
+
+/obj/item/clothing/under/verb/removetie()
+ set name = "Remove Accessory"
+ set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
-
- if(hastie)
- usr.put_in_hands(hastie)
- hastie = null
-
- if (istype(hastie,/obj/item/clothing/tie/storage))
- var/obj/item/clothing/tie/storage/W = hastie
- if (W.hold)
- W.hold.loc = hastie
-
- if(istype(loc, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = loc
- H.update_inv_w_uniform()
+ if(!accessories.len) return
+ var/obj/item/clothing/accessory/A
+ if(accessories.len > 1)
+ A = input("Select an accessory to remove from [src]") as null|anything in accessories
+ else
+ A = accessories[1]
+ src.remove_accessory(usr,A)
/obj/item/clothing/under/rank/New()
sensor_mode = pick(0,1,2,3)
..()
/obj/item/clothing/under/emp_act(severity)
- if (hastie)
- hastie.emp_act(severity)
+ if(accessories.len)
+ for(var/obj/item/clothing/accessory/A in accessories)
+ A.emp_act(severity)
..()
diff --git a/code/modules/clothing/gloves/ninja.dm b/code/modules/clothing/gloves/ninja.dm
index 4fbdcdf8607..5876067697b 100644
--- a/code/modules/clothing/gloves/ninja.dm
+++ b/code/modules/clothing/gloves/ninja.dm
@@ -102,7 +102,7 @@
drain("MECHA",A,suit)
return 1
/*
- if(istype(A,/obj/item/weapon/cell))
+ if(istype(A,/obj/item/weapon/stock_parts/cell))
A.add_fingerprint(H)
drain("CELL",A,suit)
return 1
diff --git a/code/modules/clothing/spacesuits/ninja.dm b/code/modules/clothing/spacesuits/ninja.dm
index 3f162fbf09e..b1b51684ee0 100644
--- a/code/modules/clothing/spacesuits/ninja.dm
+++ b/code/modules/clothing/spacesuits/ninja.dm
@@ -3,7 +3,7 @@
name = "ninja hood"
icon_state = "s-ninja"
item_state = "s-ninja_hood"
- allowed = list(/obj/item/weapon/cell)
+ allowed = list(/obj/item/weapon/stock_parts/cell)
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 25)
unacidable = 1
siemens_coefficient = 0.2
@@ -14,7 +14,7 @@
desc = "A unique, vaccum-proof suit of nano-enhanced armor designed specifically for Spider Clan assassins."
icon_state = "s-ninja"
item_state = "s-ninja_suit"
- allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/weapon/cell,/obj/item/device/suit_cooling_unit)
+ allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/weapon/stock_parts/cell,/obj/item/device/suit_cooling_unit)
slowdown = 0
unacidable = 1
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)
@@ -22,7 +22,7 @@
//Important parts of the suit.
var/mob/living/carbon/affecting = null//The wearer.
- var/obj/item/weapon/cell/cell//Starts out with a high-capacity cell using New().
+ var/obj/item/weapon/stock_parts/cell/cell//Starts out with a high-capacity cell using New().
var/datum/effect/effect/system/spark_spread/spark_system//To create sparks.
var/reagent_list[] = list("tricordrazine","dexalinp","spaceacillin","anti_toxin","nutriment","uranium","hyronalin")//The reagents ids which are added to the suit at New().
var/stored_research[]//For stealing station research.
diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm
new file mode 100644
index 00000000000..cb03feb5997
--- /dev/null
+++ b/code/modules/clothing/suits/storage.dm
@@ -0,0 +1,29 @@
+/obj/item/clothing/suit/storage
+ var/obj/item/weapon/storage/internal/pockets
+
+/obj/item/clothing/suit/storage/New()
+ ..()
+ pockets = new/obj/item/weapon/storage/internal(src)
+ pockets.storage_slots = 2 //two slots
+ pockets.max_w_class = 2 //fit only pocket sized items
+ pockets.max_combined_w_class = 4
+
+/obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
+ if (pockets.handle_attack_hand(user))
+ ..(user)
+
+/obj/item/clothing/suit/storage/MouseDrop(obj/over_object as obj)
+ if (pockets.handle_mousedrop(usr, over_object))
+ ..(over_object)
+
+/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob)
+ ..()
+ pockets.attackby(W, user)
+
+/obj/item/clothing/suit/storage/emp_act(severity)
+ pockets.emp_act(severity)
+ ..()
+
+/obj/item/clothing/suit/storage/hear_talk(mob/M, var/msg)
+ pockets.hear_talk(M, msg)
+ ..()
\ No newline at end of file
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
new file mode 100644
index 00000000000..1e0682fa5f0
--- /dev/null
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -0,0 +1,320 @@
+/obj/item/clothing/accessory
+ name = "tie"
+ desc = "A neosilk clip-on tie."
+ icon = 'icons/obj/clothing/ties.dmi'
+ icon_state = "bluetie"
+ item_state = "" //no inhands
+ _color = "bluetie"
+ slot_flags = SLOT_TIE
+ w_class = 2.0
+ var/slot = "decor"
+ var/obj/item/clothing/under/has_suit = null //the suit the tie may be attached to
+ var/image/inv_overlay = null //overlay used when attached to clothing.
+
+/obj/item/clothing/accessory/New()
+ ..()
+ inv_overlay = image("icon" = 'icons/obj/clothing/ties_overlay.dmi', "icon_state" = "[_color? "[_color]" : "[icon_state]"]")
+
+//when user attached an accessory to S
+/obj/item/clothing/accessory/proc/on_attached(obj/item/clothing/under/S, mob/user as mob)
+ if(!istype(S))
+ return
+ has_suit = S
+ loc = has_suit
+ has_suit.overlays += inv_overlay
+
+ user << "You attach [src] to [has_suit]."
+ src.add_fingerprint(user)
+
+/obj/item/clothing/accessory/proc/on_removed(mob/user as mob)
+ if(!has_suit)
+ return
+ has_suit.overlays -= inv_overlay
+ has_suit = null
+ usr.put_in_hands(src)
+ src.add_fingerprint(user)
+
+//default attackby behaviour
+/obj/item/clothing/accessory/attackby(obj/item/I, mob/user)
+ ..()
+
+//default attack_hand behaviour
+/obj/item/clothing/accessory/attack_hand(mob/user as mob)
+ if(has_suit)
+ return //we aren't an object on the ground so don't call parent
+ ..()
+
+/obj/item/clothing/accessory/blue
+ name = "blue tie"
+ icon_state = "bluetie"
+ _color = "bluetie"
+
+/obj/item/clothing/accessory/red
+ name = "red tie"
+ icon_state = "redtie"
+ _color = "redtie"
+
+/obj/item/clothing/accessory/black
+ name = "black tie"
+ icon_state = "blacktie"
+ _color = "blacktie"
+
+/obj/item/clothing/accessory/horrible
+ name = "horrible tie"
+ desc = "A neosilk clip-on tie. This one is disgusting."
+ icon_state = "horribletie"
+ _color = "horribletie"
+
+/obj/item/clothing/accessory/waistcoat // No overlay
+ name = "waistcoat"
+ desc = "For some classy, murderous fun."
+ icon_state = "waistcoat"
+ item_state = "waistcoat"
+ _color = "waistcoat"
+
+/obj/item/clothing/accessory/stethoscope
+ name = "stethoscope"
+ desc = "An outdated medical apparatus for listening to the sounds of the human body. It also makes you look like you know what you're doing."
+ icon_state = "stethoscope"
+ _color = "stethoscope"
+
+/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
+ if(ishuman(M) && isliving(user))
+ if(user.a_intent == "help")
+ var/body_part = parse_zone(user.zone_sel.selecting)
+ if(body_part)
+ var/their = "their"
+ switch(M.gender)
+ if(MALE) their = "his"
+ if(FEMALE) their = "her"
+
+ var/sound = "pulse"
+ var/sound_strength
+
+ if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
+ sound_strength = "cannot hear"
+ sound = "anything"
+ else
+ sound_strength = "hear a weak"
+ switch(body_part)
+ if("chest")
+ if(M.oxyloss < 50)
+ sound_strength = "hear a healthy"
+ sound = "pulse and respiration"
+ if("eyes","mouth")
+ sound_strength = "cannot hear"
+ sound = "anything"
+ else
+ sound_strength = "hear a weak"
+
+ user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].")
+ return
+ return ..(M,user)
+
+
+//Medals
+/obj/item/clothing/accessory/medal
+ name = "bronze medal"
+ desc = "A bronze medal."
+ icon_state = "bronze"
+ _color = "bronze"
+
+/obj/item/clothing/accessory/medal/conduct
+ name = "distinguished conduct medal"
+ desc = "A bronze medal awarded for distinguished conduct. Whilst a great honor, this is most basic award given by Nanotrasen. It is often awarded by a captain to a member of his crew."
+
+/obj/item/clothing/accessory/medal/bronze_heart
+ name = "bronze heart medal"
+ desc = "A bronze heart-shaped medal awarded for sacrifice. It is often awarded posthumously or for severe injury in the line of duty."
+ icon_state = "bronze_heart"
+
+/obj/item/clothing/accessory/medal/nobel_science
+ name = "nobel sciences award"
+ desc = "A bronze medal which represents significant contributions to the field of science or engineering."
+
+/obj/item/clothing/accessory/medal/silver
+ name = "silver medal"
+ desc = "A silver medal."
+ icon_state = "silver"
+ _color = "silver"
+
+/obj/item/clothing/accessory/medal/silver/valor
+ name = "medal of valor"
+ desc = "A silver medal awarded for acts of exceptional valor."
+
+/obj/item/clothing/accessory/medal/silver/security
+ name = "robust security award"
+ desc = "An award for distinguished combat and sacrifice in defence of Nanotrasen's commercial interests. Often awarded to security staff."
+
+/obj/item/clothing/accessory/medal/gold
+ name = "gold medal"
+ desc = "A prestigious golden medal."
+ icon_state = "gold"
+ _color = "gold"
+
+/obj/item/clothing/accessory/medal/gold/captain
+ name = "medal of captaincy"
+ desc = "A golden medal awarded exclusively to those promoted to the rank of captain. It signifies the codified responsibilities of a captain to Nanotrasen, and their undisputable authority over their crew."
+
+/obj/item/clothing/accessory/medal/gold/heroism
+ name = "medal of exceptional heroism"
+ desc = "An extremely rare golden medal awarded only by CentComm. To recieve such a medal is the highest honor and as such, very few exist. This medal is almost never awarded to anybody but commanders."
+
+/*
+ Holobadges are worn on the belt or neck, and can be used to show that the holder is an authorized
+ Security agent - the user details can be imprinted on the badge with a Security-access ID card,
+ or they can be emagged to accept any ID for use in disguises.
+*/
+
+/obj/item/clothing/accessory/holobadge
+ name = "holobadge"
+ desc = "This glowing blue badge marks the holder as THE LAW."
+ icon_state = "holobadge"
+ _color = "holobadge"
+ slot_flags = SLOT_BELT | SLOT_TIE
+
+ var/emagged = 0 //Emagging removes Sec check.
+ var/stored_name = null
+
+/obj/item/clothing/accessory/holobadge/cord
+ icon_state = "holobadge-cord"
+ _color = "holobadge-cord"
+ slot_flags = SLOT_MASK | SLOT_TIE
+
+/obj/item/clothing/accessory/holobadge/attack_self(mob/user as mob)
+ if(!stored_name)
+ user << "Waving around a badge before swiping an ID would be pretty pointless."
+ return
+ if(isliving(user))
+ user.visible_message("\red [user] displays their NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.","\red You display your NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.")
+
+/obj/item/clothing/accessory/holobadge/attackby(var/obj/item/O as obj, var/mob/user as mob)
+
+ if (istype(O, /obj/item/weapon/card/emag))
+ if (emagged)
+ user << "\red [src] is already cracked."
+ return
+ else
+ emagged = 1
+ user << "\red You swipe [O] and crack the holobadge security checks."
+ return
+
+ else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
+
+ var/obj/item/weapon/card/id/id_card = null
+
+ if(istype(O, /obj/item/weapon/card/id))
+ id_card = O
+ else
+ var/obj/item/device/pda/pda = O
+ id_card = pda.id
+
+ if(access_security in id_card.access || emagged)
+ user << "You imprint your ID details onto the badge."
+ stored_name = id_card.registered_name
+ name = "holobadge ([stored_name])"
+ desc = "This glowing blue badge marks [stored_name] as THE LAW."
+ else
+ user << "[src] rejects your insufficient access rights."
+ return
+ ..()
+
+/obj/item/clothing/accessory/holobadge/attack(mob/living/carbon/human/M, mob/living/user)
+ if(isliving(user))
+ user.visible_message("\red [user] invades [M]'s personal space, thrusting [src] into their face insistently.","\red You invade [M]'s personal space, thrusting [src] into their face insistently. You are the law.")
+
+/obj/item/weapon/storage/box/holobadge
+ name = "holobadge box"
+ desc = "A box claiming to contain holobadges."
+ New()
+ new /obj/item/clothing/accessory/holobadge(src)
+ new /obj/item/clothing/accessory/holobadge(src)
+ new /obj/item/clothing/accessory/holobadge(src)
+ new /obj/item/clothing/accessory/holobadge(src)
+ new /obj/item/clothing/accessory/holobadge/cord(src)
+ new /obj/item/clothing/accessory/holobadge/cord(src)
+ ..()
+ return
+
+
+///////////
+//SCARVES//
+///////////
+
+/obj/item/clothing/accessory/scarf // No overlay
+ name = "scarf"
+ desc = "A stylish scarf. The perfect winter accessory for those with a keen fashion sense, and those who just can't handle a cold breeze on their necks."
+
+/obj/item/clothing/accessory/scarf/red
+ name = "red scarf"
+ icon_state = "redscarf"
+ _color = "redscarf"
+
+/obj/item/clothing/accessory/scarf/green
+ name = "green scarf"
+ icon_state = "greenscarf"
+ _color = "greenscarf"
+
+/obj/item/clothing/accessory/scarf/darkblue
+ name = "dark blue scarf"
+ icon_state = "darkbluescarf"
+ _color = "darkbluescarf"
+
+/obj/item/clothing/accessory/scarf/purple
+ name = "purple scarf"
+ icon_state = "purplescarf"
+ _color = "purplescarf"
+
+/obj/item/clothing/accessory/scarf/yellow
+ name = "yellow scarf"
+ icon_state = "yellowscarf"
+ _color = "yellowscarf"
+
+/obj/item/clothing/accessory/scarf/orange
+ name = "orange scarf"
+ icon_state = "orangescarf"
+ _color = "orangescarf"
+
+/obj/item/clothing/accessory/scarf/lightblue
+ name = "light blue scarf"
+ icon_state = "lightbluescarf"
+ _color = "lightbluescarf"
+
+/obj/item/clothing/accessory/scarf/white
+ name = "white scarf"
+ icon_state = "whitescarf"
+ _color = "whitescarf"
+
+/obj/item/clothing/accessory/scarf/black
+ name = "black scarf"
+ icon_state = "blackscarf"
+ _color = "blackscarf"
+
+/obj/item/clothing/accessory/scarf/zebra
+ name = "zebra scarf"
+ icon_state = "zebrascarf"
+ _color = "zebrascarf"
+
+/obj/item/clothing/accessory/scarf/christmas
+ name = "christmas scarf"
+ icon_state = "christmasscarf"
+ _color = "christmasscarf"
+
+//The three following scarves don't have the scarf subtype
+//This is because Ian can equip anything from that subtype
+//However, these 3 don't have corgi versions of their sprites
+/obj/item/clothing/accessory/stripedredscarf
+ name = "striped red scarf"
+ icon_state = "stripedredscarf"
+ _color = "stripedredscarf"
+
+/obj/item/clothing/accessory/stripedgreenscarf
+ name = "striped green scarf"
+ icon_state = "stripedgreenscarf"
+ _color = "stripedgreenscarf"
+
+/obj/item/clothing/accessory/stripedbluescarf
+ name = "striped blue scarf"
+ icon_state = "stripedbluescarf"
+ _color = "stripedbluescarf"
+
diff --git a/code/modules/clothing/under/accessories/armband.dm b/code/modules/clothing/under/accessories/armband.dm
new file mode 100644
index 00000000000..8c4dd79ffe8
--- /dev/null
+++ b/code/modules/clothing/under/accessories/armband.dm
@@ -0,0 +1,42 @@
+/obj/item/clothing/accessory/armband
+ name = "red armband"
+ desc = "A fancy red armband!"
+ icon_state = "red"
+ _color = "red"
+ slot = "armband"
+
+/obj/item/clothing/accessory/armband/cargo
+ name = "cargo armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is brown."
+ icon_state = "cargo"
+ _color = "cargo"
+
+/obj/item/clothing/accessory/armband/engine
+ name = "engineering armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is orange with a reflective strip!"
+ icon_state = "engie"
+ _color = "engie"
+
+/obj/item/clothing/accessory/armband/science
+ name = "science armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is purple."
+ icon_state = "rnd"
+ _color = "rnd"
+
+/obj/item/clothing/accessory/armband/hydro
+ name = "hydroponics armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is green and blue."
+ icon_state = "hydro"
+ _color = "hydro"
+
+/obj/item/clothing/accessory/armband/med
+ name = "medical armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is white."
+ icon_state = "med"
+ _color = "med"
+
+/obj/item/clothing/accessory/armband/medgreen
+ name = "EMT armband"
+ desc = "An armband, worn by the crew to display which department they're assigned to. This one is white and green."
+ icon_state = "medgreen"
+ _color = "medgreen"
diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm
new file mode 100644
index 00000000000..12508cc5328
--- /dev/null
+++ b/code/modules/clothing/under/accessories/holster.dm
@@ -0,0 +1,135 @@
+/obj/item/clothing/accessory/holster
+ name = "shoulder holster"
+ desc = "A handgun holster."
+ icon_state = "holster"
+ _color = "holster"
+ slot = "utility"
+ var/holster_allow = /obj/item/weapon/gun
+ var/obj/item/weapon/gun/holstered = null
+ icon_action_button = "action_holster"
+ w_class = 3.0 // so it doesn't fit in pockets
+
+//subtypes can override this to specify what can be holstered
+/obj/item/clothing/accessory/holster/proc/can_holster(obj/item/weapon/gun/W)
+ if(!W.isHandgun())
+ return 0
+ else if(!istype(W,holster_allow))
+ return 0
+ else
+ return 1
+
+/obj/item/clothing/accessory/holster/attack_self()
+ var/holsteritem = usr.get_active_hand()
+ if(!holstered)
+ holster(holsteritem, usr)
+ else
+ unholster(usr)
+
+/obj/item/clothing/accessory/holster/proc/holster(obj/item/I, mob/user as mob)
+ if(holstered)
+ user << "There is already a [holstered] holstered here!"
+ return
+
+ if (!istype(I, /obj/item/weapon/gun))
+ user << "Only guns can be holstered!"
+ return
+
+ var/obj/item/weapon/gun/W = I
+ if (!can_holster(W))
+ user << "This [W] won't fit in the [src]!"
+ return
+
+ holstered = W
+ user.drop_from_inventory(holstered)
+ holstered.loc = src
+ holstered.add_fingerprint(user)
+ user.visible_message("[user] holsters the [holstered].", "You holster the [holstered].")
+
+/obj/item/clothing/accessory/holster/proc/unholster(mob/user as mob)
+ if(!holstered)
+ return
+
+ if(istype(user.get_active_hand(),/obj) && istype(user.get_inactive_hand(),/obj))
+ user << "You need an empty hand to draw the [holstered]!"
+ else
+ if(user.a_intent == "hurt")
+ usr.visible_message("\red [user] draws the [holstered], ready to shoot!", \
+ "You draw the [holstered], ready to shoot!")
+ else
+ user.visible_message("[user] draws the [holstered], pointing it at the ground.", \
+ "You draw the [holstered], pointing it at the ground.")
+ user.put_in_hands(holstered)
+ holstered.add_fingerprint(user)
+ holstered = null
+
+/obj/item/clothing/accessory/holster/attack_hand(mob/user as mob)
+ if (has_suit) //if we are part of a suit
+ if (holstered)
+ unholster(user)
+ return
+
+ ..(user)
+
+/obj/item/clothing/accessory/holster/attackby(obj/item/W as obj, mob/user as mob)
+ holster(W, user)
+
+/obj/item/clothing/accessory/holster/emp_act(severity)
+ if (holstered)
+ holstered.emp_act(severity)
+ ..()
+
+/obj/item/clothing/accessory/holster/examine(mob/user)
+ ..(user)
+ if (holstered)
+ user << "A [holstered] is holstered here."
+ else
+ user << "It is empty."
+
+/obj/item/clothing/accessory/holster/on_attached(obj/item/clothing/under/S, mob/user as mob)
+ ..()
+ has_suit.verbs += /obj/item/clothing/accessory/holster/verb/holster_verb
+
+/obj/item/clothing/accessory/holster/on_removed(mob/user as mob)
+ has_suit.verbs -= /obj/item/clothing/accessory/holster/verb/holster_verb
+ ..()
+
+//For the holster hotkey
+/obj/item/clothing/accessory/holster/verb/holster_verb()
+ set name = "Holster"
+ set category = "Object"
+ set src in usr
+ if(!istype(usr, /mob/living)) return
+ if(usr.stat) return
+
+ var/obj/item/clothing/accessory/holster/H = null
+ if (istype(src, /obj/item/clothing/accessory/holster))
+ H = src
+ else if (istype(src, /obj/item/clothing/under))
+ var/obj/item/clothing/under/S = src
+ if (S.accessories.len)
+ H = locate() in S.accessories
+
+ if (!H)
+ usr << "Something is very wrong."
+
+ if(!H.holstered)
+ if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
+ usr << "You need your gun equiped to holster it."
+ return
+ var/obj/item/weapon/gun/W = usr.get_active_hand()
+ H.holster(W, usr)
+ else
+ H.unholster(usr)
+
+/obj/item/clothing/accessory/holster/armpit
+ name = "shoulder holster"
+ desc = "A worn-out handgun holster. Perfect for concealed carry"
+ icon_state = "holster"
+ _color = "holster"
+ holster_allow = /obj/item/weapon/gun/projectile
+
+/obj/item/clothing/accessory/holster/waist
+ name = "shoulder holster"
+ desc = "A handgun holster. Made of expensive leather."
+ icon_state = "holster"
+ _color = "holster_low"
\ No newline at end of file
diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm
new file mode 100644
index 00000000000..8a215233b08
--- /dev/null
+++ b/code/modules/clothing/under/accessories/storage.dm
@@ -0,0 +1,91 @@
+/obj/item/clothing/accessory/storage
+ name = "load bearing equipment"
+ desc = "Used to hold things when you don't have enough hands."
+ icon_state = "webbing"
+ _color = "webbing"
+ slot = "utility"
+ var/slots = 3
+ var/obj/item/weapon/storage/internal/hold
+ icon_action_button = "action_storage"
+ w_class = 3.0 // so it doesn't fit in pockets
+
+/obj/item/clothing/accessory/storage/New()
+ ..()
+ hold = new/obj/item/weapon/storage/internal(src)
+ hold.storage_slots = slots
+
+/obj/item/clothing/accessory/storage/attack_hand(mob/user as mob)
+ if (has_suit) //if we are part of a suit
+ hold.open(user)
+ return
+
+ if (hold.handle_attack_hand(user)) //otherwise interact as a regular storage item
+ ..(user)
+
+/obj/item/clothing/accessory/storage/MouseDrop(obj/over_object as obj)
+ if (has_suit)
+ return
+
+ if (hold.handle_mousedrop(usr, over_object))
+ ..(over_object)
+
+/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob)
+ return hold.attackby(W, user)
+
+/obj/item/clothing/accessory/storage/emp_act(severity)
+ hold.emp_act(severity)
+ ..()
+
+/obj/item/clothing/accessory/storage/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
+ hold.hear_talk(M, msg, verb, speaking)
+ ..()
+
+/obj/item/clothing/accessory/storage/attack_self(mob/user as mob)
+ if (has_suit) //if we are part of a suit
+ hold.open(user)
+ else
+ user << "You empty [src]."
+ var/turf/T = get_turf(src)
+ hold.hide_from(usr)
+ for(var/obj/item/I in hold.contents)
+ hold.remove_from_storage(I, T)
+ src.add_fingerprint(user)
+
+/obj/item/clothing/accessory/storage/webbing
+ name = "webbing"
+ desc = "Sturdy mess of synthcotton belts and buckles, ready to share your burden."
+ icon_state = "webbing"
+ _color = "webbing"
+
+/obj/item/clothing/accessory/storage/black_vest
+ name = "black webbing vest"
+ desc = "Robust black synthcotton vest with lots of pockets to hold whatever you need, but cannot hold in hands."
+ icon_state = "vest_black"
+ _color = "vest_black"
+ slots = 5
+
+/obj/item/clothing/accessory/storage/brown_vest
+ name = "brown webbing vest"
+ desc = "Worn brownish synthcotton vest with lots of pockets to unload your hands."
+ icon_state = "vest_brown"
+ _color = "vest_brown"
+ slots = 5
+
+/obj/item/clothing/accessory/storage/knifeharness
+ name = "decorated harness"
+ desc = "A heavily decorated harness of sinew and leather with two knife-loops."
+ icon_state = "unathiharness2"
+ _color = "unathiharness2"
+ slots = 2
+
+/obj/item/clothing/accessory/storage/knifeharness/New()
+ ..()
+ hold.max_combined_w_class = 4
+ hold.can_hold = list("/obj/item/weapon/hatchet/unathiknife",\
+ "/obj/item/weapon/kitchen/utensil/knife",\
+ "/obj/item/weapon/kitchen/utensil/pknife",\
+ "/obj/item/weapon/kitchenknife",\
+ "/obj/item/weapon/kitchenknife/ritual")
+
+ new /obj/item/weapon/hatchet/unathiknife(hold)
+ new /obj/item/weapon/hatchet/unathiknife(hold)
\ No newline at end of file
diff --git a/code/modules/clothing/under/ties.dm b/code/modules/clothing/under/ties.dm
deleted file mode 100644
index 5bf9e1cb75f..00000000000
--- a/code/modules/clothing/under/ties.dm
+++ /dev/null
@@ -1,467 +0,0 @@
-/obj/item/clothing/tie
- name = "tie"
- desc = "A neosilk clip-on tie."
- icon = 'icons/obj/clothing/ties.dmi'
- icon_state = "bluetie"
- item_state = "" //no inhands
- _color = "bluetie"
- flags = FPRINT | TABLEPASS
- slot_flags = 0
- w_class = 2.0
-
-/obj/item/clothing/tie/blue
- name = "blue tie"
- icon_state = "bluetie"
- _color = "bluetie"
-
-/obj/item/clothing/tie/red
- name = "red tie"
- icon_state = "redtie"
- _color = "redtie"
-
-/obj/item/clothing/tie/black
- name = "black tie"
- icon_state = "blacktie"
- _color = "blacktie"
-
-/obj/item/clothing/tie/horrible
- name = "horrible tie"
- desc = "A neosilk clip-on tie. This one is disgusting."
- icon_state = "horribletie"
- _color = "horribletie"
-
-/obj/item/clothing/tie/waistcoat
- name = "waistcoat"
- desc = "For some classy, murderous fun."
- icon_state = "waistcoat"
- item_state = "waistcoat"
- _color = "waistcoat"
-
-/obj/item/clothing/tie/stethoscope
- name = "stethoscope"
- desc = "An outdated medical apparatus for listening to the sounds of the human body. It also makes you look like you know what you're doing."
- icon_state = "stethoscope"
- _color = "stethoscope"
-
-/obj/item/clothing/tie/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
- if(ishuman(M) && isliving(user))
- if(user.a_intent == "help")
- var/body_part = parse_zone(user.zone_sel.selecting)
- if(body_part)
- var/their = "their"
- switch(M.gender)
- if(MALE) their = "his"
- if(FEMALE) their = "her"
-
- var/sound = "pulse"
- var/sound_strength
-
- if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
- sound_strength = "cannot hear"
- sound = "anything"
- else
- sound_strength = "hear a weak"
- switch(body_part)
- if("chest")
- if(M.oxyloss < 50)
- sound_strength = "hear a healthy"
- sound = "pulse and respiration"
- if("eyes","mouth")
- sound_strength = "cannot hear"
- sound = "anything"
- else
- sound_strength = "hear a weak"
-
- user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].")
- return
- return ..(M,user)
-
-
-//Medals
-/obj/item/clothing/tie/medal
- name = "bronze medal"
- desc = "A bronze medal."
- icon_state = "bronze"
- _color = "bronze"
-
-/obj/item/clothing/tie/medal/conduct
- name = "distinguished conduct medal"
- desc = "A bronze medal awarded for distinguished conduct. Whilst a great honor, this is most basic award given by Nanotrasen. It is often awarded by a captain to a member of his crew."
-
-/obj/item/clothing/tie/medal/bronze_heart
- name = "bronze heart medal"
- desc = "A bronze heart-shaped medal awarded for sacrifice. It is often awarded posthumously or for severe injury in the line of duty."
- icon_state = "bronze_heart"
-
-/obj/item/clothing/tie/medal/nobel_science
- name = "nobel sciences award"
- desc = "A bronze medal which represents significant contributions to the field of science or engineering."
-
-/obj/item/clothing/tie/medal/silver
- name = "silver medal"
- desc = "A silver medal."
- icon_state = "silver"
- _color = "silver"
-
-/obj/item/clothing/tie/medal/silver/valor
- name = "medal of valor"
- desc = "A silver medal awarded for acts of exceptional valor."
-
-/obj/item/clothing/tie/medal/silver/security
- name = "robust security award"
- desc = "An award for distinguished combat and sacrifice in defence of Nanotrasen's commercial interests. Often awarded to security staff."
-
-/obj/item/clothing/tie/medal/gold
- name = "gold medal"
- desc = "A prestigious golden medal."
- icon_state = "gold"
- _color = "gold"
-
-/obj/item/clothing/tie/medal/gold/captain
- name = "medal of captaincy"
- desc = "A golden medal awarded exclusively to those promoted to the rank of captain. It signifies the codified responsibilities of a captain to Nanotrasen, and their undisputable authority over their crew."
-
-/obj/item/clothing/tie/medal/gold/heroism
- name = "medal of exceptional heroism"
- desc = "An extremely rare golden medal awarded only by CentComm. To recieve such a medal is the highest honor and as such, very few exist. This medal is almost never awarded to anybody but commanders."
-
-/obj/item/clothing/tie/medal/gold/ion
- name = "Ion Chef Medal"
- desc = "A medal awarded to the winner of the Ion Chef contest"
- icon_state = "ion"
- _color = "ion"
-
-
-//Armbands
-/obj/item/clothing/tie/armband
- name = "red armband"
- desc = "An fancy red armband!"
- icon_state = "red"
- _color = "red"
-
-/obj/item/clothing/tie/armband/cargo
- name = "cargo bay guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is brown."
- icon_state = "cargo"
- _color = "cargo"
-
-/obj/item/clothing/tie/armband/engine
- name = "engineering guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is orange with a reflective strip!"
- icon_state = "engie"
- _color = "engie"
-
-/obj/item/clothing/tie/armband/science
- name = "science guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is purple."
- icon_state = "rnd"
- _color = "rnd"
-
-/obj/item/clothing/tie/armband/hydro
- name = "hydroponics guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is green and blue."
- icon_state = "hydro"
- _color = "hydro"
-
-/obj/item/clothing/tie/armband/med
- name = "medical guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is white."
- icon_state = "med"
- _color = "med"
-
-/obj/item/clothing/tie/armband/medgreen
- name = "medical guard armband"
- desc = "An armband, worn by the station's security forces to display which department they're assigned to. This one is white and green."
- icon_state = "medgreen"
- _color = "medgreen"
-
-/obj/item/clothing/tie/holster
- name = "large shoulder holster"
- desc = "A handgun holster."
- icon_state = "holster"
- _color = "holster"
- var/obj/item/weapon/gun/holstered = null
- var/holster_allow = /obj/item/weapon/gun
- icon_action_button = "action_holster"
-
-/obj/item/clothing/tie/holster/attack_self()
- holster()
-
-/obj/item/clothing/tie/holster/proc/holster()
- if(!istype(usr, /mob/living)) return
- if(usr.stat) return
-
- if(!holstered)
- if(!istype(usr.get_active_hand(), holster_allow))
- usr << "You can't fit that in the holster."
- return
- var/obj/item/weapon/gun/W = usr.get_active_hand()
- if (!W.isHandgun())
- usr << "This gun won't fit in \the [src]!"
- return
- holstered = usr.get_active_hand()
- usr.drop_item()
- holstered.loc = src
- usr.visible_message("\The [usr] holsters \the [holstered].", "You holster \the [holstered].")
- else
- if(istype(usr.get_active_hand(),/obj) && istype(usr.get_inactive_hand(),/obj))
- usr << "You need an empty hand to draw the gun!"
- else
- if(usr.a_intent == "harm")
- usr.visible_message("\The [usr] draws \the [holstered], ready to shoot!", \
- "You draw \the [holstered], ready to shoot!")
- else
- usr.visible_message("\The [usr] draws \the [holstered], pointing it at the ground.", \
- "You draw \the [holstered], pointing it at the ground.")
- usr.put_in_hands(holstered)
- holstered = null
-
-/obj/item/clothing/tie/holster/armpit
- name = "shoulder holster"
- desc = "A worn-out handgun holster. Perfect for concealed carry"
- icon_state = "holster"
- _color = "holster"
- holster_allow = /obj/item/weapon/gun/projectile
-
-/obj/item/clothing/tie/storage
- name = "load bearing equipment"
- desc = "Used to hold things when you don't have enough hands for that."
- icon_state = "webbing"
- _color = "webbing"
- var/slots = 3
- var/obj/item/weapon/storage/pockets/hold
- icon_action_button = "action_storage"
-
-/obj/item/clothing/tie/storage/New()
- hold = new /obj/item/weapon/storage/pockets(src)
- hold.master_item = src
- hold.storage_slots = slots
-
-
-/obj/item/clothing/tie/storage/attack_self(mob/user as mob)
- if (!istype(hold))
- return
-
- hold.loc = user
- hold.attack_hand(user)
-
-/obj/item/clothing/tie/storage/attackby(obj/item/weapon/W as obj, mob/user as mob)
- hold.attackby(W,user)
- src.add_fingerprint(user)
-
-/obj/item/weapon/storage/pockets
- name = "storage"
- var/master_item //item it belongs to
-
-/obj/item/weapon/storage/pockets/close(mob/user as mob)
- ..()
- loc = master_item
-
-/obj/item/clothing/tie/storage/webbing
- name = "webbing"
- desc = "Strudy mess of synthcotton belts and buckles, ready to share your burden."
- icon_state = "webbing"
- _color = "webbing"
-
-/obj/item/clothing/tie/storage/black_vest
- name = "black webbing vest"
- desc = "Robust black synthcotton vest with lots of pockets to hold whatever you need, but cannot hold in hands."
- icon_state = "vest_black"
- _color = "vest_black"
- slots = 5
-
-/obj/item/clothing/tie/storage/brown_vest
- name = "brown webbing vest"
- desc = "Worn brownish synthcotton vest with lots of pockets to unload your hands."
- icon_state = "vest_brown"
- _color = "vest_brown"
- slots = 5
-/*
- Holobadges are worn on the belt or neck, and can be used to show that the holder is an authorized
- Security agent - the user details can be imprinted on the badge with a Security-access ID card,
- or they can be emagged to accept any ID for use in disguises.
-*/
-
-/obj/item/clothing/tie/holobadge
-
- name = "holobadge"
- desc = "This glowing blue badge marks the holder as THE LAW."
- icon_state = "holobadge"
- _color = "holobadge"
- slot_flags = SLOT_BELT
-
- var/emagged = 0 //Emagging removes Sec check.
- var/stored_name = null
-
-/obj/item/clothing/tie/holobadge/cord
- icon_state = "holobadge-cord"
- _color = "holobadge-cord"
- slot_flags = SLOT_MASK
-
-/obj/item/clothing/tie/holobadge/attack_self(mob/user as mob)
- if(!stored_name)
- user << "Waving around a badge before swiping an ID would be pretty pointless."
- return
- if(isliving(user))
- user.visible_message("\red [user] displays their Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.","\red You display your Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.")
-
-/obj/item/clothing/tie/holobadge/attackby(var/obj/item/O as obj, var/mob/user as mob)
-
- if (istype(O, /obj/item/weapon/card/emag))
- if (emagged)
- user << "\red [src] is already cracked."
- return
- else
- emagged = 1
- user << "\red You swipe [O] and crack the holobadge security checks."
- return
-
- else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
-
- var/obj/item/weapon/card/id/id_card = null
-
- if(istype(O, /obj/item/weapon/card/id))
- id_card = O
- else
- var/obj/item/device/pda/pda = O
- id_card = pda.id
-
- if(access_security in id_card.access || emagged)
- user << "You imprint your ID details onto the badge."
- stored_name = id_card.registered_name
- name = "holobadge ([stored_name])"
- desc = "This glowing blue badge marks [stored_name] as THE LAW."
- else
- user << "[src] rejects your insufficient access rights."
- return
- ..()
-
-/obj/item/clothing/tie/holobadge/attack(mob/living/carbon/human/M, mob/living/user)
- if(isliving(user))
- user.visible_message("\red [user] invades [M]'s personal space, thrusting [src] into their face insistently.","\red You invade [M]'s personal space, thrusting [src] into their face insistently. You are the law.")
-
-/obj/item/weapon/storage/box/holobadge
- name = "holobadge box"
- desc = "A box claiming to contain holobadges."
- New()
- new /obj/item/clothing/tie/holobadge(src)
- new /obj/item/clothing/tie/holobadge(src)
- new /obj/item/clothing/tie/holobadge(src)
- new /obj/item/clothing/tie/holobadge(src)
- new /obj/item/clothing/tie/holobadge/cord(src)
- new /obj/item/clothing/tie/holobadge/cord(src)
- ..()
- return
-
-/obj/item/clothing/tie/storage/knifeharness
- name = "decorated harness"
- desc = "A heavily decorated harness of sinew and leather with two knife-loops."
- icon_state = "unathiharness2"
- _color = "unathiharness2"
- slots = 2
-
-/obj/item/clothing/tie/storage/knifeharness/attackby(var/obj/item/O as obj, mob/user as mob)
- ..()
- update()
-
-/obj/item/clothing/tie/storage/knifeharness/proc/update()
- var/count = 0
- for(var/obj/item/I in hold)
- if(istype(I,/obj/item/weapon/hatchet/unathiknife))
- count++
- if(count>2) count = 2
- item_state = "unathiharness[count]"
- icon_state = item_state
- _color = item_state
-
- if(istype(loc, /obj/item/clothing))
- var/obj/item/clothing/U = loc
- if(istype(U.loc, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = U.loc
- H.update_inv_w_uniform()
-
-/obj/item/clothing/tie/storage/knifeharness/New()
- ..()
- new /obj/item/weapon/hatchet/unathiknife(hold)
- new /obj/item/weapon/hatchet/unathiknife(hold)
-
-///////////
-//SCARVES//
-///////////
-
-/obj/item/clothing/tie/scarf
- name = "scarf"
- desc = "A stylish scarf. The perfect winter accessory for those with a keen fashion sense, and those who just can't handle a cold breeze on their necks."
-
-/obj/item/clothing/tie/scarf/red
- name = "red scarf"
- icon_state = "redscarf"
- _color = "redscarf"
-
-/obj/item/clothing/tie/scarf/green
- name = "green scarf"
- icon_state = "greenscarf"
- _color = "greenscarf"
-
-/obj/item/clothing/tie/scarf/darkblue
- name = "dark blue scarf"
- icon_state = "darkbluescarf"
- _color = "darkbluescarf"
-
-/obj/item/clothing/tie/scarf/purple
- name = "purple scarf"
- icon_state = "purplescarf"
- _color = "purplescarf"
-
-/obj/item/clothing/tie/scarf/yellow
- name = "yellow scarf"
- icon_state = "yellowscarf"
- _color = "yellowscarf"
-
-/obj/item/clothing/tie/scarf/orange
- name = "orange scarf"
- icon_state = "orangescarf"
- _color = "orangescarf"
-
-/obj/item/clothing/tie/scarf/lightblue
- name = "light blue scarf"
- icon_state = "lightbluescarf"
- _color = "lightbluescarf"
-
-/obj/item/clothing/tie/scarf/white
- name = "white scarf"
- icon_state = "whitescarf"
- _color = "whitescarf"
-
-/obj/item/clothing/tie/scarf/black
- name = "black scarf"
- icon_state = "blackscarf"
- _color = "blackscarf"
-
-/obj/item/clothing/tie/scarf/zebra
- name = "zebra scarf"
- icon_state = "zebrascarf"
- _color = "zebrascarf"
-
-/obj/item/clothing/tie/scarf/christmas
- name = "christmas scarf"
- icon_state = "christmasscarf"
- _color = "christmasscarf"
-
-//The three following scarves don't have the scarf subtype
-//This is because Ian can equip anything from that subtype
-//However, these 3 don't have corgi versions of their sprites
-/obj/item/clothing/tie/stripedredscarf
- name = "striped red scarf"
- icon_state = "stripedredscarf"
- _color = "stripedredscarf"
-
-/obj/item/clothing/tie/stripedgreenscarf
- name = "striped green scarf"
- icon_state = "stripedgreenscarf"
- _color = "stripedgreenscarf"
-
-/obj/item/clothing/tie/stripedbluescarf
- name = "striped blue scarf"
- icon_state = "stripedbluescarf"
- _color = "stripedbluescarf"
\ No newline at end of file
diff --git a/code/modules/computer3/buildandrepair.dm b/code/modules/computer3/buildandrepair.dm
index 38db742ee67..d525f40a73e 100644
--- a/code/modules/computer3/buildandrepair.dm
+++ b/code/modules/computer3/buildandrepair.dm
@@ -61,7 +61,7 @@
// Battery must be installed BEFORE wiring the computer.
// if installing it in an existing computer, you will have to
// get back to this state first.
- var/obj/item/weapon/cell/battery = null
+ var/obj/item/weapon/stock_parts/cell/battery = null
/obj/structure/computer3frame/server
name = "server frame"
@@ -143,7 +143,7 @@
else
user << "\red There's no battery to remove!"
- if(istype(P, /obj/item/weapon/cell))
+ if(istype(P, /obj/item/weapon/stock_parts/cell))
if(!battery)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(5))
diff --git a/code/modules/computer3/computer.dm b/code/modules/computer3/computer.dm
index 456bdf3d71f..796dee7cd95 100644
--- a/code/modules/computer3/computer.dm
+++ b/code/modules/computer3/computer.dm
@@ -68,7 +68,7 @@
// the comms computer, solar trackers, etc, that should function when all else is off.
// Laptops will require batteries and have no mains power.
- var/obj/item/weapon/cell/battery = null // uninterruptible power supply aka battery
+ var/obj/item/weapon/stock_parts/cell/battery = null // uninterruptible power supply aka battery
verb/ResetComputer()
@@ -185,7 +185,7 @@
toybox.init(src)
continue
- if(ispath(typekey,/obj/item/weapon/cell))
+ if(ispath(typekey,/obj/item/weapon/stock_parts/cell))
if(battery) continue
battery = new typekey(src)
continue
@@ -452,7 +452,7 @@
//Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
proc/check_battery_status()
if (battery)
- var/obj/item/weapon/cell/B = battery
+ var/obj/item/weapon/stock_parts/cell/B = battery
return round(B.charge / (B.maxcharge / 100))
else
return -1
diff --git a/code/modules/computer3/laptop.dm b/code/modules/computer3/laptop.dm
index 819036c6df5..bd45c044748 100644
--- a/code/modules/computer3/laptop.dm
+++ b/code/modules/computer3/laptop.dm
@@ -122,7 +122,7 @@
New(var/L, var/built = 0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell(src)
+ battery = new /obj/item/weapon/stock_parts/cell(src)
..(L,built)
verb/close_computer()
diff --git a/code/modules/computer3/lapvend.dm b/code/modules/computer3/lapvend.dm
index 7d9b14da7ef..8979d4c1c2f 100644
--- a/code/modules/computer3/lapvend.dm
+++ b/code/modules/computer3/lapvend.dm
@@ -202,10 +202,10 @@
newlap.spawn_parts += (/obj/item/part/computer/networking/cable)
if (power == 1)
del(newlap.battery)
- newlap.battery = new /obj/item/weapon/cell/high(newlap)
+ newlap.battery = new /obj/item/weapon/stock_parts/cell/high(newlap)
if (power == 2)
del(newlap.battery)
- newlap.battery = new /obj/item/weapon/cell/super(newlap)
+ newlap.battery = new /obj/item/weapon/stock_parts/cell/super(newlap)
newlap.spawn_parts()
@@ -293,7 +293,7 @@
return total
/obj/machinery/lapvend/proc/choose_progs(var/obj/item/weapon/card/id/C)
- if(access_security in C.access || access_forensics_lockers in C.access)
+ if((access_security in C.access) || (access_forensics_lockers in C.access))
newlap.spawn_files += (/datum/file/program/secure_data)
newlap.spawn_files += (/datum/file/camnet_key)
newlap.spawn_files += (/datum/file/camnet_key/researchoutpost)
@@ -349,9 +349,9 @@
network = 2
if(istype(L.stored_computer.net,/obj/item/part/computer/networking/cable))
network = 3
- if(istype(L.stored_computer.battery, /obj/item/weapon/cell/high))
+ if(istype(L.stored_computer.battery, /obj/item/weapon/stock_parts/cell/high))
power = 1
- if(istype(L.stored_computer.battery, /obj/item/weapon/cell/super))
+ if(istype(L.stored_computer.battery, /obj/item/weapon/stock_parts/cell/super))
power = 2
diff --git a/code/modules/computer3/test_machines.dm b/code/modules/computer3/test_machines.dm
index 998937e6344..1be6f232d61 100644
--- a/code/modules/computer3/test_machines.dm
+++ b/code/modules/computer3/test_machines.dm
@@ -12,7 +12,7 @@
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
New(var/L,var/built=0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell(src)
+ battery = new /obj/item/weapon/stock_parts/cell(src)
..(L,built)
/obj/machinery/computer3/laptop/testing
@@ -28,7 +28,7 @@
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
New(var/L,var/built=0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell/super(src)
+ battery = new /obj/item/weapon/stock_parts/cell/super(src)
..(L,built)
/obj/machinery/computer3/wall_comp/testing
@@ -44,7 +44,7 @@
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
New(var/L,var/built=0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell(src)
+ battery = new /obj/item/weapon/stock_parts/cell(src)
..(L,built)
/obj/machinery/computer3/server/testing
@@ -60,7 +60,7 @@
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
New(var/L,var/built=0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell(src)
+ battery = new /obj/item/weapon/stock_parts/cell(src)
..(L,built)
/obj/machinery/computer3/server/rack/testing
@@ -76,7 +76,7 @@
/obj/item/part/computer/cardslot/dual,/obj/item/part/computer/networking/area)
New(var/L,var/built=0)
if(!built && !battery)
- battery = new /obj/item/weapon/cell(src)
+ battery = new /obj/item/weapon/stock_parts/cell(src)
..(L,built)
/obj/item/weapon/storage/box/testing_disks
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index 27736fe0858..07eb3da5f3f 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -738,7 +738,7 @@
/obj/item/clothing/under/rank/bartender/fluff/classy //searif: Ara Al-Jazari
name = "classy bartender uniform"
- desc = "A prim and proper uniform that looks very similar to a bartender's, the only differences being a red tie, waistcoat and a rag hanging out of the back pocket."
+ desc = "A prim and proper uniform that looks very similar to a bartender's, the only differences being a red accessory, waistcoat and a rag hanging out of the back pocket."
icon = 'icons/obj/custom_items.dmi'
icon_state = "ara_bar_uniform"
item_state = "ara_bar_uniform"
@@ -833,7 +833,7 @@
////// Small locket - Altair An-Nasaqan - Serithi
-/obj/item/clothing/tie/fluff/altair_locket
+/obj/item/clothing/accessory/fluff/altair_locket
name = "small locket"
desc = "A small golden locket attached to an Ii'rka-reed string. Inside the locket is a holo-picture of a female Tajaran, and an inscription writtin in Siik'mas."
icon = 'icons/obj/custom_items.dmi'
@@ -847,7 +847,7 @@
////// Silver locket - Konaa Hirano - Konaa_Hirano
-/obj/item/clothing/tie/fluff/konaa_hirano
+/obj/item/clothing/accessory/fluff/konaa_hirano
name = "silver locket"
desc = "This oval shaped, argentium sterling silver locket hangs on an incredibly fine, refractive string, almost thin as hair and microweaved from links to a deceptive strength, of similar material. The edges are engraved very delicately with an elegant curving design, but overall the main is unmarked and smooth to the touch, leaving room for either remaining as a stolid piece or future alterations. There is an obvious internal place for a picture or lock of some sort, but even behind that is a very thin compartment unhinged with the pinch of a thumb and forefinger."
icon = 'icons/obj/custom_items.dmi'
@@ -860,13 +860,13 @@
slot_flags = SLOT_MASK
var/obj/item/held //Item inside locket.
-/obj/item/clothing/tie/fluff/konaa_hirano/attack_self(mob/user as mob)
+/obj/item/clothing/accessory/fluff/konaa_hirano/attack_self(mob/user as mob)
if(held)
user << "You open [src] and [held] falls out."
held.loc = get_turf(user)
src.held = null
-/obj/item/clothing/tie/fluff/konaa_hirano/attackby(var/obj/item/O as obj, mob/user as mob)
+/obj/item/clothing/accessory/fluff/konaa_hirano/attackby(var/obj/item/O as obj, mob/user as mob)
if(istype(O,/obj/item/weapon/paper))
if(held)
usr << "[src] already has something inside it."
@@ -880,7 +880,7 @@
////// Medallion - Nasir Khayyam - Jamini
-/obj/item/clothing/tie/fluff/nasir_khayyam_1
+/obj/item/clothing/accessory/fluff/nasir_khayyam_1
name = "medallion"
desc = "This silvered medallion bears the symbol of the Hadii Clan of the Tajaran."
icon = 'icons/obj/custom_items.dmi'
@@ -892,7 +892,7 @@
////// Medallion - Lin Chang - Roland410
-/obj/item/clothing/tie/fluff/lin_chang_1
+/obj/item/clothing/accessory/fluff/lin_chang_1
name = "shining black medallion"
desc = "A shiny black medallion made of something that looks like the Earth's obsidian, but it is harder than anything ever seen yet. On the front there seems to be a standing unathi chiseled in it, on the back the name of Lin Chang with the title of the Assassin Archmage."
icon = 'icons/obj/custom_items.dmi'
diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm
index 2e0d771cd57..622e62b5172 100644
--- a/code/modules/events/event_container.dm
+++ b/code/modules/events/event_container.dm
@@ -176,7 +176,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 1320),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 3), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 30), 1),
- new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 60), 1),
+ new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 30), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1),
)
diff --git a/code/modules/events/wallrot.dm b/code/modules/events/wallrot.dm
index dfaedf451ec..739ca92411b 100644
--- a/code/modules/events/wallrot.dm
+++ b/code/modules/events/wallrot.dm
@@ -1,20 +1,13 @@
-/turf/simulated/wall
-
-
-datum/event/wallrot
- severity = 1
-
datum/event/wallrot/setup()
announceWhen = rand(0, 300)
endWhen = announceWhen + 1
- severity = rand(5, 10)
datum/event/wallrot/announce()
command_alert("Harmful fungi detected on station. Station structures may be contaminated.", "Biohazard Alert")
datum/event/wallrot/start()
spawn()
- var/turf/center = null
+ var/turf/simulated/wall/center = null
// 100 attempts
for(var/i=0, i<100, i++)
@@ -24,14 +17,15 @@ datum/event/wallrot/start()
if(center)
// Make sure at least one piece of wall rots!
- center:rot()
+ center.rot()
// Have a chance to rot lots of other walls.
var/rotcount = 0
+ var/actual_severity = severity * rand(5, 10)
for(var/turf/simulated/wall/W in range(5, center)) if(prob(50))
- W:rot()
+ W.rot()
rotcount++
// Only rot up to severity walls
- if(rotcount >= severity)
+ if(rotcount >= actual_severity)
break
\ No newline at end of file
diff --git a/code/modules/jungle/jungle_temple.dm b/code/modules/jungle/jungle_temple.dm
index ca7b21c8cf8..138d1dc47d1 100644
--- a/code/modules/jungle/jungle_temple.dm
+++ b/code/modules/jungle/jungle_temple.dm
@@ -249,7 +249,7 @@
new /obj/item/weapon/storage/toolbox/electrical(C)
if(prob(25))
- new /obj/item/weapon/cell(C)
+ new /obj/item/weapon/stock_parts/cell(C)
if("coffin")
new /obj/structure/closet/coffin(src.loc)
diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index 504234d9886..c11f66cd196 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -50,7 +50,7 @@
if(15)
new/obj/item/clothing/under/chameleon(src)
for(var/i = 0, i < 7, i++)
- new/obj/item/clothing/tie/horrible(src)
+ new/obj/item/clothing/accessory/horrible(src)
if(16)
new/obj/item/clothing/under/shorts(src)
new/obj/item/clothing/under/shorts/red(src)
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 65fc72f1636..4b6f63445d6 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -33,7 +33,7 @@
var/obj/item/weapon/stock_parts/matter_bin/storage
var/obj/item/weapon/stock_parts/micro_laser/cutter
var/obj/item/weapon/stock_parts/capacitor/cellmount
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
//Flags
var/need_update_field = 0
@@ -195,7 +195,7 @@
cellmount = W
user << "You install \the [W]."
return
- else if(istype(W,/obj/item/weapon/cell))
+ else if(istype(W,/obj/item/weapon/stock_parts/cell))
if(cell)
user << "The drill already has a cell installed."
else
diff --git a/code/modules/mining/manufacturing.dm b/code/modules/mining/manufacturing.dm
index 07a00bb7561..a59a1071a22 100644
--- a/code/modules/mining/manufacturing.dm
+++ b/code/modules/mining/manufacturing.dm
@@ -814,7 +814,7 @@
/datum/manufacture/powercell
name = "Power Cell"
- item = /obj/item/weapon/cell
+ item = /obj/item/weapon/stock_parts/cell
cost1 = /obj/item/weapon/ore/iron
cname1 = "Iron"
amount1 = 4
diff --git a/code/modules/mining/surprises/tg.dm b/code/modules/mining/surprises/tg.dm
index 5c9b6b201af..e80d3a87115 100644
--- a/code/modules/mining/surprises/tg.dm
+++ b/code/modules/mining/surprises/tg.dm
@@ -130,7 +130,7 @@
spawntypes = list(
/obj/item/weapon/pickaxe/plasmacutter=1,
/obj/machinery/shieldgen=1,
- /obj/item/weapon/cell/hyper=1
+ /obj/item/weapon/stock_parts/cell/hyper=1
)
fluffitems = list(
/obj/structure/table/reinforced=2,
diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm
index 04295be82da..3f912cb3ce2 100644
--- a/code/modules/mob/living/carbon/alien/special/facehugger.dm
+++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm
@@ -231,6 +231,9 @@ var/const/MAX_ACTIVE_TIME = 400
return
/proc/CanHug(var/mob/M)
+ if(!M || !ismob(M))
+ return 0
+
if(M.stat == DEAD)
return 0
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 3f8953c397a..f763179550e 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -67,8 +67,8 @@
var/tie_msg
if(istype(w_uniform,/obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
- if(U.hastie)
- tie_msg += " with \icon[U.hastie] \a [U.hastie]"
+ if(U.accessories.len)
+ tie_msg += " with [lowertext(english_list(U.accessories))]"
if(w_uniform.blood_DNA)
msg += "[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg]!\n"
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 1c0feaaef05..ded2a3c949e 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -517,7 +517,7 @@
Empty Both Pockets
[(handcuffed ? text("Handcuffed") : text("Not Handcuffed"))]
[(legcuffed ? text("Legcuffed") : text(""))]
- [(suit) ? ((suit.hastie) ? text(" Remove Accessory", src) : "") :]
+ [(suit) ? ((suit.accessories.len) ? text(" Remove Accessory", src) : "") :]
[(internal ? text(" Remove Internal") : "")]
Remove Splints Refresh
@@ -1159,11 +1159,16 @@
/mob/living/carbon/human/proc/is_lung_ruptured()
var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"]
+ if(!L)
+ return 0
+
return L.is_bruised()
/mob/living/carbon/human/proc/rupture_lung()
var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"]
-
+ if(!L)
+ return 0
+
if(!L.is_bruised())
src.custom_pain("You feel a stabbing pain in your chest!", 1)
L.damage = L.min_bruised_damage
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 2520b2d1982..80addc967c6 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -101,6 +101,8 @@
return has_organ("chest")
if(slot_in_backpack)
return 1
+ if(slot_tie)
+ return 1
/mob/living/carbon/human/u_equip(obj/item/W as obj)
if(!W) return 0
@@ -337,6 +339,9 @@
if(src.get_active_hand() == W)
src.u_equip(W)
W.loc = src.back
+ if(slot_tie)
+ var/obj/item/clothing/under/uniform = src.w_uniform
+ uniform.attackby(W,src)
else
src << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!"
return
@@ -552,15 +557,17 @@
message = "\red [source] is trying to take off \a [target.w_uniform] from [target]'s body!"
if("tie")
var/obj/item/clothing/under/suit = target.w_uniform
- target.attack_log += text("\[[time_stamp()]\] Has had their accessory ([suit.hastie]) removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) accessory ([suit.hastie])")
- if(istype(suit.hastie, /obj/item/clothing/tie/holobadge) || istype(suit.hastie, /obj/item/clothing/tie/medal))
- for(var/mob/M in viewers(target, null))
- M.show_message("\red [source] tears off \the [suit.hastie] from [target]'s suit!" , 1)
- done()
- return
- else
- message = "\red [source] is trying to take off \a [suit.hastie] from [target]'s suit!"
+ if(suit.accessories.len)
+ var/obj/item/clothing/accessory/A = suit.accessories[1]
+ target.attack_log += "\[[time_stamp()]\] Has had their accessory ([A]) removed by [source.name] ([source.ckey])"
+ source.attack_log += "\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) accessory ([A])"
+ if(istype(A, /obj/item/clothing/accessory/holobadge) || istype(A, /obj/item/clothing/accessory/medal))
+ for(var/mob/M in viewers(target, null))
+ M.show_message("\red [source] tears off \the [A] from [target]'s [suit]!" , 1)
+ done()
+ return
+ else
+ message = "\red [source] is trying to take off \a [A] from [target]'s [suit]!"
if("s_store")
target.attack_log += text("\[[time_stamp()]\] Has had their suit storage item ([target.s_store]) removed by [source.name] ([source.ckey])")
source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit storage item ([target.s_store])")
@@ -701,15 +708,19 @@ It can still be worn/put on as normal.
strip_item = target.wear_suit
if("tie")
var/obj/item/clothing/under/suit = target.w_uniform
- var/obj/item/clothing/tie/tie = suit.hastie
- if(tie)
- if (istype(tie,/obj/item/clothing/tie/storage))
- var/obj/item/clothing/tie/storage/W = tie
+ //var/obj/item/clothing/accessory/tie = suit.hastie
+ /*if(tie)
+ if (istype(tie,/obj/item/clothing/accessory/storage))
+ var/obj/item/clothing/accessory/storage/W = tie
if (W.hold)
W.hold.close(usr)
usr.put_in_hands(tie)
- suit.hastie = null
- target.update_inv_w_uniform()
+ suit.hastie = null*/
+ if(suit && suit.accessories.len)
+ var/obj/item/clothing/accessory/A = suit.accessories[1]
+ A.on_removed(usr)
+ suit.accessories -= A
+ target.update_inv_w_uniform()
if("id")
slot_to_process = slot_wear_id
if (target.wear_id)
@@ -832,8 +843,8 @@ It can still be worn/put on as normal.
if(slot_r_hand)
return r_hand
return null
-
-/mob/living/carbon/human/get_item_by_slot(slot_id)
+
+/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_back)
return back
@@ -849,4 +860,45 @@ It can still be worn/put on as normal.
return r_hand
return null
-
+// Return the item currently in the slot ID
+/mob/living/carbon/human/get_item_by_slot(slot_id)
+ switch(slot_id)
+ if(slot_back)
+ return back
+ if(slot_wear_mask)
+ return wear_mask
+ if(slot_handcuffed)
+ return handcuffed
+ if(slot_legcuffed)
+ return legcuffed
+ if(slot_l_hand)
+ return l_hand
+ if(slot_r_hand)
+ return r_hand
+ if(slot_belt)
+ return belt
+ if(slot_wear_id)
+ return wear_id
+ if(slot_l_ear)
+ return l_ear
+ if(slot_r_ear)
+ return r_ear
+ if(slot_glasses)
+ return glasses
+ if(slot_gloves)
+ return gloves
+ if(slot_head)
+ return head
+ if(slot_shoes)
+ return shoes
+ if(slot_wear_suit)
+ return wear_suit
+ if(slot_w_uniform)
+ return w_uniform
+ if(slot_l_store)
+ return l_store
+ if(slot_r_store)
+ return r_store
+ if(slot_s_store)
+ return s_store
+ return null
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index c920db100a8..4b9f4f1e107 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -614,10 +614,11 @@ proc/get_damage_icon_part(damage_state, body_part)
else
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "uniformblood")
- if(w_uniform:hastie) //WE CHECKED THE TYPE ABOVE. THIS REALLY SHOULD BE FINE.
- var/tie_color = w_uniform:hastie._color
- if(!tie_color) tie_color = w_uniform:hastie.icon_state
- standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
+ if(w_uniform:accessories.len) //WE CHECKED THE TYPE ABOVE. THIS REALLY SHOULD BE FINE.
+ for(var/obj/item/clothing/accessory/A in w_uniform:accessories)
+ var/tie_color = A._color
+ if(!tie_color) tie_color = A.icon_state
+ standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
overlays_standing[UNIFORM_LAYER] = standing
else
@@ -867,7 +868,7 @@ proc/get_damage_icon_part(damage_state, body_part)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1)
- if( wear_mask && ( istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/tie) ) )
+ if( wear_mask && ( istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory) ) )
wear_mask.screen_loc = ui_mask //TODO
var/image/standing
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 791c1b64d88..737a44342b0 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -216,7 +216,7 @@
L += get_contents(S)
for(var/obj/item/clothing/suit/storage/S in src.contents)//Check for labcoats and jackets
L += get_contents(S)
- for(var/obj/item/clothing/tie/storage/S in src.contents)//Check for holsters
+ for(var/obj/item/clothing/accessory/storage/S in src.contents)//Check for holsters
L += get_contents(S)
for(var/obj/item/weapon/gift/G in src.contents) //Check for gift-wrapped items
L += G.gift
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index f34da6c2e75..1fabedb239c 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -52,6 +52,7 @@ var/list/ai_list = list()
var/mob/living/silicon/ai/parent = null
+ var/apc_override = 0 //hack for letting the AI use its APC even when visionless
var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through.
var/datum/trackable/track = null
var/can_shunt = 1
diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm
index a4a0d5bdc28..477565b9cca 100644
--- a/code/modules/mob/living/silicon/ai/life.dm
+++ b/code/modules/mob/living/silicon/ai/life.dm
@@ -166,7 +166,9 @@
src << "Receiving control information from APC."
sleep(2)
//bring up APC dialog
+ apc_override = 1
theAPC.attack_ai(src)
+ apc_override = 0
src:aiRestorePowerRoutine = 3
src << "Here are your current laws:"
src.show_laws()
diff --git a/code/modules/mob/living/silicon/mommi/life.dm b/code/modules/mob/living/silicon/mommi/life.dm
index 948d5967888..73e6ee16aa5 100644
--- a/code/modules/mob/living/silicon/mommi/life.dm
+++ b/code/modules/mob/living/silicon/mommi/life.dm
@@ -264,7 +264,7 @@
if (src.client)
src.client.screen -= src.contents
for(var/obj/I in src.contents)
- //if(I && !(istype(I,/obj/item/weapon/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
+ //if(I && !(istype(I,/obj/item/weapon/stock_parts/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
if(I)
// Make sure we're not showing any of our internal components, as that would be lewd.
// This way of doing it ensures that shit we pick up will be visible, wheras shit inside of us isn't.
diff --git a/code/modules/mob/living/silicon/mommi/mommi.dm b/code/modules/mob/living/silicon/mommi/mommi.dm
index 79034c8782c..91defdaedfb 100644
--- a/code/modules/mob/living/silicon/mommi/mommi.dm
+++ b/code/modules/mob/living/silicon/mommi/mommi.dm
@@ -40,7 +40,7 @@ They can only use one tool at a time, they can't choose modules, and they have 1
updateicon()
if(!cell)
- cell = new /obj/item/weapon/cell(src)
+ cell = new /obj/item/weapon/stock_parts/cell(src)
cell.maxcharge = 7500
cell.charge = 7500
..()
@@ -190,7 +190,7 @@ They can only use one tool at a time, they can't choose modules, and they have 1
opened = 1
updateicon()
- else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
+ else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
if(wiresexposed)
user << "Close the panel first."
else if(cell)
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
index 1db5b3e059f..fff8878ff0e 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
@@ -8,7 +8,7 @@
//Has a list of items that it can hold.
var/list/can_hold = list(
- /obj/item/weapon/cell,
+ /obj/item/weapon/stock_parts/cell,
/obj/item/weapon/firealarm_electronics,
/obj/item/weapon/airalarm_electronics,
/obj/item/weapon/airlock_electronics,
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index 3bea2e0ee96..6ecbfbd9dfc 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -309,7 +309,7 @@
if (src.client)
src.client.screen -= src.contents
for(var/obj/I in src.contents)
- if(I && !(istype(I,/obj/item/weapon/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
+ if(I && !(istype(I,/obj/item/weapon/stock_parts/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
src.client.screen += I
if(src.module_state_1)
src.module_state_1:screen_loc = ui_inv1
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 1b12f3595fd..1e0a62eedb2 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -30,7 +30,7 @@
var/obj/item/device/radio/borg/radio = null
var/mob/living/silicon/ai/connected_ai = null
- var/obj/item/weapon/cell/cell = null
+ var/obj/item/weapon/stock_parts/cell/cell = null
var/obj/machinery/camera/camera = null
// Components are basically robot organs.
@@ -95,7 +95,7 @@
mmi.icon_state="posibrain-occupied"
if(syndie)
if(!cell)
- cell = new /obj/item/weapon/cell(src)
+ cell = new /obj/item/weapon/stock_parts/cell(src)
laws = new /datum/ai_laws/antimov()
lawupdate = 0
scrambledcodes = 1
@@ -124,7 +124,7 @@
C.wrapped = new C.external_type
if(!cell)
- cell = new /obj/item/weapon/cell(src)
+ cell = new /obj/item/weapon/stock_parts/cell(src)
cell.maxcharge = 7500
cell.charge = 7500
@@ -752,7 +752,7 @@
opened = 1
updateicon()
- else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
+ else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
var/datum/robot_component/C = components["power cell"]
if(wiresexposed)
user << "Close the panel first."
diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
index 0854948bf6a..aa64a6fe921 100644
--- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
+++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
@@ -8,7 +8,7 @@
var/obj/item/device/radio/borg/radio = null
var/mob/living/silicon/ai/connected_ai = null
- var/obj/item/weapon/cell/cell = null
+ var/obj/item/weapon/stock_parts/cell/cell = null
var/obj/machinery/camera/camera = null
var/obj/item/device/mmi/mmi = null
var/list/req_access = list(access_robotics) //Access needed to pop out the brain.
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 6abce2c37d7..84c4be074f3 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -193,6 +193,7 @@ var/list/slot_equipment_priority = list( \
slot_glasses,\
slot_belt,\
slot_s_store,\
+ slot_tie,\
slot_l_store,\
slot_r_store\
)
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 9697509e5e1..6de3d9cea23 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -52,7 +52,7 @@
var/spooky=0
var/area/area
var/areastring = null
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/start_charge = 90 // initial cell charge %
var/cell_type = 2500 // 0=no cell, 1=regular, 2=high-cap (x5) <- old, now it's just 0=no cell, otherwise dictate cellcapacity by changing this value. 1 used to be 1000, 2 was 2500
var/opened = 0 //0=closed, 1=opened, 2=cover removed
@@ -142,7 +142,7 @@
has_electronics = 2 //installed and secured
// is starting with a power cell installed, create it and set its charge level
if(cell_type)
- src.cell = new/obj/item/weapon/cell(src)
+ src.cell = new/obj/item/weapon/stock_parts/cell(src)
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
cell.charge = start_charge * cell.maxcharge / 100.0 // (convert percentage to actual value)
@@ -399,7 +399,7 @@
else
opened = 1
update_icon()
- else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
+ else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
if(cell)
user << "There is a power cell already installed."
return
@@ -805,6 +805,8 @@
if (user.stat && !isobserver(user))
user << "\red You must be conscious to use this [src]!"
return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
if(!user.client)
return 0
if ( ! (istype(user, /mob/living/carbon/human) || \
@@ -849,36 +851,63 @@
user << "\red You momentarily forget how to use [src]."
return 0
return 1
+
+/obj/machinery/power/apc/proc/is_authenticated(mob/user as mob)
+ if(isAI(user) || isrobot(user))
+ return 1
+ else
+ return !locked
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
+ if(..())
+ return 1
+
if(!can_use(usr, 1))
- return 0
+ return 1
if (href_list["lock"])
+ if(!is_authenticated(usr))
+ return
+
coverlocked = !coverlocked
else if (href_list["breaker"])
+ if(!is_authenticated(usr))
+ return
+
toggle_breaker()
else if (href_list["cmode"])
+ if(!is_authenticated(usr))
+ return
+
chargemode = !chargemode
if(!chargemode)
charging = 0
update_icon()
else if (href_list["eqp"])
+ if(!is_authenticated(usr))
+ return
+
var/val = text2num(href_list["eqp"])
equipment = setsubsystem(val)
update_icon()
update()
else if (href_list["lgt"])
+ if(!is_authenticated(usr))
+ return
+
var/val = text2num(href_list["lgt"])
lighting = setsubsystem(val)
update_icon()
update()
else if (href_list["env"])
+ if(!is_authenticated(usr))
+ return
+
var/val = text2num(href_list["env"])
environ = setsubsystem(val)
update_icon()
@@ -893,7 +922,7 @@
return 0
else if (href_list["overload"])
- if(istype(usr, /mob/living/silicon))
+ if(istype(usr, /mob/living/silicon) && !aidisabled)
src.overload_lighting()
else if (href_list["malfhack"])
@@ -931,13 +960,13 @@
else if (href_list["toggleaccess"])
if(istype(usr, /mob/living/silicon))
- if(emagged || (stat & (BROKEN|MAINT)))
+ if(emagged || aidisabled || (stat & (BROKEN|MAINT)))
usr << "The APC does not respond to the command."
else
locked = !locked
update_icon()
- return 1
+ return 0
/obj/machinery/power/apc/proc/toggle_breaker()
operating = !operating
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index e099b39e35d..606d58a4724 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -1,16 +1,16 @@
// the power cell
// charge from 0 to 100%
// fits in APC to provide backup power
-/obj/item/weapon/cell/var/image/overlay_image
+/obj/item/weapon/stock_parts/cell/var/image/overlay_image
-/obj/item/weapon/cell/New()
+/obj/item/weapon/stock_parts/cell/New()
..()
charge = maxcharge
spawn(5)
updateicon()
-/obj/item/weapon/cell/proc/updateicon()
+/obj/item/weapon/stock_parts/cell/proc/updateicon()
if(isnull(src.overlay_image))
src.overlay_image = image('icons/obj/power.dmi')
overlays.Cut()
@@ -24,11 +24,11 @@
src.overlay_image.icon_state = "cell-o1"
overlays += src.overlay_image
-/obj/item/weapon/cell/proc/percent() // return % charge of cell
+/obj/item/weapon/stock_parts/cell/proc/percent() // return % charge of cell
return 100.0*charge/maxcharge
// use power from a cell
-/obj/item/weapon/cell/proc/use(var/amount)
+/obj/item/weapon/stock_parts/cell/proc/use(var/amount)
if(rigged && amount > 0)
explode()
return 0
@@ -38,7 +38,7 @@
return 1
// recharge the cell
-/obj/item/weapon/cell/proc/give(var/amount)
+/obj/item/weapon/stock_parts/cell/proc/give(var/amount)
if(rigged && amount > 0)
explode()
return 0
@@ -55,7 +55,7 @@
return power_used
-/obj/item/weapon/cell/examine()
+/obj/item/weapon/stock_parts/cell/examine()
set src in view(1)
if(usr /*&& !usr.stat*/)
if(maxcharge <= 2500)
@@ -65,7 +65,7 @@
if(crit_fail)
usr << "\red This power cell seems to be faulty."
-/obj/item/weapon/cell/attack_self(mob/user as mob)
+/obj/item/weapon/stock_parts/cell/attack_self(mob/user as mob)
src.add_fingerprint(user)
if(ishuman(user))
@@ -76,7 +76,7 @@
SNG.drain("CELL",src,H.wear_suit)
return
-/obj/item/weapon/cell/attackby(obj/item/W, mob/user)
+/obj/item/weapon/stock_parts/cell/attackby(obj/item/W, mob/user)
..()
if(istype(W, /obj/item/weapon/reagent_containers/syringe))
var/obj/item/weapon/reagent_containers/syringe/S = W
@@ -93,7 +93,7 @@
S.reagents.clear_reagents()
-/obj/item/weapon/cell/proc/explode()
+/obj/item/weapon/stock_parts/cell/proc/explode()
var/turf/T = get_turf(src.loc)
/*
* 1000-cell explosion(T, -1, 0, 1, 1)
@@ -121,13 +121,13 @@
spawn(1)
del(src)
-/obj/item/weapon/cell/proc/corrupt()
+/obj/item/weapon/stock_parts/cell/proc/corrupt()
charge /= 2
maxcharge /= 2
if (prob(10))
rigged = 1 //broken batterys are dangerous
-/obj/item/weapon/cell/emp_act(severity)
+/obj/item/weapon/stock_parts/cell/emp_act(severity)
charge -= 1000 / severity
if (charge < 0)
charge = 0
@@ -135,7 +135,7 @@
reliability -= 10 / severity
..()
-/obj/item/weapon/cell/ex_act(severity)
+/obj/item/weapon/stock_parts/cell/ex_act(severity)
switch(severity)
if(1.0)
@@ -155,10 +155,10 @@
corrupt()
return
-/obj/item/weapon/cell/blob_act()
+/obj/item/weapon/stock_parts/cell/blob_act()
ex_act(1)
-/obj/item/weapon/cell/proc/get_electrocute_damage()
+/obj/item/weapon/stock_parts/cell/proc/get_electrocute_damage()
switch (charge)
/* if (9000 to INFINITY)
return min(rand(90,150),rand(90,150))
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index bff319d9b60..fbb8d479470 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -475,11 +475,11 @@
power_source = Cable.powernet
var/datum/powernet/PN
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
if(istype(power_source,/datum/powernet))
PN = power_source
- else if(istype(power_source,/obj/item/weapon/cell))
+ else if(istype(power_source,/obj/item/weapon/stock_parts/cell))
cell = power_source
else if(istype(power_source,/obj/machinery/power/apc))
var/obj/machinery/power/apc/apc = power_source
@@ -514,7 +514,7 @@
else if (istype(power_source,/datum/powernet))
var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts"
PN.newload+=drained_power
- else if (istype(power_source, /obj/item/weapon/cell))
+ else if (istype(power_source, /obj/item/weapon/stock_parts/cell))
cell.use(drained_energy)
return drained_energy
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 1613bc46187..a3065ce3bb4 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -33,11 +33,11 @@
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/smes(null)
- component_parts += new /obj/item/weapon/cell/high(null)
- component_parts += new /obj/item/weapon/cell/high(null)
- component_parts += new /obj/item/weapon/cell/high(null)
- component_parts += new /obj/item/weapon/cell/high(null)
- component_parts += new /obj/item/weapon/cell/high(null)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(null)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(null)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(null)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(null)
+ component_parts += new /obj/item/weapon/stock_parts/cell/high(null)
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
component_parts += new /obj/item/stack/cable_coil(null, 5)
RefreshParts()
@@ -68,7 +68,7 @@
IO += CP.rating
input_level_max = 200000 * IO
output_level_max = 200000 * IO
- for(var/obj/item/weapon/cell/PC in component_parts)
+ for(var/obj/item/weapon/stock_parts/cell/PC in component_parts)
C += PC.maxcharge
capacity = C / (15000) * 1e6
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index c32f3973882..bd823f3c4ee 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -292,6 +292,7 @@
A.loc = src
update_icon()
update_gunlight(user)
+ verbs += /obj/item/weapon/gun/proc/toggle_gunlight
if(istype(A, /obj/item/weapon/screwdriver))
if(F)
if(user.l_hand != src && user.r_hand != src)
@@ -304,13 +305,18 @@
update_gunlight(user)
S.update_brightness(user)
update_icon()
+ verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
..()
return
-/obj/item/weapon/gun/verb/toggle_gunlight()
+/obj/item/weapon/gun/proc/toggle_gunlight()
set name = "Toggle Gunlight"
set category = "Object"
set desc = "Click to toggle your weapon's attached flashlight."
+
+ if(!F)
+ return
+
var/mob/living/carbon/human/user = usr
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]."
diff --git a/code/modules/projectiles/guns/alien.dm b/code/modules/projectiles/guns/alien.dm
index 76ea406751b..177255cfe72 100644
--- a/code/modules/projectiles/guns/alien.dm
+++ b/code/modules/projectiles/guns/alien.dm
@@ -77,7 +77,7 @@
force = 10
projectile_type = "/obj/item/projectile/energy/sonic"
- cell_type = "/obj/item/weapon/cell/super"
+ cell_type = "/obj/item/weapon/stock_parts/cell/super"
fire_delay = 40
fire_sound = 'sound/effects/basscannon.ogg'
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 3d09aadc2c6..b3bb07066e6 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -4,9 +4,9 @@
desc = "A basic energy-based gun."
fire_sound = 'sound/weapons/Taser.ogg'
- var/obj/item/weapon/cell/power_supply //What type of power cell this uses
+ var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
var/charge_cost = 1000 //How much energy is needed to fire.
- var/cell_type = "/obj/item/weapon/cell"
+ var/cell_type = "/obj/item/weapon/stock_parts/cell"
var/projectile_type = "/obj/item/projectile/beam"
var/modifystate
@@ -55,7 +55,7 @@
/*
attackby(obj/item/weapon/W, mob/user)
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(!power_supply)
user.drop_item()
W.loc = src
diff --git a/code/modules/projectiles/guns/energy/advtaser.dm b/code/modules/projectiles/guns/energy/advtaser.dm
index ff552909ab8..039c569131e 100644
--- a/code/modules/projectiles/guns/energy/advtaser.dm
+++ b/code/modules/projectiles/guns/energy/advtaser.dm
@@ -4,7 +4,7 @@
icon_state = "advtaser"
item_state = null //so the human update icon uses the icon_state instead.
icon_override = 'icons/mob/in-hand/guns.dmi'
- cell_type = "/obj/item/weapon/cell"
+ cell_type = "/obj/item/weapon/stock_parts/cell"
origin_tech = null
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm
index e11a604b45e..38f14ca87b0 100644
--- a/code/modules/projectiles/guns/energy/pulse.dm
+++ b/code/modules/projectiles/guns/energy/pulse.dm
@@ -7,7 +7,7 @@
fire_sound = 'sound/weapons/pulse.ogg'
charge_cost = 200
projectile_type = "/obj/item/projectile/beam/pulse"
- cell_type = "/obj/item/weapon/cell/super"
+ cell_type = "/obj/item/weapon/stock_parts/cell/super"
var/mode = 2
slot_flags = SLOT_BACK
w_class = 4.0
@@ -52,7 +52,7 @@
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
name = "pulse destroyer"
desc = "A heavy-duty, pulse-based energy weapon."
- cell_type = "/obj/item/weapon/cell/infinite"
+ cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
attack_self(mob/living/user as mob)
user << "\red [src.name] has three settings, and they are all DESTROY."
@@ -63,7 +63,7 @@
name = "m1911-P"
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
icon_state = "m1911-p"
- cell_type = "/obj/item/weapon/cell/infinite"
+ cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
w_class = 3.0
slot_flags = SLOT_BELT
isHandgun()
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 04982e8e587..22d9bb2f47e 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -92,7 +92,7 @@
item_state = "c20r"
w_class = 4
projectile_type = "/obj/item/projectile/meteor"
- cell_type = "/obj/item/weapon/cell/potato"
+ cell_type = "/obj/item/weapon/stock_parts/cell/potato"
clumsy_check = 0 //Admin spawn only, might as well let clowns use it.
var/charge_tick = 0
var/recharge_time = 5 //Time it takes for shots to recharge (in ticks)
@@ -229,7 +229,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
projectile_type = "/obj/item/projectile/kinetic"
fire_sound = 'sound/weapons/Kenetic_accel.ogg'
charge_cost = 5000
- cell_type = "/obj/item/weapon/cell/crap"
+ cell_type = "/obj/item/weapon/stock_parts/cell/crap"
var/overheat = 0
var/recent_reload = 1
@@ -281,7 +281,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
icon_state = "disabler"
item_state = null
projectile_type = "/obj/item/projectile/beam/disabler"
- cell_type = "/obj/item/weapon/cell"
+ cell_type = "/obj/item/weapon/stock_parts/cell"
charge_cost = 500
/obj/item/weapon/gun/energy/disabler/cyborg
@@ -326,7 +326,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
icon_state = "l6closed0"
icon = 'icons/obj/gun.dmi'
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
- cell_type = "/obj/item/weapon/cell/secborg"
+ cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
projectile_type = "/obj/item/projectile/bullet/midbullet3"
charge_cost = 300 //Yeah, let's NOT give them a 300 round clip that recharges, 20 is more reasonable and will actually hurt the borg's battery for overuse.
var/charge_tick = 0
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index cf3ba6028d6..8abebcb8597 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -6,7 +6,7 @@
item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
- cell_type = "/obj/item/weapon/cell/crap"
+ cell_type = "/obj/item/weapon/stock_parts/cell/crap"
/obj/item/weapon/gun/energy/taser/cyborg
name = "taser gun"
@@ -14,7 +14,7 @@
icon_state = "taser"
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
- cell_type = "/obj/item/weapon/cell/secborg"
+ cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
var/charge_tick = 0
var/recharge_time = 10 //Time it takes for shots to recharge (in ticks)
@@ -52,7 +52,7 @@
fire_sound = "sound/weapons/gunshot.ogg"
origin_tech = "combat=3;materials=3;powerstorage=2"
projectile_type = "/obj/item/projectile/energy/electrode"
- cell_type = "/obj/item/weapon/cell"
+ cell_type = "/obj/item/weapon/stock_parts/cell"
@@ -67,7 +67,7 @@
silenced = 1
fire_sound = 'sound/weapons/Genhit.ogg'
projectile_type = "/obj/item/projectile/energy/bolt"
- cell_type = "/obj/item/weapon/cell/crap"
+ cell_type = "/obj/item/weapon/stock_parts/cell/crap"
var/charge_tick = 0
/obj/item/weapon/gun/energy/crossbow/New()
diff --git a/code/modules/projectiles/guns/energy/temperature.dm b/code/modules/projectiles/guns/energy/temperature.dm
index 520a2cf6c73..ffc680a151a 100644
--- a/code/modules/projectiles/guns/energy/temperature.dm
+++ b/code/modules/projectiles/guns/energy/temperature.dm
@@ -9,7 +9,7 @@
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
projectile_type = "/obj/item/projectile/temp"
- cell_type = "/obj/item/weapon/cell/crap"
+ cell_type = "/obj/item/weapon/stock_parts/cell/crap"
New()
diff --git a/code/modules/projectiles/guns/projectile/crossbow.dm b/code/modules/projectiles/guns/projectile/crossbow.dm
index 17fd65cacee..655fcfb92a8 100644
--- a/code/modules/projectiles/guns/projectile/crossbow.dm
+++ b/code/modules/projectiles/guns/projectile/crossbow.dm
@@ -72,7 +72,7 @@
var/tension = 0 // Current draw on the bow.
var/max_tension = 5 // Highest possible tension.
var/release_speed = 5 // Speed per unit of tension.
- var/obj/item/weapon/cell/cell = null // Used for firing superheated rods.
+ var/obj/item/weapon/stock_parts/cell/cell = null // Used for firing superheated rods.
var/current_user // Used to check if the crossbow has changed hands since being drawn.
/obj/item/weapon/gun/launcher/crossbow/emp_act(severity)
@@ -158,7 +158,7 @@
superheat_rod(user)
return
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(!cell)
user.drop_item()
W.loc = src
@@ -213,7 +213,7 @@
user.visible_message("\The [src] only takes baguettes.")
return
- if(istype(W, /obj/item/weapon/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
user.visible_message("The [src] is too simple be adapted with a cell.")
return
diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm
index e8e27bba046..436dc211d61 100644
--- a/code/modules/reagents/Chemistry-Holder.dm
+++ b/code/modules/reagents/Chemistry-Holder.dm
@@ -398,7 +398,7 @@ datum
return 1
check_gofast(var/mob/M)
- if(istype(M, /mob))
+ if(M && istype(M, /mob))
if(M.reagents.has_reagent("hyperzine")||M.reagents.has_reagent("nuka_cola"))
return 1
else
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index f9aa75afee5..8ce267c6d21 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -65,7 +65,7 @@
options[/obj/item/weapon/stock_parts/console_screen] = "Replace the console screen to fix it."
options[/obj/item/weapon/stock_parts/manipulator/pico] = "Upgrade to a pico manipulator to fix it."
options[/obj/item/weapon/stock_parts/matter_bin/super] = "Give it a super matter bin to fix it."
- options[/obj/item/weapon/cell/super] = "Replace the reagent synthesizer with a super capacity cell to fix it."
+ options[/obj/item/weapon/stock_parts/cell/super] = "Replace the reagent synthesizer with a super capacity cell to fix it."
options[/obj/item/device/mass_spectrometer/adv] = "Replace the reagent scanner with an advanced mass spectrometer to fix it"
options[/obj/item/weapon/stock_parts/micro_laser/high] = "Repair the reagent synthesizer with an high-power micro-laser to fix it"
options[/obj/item/device/reagent_scanner/adv] = "Replace the reagent scanner with an advanced reagent scanner to fix it"
@@ -290,7 +290,7 @@
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
- component_parts += new /obj/item/weapon/cell/super(src)
+ component_parts += new /obj/item/weapon/stock_parts/cell/super(src)
RefreshParts()
/obj/machinery/chem_dispenser/constructable/RefreshParts()
@@ -303,7 +303,7 @@
max_energy = temp_energy * 5 //max energy = (bin1.rating + bin2.rating - 1) * 5, 5 on lowest 25 on highest
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
time += C.rating
- for(var/obj/item/weapon/cell/P in component_parts)
+ for(var/obj/item/weapon/stock_parts/cell/P in component_parts)
time += round(P.maxcharge, 10000) / 10000
recharge_delay /= time/2 //delay between recharges, double the usual time on lowest 50% less than usual on highest
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm
index 5de47de26d8..fd8d1334e30 100644
--- a/code/modules/reagents/Chemistry-Reagents.dm
+++ b/code/modules/reagents/Chemistry-Reagents.dm
@@ -2562,15 +2562,16 @@ datum
return
Del()
- if (istype(holder.my_atom,/mob/living))
- var/mob/living/M as mob
- var/to_remove = 0
- if (holder.has_reagent("anti_toxin"))
- to_remove = min(holder.get_reagent_amount("anti_toxin"),data)
- holder.remove_reagent("anti_toxin", to_remove, 0)
- data -= to_remove
- if(M)
- M.adjustToxLoss((data-1)*rand(2,4))
+ if(holder)
+ if (istype(holder.my_atom,/mob/living))
+ var/mob/living/M as mob
+ var/to_remove = 0
+ if (holder.has_reagent("anti_toxin"))
+ to_remove = min(holder.get_reagent_amount("anti_toxin"),data)
+ holder.remove_reagent("anti_toxin", to_remove, 0)
+ data -= to_remove
+ if(M)
+ M.adjustToxLoss((data-1)*rand(2,4))
..()
psilocybin
diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm
index e768546c883..4f3a0990476 100644
--- a/code/modules/reagents/Chemistry-Recipes.dm
+++ b/code/modules/reagents/Chemistry-Recipes.dm
@@ -1323,7 +1323,7 @@ datum
required_container = /obj/item/slime_extract/yellow
required_other = 1
on_reaction(var/datum/reagents/holder, var/created_volume)
- var/obj/item/weapon/cell/slime/P = new /obj/item/weapon/cell/slime
+ var/obj/item/weapon/stock_parts/cell/slime/P = new /obj/item/weapon/stock_parts/cell/slime
P.loc = get_turf_loc(holder.my_atom)
slimeglow
diff --git a/code/modules/reagents/reagent_containers/food/snacks/grown.dm b/code/modules/reagents/reagent_containers/food/snacks/grown.dm
index c3d41be9820..036e19439d9 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/grown.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/grown.dm
@@ -89,7 +89,7 @@
W:amount -= 5
if(!W:amount) del(W)
user << "You add some cable to the potato and slide it inside the battery encasing."
- var/obj/item/weapon/cell/potato/pocell = new /obj/item/weapon/cell/potato(user.loc)
+ var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(user.loc)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge
del(src)
diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm
index 541518016b9..a129dde7472 100644
--- a/code/modules/research/designs/autolathe_designs.dm
+++ b/code/modules/research/designs/autolathe_designs.dm
@@ -19,7 +19,7 @@
category = list("initial","Tools")
/datum/design/crowbar
- name = "Pocket crowbar"
+ name = "Pocket Crowbar"
id = "crowbar"
build_type = AUTOLATHE
materials = list("$metal" = 50)
diff --git a/code/modules/research/designs/power_designs.dm b/code/modules/research/designs/power_designs.dm
index 2b6efbff3fb..9edc8400e3e 100644
--- a/code/modules/research/designs/power_designs.dm
+++ b/code/modules/research/designs/power_designs.dm
@@ -9,7 +9,7 @@
req_tech = list("powerstorage" = 1)
build_type = PROTOLATHE | AUTOLATHE | MECHFAB
materials = list("$metal" = 700, "$glass" = 50)
- build_path = /obj/item/weapon/cell
+ build_path = /obj/item/weapon/stock_parts/cell
category = list("Misc","Power")
/datum/design/high_cell
@@ -19,7 +19,7 @@
req_tech = list("powerstorage" = 2)
build_type = PROTOLATHE | AUTOLATHE | MECHFAB
materials = list("$metal" = 700, "$glass" = 60)
- build_path = /obj/item/weapon/cell/high
+ build_path = /obj/item/weapon/stock_parts/cell/high
category = list("Misc","Power")
/datum/design/hyper_cell
@@ -30,7 +30,7 @@
reliability_base = 70
build_type = PROTOLATHE | MECHFAB
materials = list("$metal" = 400, "$gold" = 150, "$silver" = 150, "$glass" = 70)
- build_path = /obj/item/weapon/cell/hyper
+ build_path = /obj/item/weapon/stock_parts/cell/hyper
category = list("Misc","Power")
/datum/design/super_cell
@@ -41,7 +41,7 @@
reliability_base = 75
build_type = PROTOLATHE | MECHFAB
materials = list("$metal" = 700, "$glass" = 70)
- build_path = /obj/item/weapon/cell/super
+ build_path = /obj/item/weapon/stock_parts/cell/super
category = list("Misc","Power")
/datum/design/pacman
diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm
index b1ddc3eb62a..2554415323f 100644
--- a/code/modules/research/protolathe.dm
+++ b/code/modules/research/protolathe.dm
@@ -199,8 +199,9 @@ Note: Must be placed west/left of and R&D console to function.
busy = 0
src.updateUsrDialog()
- src.overlays += "protolathe_[stack.name]"
- sleep(10)
- src.overlays -= "protolathe_[stack.name]"
+ if(stack)
+ src.overlays += "protolathe_[stack.name]"
+ sleep(10)
+ src.overlays -= "protolathe_[stack.name]"
return
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 6cd7c7471b1..90e7ff47ace 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -50,7 +50,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
req_access = list(access_research) //Data and setting manipulation requires scientist access.
var/selected_category
-
+ var/list/datum/design/matching_designs = list() //for the search function
/obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID.
var/datum/tech/check_tech
@@ -135,6 +135,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
/obj/machinery/computer/rdconsole/New()
..()
files = new /datum/research(src) //Setup the research data holder.
+ matching_designs = list()
if(!id)
for(var/obj/machinery/r_n_d/server/centcom/S in world)
S.initialize()
@@ -589,6 +590,25 @@ won't update every console in existence) but it's more of a hassle to do. Also,
spawn(20)
screen = 1.6
updateUsrDialog()
+
+ else if(href_list["search"]) //Search for designs with name matching pattern
+ var/compare
+
+ matching_designs.Cut()
+
+ if(href_list["type"] == "proto")
+ compare = PROTOLATHE
+ screen = 3.17
+ else
+ compare = IMPRINTER
+ screen = 4.17
+
+ for(var/datum/design/D in files.known_designs)
+ if(!(D.build_type & compare))
+ continue
+ if(findtext(D.name,href_list["to_search"]))
+ matching_designs.Add(D)
+
updateUsrDialog()
return
@@ -801,7 +821,15 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "Chemical Storage
"
dat += "
Protolathe Menu:
"
dat += "Material Amount: [linked_lathe.TotalMaterials()] / [linked_lathe.max_material_storage] "
- dat += "Chemical Volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]"
+ dat += "Chemical Volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume] "
+
+ dat += ""
dat += list_categories(linked_lathe.categories, 3.15)
@@ -842,6 +870,39 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += " | LOCKED"
dat += " "
dat += "
"
+
+ if(3.17) //Display search result
+ dat += "Main Menu"
+ dat += "Protolathe Menu"
+ dat += "
Search results:
"
+ dat += "Material Amount: [linked_lathe.TotalMaterials()] / [linked_lathe.max_material_storage] "
+ dat += "Chemical Volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]"
+
+ var/coeff = linked_lathe.efficiency_coeff
+ for(var/datum/design/D in matching_designs)
+ var/temp_material
+ var/c = 50
+ var/t
+ for(var/M in D.materials)
+ t = linked_lathe.check_mat(D, M)
+ temp_material += " | "
+ if (!t)
+ temp_material += "[D.materials[M]/coeff] [CallMaterialName(M)]"
+ else
+ temp_material += " [D.materials[M]/coeff] [CallMaterialName(M)]"
+ c = min(c,t)
+
+ if (c)
+ dat += "[D.name]"
+ if(c >= 5.0)
+ dat += "x5"
+ if(c >= 10.0)
+ dat += "x10"
+ dat += "[temp_material]"
+ else
+ dat += "[D.name][temp_material]"
+ dat += " "
+ dat += "
"
if(3.2) //Protolathe Material Storage Sub-menu
dat += "Main Menu"
@@ -917,6 +978,14 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "
Circuit Imprinter Menu:
"
dat += "Material Amount: [linked_imprinter.TotalMaterials()] "
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]"
+
+ dat += ""
dat += list_categories(linked_imprinter.categories, 4.15)
@@ -947,6 +1016,30 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(D.locked)
dat += " | LOCKED"
dat += ""
+
+ if(4.17)
+ dat += "Main Menu"
+ dat += "Circuit Imprinter Menu"
+ dat += "
Search results:
"
+ dat += "Material Amount: [linked_imprinter.TotalMaterials()] "
+ dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]"
+
+ var/coeff = linked_imprinter.efficiency_coeff
+ for(var/datum/design/D in matching_designs)
+ var/temp_materials
+ var/check_materials = 1
+ for(var/M in D.materials)
+ temp_materials += " | "
+ if (!linked_imprinter.check_mat(D, M))
+ check_materials = 0
+ temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]"
+ else
+ temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]"
+ if (check_materials)
+ dat += "[D.name][temp_materials] "
+ else
+ dat += "[D.name][temp_materials] "
+ dat += "
"
if(4.2)
dat += "Main Menu"
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact.dm b/code/modules/research/xenoarchaeology/artifact/artifact.dm
index 1ba21f79667..83e5fea7781 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact.dm
@@ -66,8 +66,9 @@
/obj/structure/boulder/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/core_sampler))
- src.geological_data.artifact_distance = rand(-100,100) / 100
- src.geological_data.artifact_id = artifact_find.artifact_id
+ if(geological_data)
+ src.geological_data.artifact_distance = rand(-100,100) / 100
+ src.geological_data.artifact_id = artifact_find.artifact_id
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
index 56954dc6dd1..d770c0def1d 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
@@ -48,7 +48,7 @@
/obj/item/weapon/caution/cone,\
/obj/item/weapon/crowbar,\
/obj/item/weapon/clipboard,\
- /obj/item/weapon/cell,\
+ /obj/item/weapon/stock_parts/cell,\
/obj/item/weapon/circular_saw,\
/obj/item/weapon/hatchet,\
/obj/item/weapon/handcuffs,\
diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_cellcharge.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_cellcharge.dm
index d7ff967c2d0..da7f1a012ee 100644
--- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_cellcharge.dm
+++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_cellcharge.dm
@@ -8,7 +8,7 @@
if(user)
if(istype(user, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
- for (var/obj/item/weapon/cell/D in R.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in R.contents)
D.charge += rand() * 100 + 50
R << "\blue SYSTEM ALERT: Large energy boost detected!"
return 1
@@ -17,12 +17,12 @@
if(holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
- for (var/obj/item/weapon/cell/B in C.contents)
+ for (var/obj/item/weapon/stock_parts/cell/B in C.contents)
B.charge += 25
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge += 25
for (var/mob/living/silicon/robot/M in mob_list)
- for (var/obj/item/weapon/cell/D in M.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in M.contents)
D.charge += 25
M << "\blue SYSTEM ALERT: Energy boost detected!"
return 1
@@ -31,12 +31,12 @@
if(holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
- for (var/obj/item/weapon/cell/B in C.contents)
+ for (var/obj/item/weapon/stock_parts/cell/B in C.contents)
B.charge += rand() * 100
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge += 250
for (var/mob/living/silicon/robot/M in mob_list)
- for (var/obj/item/weapon/cell/D in M.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in M.contents)
D.charge += rand() * 100
M << "\blue SYSTEM ALERT: Energy boost detected!"
return 1
diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_celldrain.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_celldrain.dm
index 8af61035d49..025cdec5ee0 100644
--- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_celldrain.dm
+++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_celldrain.dm
@@ -8,7 +8,7 @@
if(user)
if(istype(user, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
- for (var/obj/item/weapon/cell/D in R.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in R.contents)
D.charge = max(D.charge - rand() * 100, 0)
R << "\blue SYSTEM ALERT: Energy drain detected!"
return 1
@@ -19,12 +19,12 @@
if(holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
- for (var/obj/item/weapon/cell/B in C.contents)
+ for (var/obj/item/weapon/stock_parts/cell/B in C.contents)
B.charge = max(B.charge - 50,0)
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge = max(S.charge - 100,0)
for (var/mob/living/silicon/robot/M in mob_list)
- for (var/obj/item/weapon/cell/D in M.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in M.contents)
D.charge = max(D.charge - 50,0)
M << "\red SYSTEM ALERT: Energy drain detected!"
return 1
@@ -33,12 +33,12 @@
if(holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
- for (var/obj/item/weapon/cell/B in C.contents)
+ for (var/obj/item/weapon/stock_parts/cell/B in C.contents)
B.charge = max(B.charge - rand() * 150,0)
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge = max(S.charge - 250,0)
for (var/mob/living/silicon/robot/M in mob_list)
- for (var/obj/item/weapon/cell/D in M.contents)
+ for (var/obj/item/weapon/stock_parts/cell/D in M.contents)
D.charge = max(D.charge - rand() * 150,0)
M << "\red SYSTEM ALERT: Energy drain detected!"
return 1
diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm
index a8f5a8f6cb1..e2b4215128b 100644
--- a/code/modules/research/xenoarchaeology/finds/finds.dm
+++ b/code/modules/research/xenoarchaeology/finds/finds.dm
@@ -544,12 +544,14 @@
if(talkative)
new_item.talking_atom = new()
- talking_atom.holder_atom = new_item
- talking_atom.init()
+ if(talking_atom)
+ talking_atom.holder_atom = new_item
+ talking_atom.init()
del(src)
else if(talkative)
src.talking_atom = new()
- talking_atom.holder_atom = src
- talking_atom.init()
+ if(talking_atom)
+ talking_atom.holder_atom = src
+ talking_atom.init()
diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
index e0a1faf60d2..2a6df06c6f5 100644
--- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
+++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
@@ -5,7 +5,7 @@
icon_state = "suspension2"
density = 1
req_access = list(access_research)
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/obj/item/weapon/card/id/auth_card
var/locked = 1
var/open = 0
@@ -16,7 +16,7 @@
var/list/secured_mobs = list()
/obj/machinery/suspension_gen/New()
- src.cell = new/obj/item/weapon/cell/high(src)
+ src.cell = new/obj/item/weapon/stock_parts/cell/high(src)
..()
/obj/machinery/suspension_gen/process()
@@ -205,7 +205,7 @@
desc = "It has stubby legs bolted up against it's body for stabilising."
else
user << "You are unable to secure [src] while it is active!"
- else if (istype(W, /obj/item/weapon/cell))
+ else if (istype(W, /obj/item/weapon/stock_parts/cell))
if(open)
if(cell)
user << "There is a power cell already installed."
diff --git a/code/modules/vehicles/ambulance.dm b/code/modules/vehicles/ambulance.dm
index 581b8ca8efd..139bf08fde4 100644
--- a/code/modules/vehicles/ambulance.dm
+++ b/code/modules/vehicles/ambulance.dm
@@ -39,7 +39,7 @@
//-------------------------------------------
/obj/vehicle/train/ambulance/engine/New()
..()
- cell = new /obj/item/weapon/cell/high
+ cell = new /obj/item/weapon/stock_parts/cell/high
verbs -= /atom/movable/verb/pull
key = new()
@@ -86,10 +86,10 @@
..()
flick("mulebot-emagged", src)
-/obj/vehicle/train/ambulance/trolley/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/ambulance/trolley/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
return
-/obj/vehicle/train/ambulance/engine/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/ambulance/engine/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
..()
update_stats()
diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm
index cc416aa34b3..896ee3cc652 100644
--- a/code/modules/vehicles/cargo_train.dm
+++ b/code/modules/vehicles/cargo_train.dm
@@ -40,7 +40,7 @@
//-------------------------------------------
/obj/vehicle/train/cargo/engine/New()
..()
- cell = new /obj/item/weapon/cell/high
+ cell = new /obj/item/weapon/stock_parts/cell/high
verbs -= /atom/movable/verb/pull
key = new()
var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs
@@ -82,10 +82,10 @@
else
icon_state = initial(icon_state)
-/obj/vehicle/train/cargo/trolley/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/cargo/trolley/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
return
-/obj/vehicle/train/cargo/engine/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/cargo/engine/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
..()
update_stats()
diff --git a/code/modules/vehicles/janicart.dm b/code/modules/vehicles/janicart.dm
index 8219335c24a..39008dfb2ba 100644
--- a/code/modules/vehicles/janicart.dm
+++ b/code/modules/vehicles/janicart.dm
@@ -43,7 +43,7 @@
//-------------------------------------------
/obj/vehicle/train/janitor/engine/New()
..()
- cell = new /obj/item/weapon/cell/high
+ cell = new /obj/item/weapon/stock_parts/cell/high
verbs -= /atom/movable/verb/pull
key = new()
var/datum/reagents/R = new/datum/reagents(100)
@@ -136,10 +136,10 @@
..()
flick("mulebot-emagged", src)
-/obj/vehicle/train/janitor/trolley/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/janitor/trolley/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
return
-/obj/vehicle/train/janitor/engine/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/train/janitor/engine/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
..()
update_stats()
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index 1eaf42f62ce..a929e4499d9 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -21,7 +21,7 @@
var/move_delay = 1 //set this to limit the speed of the vehicle
var/movable = 1
- var/obj/item/weapon/cell/cell
+ var/obj/item/weapon/stock_parts/cell/cell
var/charge_use = 5 //set this to adjust the amount of power the vehicle uses per move
var/atom/movable/load //all vehicles can take a load, since they should all be a least drivable
@@ -72,7 +72,7 @@
else if(istype(W, /obj/item/weapon/crowbar) && cell && open)
remove_cell(user)
- else if(istype(W, /obj/item/weapon/cell) && !cell && open)
+ else if(istype(W, /obj/item/weapon/stock_parts/cell) && !cell && open)
insert_cell(W, user)
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/T = W
@@ -236,7 +236,7 @@
turn_on()
return
-/obj/vehicle/proc/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
+/obj/vehicle/proc/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
if(cell)
return
if(!istype(C))
diff --git a/code/setup.dm b/code/setup.dm
index 008a92fbc06..157b5a47d04 100644
--- a/code/setup.dm
+++ b/code/setup.dm
@@ -186,6 +186,7 @@ var/MAX_EXPLOSION_RANGE = 14
#define SLOT_DENYPOCKET 4096 //this is to deny items with a w_class of 2 or 1 to fit in pockets.
#define SLOT_TWOEARS 8192
#define SLOT_PDA 16384
+#define SLOT_TIE 32768
//FLAGS BITMASK
@@ -271,6 +272,7 @@ var/MAX_EXPLOSION_RANGE = 14
#define slot_legcuffed 19
#define slot_r_ear 20
#define slot_wear_pda 21
+#define slot_tie 22
//Cant seem to find a mob bitflags area other than the powers one
diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi
index bbad97bf8bd..f989cb1ab34 100644
Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ
diff --git a/icons/obj/clothing/ties_overlay.dmi b/icons/obj/clothing/ties_overlay.dmi
new file mode 100644
index 00000000000..b4876371591
Binary files /dev/null and b/icons/obj/clothing/ties_overlay.dmi differ
diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi
index ab98bbb87be..e2f6452cdcd 100644
Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ
diff --git a/icons/turf/walls.dmi b/icons/turf/walls.dmi
index c56f7fb8d8c..d977584bd34 100644
Binary files a/icons/turf/walls.dmi and b/icons/turf/walls.dmi differ
diff --git a/maps/RandomZLevels/moonoutpost19.dmm b/maps/RandomZLevels/moonoutpost19.dmm
index c9f561c8109..cf8bcee621f 100644
--- a/maps/RandomZLevels/moonoutpost19.dmm
+++ b/maps/RandomZLevels/moonoutpost19.dmm
@@ -109,7 +109,7 @@
"ce" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/obj/effect/decal/cleanable/dirt,/turf/simulated/floor{carbon_dioxide = 48.7; dir = 1; heat_capacity = 1e+006; icon_state = "warning"; nitrogen = 13.2; oxygen = 32.4; temperature = 251},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
"cf" = (/obj/structure/sign/securearea{pixel_x = 0; pixel_y = 32},/turf/simulated/floor{carbon_dioxide = 48.7; dir = 4; heat_capacity = 1e+006; icon_state = "warningcorner"; nitrogen = 13.2; oxygen = 32.4; temperature = 251},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
"cg" = (/obj/machinery/light/small{active_power_usage = 0; dir = 4; icon_state = "bulb-broken"; status = 2},/obj/effect/decal/cleanable/dirt,/turf/simulated/floor{carbon_dioxide = 48.7; dir = 4; heat_capacity = 1e+006; icon_state = "red"; nitrogen = 13.2; oxygen = 32.4; temperature = 251},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
-"ch" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/obj/structure/table,/obj/machinery/cell_charger,/obj/machinery/light/small{dir = 8},/obj/item/weapon/cell/high,/obj/item/weapon/paper{info = "Alright, listen up. If you're reading this, I'm either taking a shit or I've been recalled back to Command. Either way, you'll need to know how to restore power. We've stolen this stuff from Nanotrasen, so all the equipment is jury-rigged. We have generators that work on both plasma and uranium, about 50 sheets should power the outpost for quite a while. If the generators aren't working, which is very likely, take the power cell on the desk and put it into the APC in the hallway. That should get the place running, at least for a little while."; name = "Engineering Instructions"},/turf/simulated/floor/plating{dir = 8; heat_capacity = 1e+006; icon_state = "warnplate"},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
+"ch" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/obj/structure/table,/obj/machinery/cell_charger,/obj/machinery/light/small{dir = 8},/obj/item/weapon/stock_parts/cell/high,/obj/item/weapon/paper{info = "Alright, listen up. If you're reading this, I'm either taking a shit or I've been recalled back to Command. Either way, you'll need to know how to restore power. We've stolen this stuff from Nanotrasen, so all the equipment is jury-rigged. We have generators that work on both plasma and uranium, about 50 sheets should power the outpost for quite a while. If the generators aren't working, which is very likely, take the power cell on the desk and put it into the APC in the hallway. That should get the place running, at least for a little while."; name = "Engineering Instructions"},/turf/simulated/floor/plating{dir = 8; heat_capacity = 1e+006; icon_state = "warnplate"},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
"ci" = (/obj/structure/stool,/turf/simulated/floor/plating{broken = 1; heat_capacity = 1e+006; icon_state = "platingdmg3"; tag = "icon-platingdmg3"},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
"cj" = (/obj/machinery/power/terminal{icon_state = "term"; dir = 1},/obj/structure/cable{icon_state = "0-2"; d2 = 2},/turf/simulated/floor/plating{dir = 1; heat_capacity = 1e+006; icon_state = "warnplate"},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
"ck" = (/obj/effect/decal/cleanable/dirt,/turf/simulated/floor/plating{dir = 4; heat_capacity = 1e+006; icon_state = "warnplatecorner"; tag = "icon-warnplatecorner (EAST)"},/area/awaycontent/a4{has_gravity = 1; name = "Syndicate Outpost"})
@@ -332,7 +332,7 @@
"gt" = (/obj/structure/cable{icon_state = "0-2"; d2 = 2},/obj/structure/disposalpipe/segment{desc = "An underfloor disposal pipe. This one has been applied with an acid-proof coating."; dir = 4; name = "Acid-Proof disposal pipe"; unacidable = 1},/obj/machinery/door/poddoor/preopen{desc = "A heavy duty blast door that opens mechanically. This one has been applied with an acid-proof coating."; id = "Awaylab"; name = "Acid-Proof containment chamber blast door"; unacidable = 1},/obj/structure/cable,/obj/structure/grille,/obj/structure/window/full/reinforced,/turf/simulated/floor/plating{heat_capacity = 1e+006},/area/awaycontent/a2{has_gravity = 1; name = "MO19 Research"})
"gu" = (/obj/structure/disposalpipe/segment{desc = "An underfloor disposal pipe. This one has been applied with an acid-proof coating."; dir = 4; name = "Acid-Proof disposal pipe"; unacidable = 1},/obj/structure/alien/weeds,/obj/structure/alien/resin/wall,/turf/simulated/floor/engine,/area/awaycontent/a2{has_gravity = 1; name = "MO19 Research"})
"gv" = (/obj/structure/disposalpipe/segment{desc = "An underfloor disposal pipe. This one has been applied with an acid-proof coating."; dir = 2; icon_state = "pipe-c"; name = "Acid-Proof disposal pipe"; unacidable = 1},/obj/structure/alien/weeds{icon_state = "weeds2"},/turf/simulated/floor/engine,/area/awaycontent/a2{has_gravity = 1; name = "MO19 Research"})
-"gw" = (/obj/structure/table,/obj/effect/decal/cleanable/dirt,/obj/machinery/cell_charger,/obj/item/weapon/cell/high,/obj/item/device/radio/off,/turf/simulated/floor/plating{heat_capacity = 1e+006},/area/awaycontent/a2{has_gravity = 1; name = "MO19 Research"})
+"gw" = (/obj/structure/table,/obj/effect/decal/cleanable/dirt,/obj/machinery/cell_charger,/obj/item/weapon/stock_parts/cell/high,/obj/item/device/radio/off,/turf/simulated/floor/plating{heat_capacity = 1e+006},/area/awaycontent/a2{has_gravity = 1; name = "MO19 Research"})
"gx" = (/obj/structure/table,/obj/item/weapon/paper{info = "Ivan Volodin Stories:
Entry Won - 28/05/2554: Hello. I am Crazy Ivan. Boss say I must write. I do good job fixing outpost. Is very good job. Much better than mines. Many nice people. I cause no trouble.
Entry Too - 05/06/2554: I am finding problem with Booze-O-Mat. Is not problem. I solve very easy. Use yellow tool to make purple light go off. I am good engineer! Bartender will be very happy.
Entry Tree - 08/06/2554: Bartender is not happy. Security man is not happy. Cannot feel legs, is very cold in freezer. Is not good. Table is jammed into door, have no tools. Is very not good. But, on bright side, found meat! Shall chew to keep spirits up.
Entry Fore - 12/06/2554: Big nasty purple bug looked at me today. Make nervous. Blue wall wire can be broken, then bad thing happens. Very very bad thing. Man in orange spacesuit wave at me today too. He seem nice. Wonder who was?
Entry Fiv - 15/06/2554: I eat cornflakes today. Is good day. Sun shine for a while. Was nice. I also take ride on disposals chute. Was fun, but tiny. Get clog out of pipes, was vodka bottle. Is empty. This make many sads.