Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes bone-gel bottles slightly transparent #5675

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions code/game/objects/items/tools/surgery_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

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