Skip to content

Commit

Permalink
adds reagents splashing animation (#72231)
Browse files Browse the repository at this point in the history
## About The Pull Request
Adds animations for splashing reagents on stuff. Both when combat mode +
right clicking something, and when throwing the reagent container at
something. The slosh sound now also plays in both these cases, because
it seemed weird that these were lacking sounds. There's also an
animation for splashing reagents into hydroponics trays.

default splash animation:
![default](https://user-images.githubusercontent.com/94711066/209586106-1c64bef2-ce1c-40e0-af12-8b17e40efd4c.gif)
splash animation when targeting turfs:
![floor](https://user-images.githubusercontent.com/94711066/209586125-c9eee1b0-96fc-4dd2-9b7b-4715f87d8842.gif)
animation for pouring reagents into hydroponics trays:
![hydroponics](https://user-images.githubusercontent.com/94711066/209586127-669be1d0-5fb8-4ae3-a611-7bde9876dcdc.gif)
(they all get recolored by the reagents)

[new demo video!](https://youtu.be/PuoOmbc3-Nc)

~~[old demo video](https://youtu.be/SfHrINpIidk)
[old extra demo because i forgot to record it the first
time](https://youtu.be/CscgltRpE64)~~
## Why It's Good For The Game
Visual and auditory feedback for splashing things and getting splashed
(with potentially dangerous chemicals). Also looks neat when watering
your plants.
## Changelog
:cl:
add: added reagent splashing animation for spilling reagents on things
add: added reagent splashing animation for spilling reagents onto floors
add: added reagent splashing animation for pouring reagents into
hydroponics trays
soundadd: slosh sound now plays when spilling reagents on things, both
directly and by throwing
/:cl:
  • Loading branch information
kawoppi committed Jan 4, 2023
1 parent 43c64a0 commit 3094b8a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/modules/hydroponics/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,9 @@
// Beakers, bottles, buckets, etc.
if(reagent_source.is_drainable())
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
var/image/splash_animation = image('icons/effects/effects.dmi', src, "splash_hydroponics")
splash_animation.color = mix_color_from_reagents(reagent_source.reagents.reagent_list)
flick_overlay_global(splash_animation, GLOB.clients, 1.1 SECONDS)

if(visi_msg)
visible_message(span_notice("[visi_msg]."))
Expand Down
16 changes: 16 additions & 0 deletions code/modules/reagents/reagent_containers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@
span_userdanger("You feel drenched!"),
)

playsound(target, 'sound/effects/slosh.ogg', 25, TRUE)

var/image/splash_animation = image('icons/effects/effects.dmi', target, "splash")
if(isturf(target))
splash_animation = image('icons/effects/effects.dmi', target, "splash_floor")
splash_animation.color = mix_color_from_reagents(reagents.reagent_list)
flick_overlay_global(splash_animation, GLOB.clients, 1.0 SECONDS)

for(var/datum/reagent/reagent as anything in reagents.reagent_list)
reagent_text += "[reagent] ([num2text(reagent.volume)]),"

Expand Down Expand Up @@ -204,6 +212,14 @@
if(QDELETED(src))
return

playsound(target, 'sound/effects/slosh.ogg', 25, TRUE)

var/image/splash_animation = image('icons/effects/effects.dmi', target, "splash")
if(isturf(target))
splash_animation = image('icons/effects/effects.dmi', target, "splash_floor")
splash_animation.color = mix_color_from_reagents(reagents.reagent_list)
flick_overlay_global(splash_animation, GLOB.clients, 1.0 SECONDS)

reagents.clear_reagents()

/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver, randomize_pixel_offset)
Expand Down
Binary file modified icons/effects/effects.dmi
Binary file not shown.

0 comments on commit 3094b8a

Please sign in to comment.