Skip to content

Commit

Permalink
Makes bone-gel bottles slightly transparent (#5675)
Browse files Browse the repository at this point in the history
# About the pull request

Adds 4 new sprites for bone-gel depending on how full it is.

Base (full bottle) sprite is unchanged.

# Explain why it's good for the game

Seeing at a glance whether you will have enough bone-gel in your
bone-gel is better than reading examine text or finding out when you
arrive at your bone-gel surgery step and come up short.

# Testing Photographs and Procedure

<details>
<summary>Screenshots & Videos</summary>


![bone-gel_animated](https://github.com/cmss13-devs/cmss13/assets/8878624/06ea9f79-0ec1-43e2-a995-b33b2f1c15f1)

![image](https://github.com/cmss13-devs/cmss13/assets/8878624/8547d181-21a2-43c9-9452-ed7cb47e965f)

</details>

# Changelog

:cl:
imageadd: added 4 bone-gel fill level sprite states
/:cl:

---------

Co-authored-by: Megaddd <>
Co-authored-by: BeagleGaming1 <[email protected]>
  • Loading branch information
Megaddd and BeagleGaming1 authored Feb 7, 2024
1 parent 2d35f2a commit 7917d83
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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.

0 comments on commit 7917d83

Please sign in to comment.