From 5d3a64f74c6616cedd0fbd54b498ead4ac23822e Mon Sep 17 00:00:00 2001 From: killer653 Date: Wed, 13 Sep 2017 03:25:22 -0400 Subject: [PATCH] Makes beakers require harm intent to splash/spill --- .../reagents/reagent_containers/glass.dm | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index ba1df21038..2d65d67a14 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -78,25 +78,27 @@ /obj/item/weapon/reagent_containers/glass/afterattack(var/obj/target, var/mob/user, var/proximity) - if(!is_open_container() || !proximity) - return + if(!is_open_container() || !proximity) //Is the container open & are they next to whatever they're clicking? + return //If not, do nothing. - for(var/type in can_be_placed_into) + for(var/type in can_be_placed_into) //Is it something it can be placed into? if(istype(target, type)) return - if(standard_splash_mob(user, target)) - return - if(standard_dispenser_refill(user, target)) - return - if(standard_pour_into(user, target)) + if(standard_dispenser_refill(user, target)) //Are they clicking a water tank/some dispenser? return - if(reagents && reagents.total_volume) - user << "You splash the solution onto [target]." - reagents.splash(target, reagents.total_volume) + if(standard_pour_into(user, target)) //Pouring into another beaker? return + if(user.a_intent == I_HURT) //Harm intent? + if(standard_splash_mob(user, target)) //If harm intent and can splash a mob, go ahead. + return + if(reagents && reagents.total_volume) //Otherwise? Splash the floor. + user << "You splash the solution onto [target]." + reagents.splash(target, reagents.total_volume) + return + /obj/item/weapon/reagent_containers/glass/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)