From 64a0b9e83da9db9cf06ad60f9c61c72dd09bc98b Mon Sep 17 00:00:00 2001 From: Pidgey <35320204+PidgeyThePirate@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:33:12 +1000 Subject: [PATCH] Bottles and cartons now smash when thrown, breaking the container and spilling the contents over whatever is hit. This includes ones made into molotov cocktails. (#15943) --- code/modules/food_and_drinks/drinks/drinks/bottle.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index 532e5572894..d01e314c593 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -12,7 +12,7 @@ var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets) var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it -/obj/item/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = 0) +/obj/item/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = FALSE) //Creates a shattering noise and replaces the bottle with a broken_bottle var/new_location = get_turf(loc) @@ -124,6 +124,11 @@ reagents.reaction(M, REAGENT_TOUCH) reagents.clear_reagents() +/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/target,mob/thrower) + ..() + SplashReagents(target) + smash(target, thrower, ranged = TRUE) + /obj/item/reagent_containers/food/drinks/bottle/decompile_act(obj/item/matter_decompiler/C, mob/user) if(!reagents.total_volume) C.stored_comms["glass"] += 3 @@ -345,11 +350,10 @@ if(istype(R, A)) firestarter = 1 break - SplashReagents(target) + ..() if(firestarter && active) target.fire_act() new /obj/effect/hotspot(get_turf(target)) - ..() /obj/item/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params) if(is_hot(I) && !active)