Skip to content

Commit

Permalink
Testing/fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Sep 13, 2023
1 parent 935dcad commit 29ca075
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/scanners/mass_spectrometer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

/obj/item/scanner/spectrometer/on_update_icon()
. = ..()
icon_state = initial(icon_state)
if(reagents.total_volume)
icon_state += "_s"
icon_state = get_world_inventory_state()
if(reagents?.total_volume)
icon_state += "_loaded"

/obj/item/scanner/spectrometer/is_valid_scan_target(atom/O)
if(!O.reagents || !O.reagents.total_volume)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
/obj/item/chems/water_balloon/on_update_icon()
. = ..()
icon_state = get_world_inventory_state()
if(reagents?.total_volume < =0)
if(reagents?.total_volume <= 0)
icon_state = "[icon_state]_empty"

/obj/item/chems/water_balloon/afterattack(obj/target, mob/user, proximity)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/projectiles/guns/launcher/syringe_gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
. = ..()
underlays.Cut()
if(syringe)
underlays += image(syringe.icon, src, syringe.icon_state)
underlays += syringe.filling
var/mutable_appearance/MA = syringe.appearance
MA.layer = FLOAT_LAYER
MA.plane = FLOAT_PLANE
underlays += MA

/obj/item/syringe_cartridge/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/chems/syringe) && user.try_unequip(I, src))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reagent_containers/inhaler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
. = ..()
if(ATOM_IS_OPEN_CONTAINER(src))
add_overlay("[icon_state]_loaded")
if(reagents.total_volume > 0)
if(reagents?.total_volume > 0)
add_overlay("[icon_state]_reagents")

/obj/item/chems/inhaler/attack(var/mob/living/carbon/human/target, var/mob/user, var/proximity)
Expand Down
10 changes: 5 additions & 5 deletions code/modules/reagents/reagent_containers/syringes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@
if(mode == SYRINGE_BROKEN)
icon_state = "[icon_state]_broken"
return
var/rounded_vol = clamp(round((reagents.total_volume / volume * 15),5), 5, 15)
if (reagents.total_volume == 0)
rounded_vol = 0
var/rounded_vol = 0
if (reagents?.total_volume > 0)
rounded_vol = clamp(round((reagents.total_volume / volume * 15),5), 5, 15)
if(ismob(loc))
add_overlay((mode == SYRINGE_DRAW)? "[icon_state]_draw" : "[icon_state]_inject")
icon_state = "[icon_state]_[rounded_vol]"
if(reagents.total_volume)
filling = image(icon, "[icon_state]_underlay")
if(reagents?.total_volume)
var/image/filling = image(icon, "[icon_state]_underlay")
filling.color = reagents.get_color()
filling.appearance_flags |= RESET_COLOR
underlays += filling
Expand Down
Binary file modified icons/obj/items/device/scanner/advanced_spectrometer.dmi
Binary file not shown.
Binary file modified icons/obj/items/device/scanner/spectrometer.dmi
Binary file not shown.

0 comments on commit 29ca075

Please sign in to comment.