Merge pull request #9309 from Thalpy/tg-Organ-port

[READY][SUCCESSFULLY TESTMERGED] Ports TG's organ handling (with a few tweaks to make it fit).
This commit is contained in:
kevinz000
2019-10-07 23:29:19 -07:00
committed by GitHub
115 changed files with 1572 additions and 367 deletions
+5 -1
View File
@@ -555,6 +555,10 @@
if (multiplier == 0)
fermiEnd()
return
for(var/P in C.required_catalysts)
if(!has_reagent(P))
fermiEnd()
return
for(var/P in cached_results)
targetVol = cached_results[P]*multiplier
@@ -681,7 +685,7 @@
STOP_PROCESSING(SSprocessing, src)
return 0
C.FermiCreate(src)//proc that calls when step is done
C.FermiCreate(src, addChemAmmount, purity)//proc that calls when step is done
//Apply pH changes and thermal output of reaction to beaker
chem_temp = round(cached_temp + (C.ThermicConstant * addChemAmmount))
@@ -1394,7 +1394,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/neurotoxin/on_mob_life(mob/living/carbon/M)
M.set_drugginess(50)
M.dizziness +=2
M.adjustBrainLoss(1*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 150)
if(prob(20) && !holder.has_reagent("neuroweak"))
M.adjustStaminaLoss(10)
M.drop_all_held_items()
@@ -1405,7 +1405,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
ADD_TRAIT(M, t, type)
M.adjustStaminaLoss(10)
if(current_cycle > 30)
M.adjustBrainLoss(2*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
if(current_cycle > 50 && prob(15))
if(!M.undergoing_cardiac_arrest() && M.can_heartattack())
M.set_heartattack(TRUE)
@@ -1431,13 +1431,13 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M)
if(holder.has_reagent("neurotoxin"))
M.adjustBrainLoss(-1*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150)
M.reagents.remove_reagent("neurotoxin", 1.5 * REAGENTS_METABOLISM, FALSE)
if(holder.has_reagent("fentanyl"))
M.adjustBrainLoss(-1*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150)
M.reagents.remove_reagent("fentanyl", 0.75 * REAGENTS_METABOLISM, FALSE)
else
M.adjustBrainLoss(-0.5*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -0.5*REM, 150)
M.dizziness +=2
..()
@@ -80,14 +80,14 @@
. = 1
/datum/reagent/drug/crank/overdose_process(mob/living/M)
M.adjustBrainLoss(2*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
M.adjustToxLoss(2*REM, 0)
M.adjustBruteLoss(2*REM, 0)
..()
. = 1
/datum/reagent/drug/crank/addiction_act_stage1(mob/living/M)
M.adjustBrainLoss(5*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5*REM)
..()
/datum/reagent/drug/crank/addiction_act_stage2(mob/living/M)
@@ -101,7 +101,7 @@
. = 1
/datum/reagent/drug/crank/addiction_act_stage4(mob/living/M)
M.adjustBrainLoss(3*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM)
M.adjustToxLoss(5*REM, 0)
M.adjustBruteLoss(5*REM, 0)
..()
@@ -125,13 +125,13 @@
..()
/datum/reagent/drug/krokodil/overdose_process(mob/living/M)
M.adjustBrainLoss(0.25*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.25*REM)
M.adjustToxLoss(0.25*REM, 0)
..()
. = 1
/datum/reagent/drug/krokodil/addiction_act_stage1(mob/living/M)
M.adjustBrainLoss(2*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
M.adjustToxLoss(2*REM, 0)
..()
. = 1
@@ -192,7 +192,7 @@
if(jitter)
M.Jitter(2)
if(brain_damage)
M.adjustBrainLoss(rand(1,4))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1,4))
M.heal_overall_damage(2, 2)
if(prob(5))
M.emote(pick("twitch", "shiver"))
@@ -210,7 +210,7 @@
M.drop_all_held_items()
..()
M.adjustToxLoss(1, 0)
M.adjustBrainLoss(pick(0.5, 0.6, 0.7, 0.8, 0.9, 1))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, pick(0.5, 0.6, 0.7, 0.8, 0.9, 1))
. = 1
/datum/reagent/drug/methamphetamine/addiction_act_stage1(mob/living/M)
@@ -289,7 +289,7 @@
if(prob(5))
to_chat(M, "<span class='notice'>[high_message]</span>")
M.adjustStaminaLoss(-5, 0)
M.adjustBrainLoss(4)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4)
M.hallucination += 5
if(M.canmove && !ismovableatom(M.loc))
step(M, pick(GLOB.cardinals))
@@ -314,7 +314,7 @@
for(var/i = 0, i < 8, i++)
step(M, pick(GLOB.cardinals))
M.Jitter(5)
M.adjustBrainLoss(10)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
if(prob(20))
M.emote(pick("twitch","drool","moan"))
..()
@@ -326,7 +326,7 @@
step(M, pick(GLOB.cardinals))
M.Jitter(10)
M.Dizzy(10)
M.adjustBrainLoss(10)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
if(prob(30))
M.emote(pick("twitch","drool","moan"))
..()
@@ -338,7 +338,7 @@
step(M, pick(GLOB.cardinals))
M.Jitter(15)
M.Dizzy(15)
M.adjustBrainLoss(10)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
if(prob(40))
M.emote(pick("twitch","drool","moan"))
..()
@@ -351,7 +351,7 @@
M.Jitter(50)
M.Dizzy(50)
M.adjustToxLoss(5, 0)
M.adjustBrainLoss(10)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
if(prob(50))
M.emote(pick("twitch","drool","moan"))
..()
@@ -401,7 +401,7 @@
M.jitteriness = 0
M.confused = 0
M.disgust = 0
M.adjustBrainLoss(0.2)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2)
..()
. = 1
@@ -418,7 +418,7 @@
if(3)
M.emote("frown")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_bad_od)
M.adjustBrainLoss(0.5)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5)
..()
. = 1
@@ -490,7 +490,7 @@
H.dna.species.punchdamagehigh *= 0.2
/datum/reagent/drug/skooma/on_mob_life(mob/living/carbon/M)
M.adjustBrainLoss(1*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM)
M.adjustToxLoss(1*REM)
if(prob(10))
M.adjust_blurriness(2)
@@ -522,7 +522,7 @@
M.Dizzy(50)
M.adjust_blurriness(10)
if(prob(50)) //This proc will be called about 200 times and the adjustbrainloss() below only has to be called 40 times to kill. This will make surviving skooma addiction pretty rare without mannitol usage.
M.adjustBrainLoss(5)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
if(prob(40))
M.emote(pick("twitch","drool","moan"))
..()
@@ -691,7 +691,7 @@
. = 1
if(prob(20))
M.losebreath += 4
M.adjustBrainLoss(2*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM, 150)
M.adjustToxLoss(3*REM,0)
M.adjustStaminaLoss(10*REM,0)
M.blur_eyes(5)
@@ -44,7 +44,7 @@
M.heal_bodypart_damage(5,5)
M.adjustToxLoss(-5, 0, TRUE)
M.hallucination = 0
M.setBrainLoss(0)
M.setOrganLoss(ORGAN_SLOT_BRAIN, 0)
REMOVE_TRAITS_NOT_IN(M, list(SPECIES_TRAIT, ROUNDSTART_TRAIT, ORGAN_TRAIT))
M.set_blurriness(0)
M.set_blindness(0)
@@ -64,6 +64,10 @@
if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio))
M.blood_volume = (BLOOD_VOLUME_NORMAL*M.blood_ratio)
for(var/organ in M.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
for(var/thing in M.diseases)
var/datum/disease/D = thing
if(D.severity == DISEASE_SEVERITY_POSITIVE)
@@ -852,10 +856,16 @@
if(M.notify_ghost_cloning(source = M))
spawn (100) //so the ghost has time to re-enter
return
else
M.adjustOxyLoss(-20, 0)
M.adjustToxLoss(-20, 0)
var/mob/living/carbon/H = M
for(var/organ in H.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
M.updatehealth()
if(M.revive())
M.emote("gasp")
log_combat(M, M, "revived", src)
@@ -875,7 +885,7 @@
pH = 10.4
/datum/reagent/medicine/mannitol/on_mob_life(mob/living/carbon/C)
C.adjustBrainLoss(-2*REM)
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2*REM)
if(prob(10))
C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC)
..()
@@ -1130,7 +1140,7 @@
M.adjustFireLoss(-5*REM, 0)
M.adjustOxyLoss(-15, 0)
M.adjustToxLoss(-5*REM, 0)
M.adjustBrainLoss(-15*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -15*REM)
M.adjustCloneLoss(-3*REM, 0)
M.adjustStaminaLoss(-20*REM,0)
..()
@@ -1175,7 +1185,7 @@
M.adjustFireLoss(-3 * REM, 0)
M.adjustOxyLoss(-15 * REM, 0)
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.adjustOrganLoss(ORGAN_SLOT_BRAIN, 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(-13 * REM, 0)
M.jitteriness = min(max(0, M.jitteriness + 3), 30)
@@ -1207,7 +1217,7 @@
if (M.hallucination >= 5)
M.hallucination -= 5
if(prob(20))
M.adjustBrainLoss(1*REM, 50)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 50)
M.adjustStaminaLoss(2.5*REM, 0)
..()
return TRUE
@@ -296,7 +296,7 @@
if(ishuman(M) && M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio))
M.blood_volume += 3
else // Will deal about 90 damage when 50 units are thrown
M.adjustBrainLoss(3, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150)
M.adjustToxLoss(2, 0)
M.adjustFireLoss(2, 0)
M.adjustOxyLoss(2, 0)
@@ -315,7 +315,7 @@
M.IgniteMob() //Only problem with igniting people is currently the commonly availible fire suits make you immune to being on fire
M.adjustToxLoss(1, 0)
M.adjustFireLoss(1, 0) //Hence the other damages... ain't I a bastard?
M.adjustBrainLoss(5, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 150)
holder.remove_reagent(id, 1)
pH = 0.1
@@ -805,7 +805,7 @@
step(M, pick(GLOB.cardinals))
if(prob(5))
M.emote(pick("twitch","drool","moan"))
M.adjustBrainLoss(1)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1)
..()
/datum/reagent/sulfur
@@ -1172,7 +1172,7 @@
/datum/reagent/impedrezene/on_mob_life(mob/living/carbon/M)
M.jitteriness = max(M.jitteriness-5,0)
if(prob(80))
M.adjustBrainLoss(2*REM)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
if(prob(50))
M.drowsyness = max(M.drowsyness, 3)
if(prob(10))
@@ -471,7 +471,7 @@
toxpwr = 0
/datum/reagent/toxin/fentanyl/on_mob_life(mob/living/carbon/M)
M.adjustBrainLoss(3*REM, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM, 150)
if(M.toxloss <= 60)
M.adjustToxLoss(1*REM, 0)
if(current_cycle >= 18)
@@ -950,3 +950,20 @@
to_chat(M, "<span class='warning'>Your missing arm aches from wherever you left it.</span>")
M.emote("sigh")
return ..()
/datum/reagent/toxin/brainhurtingjuice //oof ouch
name = "Brain Hurting Juice"
id = "brainhurtingjuice"
color = "#AAAAAA77" //RGBA: 170, 170, 170, 77
toxpwr = 0
taste_description = "brain hurting"
metabolization_rate = 5
/datum/reagent/toxin/brainhurtingjuice/on_mob_life(mob/living/carbon/M)
if(prob(50))
M.gain_trauma_type(BRAIN_TRAUMA_MILD)
else if(prob(50))
M.gain_trauma_type(BRAIN_TRAUMA_SEVERE)
else
M.gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
..()
@@ -68,6 +68,42 @@
results = list("synthflesh" = 3)
required_reagents = list("blood" = 1, "carbon" = 1, "styptic_powder" = 1)
/datum/chemical_reaction/synthtissue
name = "Synthtissue"
id = "synthtissue"
results = list("synthtissue" = 0.05)
required_reagents = list("synthflesh" = 0.01)
required_catalysts = list("nutriment" = 0.1)
//FermiChem vars:
OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions
OptimalTempMax = 315 // Upper end for above
ExplodeTemp = 1050 // Temperature at which reaction explodes
OptimalpHMin = 8.5 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
OptimalpHMax = 9.5 // Higest value for above
ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase)
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
CurveSharpT = 1 // How sharp the temperature exponential curve is (to the power of value)
CurveSharppH = 2.5 // How sharp the pH exponential curve is (to the power of value)
ThermicConstant = 0.01 // Temperature change per 1u produced
HIonRelease = 0.015 // pH change per 1u reaction (inverse for some reason)
RateUpLim = 0.05 // Optimal/max rate possible if all conditions are perfect
FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics
PurityMin = 0
/datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity)
var/datum/reagent/synthtissue/St = holder.has_reagent("synthtissue")
var/datum/reagent/N = holder.has_reagent("nutriment")
if(!St)
return
if(holder.chem_temp > 320)
var/temp_ratio = 1-(330 - holder.chem_temp)/10
holder.remove_reagent(src.id, added_volume*temp_ratio)
if(St.purity < 1)
St.volume *= St.purity
St.purity = 1
N.volume -= 0.002
St.data["grown_volume"] = St.data["grown_volume"] + added_volume
/datum/chemical_reaction/styptic_powder
name = "Styptic Powder"
id = "styptic_powder"