From d6d6dc77f1a26b4718307771ae9937192541822a Mon Sep 17 00:00:00 2001 From: Fermi Date: Tue, 23 Apr 2019 07:32:56 +0100 Subject: [PATCH] Fixes and tweaks to try to get things to work. --- code/modules/reagents/chemistry/holder.dm | 5 ++- .../chemistry/reagents/fermi_reagents.dm | 42 +++++++++---------- .../reagents/chemistry/recipes/fermi.dm | 2 +- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 4d9b541579..0b76dcef5d 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -665,8 +665,6 @@ message_admins("purity: [purity], purity of beaker") message_admins("Temp before change: [chem_temp], pH after change: [pH]") //Apply pH changes and thermal output of reaction to beaker - chem_temp += (C.ThermicConstant * stepChemAmmount) - pH += (C.HIonRelease * stepChemAmmount) message_admins("Temp after change: [chem_temp], pH after change: [pH]") // End. @@ -687,6 +685,9 @@ SSblackbox.record_feedback("tally", "chemical_reaction", cached_results[P]*stepChemAmmount, P)//log add_reagent(P, cached_results[P]*stepChemAmmount, null, chem_temp)//add reagent function!! I THINK I can do this: + chem_temp += (C.ThermicConstant * stepChemAmmount) + pH += (C.HIonRelease * stepChemAmmount) + reactedVol = reactedVol + stepChemAmmount 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 151d84bafb..243ff10dad 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -37,8 +37,8 @@ addiction_stage2_end = 30 addiction_stage3_end = 40 addiction_stage4_end = 45 //Incase it's too long - //var/turf/open/location_created = null - var/turf/location_return = null + var/turf/open/location_created = null + var/turf/open/location_return = null var/addictCyc1 = 1 var/addictCyc2 = 1 var/addictCyc3 = 1 @@ -46,36 +46,29 @@ var/mob/living/fermi_Tclone = null var/teleBool = FALSE -/mob/living/carbon - var/turf/location_spawn = null - -/mob/living/carbon/Initialize() - . = ..() - location_spawn = get_turf(src) ///obj/item/reagent/fermi/eigenstate/Initialize() -/*/datum/reagent/fermi/eigenstate/on_new() +/datum/reagent/fermi/eigenstate/on_new() . = ..() //Needed! - //location_created = get_turf(src) //Sets up coordinate of where it was created - //message_admins("Attempting to get creation location from on_new() [location_created]") + location_created = get_turf(src) //Sets up coordinate of where it was created + message_admins("Attempting to get creation location from on_new() [location_created]") //..()s /datum/reagent/fermi/eigenstate/New() . = ..() //Needed! //if(holder && holder.my_atom) - //location_created = get_turf(holder.my_atom) //Sets up coordinate of where it was created - //message_admins("Attempting to get creation location from New() [location_created]") + location_created = get_turf(holder.my_atom) //Sets up coordinate of where it was created + message_admins("Attempting to get creation location from New() [location_created]") //..() -*/ + /datum/reagent/fermi/eigenstate/on_mob_life(mob/living/carbon/M) //Teleports to chemistry! switch(current_cycle) if(1) - location_return = get_turf(M) //sets up return point + location_return = get_turf(M.loc) //sets up return point to_chat(M, "You feel your wavefunction split!") do_sparks(5,FALSE,M) - //M.forceMove(location_created) //Teleports to creation location - M.forceMove(M.location_spawn) + M.forceMove(location_created) //Teleports to creation location do_sparks(5,FALSE,M) if(prob(20)) do_sparks(5,FALSE,M) @@ -84,7 +77,7 @@ /datum/reagent/fermi/eigenstate/on_mob_delete(mob/living/M) //returns back to original location do_sparks(5,FALSE,src) to_chat(M, "You feel your wavefunction collapse!") - M.forceMove(location_return) //Teleports home + M.forceMove(location_return.loc) //Teleports home do_sparks(5,FALSE,src) ..() @@ -118,7 +111,7 @@ M.Knockdown(100) M.Stun(40) var/items = M.get_contents() - var/obj/item/I = pick(items) + var/obj/item/I = pick(items) M.dropItemToGround(I, TRUE) do_sparks(5,FALSE,I) do_teleport(I, get_turf(I), 5, no_effects=TRUE); @@ -192,10 +185,10 @@ /datum/reagent/fermi/SGDF/on_mob_life(mob/living/carbon/M) //Clones user, then puts a ghost in them! If that fails, makes a braindead clone. //Setup clone - + message_admins("SGDF ingested") var/list/candidates = pollCandidatesForMob("Do you want to play as a clone of [M.name] and do you agree to respect their character and act in a similar manner to them? ", ROLE_SENTIENCE, null, ROLE_SENTIENCE, 50, M, POLL_IGNORE_SENTIENCE_POTION) // see poll_ignore.dm, should allow admins to ban greifers or bullies if(LAZYLEN(candidates)) - + message_admins("Candidate found!") //var/typepath = owner.type //clone = new typepath(owner.loc) var/typepath = M.type @@ -220,7 +213,12 @@ //after_success(user, SM) //qdel(src) else - if(20) + message_admins("Failed to find clone Candidate") + if(M.has_status_effect(/datum/status_effect/chem/SGDF) + + else + switch(20) + if(1) M.apply_status_effect(/datum/status_effect/chem/SGDF) ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index 37729ef21f..481c7925cf 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -40,7 +40,7 @@ CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) CurveSharpT = 4 // How sharp the temperature exponential curve is (to the power of value) CurveSharppH = 2 // How sharp the pH exponential curve is (to the power of value) - ThermicConstant = +20 //Temperature change per 1u produced + ThermicConstant = 20 //Temperature change per 1u produced HIonRelease = 0.01 //pH change per 1u reaction RateUpLim = 5 //Optimal/max rate possible if all conditions are perfect FermiChem = TRUE//If the chemical uses the Fermichem reaction mechanics