Skip to content

Commit

Permalink
Adds fill level sprite states to bone-gel
Browse files Browse the repository at this point in the history
  • Loading branch information
Megaddd committed Feb 6, 2024
1 parent dc8046f commit 4f76e5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions code/game/objects/items/tools/surgery_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
name = "bottle of bone gel"
desc = "A container for bone gel that often needs to be refilled from a specialized machine."
desc_lore = "Bone gel is a biological synthetic bone-analogue with the consistency of clay. It is capable of fixing hairline fractures and complex fractures alike. Bone gel should not be used to fix missing bone, as it does not replace the body's bone marrow. Overuse in a short period may cause acute immunodeficiency or anemia."
var/base_icon_state = "bone-gel"
icon_state = "bone-gel"
w_class = SIZE_SMALL
matter = list("plastic" = 7500)
Expand All @@ -215,6 +216,18 @@
///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]"
else if(remaining_gel > 50)
icon_state = "[base_icon_state]_75"
else if(remaining_gel > 25)
icon_state = "[base_icon_state]_50"
else if(remaining_gel > 0)
icon_state = "[base_icon_state]_25"
else
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
Expand Down Expand Up @@ -244,6 +257,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
Expand All @@ -257,14 +271,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

Expand Down
Binary file modified icons/obj/items/surgery_tools.dmi
Binary file not shown.

0 comments on commit 4f76e5a

Please sign in to comment.