mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user