Adds tool_behaviour support to crafting, door wires, surgeries and mech construction (#35384)

* Adds tool_behaviour support to construction datums (mech construction)

* Adds tool_behaviour support to wire datums

* Adds tool_behavior support to surgeries

* Adds tool_behavior support to crafting

* New proc, to be used for checking tool qualities in hands

* Improves tool quality support on wires
This commit is contained in:
ACCount
2018-02-12 22:52:11 +03:00
committed by AnturK
parent c794d13393
commit 6de835a629
16 changed files with 134 additions and 119 deletions

View File

@@ -121,6 +121,19 @@
return I
return FALSE
//Checks if we're holding a tool that has given quality
//Returns the tool that has the best version of this quality
/mob/proc/is_holding_tool_quality(quality)
var/obj/item/best_item
var/best_quality = INFINITY
for(var/obj/item/I in held_items)
if(I.tool_behaviour == quality && I.toolspeed < best_quality)
best_item = I
best_quality = I.toolspeed
return best_item
//To appropriately fluff things like "they are holding [I] in their [get_held_index_name(get_held_index_of_item(I))]"
//Can be overriden to pass off the fluff to something else (eg: science allowing people to add extra robotic limbs, and having this proc react to that