Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miasma #249

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aquila/aquila.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "code\controllers\subsystem\vote.dm"
#include "code\datum\wires\wires_jukebox.dm"
#include "code\datums\components\nanites.dm"
#include "code\datums\components\rot.dm"
#include "code\datums\diseases\advance\symptoms\fleshgrowth.dm"
#include "code\datums\diseases\transformation.dm"
#include "code\datums\ai_laws.dm"
Expand Down Expand Up @@ -105,6 +106,8 @@
#include "code\modules\antagonists\demon\sins\greed.dm"
#include "code\modules\antagonists\demon\sins\pride.dm"
#include "code\modules\antagonists\demon\sins\wrath.dm"
#include "code\modules\atmospherics\auxgm\gas_types.dm"
#include "code\modules\atmospherics\machinery\portable\canister.dm"
#include "code\modules\cargo\packs.dm"
#include "code\modules\cargo\exports\large_objects.dm"
#include "code\modules\client\verbs\input_box.dm"
Expand All @@ -124,6 +127,7 @@
#include "code\modules\food_and_drinks\drinks\drinks.dm"
#include "code\modules\food_and_drinks\food\snacks_pie.dm"
#include "code\modules\food_and_drinks\recipes\drinks_recipes.dm"
#include "code\modules\hydroponics\grown\misc.dm"
#include "code\modules\metacoin\metacoin.dm"
#include "code\modules\mining\equipment\mineral_scanner.dm"
#include "code\modules\mining\machine_bluespaceminer.dm"
Expand Down
1 change: 1 addition & 0 deletions aquila/code/__DEFINES/reactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MIASMA_RESEARCH_AMOUNT 40
66 changes: 66 additions & 0 deletions aquila/code/datums/components/rot.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/datum/component/rot
var/amount = 1

/datum/component/rot/Initialize(new_amount)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE

if(new_amount)
amount = new_amount

START_PROCESSING(SSprocessing, src)

/datum/component/rot/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()

/datum/component/rot/process(delta_time)
var/atom/A = parent

var/turf/open/T = get_turf(A)
if(!istype(T) || T.return_air().return_pressure() > (WARNING_HIGH_PRESSURE - 10))
return

var/datum/gas_mixture/stank = new
stank.set_moles(GAS_MIASMA, amount * delta_time)
stank.set_temperature(BODYTEMP_NORMAL) // otherwise we have gas below 2.7K which will break our lag generator
T.assume_air(stank)
T.air_update_turf()

/datum/component/rot/corpse
amount = MIASMA_CORPSE_MOLES

/datum/component/rot/corpse/Initialize()
if(!iscarbon(parent))
return COMPONENT_INCOMPATIBLE
. = ..()

/datum/component/rot/corpse/process()
var/mob/living/carbon/C = parent
if(C == null) //can't delete what doesnt exist
return

if(C.stat != DEAD)
qdel(src)
return

// Wait a bit before decaying
if(world.time - C.timeofdeath < 2 MINUTES)
return

// Properly stored corpses shouldn't create miasma
if(istype(C.loc, /obj/structure/closet/crate/coffin)|| istype(C.loc, /obj/structure/closet/body_bag) || istype(C.loc, /obj/structure/bodycontainer))
return

// No decay if formaldehyde in corpse or when the corpse is charred
if(C.reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(C, TRAIT_HUSK))
return

// Also no decay if corpse chilled or not organic/undead
if(C.bodytemperature <= T0C-10 || (!(MOB_ORGANIC in C.mob_biotypes) && !(MOB_UNDEAD in C.mob_biotypes)))
return

..()

/datum/component/rot/gibs
amount = MIASMA_GIBS_MOLES
7 changes: 7 additions & 0 deletions aquila/code/modules/atmospherics/auxgm/gas_types.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/datum/gas/miasma
id = GAS_MIASMA
specific_heat = 20
fusion_power = 50
name = "Miasma"
gas_overlay = "miasma"
moles_visible = MOLES_GAS_VISIBLE * 60
24 changes: 24 additions & 0 deletions aquila/code/modules/atmospherics/gasmixtures/reactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/datum/gas_reaction/miaster //dry heat sterilization: clears out pathogens in the air
priority = -10 //after all the heating from fires etc. is done
name = "Dry Heat Sterilization"
id = "sterilization"

/datum/gas_reaction/miaster/init_reqs()
min_requirements = list(
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST+70,
GAS_MIASMA = MINIMUM_MOLE_COUNT
)

/datum/gas_reaction/miaster/react(datum/gas_mixture/air, datum/holder)
// As the name says it, it needs to be dry
if(air.get_moles(GAS_H2O)/air.total_moles() > 0.1)
return

//Replace miasma with oxygen
var/cleaned_air = min(air.get_moles(GAS_MIASMA), 20 + (air.return_temperature() - FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 70) / 20)
air.adjust_moles(GAS_MIASMA, -cleaned_air)
air.adjust_moles(GAS_O2, cleaned_air)

//Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable
air.set_temperature(air.return_temperature() + cleaned_air * 0.002)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, cleaned_air*MIASMA_RESEARCH_AMOUNT)//Turns out the burning of miasma is kinda interesting to scientists
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/obj/machinery/portable_atmospherics/canister/miasma
name = "miasma canister"
desc = "Miasma. Makes you wish your nose was blocked."
gas_type = GAS_MIASMA
filled = 1
greyscale_config = /datum/greyscale_config/canister/double_stripe
greyscale_colors = "#009823#f7d5d3"
32 changes: 32 additions & 0 deletions aquila/code/modules/hydroponics/grown/misc.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Corpse flower
/obj/item/seeds/starthistle/corpse_flower
name = "pack of corpse flower seeds"
desc = "A species of plant that emits a horrible odor. The odor stops being produced in difficult atmospheric conditions."
icon_state = "seed-corpse-flower"
species = "corpse-flower"
plantname = "Corpse flower"
production = 2
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
genes = list()
mutatelist = list()

/obj/item/seeds/starthistle/corpse_flower/pre_attack(obj/machinery/hydroponics/I)
if(istype(I, /obj/machinery/hydroponics))
if(!I.myseed)
START_PROCESSING(SSobj, src)
return ..()

/obj/item/seeds/starthistle/corpse_flower/process(delta_time)
var/obj/machinery/hydroponics/parent = loc
if(parent.age < maturation) // Start a little before it blooms
return

var/turf/open/T = get_turf(parent)
if(abs(ONE_ATMOSPHERE - T.return_air().return_pressure()) > (potency/10 + 10)) // clouds can begin showing at around 50-60 potency in standard atmos
return

var/datum/gas_mixture/stank = new
stank.set_moles(GAS_MIASMA, (yield + 6)*3.5*MIASMA_CORPSE_MOLES*delta_time) // this process is only being called about 2/7 as much as corpses so this is 12-32 times a corpses
stank.set_temperature(T20C) // without this the room would eventually freeze and miasma mining would be easier
T.assume_air(stank)
T.air_update_turf()
6 changes: 6 additions & 0 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
#define GAS_PLUOXIUM "pluox"
#define GAS_CONSTRICTED_PLASMA "constricted_plasma" //NSV13
#define GAS_NUCLEIUM "nucleium" //NSV13
#define GAS_MIASMA "miasma"

#define GAS_FLAG_DANGEROUS (1<<0)
#define GAS_FLAG_BREATH_PROC (1<<1)
Expand Down Expand Up @@ -321,6 +322,11 @@ GLOBAL_LIST_INIT(pipe_paint_colors, sortList(list(
"yellow" = rgb(255,198,0)
)))

//ROT MIASMA AQ EDIT START
#define MIASMA_CORPSE_MOLES 0.02
#define MIASMA_GIBS_MOLES 0.005
//AQ EDIT END

//PIPENET UPDATE STATUS
#define PIPENET_UPDATE_STATUS_DORMANT 0
#define PIPENET_UPDATE_STATUS_REACT_NEEDED 1
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/decals/cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/obj/effect/decal/cleanable/blood/gibs/Initialize(mapload, list/datum/disease/diseases)
. = ..()
name = "rotten [name]"
//AddComponent(/datum/component/rot/gibs)
AddComponent(/datum/component/rot/gibs)//AQ EDIT
reagents.add_reagent(/datum/reagent/liquidgibs, 5)
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, PROC_REF(on_pipe_eject))

Expand Down
4 changes: 4 additions & 0 deletions code/modules/atmospherics/machinery/airalarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
GAS_O2 = new/datum/tlv(16, 19, 40, 50), // Partial pressure, kpa
GAS_N2 = new/datum/tlv(-1, -1, 1000, 1000),
GAS_CO2 = new/datum/tlv(-1, -1, 5, 10),
GAS_MIASMA = new/datum/tlv/(-1, -1, 15, 30),//AQ EDIT
GAS_PLASMA = new/datum/tlv/dangerous,
GAS_NITROUS = new/datum/tlv/dangerous,
GAS_BZ = new/datum/tlv/dangerous,
Expand All @@ -113,6 +114,7 @@
GAS_O2 = new/datum/tlv/no_checks,
GAS_N2 = new/datum/tlv/no_checks,
GAS_CO2 = new/datum/tlv/no_checks,
GAS_MIASMA = new/datum/tlv/no_checks,//AQ EDIT
GAS_PLASMA = new/datum/tlv/no_checks,
GAS_NITROUS = new/datum/tlv/no_checks,
GAS_BZ = new/datum/tlv/no_checks,
Expand All @@ -133,6 +135,7 @@
GAS_O2 = new/datum/tlv(16, 19, 135, 140), // Partial pressure, kpa
GAS_N2 = new/datum/tlv(-1, -1, 1000, 1000),
GAS_CO2 = new/datum/tlv(-1, -1, 5, 10),
GAS_MIASMA = new/datum/tlv/(-1, -1, 2, 5),//AQ EDIT
GAS_PLASMA = new/datum/tlv/dangerous,
GAS_NITROUS = new/datum/tlv/dangerous,
GAS_BZ = new/datum/tlv/dangerous,
Expand Down Expand Up @@ -537,6 +540,7 @@
"power" = 1,
"set_filters" = list(
GAS_CO2,
GAS_MIASMA,//AQ EDIT
GAS_PLASMA,
GAS_H2O,
GAS_HYPERNOB,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

/obj/machinery/atmospherics/components/unary/thermomachine/freezer/on/coldroom/Initialize(mapload)
. = ..()
target_temperature = T0C-20
target_temperature = T0C-20//zatrzymuje Miasme

/obj/machinery/atmospherics/components/unary/thermomachine/heater
icon_state = "heater"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
"stimulum" = /obj/machinery/portable_atmospherics/canister/stimulum,
"pluoxium" = /obj/machinery/portable_atmospherics/canister/pluoxium,
"caution" = /obj/machinery/portable_atmospherics/canister,
"miasma" = /obj/machinery/portable_atmospherics/canister/miasma,//AQ EDIT
"nucleium" = /obj/machinery/portable_atmospherics/canister/nucleium, //NSV13
"constricted plasma" = /obj/machinery/portable_atmospherics/canister/constricted_plasma, //NSV13
"constricted plasma" = /obj/machinery/portable_atmospherics/canister/constricted_plasma //NSV13
)

/obj/machinery/portable_atmospherics/canister/interact(mob/user)
Expand Down
1 change: 1 addition & 0 deletions code/modules/cargo/exports/large_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
worth += C.air_contents.get_moles(GAS_BZ)*4
worth += C.air_contents.get_moles(GAS_STIMULUM)*100
worth += C.air_contents.get_moles(GAS_HYPERNOB)*1000
worth += C.air_contents.get_moles(GAS_MIASMA)*10//AQ EDIT
worth += C.air_contents.get_moles(GAS_TRITIUM)*5
worth += C.air_contents.get_moles(GAS_PLUOXIUM)*5
worth += C.air_contents.get_moles(GAS_CONSTRICTED_PLASMA)*2 //NSV13 - Constricted plasma export.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
genes = list(/datum/plant_gene/trait/plant_type/weed_hardy)
mutatelist = list(/obj/item/seeds/galaxythistle)
mutatelist = list(/obj/item/seeds/starthistle/corpse_flower, /obj/item/seeds/galaxythistle)//AQ EDIT

/obj/item/seeds/starthistle/harvest(mob/user)
var/obj/machinery/hydroponics/parent = loc
Expand Down
41 changes: 41 additions & 0 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

if(stat == DEAD)
stop_sound_channel(CHANNEL_HEARTBEAT)
LoadComponent(/datum/component/rot/corpse)//AQ EDIT

//Updates the number of stored chemicals for changeling powers
if(hud_used?.lingchemdisplay && !isalien(src) && mind)
Expand Down Expand Up @@ -267,6 +268,46 @@
var/nitryl_partialpressure = (breath.get_moles(GAS_NITRYL)/breath.total_moles())*breath_pressure
adjustFireLoss(nitryl_partialpressure/4)

//MIASMA AQ EDIT START
if(breath.get_moles(GAS_MIASMA))
var/miasma_partialpressure = (breath.get_moles(GAS_MIASMA)/breath.total_moles())*breath_pressure

if(prob(1 * miasma_partialpressure))
var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2,3)
miasma_disease.name = "Unknown"
ForceContractDisease(miasma_disease, TRUE, TRUE)

//Miasma side effects
switch(miasma_partialpressure)
if(0.25 to 5)
// At lower pp, give out a little warning
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell")
if(prob(5))
to_chat(src, "<span class='notice'>There is an unpleasant smell in the air.</span>")
if(5 to 20)
//At somewhat higher pp, warning becomes more obvious
if(prob(15))
to_chat(src, "<span class='warning'>You smell something horribly decayed inside this room.</span>")
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/bad_smell)
if(15 to 30)
//Small chance to vomit. By now, people have internals on anyway
if(prob(5))
to_chat(src, "<span class='warning'>The stench of rotting carcasses is unbearable!</span>")
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench)
vomit()
if(30 to INFINITY)
//Higher chance to vomit. Let the horror start
if(prob(25))
to_chat(src, "<span class='warning'>The stench of rotting carcasses is unbearable!</span>")
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench)
vomit()
else
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell")
//Clear all moods if no miasma at all
else
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell")
//AQ EDIT END

//BREATH TEMPERATURE
handle_breath_temperature(breath)

Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/simple_animal/bot/atmosbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define ATMOSBOT_VENT_AIR 2
#define ATMOSBOT_SCRUB_TOXINS 3
#define ATMOSBOT_TEMPERATURE_CONTROL 4
#define ATMOSBOT_SPRAY_MIASMA 5//AQ EDIT

//Floorbot
/mob/living/simple_animal/bot/atmosbot
Expand Down Expand Up @@ -55,6 +56,7 @@
GAS_BZ = 1,
GAS_CO2 = 1,
GAS_HYPERNOB = 1,
GAS_MIASMA = 1,//AQ EDIT
GAS_NITROUS = 1,
GAS_NITRYL = 1,
GAS_PLASMA = 1,
Expand Down Expand Up @@ -196,7 +198,7 @@
if(pressure_delta > 0)
var/transfer_moles = pressure_delta*environment.return_volume()/(T20C * R_IDEAL_GAS_EQUATION)
if(emagged == 2)
environment.adjust_moles(GAS_CO2, transfer_moles)
environment.adjust_moles(GAS_MIASMA, transfer_moles)//AQ EDIT zamiast CO2
else
environment.adjust_moles(GAS_N2, transfer_moles * 0.7885)
environment.adjust_moles(GAS_O2, transfer_moles * 0.2115)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ GLOBAL_LIST_EMPTY(destabliization_exits)
var/static/list/valid_outputs = list(
/datum/gas/bz = 3,
/datum/gas/hypernoblium = 1,
/datum/gas/miasma = 3,//AQ
/datum/gas/plasma = 3,
/datum/gas/tritium = 2,
/datum/gas/nitryl = 1
Expand Down
Loading
Loading