diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 151acb3a396..d1302a906b7 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -1067,9 +1067,9 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
icon_state = "engivend"
icon_deny = "engivend-deny"
req_access_txt = "11" //Engineering Equipment access
- products = list(/obj/item/clothing/glasses/meson/engine = 2, /obj/item/device/multitool = 4, /obj/item/electronics/airlock = 10, /obj/item/electronics/apc = 10, /obj/item/electronics/airalarm = 10, /obj/item/stock_parts/cell/high = 10, /obj/item/construction/rcd/loaded = 3, /obj/item/device/geiger_counter = 5)
+ products = list(/obj/item/clothing/glasses/meson/engine = 2, /obj/item/device/multitool = 4, /obj/item/electronics/airlock = 10, /obj/item/electronics/apc = 10, /obj/item/electronics/airalarm = 10, /obj/item/stock_parts/cell/high = 10, /obj/item/construction/rcd/loaded = 3, /obj/item/device/geiger_counter = 5, /obj/item/grenade/chem_grenade/smart_metal_foam = 10)
contraband = list(/obj/item/stock_parts/cell/potato = 3)
- premium = list(/obj/item/storage/belt/utility = 3)
+ premium = list(/obj/item/storage/belt/utility = 3, /obj/item/storage/box/smart_metal_foam = 1)
armor = list(melee = 100, bullet = 100, laser = 100, energy = 100, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50)
resistance_flags = FIRE_PROOF
diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm
index c1a384a0b3f..5dfe5ece055 100644
--- a/code/game/objects/effects/effect_system/effects_foam.dm
+++ b/code/game/objects/effects/effect_system/effects_foam.dm
@@ -32,6 +32,9 @@
/obj/effect/particle_effect/foam/metal/MakeSlippery()
return
+/obj/effect/particle_effect/foam/metal/smart
+ name = "smart foam"
+
/obj/effect/particle_effect/foam/metal/iron
name = "iron foam"
metal = IRON_FOAM
@@ -68,6 +71,20 @@
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
+/obj/effect/particle_effect/foam/smart/kill_foam() //Smart foam adheres to area borders for walls
+ STOP_PROCESSING(SSfastprocess, src)
+ if(metal)
+ var/turf/T = get_turf(src)
+ if(isspaceturf(T)) //Block up any exposed space
+ T.ChangeTurf(/turf/open/floor/plating/foam)
+ for(var/direction in GLOB.cardinals)
+ var/turf/cardinal_turf = get_step(T, direction)
+ if(get_area(cardinal_turf) != get_area(T)) //We're at an area boundary, so let's block off this turf!
+ new/obj/structure/foamedmetal(T)
+ break
+ flick("[icon_state]-disolve", src)
+ QDEL_IN(src, 5)
+
/obj/effect/particle_effect/foam/process()
lifetime--
if(lifetime < 1)
@@ -149,6 +166,10 @@
effect_type = /obj/effect/particle_effect/foam/metal
+/datum/effect_system/foam_spread/metal/smart
+ effect_type = /obj/effect/particle_effect/foam/smart
+
+
/datum/effect_system/foam_spread/New()
..()
chemholder = new /obj()
diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm
index 608dd260b17..b352596e2f5 100644
--- a/code/game/objects/items/grenades/chem_grenade.dm
+++ b/code/game/objects/items/grenades/chem_grenade.dm
@@ -326,6 +326,24 @@
beakers += B2
+/obj/item/grenade/chem_grenade/smart_metal_foam
+ name = "smart metal foam grenade"
+ desc = "Used for sealing and reconstruction of air breaches."
+ stage = READY
+
+/obj/item/grenade/chem_grenade/smart_metal_foam/Initialize()
+ . = ..()
+ var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src)
+ var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
+
+ B1.reagents.add_reagent("aluminium", 75)
+ B2.reagents.add_reagent("smart_foaming_agent", 25)
+ B2.reagents.add_reagent("facid", 25)
+
+ beakers += B1
+ beakers += B2
+
+
/obj/item/grenade/chem_grenade/incendiary
name = "incendiary grenade"
desc = "Used for clearing rooms of living things."
diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm
index 9ee8aab13f1..e03b306c261 100644
--- a/code/game/objects/items/storage/boxes.dm
+++ b/code/game/objects/items/storage/boxes.dm
@@ -583,6 +583,15 @@
for(var/i in 1 to 7)
new /obj/item/grenade/chem_grenade/metalfoam(src)
+/obj/item/storage/box/smart_metal_foam
+ name = "box of smart metal foam grenades"
+ desc = "Used to rapidly seal hull breaches. This variety conforms to the walls of its area."
+ illustration = "flashbang"
+
+/obj/item/storage/box/smart_metal_foam/PopulateContents()
+ for(var/i in 1 to 7)
+ new/obj/item/grenade/chem_grenade/smart_metal_foam(src)
+
/obj/item/storage/box/hug
name = "box of hugs"
desc = "A special box for sensitive people."
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 1fae8ed2c06..c13def98977 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -24,7 +24,7 @@
..()
//This is so damaged or burnt tiles or platings don't get remembered as the default tile
var/static/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
- "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
+ "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2", "foam_plating",
"platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
"light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
"light_on_broken","light_off","wall_thermite","grass", "sand",
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index dc83f31736e..a03caadd19a 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -4,6 +4,7 @@
* Airless
* Airless plating
* Engine floor
+ * Foam plating
*/
// note that plating and engine floor do not call their parent attackby, unlike other flooring
// this is done in order to avoid inheriting the crowbar attackby
@@ -69,3 +70,35 @@
icon_state = icon_plating
burnt = 0
broken = 0
+
+/turf/open/floor/plating/foam
+ name = "metal foam plating"
+ desc = "Thin, fragile flooring created with metal foam."
+ icon_state = "foam_plating"
+ broken_states = list("foam_plating")
+ burnt_states = list("foam_plating")
+
+/turf/open/floor/plating/foam/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/stack/tile/plasteel))
+ var/obj/item/stack/tile/plasteel/P = I
+ if(P.use(1))
+ var/obj/L = locate(/obj/structure/lattice) in src
+ if(L)
+ qdel(L)
+ to_chat(user, "You reinforce the foamed plating with tiling.")
+ playsound(src, 'sound/weapons/Genhit.ogg', 50, TRUE)
+ ChangeTurf(/turf/open/floor/plating)
+ else
+ playsound(src, 'sound/weapons/tap.ogg', 100, TRUE) //The attack sound is muffled by the foam itself
+ user.changeNext_move(CLICK_CD_MELEE)
+ user.do_attack_animation(src)
+ if(prob(I.force * 20 - 25))
+ user.visible_message("[user] smashes through [src]!", \
+ "You smash through [src] with [I]!")
+ ChangeTurf(baseturf)
+ else
+ to_chat(user, "You hit [src], to no effect!")
+
+/turf/open/floor/plating/foam/ex_act()
+ ..()
+ ChangeTurf(baseturf)
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index 3247b273aea..a74f72c293f 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -1079,6 +1079,14 @@
color = "#664B63" // rgb: 102, 75, 99
taste_description = "metal"
+/datum/reagent/smart_foaming_agent //Smart foaming agent. Functions similarly to metal foam, but conforms to walls.
+ name = "Smart foaming agent"
+ id = "smart_foaming_agent"
+ description = "A agent that yields metallic foam which conforms to area boundaries when mixed with light metal and a strong acid."
+ reagent_state = SOLID
+ color = "#664B63" // rgb: 102, 75, 99
+ taste_description = "metal"
+
/datum/reagent/ammonia
name = "Ammonia"
id = "ammonia"
diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm
index 173bcbcaccc..222f88ba8ba 100644
--- a/code/modules/reagents/chemistry/recipes/others.dm
+++ b/code/modules/reagents/chemistry/recipes/others.dm
@@ -466,6 +466,20 @@
s.start()
holder.clear_reagents()
+/datum/chemical_reaction/smart_foam
+ name = "Smart Metal Foam"
+ id = "smart_metal_foam"
+ required_reagents = list("aluminium" = 3, "smart_foaming_agent" = 1, "facid" = 1)
+ mob_react = TRUE
+
+/datum/chemical_reaction/smart_foam/on_reaction(datum/reagents/holder, created_volume)
+ var/turf/location = get_turf(holder.my_atom)
+ location.visible_message("The solution spews out metallic foam!")
+ var/datum/effect_system/foam_spread/metal/smart/s = new()
+ s.set_up(created_volume * 5, location, holder, TRUE)
+ s.start()
+ holder.clear_reagents()
+
/datum/chemical_reaction/ironfoam
name = "Iron Foam"
id = "ironlfoam"
@@ -487,6 +501,13 @@
results = list("foaming_agent" = 1)
required_reagents = list("lithium" = 1, "hydrogen" = 1)
+/datum/chemical_reaction/smart_foaming_agent
+ name = "Smart foaming Agent"
+ id = "smart_foaming_agent"
+ results = list("smart_foaming_agent" = 3)
+ required_reagents = list("foaming_agent" = 3, "acetone" = 1, "iron" = 1)
+ mix_message = "The solution mixes into a frothy metal foam and conforms to the walls of its container."
+
/////////////////////////////// Cleaning and hydroponics /////////////////////////////////////////////////
diff --git a/icons/turf/floors.dmi b/icons/turf/floors.dmi
index ee1d1865092..a0521414f19 100644
Binary files a/icons/turf/floors.dmi and b/icons/turf/floors.dmi differ