diff --git a/code/game/objects/items/stacks/subtypes/material.dm b/code/game/objects/items/stacks/subtypes/material.dm
index 15c167c295d..3ad883ac40f 100644
--- a/code/game/objects/items/stacks/subtypes/material.dm
+++ b/code/game/objects/items/stacks/subtypes/material.dm
@@ -65,7 +65,7 @@
update_strings()
/obj/item/stack/material/get_materials(respect_multiplier)
- return list(src, null, material.id = (respect_multiplier? material_multiplier : 1) * SHEET_MATERIAL_AMOUNT)
+ return list(material.id = (respect_multiplier? material_multiplier : 1) * SHEET_MATERIAL_AMOUNT)
/obj/item/stack/material/update_icon()
if(material.icon_stack_count)
diff --git a/code/game/objects/items/stacks/subtypes/nanopaste.dm b/code/game/objects/items/stacks/subtypes/nanopaste.dm
index 64ccf0b1a7e..f5fce5b732e 100644
--- a/code/game/objects/items/stacks/subtypes/nanopaste.dm
+++ b/code/game/objects/items/stacks/subtypes/nanopaste.dm
@@ -20,7 +20,7 @@
if (istype(L,/mob/living/silicon/robot)) //Repairing cyborgs
var/mob/living/silicon/robot/R = L
if (R.getBruteLoss() || R.getFireLoss())
- if(!can_use(1))
+ if(get_amount() < 1)
to_chat(user, SPAN_WARNING("There isn't enough left."))
return CLICKCHAIN_DO_NOT_PROPAGATE
if(do_after(user,7 * tool_speed))
@@ -39,7 +39,7 @@
if (S && (S.robotic >= ORGAN_ROBOT))
if(!S.get_damage())
to_chat(user, "Nothing to fix here.")
- else if(can_use(1))
+ else if(get_amount() >= 1)
user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(S.open >= 2)
if(do_after(user,5 * tool_speed))
@@ -54,7 +54,7 @@
if (is_holosphere_shell(L))
var/mob/living/simple_mob/holosphere_shell/shell = L
if(shell.getBruteLoss() || shell.getFireLoss())
- if(!can_use(1))
+ if(get_amount() < 1)
to_chat(user, SPAN_WARNING("There isn't enough left."))
return CLICKCHAIN_DO_NOT_PROPAGATE
if(do_after(user,7 * tool_speed))
diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm
index b3a9f50bd96..0ee35d11b29 100644
--- a/code/modules/integrated_electronics/passive/power.dm
+++ b/code/modules/integrated_electronics/passive/power.dm
@@ -210,7 +210,7 @@
IO.disconnect_from_network()
/obj/item/integrated_circuit/passive/power/powernet/make_energy()
- var/obj/item/cell/battery = get_cell()
+ var/obj/item/cell/battery = assembly?.get_cell()
if(assembly && assembly.anchored && battery)
var/should_act = get_pin_data(IC_INPUT, 1) // Even if this is false, we still need to update the output pins with powernet information.
var/drawing = get_pin_data(IC_INPUT, 2)
diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm
index 464ef21e7ce..cbe763002fd 100644
--- a/code/modules/mob/living/voice/voice.dm
+++ b/code/modules/mob/living/voice/voice.dm
@@ -102,6 +102,9 @@
return TRUE
return ..()
+/mob/living/voice/death(gibbed, deathmessage = "no message") // and god taketh away
+ . = ..(gibbed, deathmessage)
+
// Proc: say()
// Parameters: 4 (generic say() arguments)
// Description: Adds a speech bubble to the communicator device, then calls ..() to do the real work.
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 8bf3c79114d..0571bdd2762 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -545,7 +545,6 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
stack_type = /obj/item/stack/cable_coil
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
- stack_type = /obj/item/stack/cable_coil
/obj/item/stack/cable_coil/Initialize(mapload, new_amount, merge, param_color)
. = ..()
@@ -560,29 +559,44 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
// General procedures
///////////////////////////////////
-//you can use wires to heal robotics
-/obj/item/stack/cable_coil/legacy_mob_melee_hook(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent)
- if(ishuman(target) && user.a_intent == INTENT_HELP)
+/obj/item/stack/cable_coil/using_as_item(atom/target, datum/event_args/actor/clickchain/clickchain, clickchain_flags)
+ . = ..()
+ if(. & CLICKCHAIN_FLAGS_INTERACT_ABORT)
+ return
+ if(clickchain.using_intent == INTENT_HELP)
+ if(fix_limb_burns(target, clickchain.performer, clickchain.target_zone) >= 0)
+ return CLICKCHAIN_DID_SOMETHING
+
+// you can use wires to heal robots
+// returns the number of cables used, or -1 if we couldn't fix the limb
+/obj/item/stack/cable_coil/proc/fix_limb_burns(mob/target, mob/user, target_zone)
+ . = -1
+ if(ishuman(target))
var/mob/living/carbon/human/H = target
- var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
- if(!S || S.robotic < ORGAN_ROBOT || S.open == 3)
- to_chat(user, SPAN_WARNING("That isn't a robotic limb."))
+ var/obj/item/organ/external/S = H.organs_by_name[target_zone]
+ if(!S)
+ user.visible_message(SPAN_WARNING("That limb is missing!"))
return
-
- var/use_amt = min(src.amount, CEILING(S.burn_dam / 20, 1), 5)
- if(can_use(use_amt))
+ if(S.robotic < ORGAN_ROBOT)
+ user.visible_message(SPAN_WARNING("That isn't a robotic limb."))
+ return
+ if(S.open == 3) // someone's doing surgery
+ return
+ var/use_amt = min(src.amount, CEILING(S.burn_dam / 5, 1), 5)
+ if(get_amount() >= use_amt)
if(S.robo_repair(5*use_amt, DAMAGE_TYPE_BURN, "some damaged wiring", src, user))
use(use_amt)
+ return use_amt
return
- if(is_holosphere_shell(target) && user.a_intent == INTENT_HELP)
+ if(is_holosphere_shell(target))
var/mob/living/simple_mob/holosphere_shell/shell = target
- var/use_amt = min(src.amount, CEILING(shell.fireloss / 20, 1), 5)
- if(can_use(use_amt))
+ var/use_amt = min(src.amount, CEILING(shell.fireloss / 5, 1), 5)
+ if(get_amount() >= use_amt)
if(shell.shell_repair(5*use_amt, DAMAGE_TYPE_BURN, "some damaged wiring", src, user))
use(use_amt)
+ return use_amt
return
- return ..()
/obj/item/stack/cable_coil/update_icon()
if (!color)
@@ -694,7 +708,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
var/end_dir = 0
if(istype(F, /turf/simulated/open))
- if(!can_use(2))
+ if(get_amount() < 2)
to_chat(user, "You don't have enough cable to do this!")
return
end_dir = DOWN
diff --git a/code/modules/research/machinery/rdconsole_tgui.dm b/code/modules/research/machinery/rdconsole_tgui.dm
index 963d01ab661..a4886402f34 100644
--- a/code/modules/research/machinery/rdconsole_tgui.dm
+++ b/code/modules/research/machinery/rdconsole_tgui.dm
@@ -245,6 +245,7 @@
if(linked_lathe) // Also sends salvaged materials to a linked protolathe, if any.
var/list/mats = linked_destroy.loaded_item.get_materials(TRUE)
linked_lathe.stored_materials.add(mats, linked_destroy.decon_mod)
+ linked_lathe.ui_controller?.ui_materials_update()
linked_destroy.loaded_item = null
for(var/obj/I in linked_destroy.contents)
diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm
index d00641f69fd..88a8644ff28 100644
--- a/code/modules/surgery/robotics.dm
+++ b/code/modules/surgery/robotics.dm
@@ -212,11 +212,11 @@
to_chat(user, "There are no burnt wires here!")
return SURGERY_FAILURE
else
- if(!C.can_use(1))
+ if(C.get_amount() < 5)
to_chat(user, "You need at least five cable pieces to repair this part.") //usage amount made more consistent with regular cable repair
return SURGERY_FAILURE
else
- C.use(1)
+ C.use(5)
return affected && affected.open == 3 && (affected.disfigured || affected.burn_dam > 0) && target_zone != O_MOUTH