diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 024b2a924cf..733d12dbf78 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -642,14 +642,16 @@ var/list/blood_splatter_icons = list() update_icons() //apply the now updated overlays to the mob -/atom/proc/add_vomit_floor(mob/living/carbon/M as mob, var/toxvomit = 0) - if( istype(src, /turf/simulated) ) - var/obj/effect/decal/cleanable/vomit/this = new /obj/effect/decal/cleanable/vomit(src) +/atom/proc/add_vomit_floor(toxvomit = 0, type = /obj/effect/decal/cleanable/vomit) + if(istype(src, /turf/simulated)) + if(locate(type) in get_turf(src)) + return //Performance improvement + var/obj/effect/decal/cleanable/vomit/this = new type(src) // Make toxins vomit look different if(toxvomit) this.icon_state = "vomittox_[pick(1,4)]" - + playsound(src, 'sound/effects/splat.ogg', 50, 1) /atom/proc/get_global_map_pos() if(!islist(global_map) || isemptylist(global_map)) return diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index 34d1f64f0d0..3b97ecd5a62 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -760,10 +760,8 @@ to_chat(src, "Your host twitches and quivers as you rapdly excrete several larvae from your sluglike body.") visible_message("[src] heaves violently, expelling a rush of vomit and a wriggling, sluglike creature!") B.chemicals -= 100 - - new /obj/effect/decal/cleanable/vomit(get_turf(src)) - playsound(loc, 'sound/effects/splat.ogg', 50, 1) - new /mob/living/simple_animal/borer(get_turf(src),B.generation + 1) + var/turf/T = get_turf(src) + T.add_vomit_floor() else to_chat(src, "You need 100 chemicals to reproduce!") diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 6d360a2ddb3..54841a78a08 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -470,7 +470,7 @@ M.nutrition -= 50 //lose a lot of food var/turf/location = usr.loc if(istype(location, /turf/simulated)) - location.add_vomit_floor(src, 1) + location.add_vomit_floor(TRUE) if(ORION_TRAIL_FLUX) if(prob(75)) M.Weaken(3) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index b0eafcbc8bb..38d5436ecfb 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -701,8 +701,7 @@ H.nutrition -= 20 H.adjustToxLoss(-3) var/turf/T = get_turf(H) - T.add_vomit_floor(H) - playsound(H, 'sound/effects/splat.ogg', 50, 1) + T.add_vomit_floor() else visible_message("[src] flickers and fails, due to bluespace interference!") qdel(src) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0f1c5d91df1..9122647c201 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -109,7 +109,7 @@ adjustBruteLoss(3) else if(T) - T.add_vomit_floor(src) + T.add_vomit_floor() nutrition -= lost_nutrition if(stun) adjustToxLoss(-3) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ee04e624f02..15c88318d0a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1176,12 +1176,11 @@ var/list/slot_equipment_priority = list( \ if(green) if(!no_text) visible_message("[src] vomits up some green goo!","You vomit up some green goo!") - new /obj/effect/decal/cleanable/vomit/green(location) + location.add_vomit_floor(FALSE, /obj/effect/decal/cleanable/vomit/green) else if(!no_text) visible_message("[src] pukes all over [p_them()]self!","You puke all over yourself!") - location.add_vomit_floor(src, 1) - playsound(location, 'sound/effects/splat.ogg', 50, 1) + location.add_vomit_floor(TRUE) /mob/proc/AddSpell(obj/effect/proc_holder/spell/S) mob_spell_list += S diff --git a/code/modules/reagents/chemistry/reagents/food.dm b/code/modules/reagents/chemistry/reagents/food.dm index 9b1aca91f8d..fe2ea7a692e 100644 --- a/code/modules/reagents/chemistry/reagents/food.dm +++ b/code/modules/reagents/chemistry/reagents/food.dm @@ -905,8 +905,7 @@ /datum/reagent/vomit/reaction_turf(turf/T, volume) if(volume >= 5 && !isspaceturf(T)) - new /obj/effect/decal/cleanable/vomit(T) - playsound(T, 'sound/effects/splat.ogg', 50, 1, -3) + T.add_vomit_floor() /datum/reagent/greenvomit name = "Green vomit" @@ -918,8 +917,7 @@ /datum/reagent/greenvomit/reaction_turf(turf/T, volume) if(volume >= 5 && !isspaceturf(T)) - new /obj/effect/decal/cleanable/vomit/green(T) - playsound(T, 'sound/effects/splat.ogg', 50, 1, -3) + T.add_vomit_floor(FALSE, /obj/effect/decal/cleanable/vomit/green) ////Lavaland Flora Reagents////