From aa7805eaa440d584063ae6fdbe952ea50add74b0 Mon Sep 17 00:00:00 2001 From: Fermi Date: Thu, 13 Jun 2019 06:35:12 +0100 Subject: [PATCH] Fixes. --- code/modules/reagents/chemistry/holder.dm | 11 ++--- code/modules/reagents/chemistry/reagents.dm | 1 + code/modules/reagents/reagent_containers.dm | 14 +++--- code/modules/surgery/organs/vocal_cords.dm | 3 +- .../code/datums/status_effects/chems.dm | 45 ++++++++++--------- .../chemistry/reagents/fermi_reagents.dm | 21 ++++----- 6 files changed, 48 insertions(+), 47 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 90bf1d61f0..a32ea45a01 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -786,7 +786,7 @@ var/S = specific_heat() chem_temp = CLAMP(chem_temp + (J / (S * total_volume)), min_temp, max_temp) -/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0)//EDIT HERE TOO ~FERMICHEM~ +/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0) if(!isnum(amount) || !amount) return FALSE @@ -803,7 +803,7 @@ if (pH <= 2) var/datum/effect_system/smoke_spread/chem/s = new var/turf/T = get_turf(my_atom) - var/datum/reagents/R = new/datum/reagents(3000)//I don't want to hold it back..! + var/datum/reagents/R = new/datum/reagents(3000) R.add_reagent("fermiAcid", amount) for (var/datum/reagent/reagentgas in reagent_list) R.add_reagent(reagentgas, amount/5) @@ -836,7 +836,6 @@ specific_heat += D.specific_heat * (amount / new_total) thermal_energy += D.specific_heat * amount * reagtemp chem_temp = thermal_energy / (specific_heat * new_total) - //// //cacluate reagent based pH shift. pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right @@ -858,10 +857,8 @@ if(my_atom) my_atom.on_reagent_change(ADD_REAGENT) R.on_merge(data, amount, my_atom, other_purity) - if(istype(D, /datum/reagent/fermi))//Is this a fermichem? - var/datum/reagent/fermi/Ferm = D //It is a fermichem! - if(Ferm.OnMobMergeCheck == TRUE) //Does this fermichem split? - R.on_mob_add(my_atom, amount) //On mob add processes fermichems, splitting them into their impure and pure products. This allows them to split when merging fermichems in a mob. + if(R.OnMobMergeCheck == TRUE)//Forces on_mob_add proc when a chem is merged + R.on_mob_add(my_atom, amount) if(!no_react) handle_reactions() diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 07da5ef6e6..54dc136560 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -38,6 +38,7 @@ var/addProc = FALSE //If the chemical should force an on_new() call 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/OnMobMergeCheck = FALSE /datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references . = ..() diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 65ae4ce171..afc93a99b4 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -1,3 +1,8 @@ +#define FLAG_STATUS_NONE (1<<0) +#define FLAG_STATUS_PH_IMMUNE (1<<1) +#define FLAG_STATUS_TEMP_IMMUNE (1<<2) + + /obj/item/reagent_containers name = "Container" desc = "..." @@ -11,8 +16,7 @@ var/spawned_disease = null var/disease_amount = 20 var/spillable = FALSE - var/pH_immune = TRUE//true for now, just so things that shouldn't melt don't. - var/temp_immune = TRUE + var/beaker_resistances |= 1<<3 /obj/item/reagent_containers/Initialize(mapload, vol) . = ..() @@ -127,7 +131,7 @@ //melts plastic beakers /obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M) reagents.expose_temperature(1000) - if(!temp_immune) + if(!beaker_resistances = FLAG_STATUS_TEMP_IMMUNE) var/list/seen = viewers(5, get_turf(src)) var/iconhtml = icon2html(src, seen) for(var/mob/H in seen) @@ -139,7 +143,7 @@ //melts plastic beakers /obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) reagents.expose_temperature(exposed_temperature) - if(!temp_immune) + if(!beaker_resistances = FLAG_STATUS_TEMP_IMMUNE) if(reagents.chem_temp > 444)//assuming polypropylene var/list/seen = viewers(5, get_turf(src)) var/iconhtml = icon2html(src, seen) @@ -150,7 +154,7 @@ //melts glass beakers /obj/item/reagent_containers/proc/pH_check() - if(!pH_immune) + if(!beaker_resistances = FLAG_STATUS_PH_IMMUNE) if((reagents.pH < 0.5) || (reagents.pH > 13.5)) var/list/seen = viewers(5, get_turf(src)) var/iconhtml = icon2html(src, seen) diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index e8b6b12ede..31c68d2ba8 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -1229,8 +1229,7 @@ return if(message_admins) message_admins("[ADMIN_LOOKUPFLW(user)] has said '[log_message]' with a Velvet Voice, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].") - log_game("[key_name(user)] has said '[log_message]' with a Velvet Voice, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].") - investigate_log("[key_name(user)] has said '[log_message]' with a Velvet Voice, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: [key_name(user)] has said '[log_message]' with a Velvet Voice, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].") //SSblackbox.record_feedback("tally", "Velvet_voice", 1, log_message) If this is on, it fills the thing up and OOFs the server return diff --git a/modular_citadel/code/datums/status_effects/chems.dm b/modular_citadel/code/datums/status_effects/chems.dm index 3c1cd72ff2..b201f394cc 100644 --- a/modular_citadel/code/datums/status_effects/chems.dm +++ b/modular_citadel/code/datums/status_effects/chems.dm @@ -1,10 +1,13 @@ +#define DICK_MOVEMENT_SPEED "hugedick" +#define BREAST_MOVEMENT_SPEED "megamilk" + /datum/status_effect/chem/SGDF id = "SGDF" var/mob/living/fermi_Clone alert_type = null /datum/status_effect/chem/SGDF/on_apply() - investigate_log("SGDF status appied on [owner], ID: [owner.key]", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: SGDF status appied on [owner], ID: [owner.key]") var/typepath = owner.type fermi_Clone = new typepath(owner.loc) var/mob/living/carbon/M = owner @@ -20,7 +23,7 @@ if(owner.stat == DEAD) if((fermi_Clone && fermi_Clone.stat != DEAD) || (fermi_Clone == null)) if(owner.mind) - investigate_log("SGDF mind shift applied. [owner] is now playing as their clone and should not have memories after their clone split (look up SGDF status applied). ID: [owner.key]", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: SGDF mind shift applied. [owner] is now playing as their clone and should not have memories after their clone split (look up SGDF status applied). ID: [owner.key]") owner.mind.transfer_to(fermi_Clone) to_chat(owner, "Lucidity shoots to your previously blank mind as your mind suddenly finishes the cloning process. You marvel for a moment at yourself, as your mind subconciously recollects all your memories up until the point when you cloned yourself. curiously, you find that you memories are blank after you ingested the sythetic serum, leaving you to wonder where the other you is.") to_chat(fermi_Clone, "Lucidity shoots to your previously blank mind as your mind suddenly finishes the cloning process. You marvel for a moment at yourself, as your mind subconciously recollects all your memories up until the point when you cloned yourself. curiously, you find that you memories are blank after you ingested the sythetic serum, leaving you to wonder where the other you is.") @@ -37,7 +40,7 @@ var/cachedmoveCalc = 1 /datum/status_effect/chem/breast_enlarger/on_apply(mob/living/carbon/human/H)//Removes clothes, they're too small to contain you. You belong to space now. - investigate_log("[owner]'s breasts has reached comical sizes. ID: [owner.key]", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: [owner]'s breasts has reached comical sizes. ID: [owner.key]") var/mob/living/carbon/human/o = owner var/items = o.get_contents() for(var/obj/item/W in items) @@ -55,7 +58,7 @@ var/obj/item/organ/genital/breasts/B = o.getorganslot("breasts") moveCalc = 1+((round(B.cached_size) - 9)/3) //Afffects how fast you move, and how often you can click. if(!B) - o.remove_movespeed_modifier("megamilk") + o.remove_movespeed_modifier(BREAST_MOVEMENT_SPEED) sizeMoveMod(1) owner.remove_status_effect(src) var/items = o.get_contents() @@ -70,14 +73,14 @@ var/target = o.get_bodypart(BODY_ZONE_CHEST) o.apply_damage(0.1, BRUTE, target) if(!B.cached_size == B.breast_values[B.prev_size]) - o.add_movespeed_modifier("megamilk", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) + o.add_movespeed_modifier(BREAST_MOVEMENT_SPEED, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) sizeMoveMod(moveCalc) return ..() else if (B.breast_values[B.size] > B.breast_values[B.prev_size]) - o.add_movespeed_modifier("megamilk", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) + o.add_movespeed_modifier(BREAST_MOVEMENT_SPEED, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) sizeMoveMod(moveCalc) else if (B.breast_values[B.size] < B.breast_values[B.prev_size]) - o.add_movespeed_modifier("megamilk", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) + o.add_movespeed_modifier(BREAST_MOVEMENT_SPEED, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) sizeMoveMod(moveCalc) if((B.cached_size) < 16) switch(round(B.cached_size)) @@ -92,8 +95,8 @@ ..() /datum/status_effect/chem/breast_enlarger/on_remove(mob/living/carbon/M) - investigate_log("[owner]'s breasts has reduced to an acceptable size. ID: [owner.key]", INVESTIGATE_FERMICHEM) - owner.remove_movespeed_modifier("megamilk") + log_game("FERMICHEM: [owner]'s breasts has reduced to an acceptable size. ID: [owner.key]") + owner.remove_movespeed_modifier(BREAST_MOVEMENT_SPEED) sizeMoveMod(1) /datum/status_effect/chem/breast_enlarger/proc/sizeMoveMod(var/value) @@ -112,7 +115,7 @@ var/moveCalc /datum/status_effect/chem/penis_enlarger/on_apply(mob/living/carbon/human/H)//Removes clothes, they're too small to contain you. You belong to space now. - investigate_log("[owner]'s dick has reached comical sizes. ID: [owner.key]", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: [owner]'s dick has reached comical sizes. ID: [owner.key]") var/mob/living/carbon/human/o = owner var/items = o.get_contents() if(o.w_uniform || o.wear_suit) @@ -133,7 +136,7 @@ moveCalc = 1+((round(P.length) - 21)/3) //effects how fast you can move bloodCalc = 1+((round(P.length) - 21)/10) //effects how much blood you need (I didn' bother adding an arousal check because I'm spending too much time on this organ already.) if(!P) - o.remove_movespeed_modifier("hugedick") + o.remove_movespeed_modifier(DICK_MOVEMENT_SPEED) o.ResetBloodVol() owner.remove_status_effect(src) var/items = o.get_contents() @@ -145,18 +148,18 @@ switch(round(P.cached_length)) if(21) to_chat(o, "Your rascally willy has become a more managable size, liberating your movements.") - o.remove_movespeed_modifier("hugedick") + o.remove_movespeed_modifier(DICK_MOVEMENT_SPEED) o.AdjustBloodVol(bloodCalc) if(22 to INFINITY) if(prob(2)) to_chat(o, "Your indulgent johnson is so substantial, it's taking all your blood and affecting your movements!") - o.add_movespeed_modifier("hugedick", TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) + o.add_movespeed_modifier(DICK_MOVEMENT_SPEED, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) o.AdjustBloodVol(bloodCalc) ..() /datum/status_effect/chem/penis_enlarger/on_remove(mob/living/carbon/human/o) - investigate_log("[owner]'s dick has reduced to an acceptable size. ID: [owner.key]", INVESTIGATE_FERMICHEM) - owner.remove_movespeed_modifier("hugedick") + log_game("FERMICHEM: [owner]'s dick has reduced to an acceptable size. ID: [owner.key]") + owner.remove_movespeed_modifier(DICK_MOVEMENT_SPEED) owner.ResetBloodVol() @@ -231,7 +234,7 @@ var/message = "[(owner.lewd?"I am a good pet for [enthrallGender].":"[master] is a really inspirational person!")]" SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "enthrall", /datum/mood_event/enthrall, message) to_chat(owner, "You feel inexplicably drawn towards [master], their words having a demonstrable effect on you. It seems the closer you are to them, the stronger the effect is. However you aren't fully swayed yet and can resist their effects by repeatedly resisting as much as you can!") - investigate_log("MKULTRA: Status applied on [owner] ckey: [owner.key] with a master of [master] ckey: [enthrallID].", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: Status applied on [owner] ckey: [owner.key] with a master of [master] ckey: [enthrallID].") return ..() /datum/status_effect/chem/enthrall/tick() @@ -265,7 +268,7 @@ if(-1)//fully removed SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "enthrall") owner.remove_status_effect(src) - investigate_log("MKULTRA: Status REMOVED from [owner] ckey: [owner.key] with a master of [master] ckey: [enthrallID].", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: Status REMOVED from [owner] ckey: [owner.key] with a master of [master] ckey: [enthrallID].") if(0)// sleeper agent if (cooldown > 0) cooldown -= 1 @@ -301,7 +304,7 @@ else to_chat(owner, "You are unable to put up a resistance any longer, and now are under the control of [master]. However you find that in your intoxicated state you are unable to resort to violence. Equally you are unable to commit suicide, even if ordered to, as you cannot serve your [master] in death. ") owner.add_trait(TRAIT_PACIFISM, "MKUltra") //IMPORTANT - investigate_log("MKULTRA: Status on [owner] ckey: [owner.key] has been fully entrhalled (state 3) with a master of [master] ckey: [enthrallID].", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: Status on [owner] ckey: [owner.key] has been fully entrhalled (state 3) with a master of [master] ckey: [enthrallID].") else if (resistanceTally > 200) enthrallTally *= 0.5 phase -= 1 @@ -540,7 +543,7 @@ var/cached_trigger = lowertext(trigger) if (findtext(raw_message, cached_trigger))//if trigger1 is the message cTriggered = TRUE - investigate_log("MKULTRA: [owner] ckey: [owner.key] has been triggered with [cached_trigger] from [speaker] saying: \"[message]\". (their master being [master] ckey: [enthrallID].)", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: [owner] ckey: [owner.key] has been triggered with [cached_trigger] from [speaker] saying: \"[message]\". (their master being [master] ckey: [enthrallID].)") //Speak (Forces player to talk) works if (lowertext(customTriggers[trigger][1]) == "speak")//trigger2 @@ -549,7 +552,7 @@ saytext += " You find yourself fully believing in the validity of what you just said and don't think to question it." to_chat(C, "[saytext]") (C.say(customTriggers[trigger][2]))//trigger3 - investigate_log("MKULTRA: [owner] ckey: [owner.key] has been forced to say: \"[customTriggers[trigger][2]]\" from previous trigger.", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: [owner] ckey: [owner.key] has been forced to say: \"[customTriggers[trigger][2]]\" from previous trigger.") //Echo (repeats message!) @@ -595,7 +598,7 @@ var/mob/living/carbon/human/o = owner o.apply_status_effect(/datum/status_effect/trance, 200, TRUE) tranceTime = 50 - investigate_log("MKULTRA: [owner] ckey: [owner.key] has been tranced from previous trigger.", INVESTIGATE_FERMICHEM) + log_game("FERMICHEM: MKULTRA: [owner] ckey: [owner.key] has been tranced from previous trigger.") cTriggered = FALSE 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 3e387381f9..5601b7d97f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -9,11 +9,8 @@ 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 - //var/addProc = FALSE //When this reagent is added to a new beaker, it does something. Implemented but unused. //This should process fermichems to find out how pure they are and what effect to do. -//TODO: add this to the main on_mob_add proc, and check if Fermichem = TRUE /datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount) . = ..() if(!M) @@ -1251,18 +1248,19 @@ Creating a chem with a low purity will make you permanently fall in love with so qdel(W) else M.dropItemToGround(W, TRUE) - hat = new /obj/item/clothing/head/hattip() + var/hat = new /obj/item/clothing/head/hattip() M.equip_to_slot(hat, SLOT_HEAD, 1, 1) /datum/reagent/fermi/hatmium/on_mob_life(mob/living/carbon/human/M) - M.head + if(!M.head == /obj/item/clothing/head/hattip) + return ..() var/hatArmor = (1+(current_cycle/30))*purity - for(var/datum/armor in ) - if(!overdosed) - hat.armor = list("melee" = hatArmor, "bullet" = hatArmor, "laser" = hatArmor, "energy" = hatArmor, "bomb" = hatArmor, "bio" = hatArmor, "rad" = hatArmor, "fire" = hatArmor) - else - hat.armor = list("melee" = -hatArmor, "bullet" = -hatArmor, "laser" = -hatArmor, "energy" = -hatArmor, "bomb" = -hatArmor, "bio" = -hatArmor, "rad" = -hatArmor, "fire" = -hatArmor) + for(var/datum/armor/i in M.head) + if(!overdosed) + i = hatArmor + else + i = -hatArmor ..() //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1546,8 +1544,7 @@ Creating a chem with a low purity will make you permanently fall in love with so /datum/reagent/fermi/secretcatchem/on_mob_add(mob/living/carbon/human/H) . = ..() - var/current_species = H.dna.species.type - if((mutation != current_species) && (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(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. //exception(al) handler: H.dna.features["ears"] = "Cat" H.dna.features["mam_ears"] = "Cat"