diff --git a/code/datums/action.dm b/code/datums/action.dm index 4ed3a1d904..a193a89516 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -763,4 +763,12 @@ for(var/datum/action/A in M.actions) if(istype(A, action_type)) return A - return \ No newline at end of file + return + +/proc/find_active_innate_action(mob/M, var/action_type) + var/datum/action/innate/A = get_action_of_type(M, action_type) + if(!istype(A)) + return FALSE + if(A.active) + return TRUE + return FALSE \ No newline at end of file diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index c48a545997..3cbaa01b65 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -111,6 +111,8 @@ return if(QDELING(src) || (ranged && !target)) return + if(ranged && bartender_check(target)) + return var/obj/item/broken_bottle/B = new (loc) B.icon_state = icon_state var/icon/I = new('icons/obj/drinks.dmi', src.icon_state) diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 35b3a84e2f..0687bd2d95 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -102,6 +102,14 @@ . = ..() SplashReagents(hit_atom, TRUE) +/obj/item/reagent_containers/proc/bartender_check(atom/target) + . = FALSE + var/turf/T = get_turf(src) + if(!T || target.CanPass(src, T) || !thrownby || !thrownby.actions) + return + if(find_active_innate_action(thrownby, /datum/action/innate/drink_fling)) + return TRUE + /obj/item/reagent_containers/proc/ForceResetRotation() transform = initial(transform) @@ -123,6 +131,13 @@ log_combat(thrownby, M, "splashed", R) reagents.reaction(target, TOUCH) + else if(bartender_check(target) && thrown) + visible_message("[src] lands onto the [target.name] without spilling a single drop.") + transform = initial(transform) + addtimer(CALLBACK(src, .proc/ForceResetRotation), 1) + return + + else if(isturf(target) && reagents.reagent_list.len && thrownby) log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]")