Skip to content

Commit

Permalink
Anti-Radiation Foam (#3366)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Buyable foam that destroys radiation emitters, and decontaminates
objects very efficiently.
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Makes wasteplanet survival less of a hassle when prepared
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl: Erika Fox
add: Anti-Radiation Foam is now available at the outpost
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Erikafox authored Sep 30, 2024
1 parent f3df7cc commit c8515f4
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 4 deletions.
5 changes: 3 additions & 2 deletions code/game/objects/effects/decals/cleanable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
/obj/effect/decal/cleanable/wash(clean_types)
..()
if(!(flags_1 & INITIALIZED_1))
return FALSE
qdel(src)
return
if(clean_types in list(CLEAN_WASH, CLEAN_SCRUB))
qdel(src)
return TRUE

/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
Expand Down
29 changes: 27 additions & 2 deletions code/game/objects/effects/effect_system/effects_foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@

/obj/effect/particle_effect/foam/firefighting/kill_foam()
STOP_PROCESSING(SSfastprocess, src)

if(absorbed_plasma)
var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src))
if(!P)
P = new(loc)
P.reagents.add_reagent(/datum/reagent/stable_plasma, absorbed_plasma)

flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)

Expand All @@ -67,6 +65,33 @@
/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return


/obj/effect/particle_effect/foam/antirad
name = "antiradiation foam"
lifetime = 80
amount = 0 //no spread
slippery_foam = FALSE
color = "#A6FAFF55"


/obj/effect/particle_effect/foam/antirad/process()
..()

var/turf/open/T = get_turf(src)
var/obj/effect/radiation/rads = (locate(/obj/effect/radiation) in T)
if(rads && istype(T))
rads.rad_power = rads.rad_power * rand(0.8, 0.95)
if (rads.rad_power <= RAD_BACKGROUND_RADIATION)
new /obj/effect/decal/cleanable/greenglow/filled(loc)
qdel(rads)
for(var/obj/things in get_turf(src))
things.wash(CLEAN_TYPE_RADIATION)

/obj/effect/particle_effect/foam/antirad/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)

/obj/effect/particle_effect/foam/metal
name = "aluminium foam"
metal = ALUMINIUM_FOAM
Expand Down
33 changes: 33 additions & 0 deletions code/game/objects/items/tanks/watertank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,39 @@
amount_per_transfer_from_this = (amount_per_transfer_from_this == 10 ? 5 : 10)
to_chat(user, "<span class='notice'>You [amount_per_transfer_from_this == 10 ? "remove" : "fix"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")

//radiation cleanup pack

/obj/item/watertank/anti_rad
name = "radiation foam pack"
desc = "A pressurized backpack tank with sprayer nozzle, intended to clean up radioactive hazards."
item_state = "waterbackpackatmos"
icon_state = "waterbackpackatmos"
volume = 200
slowdown = 0.3

/obj/item/watertank/anti_rad/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/anti_radiation_foam, 200)


/obj/item/reagent_containers/spray/mister/anti_rad
name = "spray nozzle"
desc = "A heavy duty nozzle attached to a radiation foam tank."
icon_state = "atmos_nozzle"
item_state = "nozzleatmos"
amount_per_transfer_from_this = 5
possible_transfer_amounts = list()
current_range = 6
spray_range = 6


/obj/item/watertank/anti_rad/make_noz()
return new /obj/item/reagent_containers/spray/mister/anti_rad(src)

/obj/item/reagent_containers/spray/mister/anti_rad/attack_self(mob/user)
amount_per_transfer_from_this = (amount_per_transfer_from_this == 10 ? 5 : 10)
to_chat(user, "<span class='notice'>You [amount_per_transfer_from_this == 10 ? "tigten" : "loosen"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")

//ATMOS FIRE FIGHTING BACKPACK

#define EXTINGUISHER 0
Expand Down
11 changes: 11 additions & 0 deletions code/modules/cargo/packs/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,14 @@
contains = list(/obj/structure/reagent_dispensers/foamtank)
crate_name = "foam tank crate"
crate_type = /obj/structure/closet/crate/large

/datum/supply_pack/tools/radfoamtank
name = "Radiation Foam Tank Crate"
desc = "Contains a tank of anti-radiation foam. Pressurized sprayer included!"
cost = 1500
contains = list(
/obj/item/watertank/anti_rad,
/obj/structure/reagent_dispensers/foamtank/antirad
)
crate_name = "foam tank crate"
crate_type = /obj/structure/closet/crate/large
35 changes: 35 additions & 0 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2526,3 +2526,38 @@
description = "Bacteria native to the Saint-Roumain Militia home planet."
color = "#5a4f42"
taste_description = "sour"

//anti rad foam
/datum/reagent/anti_radiation_foam
name = "Anti-Radiation Foam"
description = "A tried and tested foam, used for decontaminating nuclear disasters."
reagent_state = LIQUID
color = "#A6FAFF55"
taste_description = "bitter, foamy awfulness."

/datum/reagent/anti_radiation_foam/expose_turf(turf/open/T, reac_volume)
if (!istype(T))
return

if(reac_volume >= 1)
var/obj/effect/particle_effect/foam/antirad/F = (locate(/obj/effect/particle_effect/foam/antirad) in T)
if(!F)
F = new(T)
else if(istype(F))
F.lifetime = initial(F.lifetime) //the foam is what does the cleaning here

/datum/reagent/anti_radiation_foam/expose_obj(obj/O, reac_volume)
O.wash(CLEAN_RAD)

/datum/reagent/anti_radiation_foam/expose_mob(mob/living/M, method=TOUCH, reac_volume)
if(method in list(TOUCH, VAPOR))
M.radiation = M.radiation - rand(max(M.radiation * 0.95, M.radiation)) //get the hose
M.ExtinguishMob()
..()


/datum/reagent/anti_radiation_foam/on_mob_life(mob/living/carbon/M)
M.adjustToxLoss(0.5, 200)
M.adjust_disgust(4)
..()
. = 1
6 changes: 6 additions & 0 deletions code/modules/reagents/reagent_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
reagent_id = /datum/reagent/firefighting_foam
tank_volume = 500

/obj/structure/reagent_dispensers/foamtank/antirad
name = "anti-radiation foam tank"
desc = "A tank full of decontamination foam"
reagent_id = /datum/reagent/anti_radiation_foam
tank_volume = 1000

/obj/structure/reagent_dispensers/fueltank
name = "fuel tank"
desc = "A tank full of industrial welding fuel. Do not consume."
Expand Down

0 comments on commit c8515f4

Please sign in to comment.