diff --git a/code/game/objects/items/tools/surgery_tools.dm b/code/game/objects/items/tools/surgery_tools.dm index 2e2725b52b81..7d354d8d8c1c 100644 --- a/code/game/objects/items/tools/surgery_tools.dm +++ b/code/game/objects/items/tools/surgery_tools.dm @@ -201,6 +201,8 @@ icon_state = "bone-gel" w_class = SIZE_SMALL matter = list("plastic" = 7500) + ///base icon state for update_icon() to reference, fixes bonegel/empty + var/base_icon_state = "bone-gel" ///percent of gel remaining in container var/remaining_gel = 100 ///If gel is used when doing bone surgery @@ -215,6 +217,22 @@ ///How much bone gel is needed to mend bones var/mend_bones_fix_cost = 5 +/obj/item/tool/surgery/bonegel/update_icon() + . = ..() + if(remaining_gel >= 100) + icon_state = base_icon_state + return + if(remaining_gel > 50) + icon_state = "[base_icon_state]_75" + return + if(remaining_gel > 25) + icon_state = "[base_icon_state]_50" + return + if(remaining_gel > 0) + icon_state = "[base_icon_state]_25" + return + icon_state = "[base_icon_state]_0" + /obj/item/tool/surgery/bonegel/get_examine_text(mob/user) . = ..() if(unlimited_gel) //Only show how much gel is left if it actually uses bone gel @@ -244,6 +262,7 @@ if(!do_after(user, time_per_refill, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, refilling_obj)) break remaining_gel = clamp(remaining_gel + 10, 0, 100) + update_icon() to_chat(user, SPAN_NOTICE("[refilling_obj] chimes, and displays \"[remaining_gel]% filled\".")) refilling = FALSE @@ -257,14 +276,17 @@ if(remaining_gel < gel_cost) return FALSE remaining_gel -= gel_cost + update_icon() return TRUE /obj/item/tool/surgery/bonegel/empty remaining_gel = 0 + icon_state = "bone-gel_0" /obj/item/tool/surgery/bonegel/predatorbonegel name = "gel gun" desc = "Inside is a liquid that is similar in effect to bone gel, but requires much smaller quantities, allowing near infinite use from a single capsule." + base_icon_state = "predator_bone-gel" icon_state = "predator_bone-gel" unlimited_gel = TRUE diff --git a/icons/obj/items/surgery_tools.dmi b/icons/obj/items/surgery_tools.dmi index a5df6761d289..c5e30c0c8c2f 100644 Binary files a/icons/obj/items/surgery_tools.dmi and b/icons/obj/items/surgery_tools.dmi differ