mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-05 23:12:26 +00:00
What was supposed to be another straightforward major system overhaul that once again spiraled out of control (#8220)
* get_tool_quality has numerical meaning * Basic tools set tool quality * Toolspeed is replaced by tool quality checks * Addresses assorted results from live test * Extra cleanup
This commit is contained in:
@@ -85,8 +85,10 @@
|
||||
if(istype(item, /obj/item/stack))
|
||||
var/obj/item/stack/stack = item
|
||||
.["other"][item.type] += stack.amount
|
||||
else if(item.tool_qualities)
|
||||
.["tool_qualities"] |= item.tool_qualities
|
||||
else if(LAZYLEN(item.tool_qualities))
|
||||
for(var/tool_quality in item.tool_qualities)
|
||||
if(.["tool_qualities"][tool_quality] < item.tool_qualities[tool_quality])
|
||||
.["tool_qualities"][tool_quality] = item.tool_qualities[tool_quality]
|
||||
.["other"][item.type] += 1
|
||||
else
|
||||
if(istype(item, /obj/item/weapon/reagent_containers))
|
||||
@@ -161,10 +163,10 @@
|
||||
present_qualities[behavior] = TRUE
|
||||
available_tools[contained_item.type] = TRUE
|
||||
for(var/behavior in contained_item.tool_qualities)
|
||||
present_qualities[behavior] = TRUE
|
||||
present_qualities[behavior] = max(present_qualities[behavior], contained_item.tool_qualities[behavior])
|
||||
|
||||
for(var/quality in surroundings["tool_behaviour"])
|
||||
present_qualities[quality] = TRUE
|
||||
present_qualities[quality] = max(present_qualities[quality], surroundings[quality])
|
||||
|
||||
for(var/path in surroundings["other"])
|
||||
available_tools[path] = TRUE
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/obj/item
|
||||
var/list/tool_qualities
|
||||
|
||||
/// Used to check for a specific tool quality on an item.
|
||||
/// Returns TRUE or FALSE depending on whether `tool_quality` is found.
|
||||
/obj/item/proc/has_tool_quality(tool_quality)
|
||||
return !!LAZYFIND(tool_qualities, tool_quality)
|
||||
|
||||
/* Legacy Support */
|
||||
|
||||
/// DEPRECATED PROC: DO NOT USE IN NEW CODE
|
||||
/obj/item/proc/is_screwdriver()
|
||||
return has_tool_quality(TOOL_SCREWDRIVER)
|
||||
|
||||
/// DEPRECATED PROC: DO NOT USE IN NEW CODE
|
||||
/obj/item/proc/is_wrench()
|
||||
return has_tool_quality(TOOL_WRENCH)
|
||||
|
||||
/// DEPRECATED PROC: DO NOT USE IN NEW CODE
|
||||
/obj/item/proc/is_crowbar()
|
||||
return has_tool_quality(TOOL_CROWBAR)
|
||||
|
||||
/// DEPRECATED PROC: DO NOT USE IN NEW CODE
|
||||
/obj/item/proc/is_wirecutter()
|
||||
return has_tool_quality(TOOL_WIRECUTTER)
|
||||
|
||||
/// DEPRECATED PROC: DO NOT USE IN NEW CODE
|
||||
/obj/item/proc/is_multitool()
|
||||
return has_tool_quality(TOOL_MULTITOOL)
|
||||
Reference in New Issue
Block a user