refactors washing items

fixes #3570
Could have fixed with another if statement in sink/attackby, but it was
already pretty snowflakey, and had the potential to get worse
Items now have a wash proc that the sink calls, that can be overridden
when needed
This commit is contained in:
VampyrBytes
2016-02-20 12:01:40 +00:00
parent e124b53593
commit 386ed87126
6 changed files with 52 additions and 42 deletions
+8 -1
View File
@@ -71,4 +71,11 @@
for (var/datum/reagent/R in snack.reagents.reagent_list) //no reagents will be left behind
data += "[R.id]([R.volume] units); " //Using IDs because SOME chemicals(I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
return data
else return "No reagents"
else return "No reagents"
/obj/item/weapon/reagent_containers/wash(mob/user, atom/source)
if(is_open_container())
reagents.add_reagent("water", min(volume - reagents.total_volume, amount_per_transfer_from_this))
user << "<span class='notice'>You fill [src] from [source].</span>"
return
..()
@@ -1674,6 +1674,13 @@
if(volume >= 5)
return Expand()
/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wash(mob/user, atom/source)
if(wrapped)
..()
return
if(do_after(user, 40, target = source))
return 1
/obj/item/weapon/reagent_containers/food/snacks/monkeycube/proc/Expand()
if(isnull(gcDestroyed))
visible_message("<span class='notice'>[src] expands!</span>")