Skip to content

Commit

Permalink
remove plasma contamination mechanic (#8538)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirRichardFrancis authored Dec 21, 2024
1 parent 9753fa6 commit 362e4a8
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 130 deletions.
67 changes: 4 additions & 63 deletions code/ZAS/Plasma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
var/PLASMA_DMG_NAME = "Plasma Damage Amount"
var/PLASMA_DMG_DESC = "Self Descriptive"

var/CLOTH_CONTAMINATION = 1
var/CLOTH_CONTAMINATION_NAME = "Cloth Contamination"
var/CLOTH_CONTAMINATION_DESC = "If this is on, plasma does damage by getting into cloth."

var/PLASMAGUARD_ONLY = 0
var/PLASMAGUARD_ONLY_NAME = "\"PlasmaGuard Only\""
var/PLASMAGUARD_ONLY_DESC = "If this is on, only biosuits and spacesuits protect against contamination and ill effects."
var/PLASMAGUARD_ONLY_DESC = "If this is on, only biosuits and spacesuits protect against ill effects."

var/GENETIC_CORRUPTION = 0
var/GENETIC_CORRUPTION_NAME = "Genetic Corruption Chance"
Expand All @@ -25,10 +21,6 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
var/EYE_BURNS_NAME = "Eye Burns"
var/EYE_BURNS_DESC = "Plasma burns the eyes of anyone not wearing eye protection."

var/CONTAMINATION_LOSS = 0.02
var/CONTAMINATION_LOSS_NAME = "Contamination Loss"
var/CONTAMINATION_LOSS_DESC = "How much toxin damage is dealt from contaminated clothing" //Per tick? ASK ARYN

var/PLASMA_HALLUCINATION = 0
var/PLASMA_HALLUCINATION_NAME = "Plasma Hallucination"
var/PLASMA_HALLUCINATION_DESC = "Does being in plasma cause you to hallucinate?"
Expand All @@ -38,50 +30,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
var/N2O_HALLUCINATION_DESC = "Does being in sleeping gas cause you to hallucinate?"


obj/var/contaminated = 0


/obj/item/proc/can_contaminate()
//Clothing and backpacks can be contaminated.
if(flags & PLASMAGUARD) return 0
else if(istype(src,/obj/item/storage/backpack)) return 0 //Cannot be washed :(
else if(istype(src,/obj/item/clothing)) return 1

/obj/item/proc/contaminate()
//Do a contamination overlay? Temporary measure to keep contamination less deadly than it was.
if(!contaminated)
contaminated = 1
overlays += contamination_overlay

/obj/item/proc/decontaminate()
contaminated = 0
overlays -= contamination_overlay

/mob/proc/contaminate()

/mob/living/carbon/human/contaminate()
//See if anything can be contaminated.

if(!pl_suit_protected())
suit_contamination()

if(!pl_head_protected())
if(prob(1)) suit_contamination() //Plasma can sometimes get through such an open suit.

//Cannot wash backpacks currently.
// if(istype(back,/obj/item/storage/backpack))
// back.contaminate()

/mob/proc/pl_effects()

/mob/living/carbon/human/pl_effects()
//Handles all the bad things plasma can do.

//Contamination
if(vsc.plc.CLOTH_CONTAMINATION) contaminate()

//Anything else requires them to not be dead.
if(stat >= 2)
if(stat >= DEAD)
return

//Burn skin if exposed.
Expand Down Expand Up @@ -123,12 +76,8 @@ obj/var/contaminated = 0

/mob/living/carbon/human/proc/pl_head_protected()
//Checks if the head is adequately sealed.
if(head)
if(vsc.plc.PLASMAGUARD_ONLY)
if(head.flags & PLASMAGUARD)
return 1
else if(head.body_parts_covered & EYES)
return 1
if(head && (head.body_parts_covered & EYES))
return 1
return 0

/mob/living/carbon/human/proc/pl_suit_protected()
Expand All @@ -137,17 +86,9 @@ obj/var/contaminated = 0
for(var/obj/item/protection in list(wear_suit, gloves, shoes))
if(!protection)
continue
if(vsc.plc.PLASMAGUARD_ONLY && !(protection.flags & PLASMAGUARD))
return 0
coverage |= protection.body_parts_covered

if(vsc.plc.PLASMAGUARD_ONLY)
return 1

return BIT_TEST_ALL(coverage, UPPER_TORSO|LOWER_TORSO|LEGS|ARMS)

/mob/living/carbon/human/proc/suit_contamination()
//Runs over the things that can be contaminated and does so.
if(w_uniform) w_uniform.contaminate()
if(shoes) shoes.contaminate()
if(gloves) gloves.contaminate()
10 changes: 0 additions & 10 deletions code/ZAS/Variable Settings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,40 +199,32 @@ var/global/vs_control/vsc = new
return
switch(def)
if("Plasma - Standard")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.PLASMAGUARD_ONLY = 0
plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000.
plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited.
plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
plc.PLASMA_HALLUCINATION = 0
plc.CONTAMINATION_LOSS = 0.02

if("Plasma - Low Hazard")
plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
plc.PLASMAGUARD_ONLY = 0
plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000
plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited.
plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
plc.PLASMA_HALLUCINATION = 0
plc.CONTAMINATION_LOSS = 0.01

if("Plasma - High Hazard")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.PLASMAGUARD_ONLY = 0
plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000.
plc.SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited.
plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
plc.PLASMA_HALLUCINATION = 1
plc.CONTAMINATION_LOSS = 0.05

if("Plasma - Oh Shit!")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.PLASMAGUARD_ONLY = 1
plc.GENETIC_CORRUPTION = 5 //Chance of genetic corruption as well as toxic damage, X in 1000.
plc.SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited.
plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
plc.PLASMA_HALLUCINATION = 1
plc.CONTAMINATION_LOSS = 0.075

if("ZAS - Normal")
airflow_lightest_pressure = 20
Expand Down Expand Up @@ -312,12 +304,10 @@ var/global/vs_control/vsc = new
connection_temperature_delta = initial(connection_temperature_delta)

plc.PLASMA_DMG = initial(plc.PLASMA_DMG)
plc.CLOTH_CONTAMINATION = initial(plc.CLOTH_CONTAMINATION)
plc.PLASMAGUARD_ONLY = initial(plc.PLASMAGUARD_ONLY)
plc.GENETIC_CORRUPTION = initial(plc.GENETIC_CORRUPTION)
plc.SKIN_BURNS = initial(plc.SKIN_BURNS)
plc.EYE_BURNS = initial(plc.EYE_BURNS)
plc.CONTAMINATION_LOSS = initial(plc.CONTAMINATION_LOSS)
plc.PLASMA_HALLUCINATION = initial(plc.PLASMA_HALLUCINATION)
plc.N2O_HALLUCINATION = initial(plc.N2O_HALLUCINATION)

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#define CONDUCT 0x2 // Conducts electricity. (metal etc.)
#define ON_BORDER 0x4 // Item has priority to check when entering or leaving.
#define NOBLOODY 0x8 // Used for items if they don't want to get a blood overlay.
#define PLASMAGUARD 0x10 // Does not get contaminated by plasma.
//#define VACANT 0x10 // Free Real Estate, uncomment and use for whatever
#define PROXMOVE 0x20 // Does this object require proximity checking in Enter()?
#define SILENT 0x40 // Sneaky shoes and silenced tools
#define LOUD 0x80 // Loud as hell tools
Expand Down
12 changes: 4 additions & 8 deletions code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@

//A washing machine cleans away most of the bad effects of old clothes
//Armor penalties and name/desc changes are left
/obj/machinery/washing_machine/proc/wash(atom/A)
A.clean_blood()
if(isobj(A))
var/obj/O = A
if(istype(A, /obj/item))
var/obj/item/I = A
I.decontaminate()
O.make_young()
/obj/machinery/washing_machine/proc/wash(obj/laundry)
laundry.clean_blood()
if(istype(laundry))
laundry.make_young()

/obj/machinery/washing_machine/Process()
if(tick > 0 && (state == WASHSTATE_RUNNING))
Expand Down
12 changes: 0 additions & 12 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,6 @@
step(M, M.dir)
sleep(1)

// TODO: Contamination is ancient and utterly useless mechanic, remove in a separate PR --KIROV
else if(isitem(Obj) && vsc.plc.CLOTH_CONTAMINATION)
var/obj/item/I = Obj
if(I.can_contaminate())
var/datum/gas_mixture/env = return_air(1)
if(!env)
return
for(var/g in env.gas)
if(gas_data.flags[g] & XGM_GAS_CONTAMINANT && env.gas[g] > gas_data.overlay_limit[g] + 1)
I.contaminate()
break

// If an opaque movable atom moves around we need to potentially update visibility.
if(Obj && Obj.opacity)
has_opaque_atom = TRUE // Make sure to do this before reconsider_lights(), incase we're on instant updates. Guaranteed to be on in this case.
Expand Down
14 changes: 0 additions & 14 deletions code/modules/clothing/spacesuits/rig/rig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1041,20 +1041,6 @@
if(glasses)
glasses.clean_blood()

/obj/item/rig/decontaminate()
..()
if(chest)
chest.decontaminate()
if(boots)
boots.decontaminate()
if(helmet)
helmet.decontaminate()
if(gloves)
gloves.decontaminate()
var/obj/item/glasses = getCurrentGlasses()
if(glasses)
glasses.decontaminate()

/obj/item/rig/make_young()
..()
if(chest)
Expand Down
7 changes: 0 additions & 7 deletions code/modules/clothing/spacesuits/void/void.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@

return ..()

/obj/item/clothing/suit/space/void/decontaminate()
if(boots) boots.decontaminate()
if(helmet) helmet.decontaminate()
if(tank) tank.decontaminate()

return ..()

/obj/item/clothing/suit/space/void/make_young()
..()
if(boots) boots.make_young()
Expand Down
7 changes: 1 addition & 6 deletions code/modules/clothing/suits/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@

return ..()

/obj/item/clothing/suit/storage/toggle/robe/decontaminate()
if(hood) hood.decontaminate()

return ..()

/obj/item/clothing/suit/storage/toggle/robe/make_young()
..()
if(hood) hood.make_young()
Expand Down Expand Up @@ -126,7 +121,7 @@
set name = "Toggle Hood"
set category = "Object"
set src in usr

if(!isliving(loc))
return

Expand Down
7 changes: 0 additions & 7 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,6 @@
if(stats.getPerk(PERK_ALCOHOLIC))
stats.removePerk(PERK_ALCOHOLIC_ACTIVE)

var/total_plasmaloss = 0
for(var/obj/item/I in src)
if(I.contaminated)
total_plasmaloss += vsc.plc.CONTAMINATION_LOSS
if(!(status_flags & GODMODE))
bloodstr.add_reagent("plasma", total_plasmaloss)

if(status_flags & GODMODE)
return FALSE //godmode

Expand Down
2 changes: 0 additions & 2 deletions code/modules/scrap/oldificator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@
cold_protection = rand(0, round(cold_protection * 0.5))

if(!low_quality_oldification)
if(prob(20))
contaminate()
if(prob(15))
add_blood()
if(prob(60)) // I mean, the thing is ew gross.
Expand Down

0 comments on commit 362e4a8

Please sign in to comment.