diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index 5516dadfa6d..c6a78c418e6 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -182,4 +182,9 @@
#define TURF_WET_LUBE 2
#define TURF_WET_ICE 3
-#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA
\ No newline at end of file
+#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA
+
+// Metal foam states
+// teehee no one will find these here
+#define MFOAM_ALUMINUM 1
+#define MFOAM_IRON 2
diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm
index ee383613a68..0cd489c308d 100644
--- a/code/game/objects/effects/effect_system.dm
+++ b/code/game/objects/effects/effect_system.dm
@@ -925,6 +925,13 @@ steam.start() -- spawns the effect
sleep(30)
if(metal)
+ var/turf/T = get_turf(src)
+ if(istype(T, /turf/space))
+ T.ChangeTurf(/turf/simulated/floor/plating/metalfoam)
+ var/turf/simulated/floor/plating/metalfoam/MF = get_turf(src)
+ MF.metal = metal
+ MF.update_icon()
+
var/obj/structure/foamedmetal/M = new(src.loc)
M.metal = metal
M.updateicon()
@@ -994,51 +1001,49 @@ steam.start() -- spawns the effect
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
var/metal = 0 // 0=foam, 1=metalfoam, 2=ironfoam
+/datum/effect/system/foam_spread/set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
+ amount = round(sqrt(amt / 3), 1)
+ if(istype(loca, /turf/))
+ location = loca
+ else
+ location = get_turf(loca)
+
+ carried_reagents = list()
+ metal = metalfoam
-
- set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
- amount = round(sqrt(amt / 3), 1)
- if(istype(loca, /turf/))
- location = loca
- else
- location = get_turf(loca)
-
- carried_reagents = list()
- metal = metalfoam
+ // bit of a hack here. Foam carries along any reagent also present in the glass it is mixed
+ // with (defaults to water if none is present). Rather than actually transfer the reagents,
+ // this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
- // bit of a hack here. Foam carries along any reagent also present in the glass it is mixed
- // with (defaults to water if none is present). Rather than actually transfer the reagents,
- // this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
+ if(carry && !metal)
+ for(var/datum/reagent/R in carry.reagent_list)
+ carried_reagents += R.id
+/datum/effect/system/foam_spread/start()
+ spawn(0)
+ var/obj/effect/effect/foam/F = locate() in location
+ if(F)
+ F.amount += amount
+ return
- if(carry && !metal)
- for(var/datum/reagent/R in carry.reagent_list)
- carried_reagents += R.id
+ F = new(src.location, metal)
+ F.amount = amount
- start()
- spawn(0)
- var/obj/effect/effect/foam/F = locate() in location
- if(F)
- F.amount += amount
- return
+ if(!metal) // don't carry other chemicals if a metal foam
+ F.create_reagents(10)
- F = new(src.location, metal)
- F.amount = amount
-
- if(!metal) // don't carry other chemicals if a metal foam
- F.create_reagents(10)
-
- if(carried_reagents)
- for(var/id in carried_reagents)
- F.reagents.add_reagent(id,1)
- else
- F.reagents.add_reagent("water", 1)
+ if(carried_reagents)
+ for(var/id in carried_reagents)
+ F.reagents.add_reagent(id,1)
+ else
+ F.reagents.add_reagent("water", 1)
// wall formed by metal foams
// dense and opaque, but easy to break
+
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
@@ -1047,79 +1052,85 @@ steam.start() -- spawns the effect
anchored = 1
name = "foamed metal"
desc = "A lightweight foamed metal wall."
- var/metal = 1 // 1=aluminum, 2=iron
+ var/metal = MFOAM_ALUMINUM
- New()
- ..()
- air_update_turf(1)
+/obj/structure/foamedmetal/New()
+ ..()
+ air_update_turf(1)
- Destroy()
- density = 0
- air_update_turf(1)
- return ..()
+/obj/structure/foamedmetal/Destroy()
+ density = 0
+ air_update_turf(1)
+ return ..()
- Move()
- var/turf/T = loc
- ..()
- move_update_air(T)
+/obj/structure/foamedmetal/Move()
+ var/turf/T = loc
+ ..()
+ move_update_air(T)
- proc/updateicon()
- if(metal == 1)
- icon_state = "metalfoam"
- else
- icon_state = "ironfoam"
+/obj/structure/foamedmetal/proc/updateicon()
+ if(metal == MFOAM_ALUMINUM)
+ icon_state = "metalfoam"
+ else
+ icon_state = "ironfoam"
- ex_act(severity)
+/obj/structure/foamedmetal/ex_act(severity)
+ qdel(src)
+
+/obj/structure/foamedmetal/blob_act()
+ qdel(src)
+
+/obj/structure/foamedmetal/bullet_act()
+ if(metal==MFOAM_ALUMINUM || prob(50))
qdel(src)
- blob_act()
+/obj/structure/foamedmetal/attack_hand(var/mob/user)
+ user.changeNext_move(CLICK_CD_MELEE)
+ user.do_attack_animation(src)
+ if ((HULK in user.mutations) || (prob(75 - metal*25)))
+ user.visible_message("[user] smashes through \the [src].", "You smash through \the [src].")
qdel(src)
+ else
+ user << "You hit the metal foam but bounce off it."
- bullet_act()
- if(metal==1 || prob(50))
- qdel(src)
-
- attack_hand(var/mob/user)
- if ((HULK in user.mutations) || (prob(75 - metal*25)))
- user << "\blue You smash through the metal foam wall."
- for(var/mob/O in oviewers(user))
- if ((O.client && !( O.blinded )))
- O << "\red [user] smashes through the foamed metal."
-
- qdel(src)
- else
- user << "\blue You hit the metal foam but bounce off it."
+/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user, params)
+ user.changeNext_move(CLICK_CD_MELEE)
+ user.do_attack_animation(src)
+ if (istype(I, /obj/item/weapon/grab))
+ var/obj/item/weapon/grab/G = I
+ G.affecting.loc = src.loc
+ user.visible_message("[G.assailant] smashes [G.affecting] through the foamed metal wall.")
+ qdel(I)
+ qdel(src)
return
+ if(prob(I.force*20 - metal*25))
+ user.visible_message("[user] smashes through the foamed metal with \the [I].", "You smash through the foamed metal with \the [I].")
+ qdel(src)
+ else
+ user << "You hit the metal foam to no effect."
- attackby(var/obj/item/I, var/mob/user, params)
+/obj/structure/foamedmetal/attack_animal(mob/living/simple_animal/M)
+ M.do_attack_animation(src)
+ if(M.melee_damage_upper == 0)
+ M.visible_message("[M] nudges \the [src].")
+ else
+ if(M.attack_sound)
+ playsound(loc, M.attack_sound, 50, 1, 1)
+ M.visible_message("\The [M] [M.attacktext] [src]!")
+ qdel(src)
- if (istype(I, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = I
- G.affecting.loc = src.loc
- for(var/mob/O in viewers(src))
- if (O.client)
- O << "\red [G.assailant] smashes [G.affecting] through the foamed metal wall."
- qdel(I)
- qdel(src)
- return
+/obj/structure/foamedmetal/attack_alien(mob/living/carbon/alien/humanoid/M)
+ M.visible_message("[M] tears apart \the [src]!");
+ qdel(src)
- if(prob(I.force*20 - metal*25))
- user << "\blue You smash through the foamed metal with \the [I]."
- for(var/mob/O in oviewers(user))
- if ((O.client && !( O.blinded )))
- O << "\red [user] smashes through the foamed metal."
- qdel(src)
- else
- user << "\blue You hit the metal foam to no effect."
+/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
+ if(air_group) return 0
+ return !density
- CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
- if(air_group) return 0
- return !density
-
- CanAtmosPass()
- return !density
+/obj/structure/foamedmetal/CanAtmosPass()
+ return !density
/datum/effect/system/reagents_explosion
var/amount // TNT equivalent
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 2f18239e3df..7e4eef04c26 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -2,7 +2,7 @@
var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
"damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
"platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
- "warnplate", "warnplatecorner",
+ "warnplate", "warnplatecorner","metalfoam", "ironfoam",
"light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
"light_on_broken","light_off","wall_thermite","grass1","grass2","grass3","grass4",
"asteroid","asteroid_dug",
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 0e900329922..608a5a2f16b 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -28,11 +28,11 @@
if(istype(C, /obj/item/stack/rods))
if(broken || burnt)
user << "Repair the plating first!"
- return
+ return 1
var/obj/item/stack/rods/R = C
if (R.get_amount() < 2)
user << "You need two rods to make a reinforced floor!"
- return
+ return 1
else
user << "You begin reinforcing the floor..."
if(do_after(user, 30, target = src))
@@ -41,7 +41,7 @@
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
R.use(2)
user << "You reinforce the floor."
- return
+ return 1
else if(istype(C, /obj/item/stack/tile))
if(!broken && !burnt)
@@ -52,6 +52,7 @@
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
else
user << "This section is too damaged to support a tile! Use a welder to fix the damage."
+ return 1
else if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = C
@@ -62,6 +63,7 @@
icon_state = icon_plating
burnt = 0
broken = 0
+ return 1
/turf/simulated/floor/plating/airless
icon_state = "plating"
@@ -232,6 +234,56 @@
CW.update_icon(0)
playsound(src, 'sound/items/Screwdriver.ogg', 80, 1)
+/turf/simulated/floor/plating/metalfoam
+ name = "foamed metal plating"
+ icon_state = "metalfoam"
+ var/metal = MFOAM_ALUMINUM
+
+/turf/simulated/floor/plating/metalfoam/iron
+ icon_state = "ironfoam"
+ metal = MFOAM_IRON
+
+/turf/simulated/floor/plating/metalfoam/update_icon()
+ switch(metal)
+ if(MFOAM_ALUMINUM)
+ icon_state = "metalfoam"
+ if(MFOAM_IRON)
+ icon_state = "ironfoam"
+
+/turf/simulated/floor/plating/metalfoam/attackby(var/obj/item/C, mob/user, params)
+ if(..())
+ return 1
+ if(istype(C) && C.force)
+ user.changeNext_move(CLICK_CD_MELEE)
+ user.do_attack_animation(src)
+ var/smash_prob = max(0, C.force*17 - metal*25) // A crowbar will have a 60% chance of a breakthrough on alum, 35% on iron
+ if(prob(smash_prob))
+ // YAR BE CAUSIN A HULL BREACH
+ visible_message("[user] smashes through \the [src] with \the [C]!")
+ smash()
+ else
+ visible_message("[user]'s [C.name] bounces against \the [src]!")
+
+/turf/simulated/floor/plating/metalfoam/attack_animal(mob/living/simple_animal/M)
+ M.do_attack_animation(src)
+ if(M.melee_damage_upper == 0)
+ M.visible_message("[M] nudges \the [src].")
+ else
+ if(M.attack_sound)
+ playsound(loc, M.attack_sound, 50, 1, 1)
+ M.visible_message("\The [M] [M.attacktext] [src]!")
+ smash(src)
+
+/turf/simulated/floor/plating/metalfoam/attack_alien(mob/living/carbon/alien/humanoid/M)
+ M.visible_message("[M] tears apart \the [src]!")
+ smash(src)
+
+/turf/simulated/floor/plating/metalfoam/burn_tile()
+ smash()
+
+/turf/simulated/floor/plating/metalfoam/proc/smash()
+ ChangeTurf(/turf/space)
+
/turf/simulated/floor/plasteel/airless
name = "airless floor"
oxygen = 0.01
diff --git a/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_misc.dm b/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_misc.dm
index ff544e9129a..6d89c5a8e9c 100644
--- a/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_misc.dm
+++ b/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_misc.dm
@@ -1,207 +1,147 @@
-/datum/chemical_reaction/
// foam and foam precursor
- surfactant
- name = "Foam surfactant"
- id = "foam surfactant"
- result = "fluorosurfactant"
- required_reagents = list("fluorine" = 2, "carbon" = 2, "sacid" = 1)
- result_amount = 5
- mix_message = "A head of foam results from the mixture's constant fizzing."
+/datum/chemical_reaction/surfactant
+ name = "Foam surfactant"
+ id = "foam surfactant"
+ result = "fluorosurfactant"
+ required_reagents = list("fluorine" = 2, "carbon" = 2, "sacid" = 1)
+ result_amount = 5
+ mix_message = "A head of foam results from the mixture's constant fizzing."
+
+/datum/chemical_reaction/foam
+ name = "Foam"
+ id = "foam"
+ result = null
+ required_reagents = list("fluorosurfactant" = 1, "water" = 1)
+ result_amount = 2
+
+/datum/chemical_reaction/foam/on_reaction(var/datum/reagents/holder, var/created_volume)
+ var/location = get_turf(holder.my_atom)
+ holder.my_atom.visible_message("The solution spews out foam!")
+
+ var/datum/effect/system/foam_spread/s = new()
+ s.set_up(created_volume, location, holder, 0)
+ s.start()
+ holder.clear_reagents()
- foam
- name = "Foam"
- id = "foam"
- result = null
- required_reagents = list("fluorosurfactant" = 1, "water" = 1)
- result_amount = 2
+/datum/chemical_reaction/metalfoam
+ name = "Metal Foam"
+ id = "metalfoam"
+ result = null
+ required_reagents = list("aluminum" = 3, "fluorosurfactant" = 1, "sacid" = 1)
+ result_amount = 5
- on_reaction(var/datum/reagents/holder, var/created_volume)
+/datum/chemical_reaction/metalfoam/on_reaction(var/datum/reagents/holder, var/created_volume)
+ var/location = get_turf(holder.my_atom)
+
+ holder.my_atom.visible_message("The solution spews out a metalic foam!")
+
+ var/datum/effect/system/foam_spread/s = new()
+ s.set_up(created_volume, location, holder, MFOAM_ALUMINUM)
+ s.start()
- var/location = get_turf(holder.my_atom)
- for(var/mob/M in viewers(5, location))
- M << "\red The solution violently bubbles!"
+/datum/chemical_reaction/ironfoam
+ name = "Iron Foam"
+ id = "ironlfoam"
+ result = null
+ required_reagents = list("iron" = 3, "fluorosurfactant" = 1, "sacid" = 1)
+ result_amount = 5
- location = get_turf(holder.my_atom)
+/datum/chemical_reaction/ironfoam/on_reaction(var/datum/reagents/holder, var/created_volume)
+ var/location = get_turf(holder.my_atom)
- for(var/mob/M in viewers(5, location))
- M << "\red The solution spews out foam!"
+ holder.my_atom.visible_message("The blood writhes and wriggles and sizzles away from the container!", 1, "You hear bubbling and sizzling.", 2)
- else
- for(var/mob/M in viewers(get_turf(holder.my_atom), null))
- M.show_message( "The blood seems to break apart in the fuel.", 1)
- holder.del_reagent("blood")
- return
-*/
+/datum/chemical_reaction/plastication
+ name = "Plastic"
+ id = "solidplastic"
+ result = null
+ required_reagents = list("facid" = 10, "plasticide" = 20)
+ result_amount = 1
- plastication
- name = "Plastic"
- id = "solidplastic"
- result = null
- required_reagents = list("facid" = 10, "plasticide" = 20)
- result_amount = 1
- on_reaction(var/datum/reagents/holder)
- var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/mineral/plastic
- M.amount = 10
- M.loc = get_turf(holder.my_atom)
- return
+/datum/chemical_reaction/plastication/on_reaction(var/datum/reagents/holder)
+ var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/mineral/plastic
+ M.amount = 10
+ M.forceMove(get_turf(holder.my_atom))
+/datum/chemical_reaction/space_drugs
+ name = "Space Drugs"
+ id = "space_drugs"
+ result = "space_drugs"
+ required_reagents = list("mercury" = 1, "sugar" = 1, "lithium" = 1)
+ result_amount = 3
+ mix_message = "Slightly dizzying fumes drift from the solution."
+ mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
-//Not really misc chems, but not enough to deserve their own file
-/*
- silicate
- name = "Silicate"
- id = "silicate"
- result = "silicate"
- required_reagents = list("aluminum" = 1, "silicon" = 1, "oxygen" = 1)
- result_amount = 3
-*/
+/datum/chemical_reaction/lube
+ name = "Space Lube"
+ id = "lube"
+ result = "lube"
+ required_reagents = list("water" = 1, "silicon" = 1, "oxygen" = 1)
+ result_amount = 3
+ mix_message = "The substance turns a striking cyan and becomes oily."
- space_drugs
- name = "Space Drugs"
- id = "space_drugs"
- result = "space_drugs"
- required_reagents = list("mercury" = 1, "sugar" = 1, "lithium" = 1)
- result_amount = 3
- mix_message = "Slightly dizzying fumes drift from the solution."
- mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
+/datum/chemical_reaction/holy_water
+ name = "Holy Water"
+ id = "holywater"
+ result = "holywater"
+ required_reagents = list("water" = 1, "mercury" = 1, "wine" = 1)
+ result_amount = 3
+ mix_message = "The water somehow seems purified. Or maybe defiled."
- lube
- name = "Space Lube"
- id = "lube"
- result = "lube"
- required_reagents = list("water" = 1, "silicon" = 1, "oxygen" = 1)
- result_amount = 3
- mix_message = "The substance turns a striking cyan and becomes oily."
+/datum/chemical_reaction/lsd
+ name = "Lysergic acid diethylamide"
+ id = "lsd"
+ result = "lsd"
+ required_reagents = list("diethylamine" = 1, "fungus" = 1)
+ result_amount = 3
+ mix_message = "The mixture turns a rather unassuming color and settles."
- holy_water
- name = "Holy Water"
- id = "holywater"
- result = "holywater"
- required_reagents = list("water" = 1, "mercury" = 1, "wine" = 1)
- result_amount = 3
- mix_message = "The water somehow seems purified. Or maybe defiled."
-
-
- lsd
- name = "Lysergic acid diethylamide"
- id = "lsd"
- result = "lsd"
- required_reagents = list("diethylamine" = 1, "fungus" = 1)
- result_amount = 3
- mix_message = "The mixture turns a rather unassuming color and settles."
-
- drying_agent
- name = "Drying agent"
- id = "drying_agent"
- result = "drying_agent"
- required_reagents = list("plasma" = 2, "ethanol" = 1, "sodium" = 1)
- result_amount = 3
\ No newline at end of file
+/datum/chemical_reaction/drying_agent
+ name = "Drying agent"
+ id = "drying_agent"
+ result = "drying_agent"
+ required_reagents = list("plasma" = 2, "ethanol" = 1, "sodium" = 1)
+ result_amount = 3
\ No newline at end of file
diff --git a/icons/turf/floors.dmi b/icons/turf/floors.dmi
index bcc533187b2..98e1f035e0a 100644
Binary files a/icons/turf/floors.dmi and b/icons/turf/floors.dmi differ