Fixes self-sustaining rainbow slime extracts, blue slime extracts' foam activation and refactors foam code into a helper proc (#46259)

* Fixing self sustaining rainbow extracts and fixing foam creation of blue slime extracts

* Refactoring foams to be in a helper function. Resin foam remains untouched

* Improving refactor of create_foam

* Putting helper proc in vent clog event

* create_foam takes a foam type again

* minor type passing change
This commit is contained in:
Dingo-Dongler
2019-09-06 16:54:42 +10:00
committed by AnturK
parent 63f8856a19
commit cb31d23f49
7 changed files with 27 additions and 50 deletions

View File

@@ -72,3 +72,15 @@
if(!GLOB.chemical_reactions_list[primary_reagent])
GLOB.chemical_reactions_list[primary_reagent] = list()
GLOB.chemical_reactions_list[primary_reagent] += R
//Creates foam from the reagent. Metaltype is for metal foam, notification is what to show people in textbox
/datum/reagents/proc/create_foam(foamtype,foam_volume,metaltype = 0,notification = null)
var/location = get_turf(my_atom)
var/datum/effect_system/foam_spread/foam = new foamtype()
foam.set_up(foam_volume, location, src, metaltype)
foam.start()
clear_reagents()
if(!notification)
return
for(var/mob/M in viewers(5, location))
to_chat(M, notification)