Merge branch 'master' into more_cooking2

This commit is contained in:
TrilbySpaceClone
2019-09-25 14:56:11 -04:00
378 changed files with 12459 additions and 8338 deletions
+9 -5
View File
@@ -1,4 +1,4 @@
#define CHEMICAL_QUANTISATION_LEVEL 0.0001
#define CHEMICAL_QUANTISATION_LEVEL 0.001
/proc/build_chemical_reagent_list()
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
@@ -496,7 +496,12 @@
//Standard reaction mechanics:
else
if (C.FermiChem == TRUE)//Just to make sure
if (C.FermiChem == TRUE)//Just to make sure, should only proc when grenades are combining.
if (chem_temp > C.ExplodeTemp) //To allow fermigrenades
var/datum/chemical_reaction/fermi/Ferm = selected_reaction
fermiIsReacting = FALSE
SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[Ferm] explosion"))
Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH)
return 0
for(var/B in cached_required_reagents) //
@@ -745,7 +750,6 @@
del_reagent(R.id)
else
total_volume += R.volume
return 0
/datum/reagents/proc/clear_reagents()
@@ -874,7 +878,7 @@
var/datum/reagent/R = A
if (R.id == reagent) //IF MERGING
//Add amount and equalize purity
R.volume += amount
R.volume += round(amount, CHEMICAL_QUANTISATION_LEVEL)
R.purity = ((R.purity * R.volume) + (other_purity * amount)) /((R.volume + amount)) //This should add the purity to the product
update_total()
@@ -896,7 +900,7 @@
var/datum/reagent/R = new D.type(data)
cached_reagents += R
R.holder = src
R.volume = amount
R.volume = round(amount, CHEMICAL_QUANTISATION_LEVEL)
R.purity = other_purity
R.loc = get_turf(my_atom)
if(data)
@@ -233,6 +233,12 @@
else
reagents.remove_reagent(id, amount)
. = TRUE
else if (amount == -1) // -1 means custom amount
useramount = input("Enter the Amount you want to transfer:", name, useramount) as num|null
if (useramount > 0)
end_fermi_reaction()
reagents.trans_id_to(beaker, id, useramount)
. = TRUE
if("toggleMode")
mode = !mode
@@ -332,7 +338,7 @@
var/vol_part = min(reagents.total_volume, 30)
if(text2num(many))
amount_full = round(reagents.total_volume / 30)
vol_part = reagents.total_volume % 30
vol_part = ((reagents.total_volume*1000) % 30000) / 1000 //% operator doesn't support decimals.
var/name = stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN)
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
return
@@ -379,7 +385,34 @@
reagents.trans_to(P, vol_part)
. = TRUE
//END CITADEL ADDITIONS
if("analyze")
if("analyzeBeak")
var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
state = "Solid"
else if(initial(R.reagent_state) == 2)
state = "Liquid"
else if(initial(R.reagent_state) == 3)
state = "Gas"
var/const/P = 3 //The number of seconds between life ticks
var/T = initial(R.metabolization_rate) * (60 / P)
var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
if(Rcr && Rcr.FermiChem)
fermianalyze = TRUE
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
var/datum/reagent/targetReagent = beaker.reagents.has_reagent("[R.id]")
if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = targetReagent.purity, "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
screen = "analyze"
return
if("analyzeBuff")
var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]]
if(R)
var/state = "Unknown"
@@ -395,7 +428,11 @@
fermianalyze = TRUE
var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = initial(R.purity), "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
var/datum/reagent/targetReagent = reagents.has_reagent("[R.id]")
if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = targetReagent.purity, "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
+52 -5
View File
@@ -33,18 +33,20 @@
var/addiction_stage4_end = 40
var/overdosed = 0 // You fucked up and this is now triggering its overdose effects, purge that shit quick.
var/self_consuming = FALSE
var/metabolizing = FALSE
var/invisible = FALSE //Set to true if it doesn't appear on handheld health analyzers.
//Fermichem vars:
var/purity = 1 //How pure a chemical is from 0 - 1.
var/addProc = FALSE //If the chemical should force an on_new() call
var/turf/loc = null //Should be the creation location!
var/turf/loc = null //Should be the creation location!
var/pH = 7 //pH of the specific reagent, used for calculating the sum pH of a holder.
var/SplitChem = FALSE //If the chem splits on metabolism
var/ImpureChem = "fermiTox"// What chemical is metabolised with an inpure reaction
var/InverseChemVal = 0.25 // If the impurity is below 0.5, replace ALL of the chem with InverseChem upon metabolising
var/InverseChem = "fermiTox"// What chem is metabolised when purity is below InverseChemVal, this shouldn't be made, but if it does, well, I guess I'll know about it.
var/DoNotSplit = FALSE // If impurity is handled within the main chem itself
var/OnMobMergeCheck = FALSE //Call on_mob_life proc when reagents are merging.
var/metabolizing = FALSE
var/invisible = FALSE //Set to true if it doesn't appear on handheld health analyzers.
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
. = ..()
@@ -74,7 +76,27 @@
return
// Called when this reagent is first added to a mob
/datum/reagent/proc/on_mob_add(mob/living/L)
/datum/reagent/proc/on_mob_add(mob/living/L, amount)
if(SplitChem)
var/mob/living/carbon/M = L
if(!M)
return
if(purity < 0)
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
if (purity == 1 || DoNotSplit == TRUE)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [id]")
return
else if (InverseChemVal > purity)//Turns all of a added reagent into the inverse chem
M.reagents.remove_reagent(id, amount, FALSE)
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [InverseChem]")
return
else
var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem
M.reagents.remove_reagent(id, (impureVol), FALSE)
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [id]")
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [ImpureChem]")
return
// Called when this reagent is removed while inside a mob
@@ -97,7 +119,32 @@
return
// Called when two reagents of the same are mixing.
/datum/reagent/proc/on_merge(data)
/datum/reagent/proc/on_merge(data, amount, mob/living/carbon/M, purity)
if(SplitChem)
if(!ishuman(M))
return
if (purity < 0)
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
if (purity == 1 || DoNotSplit == TRUE)
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [id] in themselves")
return
else if (InverseChemVal > purity)
M.reagents.remove_reagent(id, amount, FALSE)
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1)
for(var/datum/reagent/fermi/R in M.reagents.reagent_list)
if(R.name == "")
R.name = name//Negative effects are hidden
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [InverseChem]")
return
else
var/impureVol = amount * (1 - purity)
M.reagents.remove_reagent(id, impureVol, FALSE)
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1)
for(var/datum/reagent/fermi/R in M.reagents.reagent_list)
if(R.name == "")
R.name = name//Negative effects are hidden
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [id]")
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [ImpureChem]")
return
/datum/reagent/proc/on_update(atom/A)
@@ -1373,6 +1373,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/neurotoxin
name = "Neurotoxin"
id = "neurotoxin"
description = "A strong neurotoxin that puts the subject into a death-like state."
color = "#2E2E61" // rgb: 46, 46, 97
boozepwr = 50
@@ -1382,6 +1383,10 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_icon_state = "neurotoxinglass"
glass_name = "Neurotoxin"
glass_desc = "A drink that is guaranteed to knock you silly."
SplitChem = TRUE
ImpureChem = "neuroweak"
InverseChemVal = 0 //Clear conversion
InverseChem = "neuroweak"
/datum/reagent/consumable/ethanol/neurotoxin/proc/pickt()
return (pick(TRAIT_PARALYSIS_L_ARM,TRAIT_PARALYSIS_R_ARM,TRAIT_PARALYSIS_R_LEG,TRAIT_PARALYSIS_L_LEG))
@@ -1390,12 +1395,12 @@ All effects don't start immediately, but rather get worse over time; the rate is
M.set_drugginess(50)
M.dizziness +=2
M.adjustBrainLoss(1*REM, 150)
if(prob(20))
if(prob(20) && !holder.has_reagent("neuroweak"))
M.adjustStaminaLoss(10)
M.drop_all_held_items()
to_chat(M, "<span class='notice'>You cant feel your hands!</span>")
if(current_cycle > 5)
if(prob(20))
if(prob(20) && !holder.has_reagent("neuroweak"))
var/t = pickt()
ADD_TRAIT(M, t, type)
M.adjustStaminaLoss(10)
@@ -1417,6 +1422,25 @@ All effects don't start immediately, but rather get worse over time; the rate is
M.adjustStaminaLoss(10)
..()
/datum/reagent/consumable/ethanol/neuroweak
name = "Neuro-Smash"
id = "neuroweak"
description = "A mostly safe alcoholic drink for the true daredevils. Counteracts Neurotoxins."
boozepwr = 60
pH = 8
/datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M)
if(holder.has_reagent("neurotoxin"))
M.adjustBrainLoss(-1*REM, 150)
M.reagents.remove_reagent("neurotoxin", 1.5 * REAGENTS_METABOLISM, FALSE)
if(holder.has_reagent("fentanyl"))
M.adjustBrainLoss(-1*REM, 150)
M.reagents.remove_reagent("fentanyl", 0.75 * REAGENTS_METABOLISM, FALSE)
else
M.adjustBrainLoss(-0.5*REM, 150)
M.dizziness +=2
..()
/datum/reagent/consumable/ethanol/hippies_delight
name = "Hippie's Delight"
id = "hippiesdelight"
@@ -2122,6 +2146,29 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_name = "Planet Cracker"
glass_desc = "Although historians believe the drink was originally created to commemorate the end of an important conflict in man's past, its origins have largely been forgotten and it is today seen more as a general symbol of human supremacy."
/datum/reagent/consumable/ethanol/commander_and_chief
name = "Commander and Chief"
id = "commander_and_chief"
description = "A cocktail for the captain on the go."
color = "#ffffc9"
boozepwr = 50
quality = DRINK_FANTASTIC
taste_description = "Tastes like...duty and responsibility?"
glass_icon_state = "commander_and_chief"
glass_name = "Commander and Chief"
glass_desc = "The gems of this majestic chalice represent the departments and their Heads."
/datum/reagent/consumable/ethanol/commander_and_chief/on_mob_life(mob/living/carbon/M)
if(M.mind && HAS_TRAIT(M.mind, TRAIT_CAPTAIN_METABOLISM))
M.heal_bodypart_damage(2,2,2)
M.adjustBruteLoss(-3.5,0)
M.adjustOxyLoss(-3.5,0)
M.adjustFireLoss(-3.5,0)
M.adjustToxLoss(-3.5,0)
M.radiation = max(M.radiation - 25, 0)
. = 1
return ..()
/datum/reagent/consumable/ethanol/fruit_wine
name = "Fruit Wine"
id = "fruit_wine"
@@ -13,6 +13,7 @@
glass_icon_state = "glass_orange"
glass_name = "glass of orange juice"
glass_desc = "Vitamins! Yay!"
pH = 3.3
/datum/reagent/consumable/orangejuice/on_mob_life(mob/living/carbon/M)
if(M.getOxyLoss() && prob(30))
@@ -45,6 +46,7 @@
glass_icon_state = "glass_green"
glass_name = "glass of lime juice"
glass_desc = "A glass of sweet-sour lime juice."
pH = 2.2
/datum/reagent/consumable/limejuice/on_mob_life(mob/living/carbon/M)
if(M.getToxLoss() && prob(20))
@@ -125,6 +127,7 @@
glass_icon_state = "lemonglass"
glass_name = "glass of lemon juice"
glass_desc = "Sour..."
pH = 2
/datum/reagent/consumable/banana
name = "Banana Juice"
@@ -883,3 +886,23 @@
to_chat(M, "<span class = 'notice'>[pick("Diamond skies where white deer fly.","Sipping strawberry tea.","Silver raindrops drift through timeless, Neverending June.","Crystal ... pearls free, with love!","Beaming love into me.")]</span>")
..()
. = 1
/datum/reagent/consumable/catnip_tea
name = "Catnip Tea"
id = "catnip_tea"
description = "A sleepy and tasty catnip tea!"
color = "#101000" // rgb: 16, 16, 0
nutriment_factor = 0
taste_description = "sugar and catnip"
glass_icon_state = "teaglass"
glass_name = "glass of catnip tea"
glass_desc = "A purrfect drink for a cat."
/datum/reagent/consumable/catnip_tea/on_mob_life(mob/living/carbon/M)
M.adjustStaminaLoss(min(50 - M.getStaminaLoss(), 3))
if(prob(20))
M.emote("nya")
if(prob(20))
to_chat(M, "<span class = 'notice'>[pick("Headpats feel nice.", "Backrubs would be nice.", "Mew")]</span>")
M.adjustArousalLoss(5)
..()
@@ -1177,7 +1177,7 @@
M.adjustToxLoss(-3 * REM, 0, TRUE) //Heals TOXINLOVERS
M.adjustBrainLoss(2 * REM, 150) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that!
M.adjustCloneLoss(-1 * REM, 0)
M.adjustStaminaLoss(-30 * REM, 0)
M.adjustStaminaLoss(-13 * REM, 0)
M.jitteriness = min(max(0, M.jitteriness + 3), 30)
M.druggy = min(max(0, M.druggy + 10), 15) //See above
..()
@@ -536,12 +536,12 @@
race = /datum/species/fly
mutationtext = "<span class='danger'>The pain subsides. You feel... buzzy.</span>"
/datum/reagent/mutationtoxin/moth
name = "Moth Mutation Toxin"
/datum/reagent/mutationtoxin/insect
name = "Insect Mutation Toxin"
id = "mothmutationtoxin"
description = "A glowing toxin."
color = "#5EFF3B" //RGB: 94, 255, 59
race = /datum/species/moth
race = /datum/species/insect
mutationtext = "<span class='danger'>The pain subsides. You feel... attracted to light.</span>"
/datum/reagent/mutationtoxin/pod
@@ -1445,9 +1445,6 @@
color = "#FFFFFF" // white
random_color_list = list("#FFFFFF") //doesn't actually change appearance at all
//////////////////////////////////Hydroponics stuff///////////////////////////////
/datum/reagent/plantnutriment
@@ -1489,16 +1486,8 @@
tox_prob = 15
pH = 1
// GOON OTHERS
/datum/reagent/oil
name = "Oil"
id = "oil"
@@ -2039,4 +2028,17 @@
color = "#BCC740" //RGB: 188, 199, 64
taste_description = "plant dust"
/datum/reagent/pax/catnip
name = "catnip"
id = "catnip"
taste_description = "grass"
description = "A colorless liquid that makes people more peaceful and felines more happy."
metabolization_rate = 1.75 * REAGENTS_METABOLISM
/datum/reagent/pax/catnip/on_mob_life(mob/living/carbon/M)
if(prob(20))
M.emote("nya")
if(prob(20))
to_chat(M, "<span class = 'notice'>[pick("Headpats feel nice.", "The feeling of a hairball...", "Backrubs would be nice.", "Whats behind those doors?")]</span>")
M.adjustArousalLoss(2)
..()
@@ -629,7 +629,7 @@
required_temp = 450
/datum/chemical_reaction/moff
name = "moth mutation toxic"
name = "insect mutation toxic"
id = "moffs"
results = list("mothmutationtoxin" = 1)
required_reagents = list("liquid_dark_matter" = 2, "ammonia" = 5, "lithium" = 1, "stablemutationtoxin" = 1)
@@ -90,3 +90,9 @@
update_pack_name()
else
return ..()
/obj/item/reagent_containers/blood/bluespace
name = "bluespace blood pack"
desc = "Contains blood used for transfusion, this one has been made with bluespace technology to hold much more blood. Must be attached to an IV drip."
icon_state = "bsbloodpack"
volume = 600 //its a blood bath!
@@ -127,6 +127,21 @@
else
to_chat(usr, "<span class='notice'>It is spent.</span>")
/obj/item/reagent_containers/hypospray/medipen/stimulants
name = "illegal stimpack medipen"
desc = "A highly illegal medipen due to its load and small injections, allow for five uses before being drained"
volume = 50
amount_per_transfer_from_this = 10
list_reagents = list("stimulants" = 50)
/obj/item/reagent_containers/hypospray/medipen/stimulants/baseball
name = "the reason the syndicate major league team wins."
desc = "They say drugs never win, but look where you are now, then where they are."
icon_state = "baseballstim"
volume = 50
amount_per_transfer_from_this = 50
list_reagents = list("stimulants" = 50)
/obj/item/reagent_containers/hypospray/medipen/stimpack //goliath kiting
name = "stimpack medipen"
desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor."