Files
Polaris/code/modules/tools/tool_quality.dm
Atermonera 4d8c43f106 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
2022-01-16 15:52:55 -08:00

40 lines
1.1 KiB
Plaintext

/obj/item
var/list/tool_qualities = list()
/obj/item/examine(mob/user)
. = ..()
for(var/qual in tool_qualities)
var/msg
switch(tool_qualities[qual])
if(TOOL_QUALITY_WORST)
msg += "very poor "
if(TOOL_QUALITY_POOR)
msg += "poor "
if(TOOL_QUALITY_MEDIOCRE)
msg += "mediocre "
if(TOOL_QUALITY_STANDARD)
msg += ""
if(TOOL_QUALITY_DECENT)
msg += "decent "
if(TOOL_QUALITY_GOOD)
msg += "pretty good "
if(TOOL_QUALITY_BEST)
msg += "very good "
. += "It looks like it can be used as a [msg][qual]."
/atom/proc/get_tool_quality(tool_quality)
return TOOL_QUALITY_NONE
/// Used to check for a specific tool quality on an item.
/// Returns the value of `tool_quality` if it is found, else 0.
/obj/item/get_tool_quality(quality)
return LAZYFIND(tool_qualities, quality)
/obj/item/proc/set_tool_quality(tool, quality)
tool_qualities[tool] = quality
/obj/item/proc/get_tool_speed(quality)
return LAZYFIND(tool_qualities, quality)
/obj/item/proc/get_use_time(quality, base_time)
return LAZYFIND(tool_qualities, quality) ? base_time / tool_qualities[quality] : -1