From ee082f200e39f41eaff4573efeec023e2d5b5db2 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 19 Sep 2019 10:21:59 -0700
Subject: [PATCH] Fermi1
---
.../food_and_drinks/recipes/drinks_recipes.dm | 4 +-
.../mob/living/simple_animal/friendly/cat.dm | 1 +
code/modules/reagents/chemistry/reagents.dm | 2 +-
.../chemistry/reagents/alcohol_reagents.dm | 10 +--
.../chemistry/reagents/drink_reagents.dm | 3 +
.../chemistry/reagents/fermi_reagents.dm | 75 +++++++++++++------
.../reagents/chemistry/recipes/fermi.dm | 58 +++++++++-----
7 files changed, 101 insertions(+), 52 deletions(-)
diff --git a/code/modules/food_and_drinks/recipes/drinks_recipes.dm b/code/modules/food_and_drinks/recipes/drinks_recipes.dm
index 8fbdf02d..89bffa0c 100644
--- a/code/modules/food_and_drinks/recipes/drinks_recipes.dm
+++ b/code/modules/food_and_drinks/recipes/drinks_recipes.dm
@@ -398,8 +398,8 @@
OptimalTempMin = 200 // Lower area of bell curve for determining heat based rate reactions
OptimalTempMax = 950 // Upper end for above
ExplodeTemp = 999 //Temperature at which reaction explodes
- OptimalpHMin = 2 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
- OptimalpHMax = 3 // Higest value for above
+ OptimalpHMin = 4.6 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
+ OptimalpHMax = 5.2 // Higest value for above
ReactpHLim = 5 // How far out pH wil react, giving impurity place (Exponential phase)
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
CurveSharpT = 2 // How sharp the temperature exponential curve is (to the power of value)
diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm
index a6197a3f..44fedb47 100644
--- a/code/modules/mob/living/simple_animal/friendly/cat.dm
+++ b/code/modules/mob/living/simple_animal/friendly/cat.dm
@@ -307,6 +307,7 @@
emote_see = list("looks at you eagerly for pets!", "wiggles enthusiastically.")
gold_core_spawnable = NO_SPAWN
var/pseudo_death = FALSE
+ var/mob/living/carbon/human/origin = null
/mob/living/simple_animal/pet/cat/custom_cat/death()
if (pseudo_death == TRUE) //secret cat chem
diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm
index 794b191a..5eb2c135 100644
--- a/code/modules/reagents/chemistry/reagents.dm
+++ b/code/modules/reagents/chemistry/reagents.dm
@@ -221,4 +221,4 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
for (var/datum/reagent/R in reagent_list)
rs += "[R.name], [R.volume]"
- return rs.Join(" | ")
\ No newline at end of file
+ return rs.Join(" | ")
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index d0a986f1..0cc469dd 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -1374,7 +1374,6 @@ 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."
- pH = 4.3
//SplitChem = TRUE
impure_chem = /datum/reagent/consumable/ethanol/neuroweak
inverse_chem_val = 0.5 //Clear conversion
@@ -1419,11 +1418,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
name = "Neuro-Smash"
description = "A mostly safe alcoholic drink for the true daredevils. Counteracts Neurotoxins."
boozepwr = 60
- quality = DRINK_VERYGOOD
- taste_description = "a numbing sensation"
- glass_icon_state = "neurosmashglass"
- glass_name = "Neurosmash"
- glass_desc = "A mostly safe alcoholic drink for the true daredevils. Do not mix with Neurotoxin."
pH = 8
value = 3
@@ -1435,7 +1429,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150)
M.reagents.remove_reagent(/datum/reagent/toxin/fentanyl, 0.75 * REAGENTS_METABOLISM, FALSE)
else
- M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1.0*REM, 150)
+ M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -0.5*REM, 150)
M.dizziness +=2
..()
@@ -2186,7 +2180,7 @@ datum/reagent/consumable/ethanol/creme_de_coconut
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)
diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
index 52100df7..71cc5f27 100644
--- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
@@ -12,6 +12,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))
@@ -42,6 +43,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))
@@ -117,6 +119,7 @@
glass_icon_state = "lemonglass"
glass_name = "glass of lemon juice"
glass_desc = "Sour..."
+ pH = 2
/datum/reagent/consumable/strawberryjuice
name = "Strawberry Juice"
diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
index ee7d7c16..fbefe31b 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
@@ -10,17 +10,16 @@
inverse_chem_val = 0.25 // If the impurity is below 0.5, replace ALL of the chem with inverse_chemupon metabolising
inverse_chem = /datum/reagent/impure/fermiTox
+
//This should process fermichems to find out how pure they are and what effect to do.
/datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount)
. = ..()
-
//When merging two fermichems, see above
/datum/reagent/fermi/on_merge(data, amount, mob/living/carbon/M, purity)//basically on_mob_add but for merging
. = ..()
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// HATIMUIM
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -46,10 +45,7 @@
. = ..()
if(M.head)
var/obj/item/W = M.head
- if(istype(W, /obj/item/clothing/head/hattip))
- qdel(W)
- else
- M.dropItemToGround(W, TRUE)
+ M.dropItemToGround(W, TRUE)
var/hat = new /obj/item/clothing/head/hattip()
M.equip_to_slot(hat, SLOT_HEAD, 1, 1)
@@ -59,15 +55,20 @@
return ..()
var/hatArmor = 0
if(!overdosed)
- hatArmor = (purity/10)
+ hatArmor = (cached_purity/10)
else
- hatArmor = - (purity/10)
+ hatArmor = (cached_purity/10)
if(hatArmor > 90)
return ..()
var/obj/item/W = M.head
W.armor = W.armor.modifyAllRatings(hatArmor)
..()
+/datum/reagent/fermi/hatmium/reaction_turf(turf/T, reac_volume)
+ if(reac_volume >= 5)
+ new /obj/item/clothing/head/hattip(T)
+ ..()
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// FURRANIUM
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -149,7 +150,7 @@
..()
/datum/reagent/fermi/furranium/on_mob_delete(mob/living/carbon/M)
- if(purity < 1)//Only permanent if you're a good chemist.
+ if(cached_purity < 0.95)//Only permanent if you're a good chemist.
nT = M.getorganslot(ORGAN_SLOT_TONGUE)
nT.Remove(M)
qdel(nT)
@@ -176,13 +177,13 @@
pH = 9
value = 90
can_synth = FALSE
+ var/react_objs = list()
/datum/reagent/fermi/nanite_b_gone/on_mob_life(mob/living/carbon/C)
- //var/component/nanites/N = M.GetComponent(/datum/component/nanites)
var/datum/component/nanites/N = C.GetComponent(/datum/component/nanites)
if(isnull(N))
return ..()
- N.nanite_volume = -purity//0.5 seems to be the default to me, so it'll neuter them.
+ N.nanite_volume += -cached_purity*5//0.5 seems to be the default to me, so it'll neuter them.
..()
/datum/reagent/fermi/nanite_b_gone/overdose_process(mob/living/carbon/C)
@@ -192,16 +193,19 @@
to_chat(C, "The residual voltage from the nanites causes you to seize up!")
C.electrocute_act(10, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE)
if(prob(10))
- //empulse((get_turf(C)), 3, 2)//So the nanites randomize
var/atom/T = C
T.emp_act(EMP_HEAVY)
to_chat(C, "You feel a strange tingling sensation come from your core.")
if(isnull(N))
return ..()
- N.nanite_volume = -2
+ N.nanite_volume += -10*cached_purity
..()
-/datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
+datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
+ for(var/active_obj in react_objs)
+ if(O == active_obj)
+ return
+ react_objs += O
O.emp_act(EMP_HEAVY)
/datum/reagent/fermi/nanite_b_goneTox
@@ -281,15 +285,15 @@
else
holder.del_reagent(type)//Avoiding recurrsion
var/location = get_turf(holder.my_atom)
- if(purity < 0.34 || purity == 1)
+ if(cached_purity < 0.34 || cached_purity == 1)
var/datum/effect_system/foam_spread/s = new()
s.set_up(volume*2, location, holder)
s.start()
- if((purity < 0.67 && purity >= 0.34)|| purity == 1)
+ if((cached_purity < 0.67 && cached_purity >= 0.34)|| cached_purity == 1)
var/datum/effect_system/smoke_spread/chem/s = new()
s.set_up(holder, volume*2, location)
s.start()
- if(purity >= 0.67)
+ if(cached_purity >= 0.67)
for (var/datum/reagent/reagent in holder.reagent_list)
if (istype(reagent, /datum/reagent/fermi))
var/datum/chemical_reaction/fermi/Ferm = GLOB.chemical_reagents_list[reagent.type]
@@ -353,6 +357,7 @@
taste_description = "hairballs and cream"
color = "#ffc224"
var/catshift = FALSE
+ var/perma = FALSE
var/mob/living/simple_animal/pet/cat/custom_cat/catto = null
can_synth = FALSE
@@ -361,7 +366,7 @@
/datum/reagent/fermi/secretcatchem/on_mob_add(mob/living/carbon/human/H)
. = ..()
- if(purity >= 0.8)//ONLY if purity is high, and given the stuff is random. It's very unlikely to get this to 1. It already requires felind too, so no new functionality there.
+ if(cached_purity >= 0.9)//ONLY if purity is high, and given the stuff is random. It's very unlikely to get this to 1.
//exception(al) handler:
H.dna.features["ears"] = "Cat"
H.dna.features["mam_ears"] = "Cat"
@@ -378,20 +383,30 @@
H.forceMove(catto)
log_game("FERMICHEM: [H] ckey: [H.key] has been made into a cute catto.")
SSblackbox.record_feedback("tally", "fermi_chem", 1, "cats")
- //Just to deal with rascally ghosts
- //ADD_TRAIT(catto, TRAIT_NODEATH, "catto")//doesn't work
- //catto.health = 1000 //To simulate fake death, while preventing ghosts escaping.
+ if(H.InCritical())
+ perma = TRUE
+ volume = 5
+ H.stat = DEAD
+ catto.origin = H
/datum/reagent/fermi/secretcatchem/on_mob_life(mob/living/carbon/H)
+ if(!catto)
+ metabolization_rate = 5
+ return ..()
if(catto.health <= 0) //So the dead can't ghost
if(prob(10))
- to_chat(H, "You feel your body start to slowly shift back from it's dead form.")
+ to_chat(catto, "You feel your body start to slowly shift back from it's dead form.")
+ perma = FALSE
+ metabolization_rate = 1
else if(prob(5))
playsound(get_turf(catto), 'modular_citadel/sound/voice/merowr.ogg', 50, 1, -1)
catto.say("lets out a meowrowr!*")
..()
/datum/reagent/fermi/secretcatchem/on_mob_delete(mob/living/carbon/H)
+ if(perma)
+ to_chat(H, "You feel your body settle into it's new form. You won't be able to shift back on death anymore.")
+ return
var/words = "Your body shifts back to normal."
H.forceMove(catto.loc)
catto.mind.transfer_to(H)
@@ -403,6 +418,22 @@
log_game("FERMICHEM: [H] ckey: [H.key] has returned to normal")
+/datum/reagent/fermi/secretcatchem/reaction_mob(var/mob/living/L)
+ if(istype(L, /mob/living/simple_animal/pet/cat/custom_cat) && cached_purity >= 0.85)
+ var/mob/living/simple_animal/pet/cat/custom_cat/catto = L
+ if(catto.origin)
+ var/mob/living/carbon/human/H = catto.origin
+ H.stat = CONSCIOUS
+ log_game("FERMICHEM: [catto] ckey: [catto.key] has returned to normal.")
+ to_chat(catto, "Your body shifts back to normal!")
+ H.forceMove(catto.loc)
+ catto.mind.transfer_to(H)
+ if(!L.mind) //Just in case
+ qdel(L)
+ else //This should never happen, but just in case, so their game isn't ruined.
+ catto.icon_state = "custom_cat"
+ catto.health = 50
+
//Tablesmitium
/datum/reagent/fermi/tablesmitium
diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
index 265ef5e0..4a1b1cfc 100644
--- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
@@ -25,9 +25,10 @@
my_atom.reagents.add_reagent(R.impure_chem, impureVol, FALSE, other_purity = 1)
R.cached_purity = R.purity
R.purity = 1
+ return
//Called when temperature is above a certain threshold, or if purity is too low.
-/datum/chemical_reaction/proc/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH, Exploding = FALSE)
+/datum/chemical_reaction/proc/FermiExplode(datum/reagents/R0, var/atom/my_atom, volume, temp, pH, Exploding = FALSE)
if (Exploding == TRUE)
return
@@ -41,26 +42,32 @@
if (500 to 750)
for(var/turf/turf in range(1,T))
new /obj/effect/hotspot(turf)
+ volume*=1.1
if (751 to 1100)
for(var/turf/turf in range(2,T))
new /obj/effect/hotspot(turf)
+ volume*=1.2
if (1101 to 1500) //If you're crafty
for(var/turf/turf in range(3,T))
new /obj/effect/hotspot(turf)
+ volume*=1.3
if (1501 to 2500) //requested
for(var/turf/turf in range(4,T))
new /obj/effect/hotspot(turf)
+ volume*=1.4
if (2501 to 5000)
for(var/turf/turf in range(5,T))
new /obj/effect/hotspot(turf)
+ volume*=1.5
if (5001 to INFINITY)
for(var/turf/turf in range(6,T))
new /obj/effect/hotspot(turf)
+ volume*=1.6
message_admins("Fermi explosion at [T], with a temperature of [temp], pH of [pH], Impurity tot of [ImpureTot].")
@@ -69,11 +76,12 @@
var/datum/effect_system/smoke_spread/chem/s = new()
R.my_atom = my_atom //Give the gas a fingerprint
- for (var/datum/reagent/reagent in my_atom.reagents.reagent_list) //make gas for reagents, has to be done this way, otherwise it never stops Exploding
- R.add_reagent(reagent.type, reagent.volume/3) //Seems fine? I think I fixed the infinite explosion bug.
+ for (var/A in R0.reagent_list) //make gas for reagents, has to be done this way, otherwise it never stops Exploding
+ var/datum/reagent/R2 = A
+ R.add_reagent(R2.type, R2.volume/3) //Seems fine? I think I fixed the infinite explosion bug.
- if (reagent.purity < 0.6)
- ImpureTot = (ImpureTot + (1-reagent.purity)) / 2
+ if (R2.purity < 0.6)
+ ImpureTot = (ImpureTot + (1-R2.purity)) / 2
if(pH < 4) //if acidic, make acid spray
R.add_reagent(/datum/reagent/impure/fermiTox, (volume/3))
@@ -83,7 +91,7 @@
if (pH > 10) //if alkaline, small explosion.
var/datum/effect_system/reagents_explosion/e = new()
- e.set_up(round((volume/30)*(pH-9)), T, 0, 0)
+ e.set_up(round((volume/28)*(pH-9)), T, 0, 0)
e.start()
if(!ImpureTot == 0) //If impure, v.small emp (0.6 or less)
@@ -98,7 +106,7 @@
name = "Eigenstasium"
id = /datum/reagent/fermi/eigenstate
results = list(/datum/reagent/fermi/eigenstate = 1)
- required_reagents = list(/datum/reagent/bluespace = 1, /datum/reagent/stable_plasma = 1, /datum/reagent/consumable/caramel = 1)
+ required_reagents = list(/datum/reagent/bluespace = 1, /datum/reagent/stable_plasma = 1, /datum/reagent/consumable/sugar = 1)
mix_message = "the reaction zaps suddenly!"
//FermiChem vars:
OptimalTempMin = 350 // Lower area of bell curve for determining heat based rate reactions
@@ -118,10 +126,10 @@
PurityMin = 0.4 //The minimum purity something has to be above, otherwise it explodes.
/datum/chemical_reaction/fermi/eigenstate/FermiFinish(datum/reagents/holder, var/atom/my_atom)//Strange how this doesn't work but the other does.
- if(!locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list)
+ var/datum/reagent/fermi/eigenstate/E = locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list
+ if(!E)
return
var/turf/open/location = get_turf(my_atom)
- var/datum/reagent/fermi/eigenstate/E = locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list
if(location)
E.location_created = location
E.data["location_created"] = location
@@ -154,12 +162,16 @@
/datum/chemical_reaction/fermi/SDGF/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)//Spawns an angery teratoma!
var/turf/T = get_turf(my_atom)
- var/mob/living/simple_animal/slime/S = new(T,"green")
- S.damage_coeff = list(BRUTE = 0.9 , BURN = 2, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1)
- S.name = "Living teratoma"
- S.real_name = "Living teratoma"
- S.rabid = 1//Make them an angery boi
- S.color = "#810010"
+ var/amount_to_spawn = round((volume/100), 1)
+ if(amount_to_spawn <= 0)
+ amount_to_spawn = 1
+ for(var/i in 1 to amount_to_spawn)
+ var/mob/living/simple_animal/slime/S = new(T,"green")
+ S.damage_coeff = list(BRUTE = 0.9 , BURN = 2, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1)
+ S.name = "Living teratoma"
+ S.real_name = "Living teratoma"
+ S.rabid = 1//Make them an angery boi
+ S.color = "#810010"
my_atom.reagents.clear_reagents()
var/list/seen = viewers(8, get_turf(my_atom))
for(var/mob/M in seen)
@@ -369,11 +381,15 @@
PurityMin = 0.5
/datum/chemical_reaction/fermi/hatmium/FermiExplode(src, var/atom/my_atom, volume, temp, pH)
- var/obj/item/clothing/head/hattip/hat = new /obj/item/clothing/head/hattip(get_turf(my_atom))
- hat.animate_atom_living()
+ var/amount_to_spawn = round((volume/100), 1)
+ if(amount_to_spawn <= 0)
+ amount_to_spawn = 1
+ for(var/i in 1 to amount_to_spawn)
+ var/obj/item/clothing/head/hattip/hat = new /obj/item/clothing/head/hattip(get_turf(my_atom))
+ hat.animate_atom_living()
var/list/seen = viewers(8, get_turf(my_atom))
for(var/mob/M in seen)
- to_chat(M, "The makes an off sounding pop, as a hat suddenly climbs out of the beaker!")
+ to_chat(M, "The [my_atom] makes an off sounding pop, as a hat suddenly climbs out of it!")
my_atom.reagents.clear_reagents()
/datum/chemical_reaction/fermi/furranium
@@ -398,6 +414,10 @@
FermiChem = TRUE
PurityMin = 0.3
+/datum/chemical_reaction/fermi/furranium/organic
+ id = "furranium_organic"
+ required_reagents = list(/datum/reagent/drug/aphrodisiac = 1, /datum/reagent/pax = 1, /datum/reagent/silver = 2, /datum/reagent/medicine/salglu_solution = 1)
+
//FOR INSTANT REACTIONS - DO NOT MULTIPLY LIMIT BY 10.
//There's a weird rounding error or something ugh.
@@ -487,7 +507,7 @@
name = "secretcatchem"
id = /datum/reagent/fermi/secretcatchem
results = list(/datum/reagent/fermi/secretcatchem = 5)
- required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/consumable/caramel = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/medicine/clonexadone = 1)//Yes this will make a kitty if you don't lucky guess. It'll eat all your reagents too.
+ required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/medicine/clonexadone = 1)//Yes this will make a kitty if you don't lucky guess. It'll eat all your reagents too.
required_catalysts = list(/datum/reagent/fermi/SDGF = 1)
required_temp = 500
mix_message = "the reaction gives off a meow!"