diff --git a/code/__DEFINES/spans.dm b/code/__DEFINES/spans.dm new file mode 100644 index 0000000000..45eae3ce76 --- /dev/null +++ b/code/__DEFINES/spans.dm @@ -0,0 +1,114 @@ +// Sorted alphabetically +#define span_abductor(str) ("" + str + "") +#define span_admin(str) ("" + str + "") +#define span_adminhelp(str) ("" + str + "") +#define span_adminnotice(str) ("" + str + "") +#define span_adminobserverooc(str) ("" + str + "") +#define span_adminooc(str) ("" + str + "") +#define span_adminsay(str) ("" + str + "") +#define span_aiprivradio(str) ("" + str + "") +#define span_alert(str) ("" + str + "") +#define span_alertalien(str) ("" + str + "") +#define span_alertsyndie(str) ("" + str + "") +#define span_alertwarning(str) ("" + str + "") +#define span_alien(str) ("" + str + "") +#define span_announce(str) ("" + str + "") +#define span_big(str) ("" + str + "") +#define span_bigicon(str) ("" + str + "") +#define span_binarysay(str) ("" + str + "") +#define span_blue(str) ("" + str + "") +#define span_blueteamradio(str) ("" + str + "") +#define span_bold(str) ("" + str + "") +#define span_boldannounce(str) ("" + str + "") +#define span_boldnotice(str) ("" + str + "") +#define span_boldwarning(str) ("" + str + "") +#define span_centcomradio(str) ("" + str + "") +#define span_changeling(str) ("" + str + "") +#define span_clown(str) ("" + str + "") +#define span_colossus(str) ("" + str + "") +#define span_command_headset(str) ("" + str + "") +#define span_comradio(str) ("" + str + "") +#define span_cult(str) ("" + str + "") +#define span_cultbold(str) ("" + str + "") +#define span_cultboldtalic(str) ("" + str + "") +#define span_cultitalic(str) ("" + str + "") +#define span_cultlarge(str) ("" + str + "") +#define span_danger(str) ("" + str + "") +#define span_deadsay(str) ("" + str + "") +#define span_deconversion_message(str) ("" + str + "") +#define span_drone(str) ("" + str + "") +#define span_engradio(str) ("" + str + "") +#define span_extremelybig(str) ("" + str + "") +#define span_ghostalert(str) ("" + str + "") +#define span_green(str) ("" + str + "") +#define span_greenannounce(str) ("" + str + "") +#define span_greenteamradio(str) ("" + str + "") +#define span_greentext(str) ("" + str + "") +#define span_hear(str) ("" + str + "") +#define span_hidden(str) ("") +#define span_hierophant(str) ("" + str + "") +#define span_hierophant_warning(str) ("" + str + "") +#define span_highlight(str) ("" + str + "") +#define span_his_grace(str) ("" + str + "") +#define span_holoparasite(str) ("" + str + "") +#define span_hypnophrase(str) ("" + str + "") +#define span_icon(str) ("" + str + "") +#define span_info(str) ("" + str + "") +#define span_interface(str) ("" + str + "") +#define span_looc(str) ("" + str + "") +#define span_medal(str) ("" + str + "") +#define span_medradio(str) ("" + str + "") +#define span_memo(str) ("" + str + "") +#define span_memoedit(str) ("" + str + "") +#define span_mind_control(str) ("" + str + "") +#define span_minorannounce(str) ("" + str + "") +#define span_monkey(str) ("" + str + "") +#define span_monkeyhive(str) ("" + str + "") +#define span_monkeylead(str) ("" + str + "") +#define span_name(str) ("" + str + "") +#define span_narsie(str) ("" + str + "") +#define span_narsiesmall(str) ("" + str + "") +#define span_nicegreen(str) ("" + str + "") +#define span_notice(str) ("" + str + "") +#define span_noticealien(str) ("" + str + "") +#define span_ooc(str) ("" + str + "") +#define span_papyrus(str) ("" + str + "") +#define span_phobia(str) ("" + str + "") +#define span_prefix(str) ("" + str + "") +#define span_purple(str) ("" + str + "") +#define span_radio(str) ("" + str + "") +#define span_reallybig(str) ("" + str + "") +#define span_red(str) ("" + str + "") +#define span_redteamradio(str) ("" + str + "") +#define span_redtext(str) ("" + str + "") +#define span_resonate(str) ("" + str + "") +#define span_revenbignotice(str) ("" + str + "") +#define span_revenboldnotice(str) ("" + str + "") +#define span_revendanger(str) ("" + str + "") +#define span_revenminor(str) ("" + str + "") +#define span_revennotice(str) ("" + str + "") +#define span_revenwarning(str) ("" + str + "") +#define span_robot(str) ("" + str + "") +#define span_rose(str) ("" + str + "") +#define span_sans(str) ("" + str + "") +#define span_sciradio(str) ("" + str + "") +#define span_secradio(str) ("" + str + "") +#define span_servradio(str) ("" + str + "") +#define span_singing(str) ("" + str + "") +#define span_slime(str) ("" + str + "") +#define span_small(str) ("" + str + "") +#define span_smallnotice(str) ("" + str + "") +#define span_smallnoticeital(str) ("" + str + "") +#define span_spider(str) ("" + str + "") +#define span_suicide(str) ("" + str + "") +#define span_suppradio(str) ("" + str + "") +#define span_swarmer(str) ("" + str + "") +#define span_syndradio(str) ("" + str + "") +#define span_tape_recorder(str) ("" + str + "") +#define span_tinynotice(str) ("" + str + "") +#define span_tinynoticeital(str) ("" + str + "") +#define span_unconscious(str) ("" + str + "") +#define span_userdanger(str) ("" + str + "") +#define span_warning(str) ("" + str + "") +#define span_yell(str) ("" + str + "") +#define span_yellowteamradio(str) ("" + str + "") diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index fb0ec3d39c..30899c0ca2 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -215,6 +215,12 @@ #define SSAIR_ATMOSMACHINERY_AIR 12 #define SSAIR_DEFERRED_AIRS 13 +// Subsystem delta times or tickrates, in seconds. I.e, how many seconds in between each process() call for objects being processed by that subsystem. +// Only use these defines if you want to access some other objects processing delta_time, otherwise use the delta_time that is sent as a parameter to process() +#define SSFLUIDS_DT (SSfluids.wait/10) +#define SSMACHINES_DT (SSmachines.wait/10) +#define SSMOBS_DT (SSmobs.wait/10) +#define SSOBJ_DT (SSobj.wait/10) //! ## Overlays subsystem diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index 2439ef4d53..0b4b3ef2dd 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -159,9 +159,9 @@ /datum/symptom/heal/metabolism/Heal(mob/living/carbon/C, datum/disease/advance/A, actual_power) if(!istype(C)) return - C.reagents.metabolize(C, can_overdose=TRUE) //this works even without a liver; it's intentional since the virus is metabolizing by itself + C.reagents.metabolize(C, SSMOBS_DT, 0, can_overdose=TRUE) //this works even without a liver; it's intentional since the virus is metabolizing by itself if(triple_metabolism) - C.reagents.metabolize(C, can_overdose=TRUE) + C.reagents.metabolize(C, SSMOBS_DT, 0, can_overdose=TRUE) C.overeatduration = max(C.overeatduration - 2, 0) var/lost_nutrition = 9 - (reduced_hunger * 5) C.adjust_nutrition(-lost_nutrition * HUNGER_FACTOR) //Hunger depletes at 10x the normal speed diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 0b12f3884e..f42661ca47 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -1,6 +1,6 @@ /mob/living/carbon/BiologicalLife(seconds, times_fired) //Reagent processing needs to come before breathing, to prevent edge cases. - handle_organs() + handle_organs(seconds, times_fired) . = ..() // if . is false, we are dead. if(stat == DEAD) stop_sound_channel(CHANNEL_HEARTBEAT) @@ -23,7 +23,7 @@ handle_brain_damage() if(stat != DEAD) - handle_liver() + handle_liver(seconds, times_fired) if(stat != DEAD) handle_corruption() @@ -378,25 +378,25 @@ /mob/living/carbon/proc/handle_blood() return -/mob/living/carbon/proc/handle_bodyparts() +/mob/living/carbon/proc/handle_bodyparts(seconds, times_fired) for(var/I in bodyparts) var/obj/item/bodypart/BP = I if(BP.needs_processing) - . |= BP.on_life() + . |= BP.on_life(seconds, times_fired) -/mob/living/carbon/proc/handle_organs() +/mob/living/carbon/proc/handle_organs(seconds, times_fired) if(stat != DEAD) for(var/V in internal_organs) var/obj/item/organ/O = V if(O) - O.on_life() + O.on_life(seconds, times_fired) else if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 1) || reagents.has_reagent(/datum/reagent/preservahyde, 1)) // No organ decay if the body contains formaldehyde. Or preservahyde. return for(var/V in internal_organs) var/obj/item/organ/O = V if(O) - O.on_death() //Needed so organs decay while inside the body. + O.on_death(seconds, times_fired) //Needed so organs decay while inside the body. /mob/living/carbon/handle_diseases() for(var/thing in diseases) @@ -687,16 +687,16 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put //LIVER// ///////// -/mob/living/carbon/proc/handle_liver() +/mob/living/carbon/proc/handle_liver(seconds, times_fired) var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) if((!dna && !liver) || (NOLIVER in dna.species.species_traits)) return if(!liver || liver.organ_flags & ORGAN_FAILING) - liver_failure() + liver_failure(seconds, times_fired) -/mob/living/carbon/proc/liver_failure() +/mob/living/carbon/proc/liver_failure(seconds, times_fired) reagents.end_metabolization(src, keep_liverless = TRUE) //Stops trait-based effects on reagents, to prevent permanent buffs - reagents.metabolize(src, can_overdose=FALSE, liverless = TRUE) + reagents.metabolize(src, seconds, times_fired, can_overdose=FALSE, liverless = TRUE) if(HAS_TRAIT(src, TRAIT_STABLELIVER)) return adjustToxLoss(4, TRUE, TRUE) diff --git a/code/modules/movespeed/modifiers/reagents.dm b/code/modules/movespeed/modifiers/reagents.dm index 1a03e8a602..b7108582d9 100644 --- a/code/modules/movespeed/modifiers/reagents.dm +++ b/code/modules/movespeed/modifiers/reagents.dm @@ -2,17 +2,37 @@ blacklisted_movetypes = (FLYING|FLOATING) /datum/movespeed_modifier/reagent/stimulants + multiplicative_slowdown = -0.55 + +/datum/movespeed_modifier/reagent/ephedrine multiplicative_slowdown = -0.5 +/datum/movespeed_modifier/reagent/pepperspray + multiplicative_slowdown = 0.25 + +/datum/movespeed_modifier/reagent/monkey_energy + multiplicative_slowdown = -0.35 + /datum/movespeed_modifier/reagent/changelinghaste - multiplicative_slowdown = -2 + multiplicative_slowdown = -0.8 -/datum/movespeed_modifier/reagent/skooma - multiplicative_slowdown = -1 +/datum/movespeed_modifier/reagent/methamphetamine + multiplicative_slowdown = -0.65 /datum/movespeed_modifier/reagent/nitryl - multiplicative_slowdown = -1 + multiplicative_slowdown = -0.65 -/datum/movespeed_modifier/reagent/meth - multiplicative_slowdown = -0.5 - absolute_max_tiles_per_second = 11 +/datum/movespeed_modifier/reagent/freon + multiplicative_slowdown = 1.6 + +/datum/movespeed_modifier/reagent/halon + multiplicative_slowdown = 1.8 + +/datum/movespeed_modifier/reagent/lenturi + multiplicative_slowdown = 1.5 + +/datum/movespeed_modifier/reagent/nuka_cola + multiplicative_slowdown = -0.35 + +/datum/movespeed_modifier/reagent/nooartrium + multiplicative_slowdown = 2 diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index fd6204a8e3..f9af19512c 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -280,45 +280,23 @@ R.handle_reactions() return amount -/datum/reagents/proc/metabolize(mob/living/carbon/C, can_overdose = FALSE, liverless = FALSE) +/** + * Triggers metabolizing for all the reagents in this holder + * + * Arguments: + * * mob/living/carbon/carbon - The mob to metabolize in, if null it uses [/datum/reagents/var/my_atom] + * * delta_time - the time in server seconds between proc calls (when performing normally it will be 2) + * * times_fired - the number of times the owner's life() tick has been called aka The number of times SSmobs has fired + * * can_overdose - Allows overdosing + * * liverless - Stops reagents that aren't set as [/datum/reagent/var/self_consuming] from metabolizing + */ +/datum/reagents/proc/metabolize(mob/living/carbon/owner, delta_time, times_fired, can_overdose = FALSE, liverless = FALSE) var/list/cached_reagents = reagent_list - var/list/cached_addictions = addiction_list - if(C) - expose_temperature(C.bodytemperature, 0.25) - var/need_mob_update = 0 - for(var/reagent in cached_reagents) - var/datum/reagent/R = reagent - if(QDELETED(R.holder)) - continue - if(liverless && !R.self_consuming) //need to be metabolized - continue - if(!C) - C = R.holder.my_atom - if(!R.metabolizing) - R.metabolizing = TRUE - R.on_mob_metabolize(C) - if(C && R) - if(C.reagent_check(R) != 1) - if(can_overdose) - if(R.overdose_threshold) - if(R.volume > R.overdose_threshold && !R.overdosed) - R.overdosed = 1 - var/turf/CT = get_turf(C) - log_reagent("OVERDOSE START: [key_name(C)] at [AREACOORD(CT)] started overdosing on [R.volume] units of [R].") - need_mob_update += R.overdose_start(C) - if(R.addiction_threshold) - if(R.volume > R.addiction_threshold && !is_type_in_list(R, cached_addictions)) - var/datum/reagent/new_reagent = new R.type() - cached_addictions.Add(new_reagent) - if(R.overdosed) - need_mob_update += R.overdose_process(C) - if(is_type_in_list(R,cached_addictions)) - for(var/addiction in cached_addictions) - var/datum/reagent/A = addiction - if(istype(R, A)) - A.addiction_stage = -15 // you're satisfied for a good while. - need_mob_update += R.on_mob_life(C) - + if(owner) + expose_temperature(owner.bodytemperature, 0.25) + var/need_mob_update = FALSE + for(var/datum/reagent/reagent as anything in cached_reagents) + need_mob_update += metabolize_reagent(owner, reagent, delta_time, times_fired, can_overdose, liverless) if(can_overdose) if(addiction_tick == 6) addiction_tick = 1 @@ -339,12 +317,77 @@ else SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose") addiction_tick++ - if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates. - C.updatehealth() - C.update_mobility() - C.update_stamina() + if(owner && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates. + owner.updatehealth() + owner.update_mobility + owner.update_stamina() update_total() +/* + * Metabolises a single reagent for a target owner carbon mob. See above. + * + * Arguments: + * * mob/living/carbon/owner - The mob to metabolize in, if null it uses [/datum/reagents/var/my_atom] + * * delta_time - the time in server seconds between proc calls (when performing normally it will be 2) + * * times_fired - the number of times the owner's life() tick has been called aka The number of times SSmobs has fired + * * can_overdose - Allows overdosing + * * liverless - Stops reagents that aren't set as [/datum/reagent/var/self_consuming] from metabolizing + */ +/datum/reagents/proc/metabolize_reagent(mob/living/carbon/owner, datum/reagent/reagent, delta_time, times_fired, can_overdose = FALSE, liverless = FALSE) + var/need_mob_update = FALSE + if(QDELETED(reagent.holder)) + return FALSE + + if(!owner) + owner = reagent.holder.my_atom + + if(owner && reagent) + if(!owner.reagent_check(reagent, delta_time, times_fired) != TRUE) + return + if(liverless && !reagent.self_consuming) //need to be metabolized + return + if(!reagent.metabolizing) + reagent.metabolizing = TRUE + reagent.on_mob_metabolize(owner) + if(can_overdose) + if(reagent.overdose_threshold) + if(reagent.volume >= reagent.overdose_threshold && !reagent.overdosed) + reagent.overdosed = TRUE + need_mob_update += reagent.overdose_start(owner) + log_game("[key_name(owner)] has started overdosing on [reagent.name] at [reagent.volume] units.") + + // for(var/addiction in reagent.addiction_types) + // owner.mind?.add_addiction_points(addiction, reagent.addiction_types[addiction] * REAGENTS_METABOLISM) + if(R.addiction_threshold) + if(R.volume > R.addiction_threshold && !is_type_in_list(R, cached_addictions)) + var/datum/reagent/new_reagent = new R.type() + cached_addictions.Add(new_reagent) + if(is_type_in_list(R,cached_addictions)) + for(var/addiction in cached_addictions) + var/datum/reagent/A = addiction + if(istype(R, A)) + A.addiction_stage = -15 // you're satisfied for a good while. + + if(reagent.overdosed) + need_mob_update += reagent.overdose_process(owner, delta_time, times_fired) + + need_mob_update += reagent.on_mob_life(owner, delta_time, times_fired) + return need_mob_update + +/// Signals that metabolization has stopped, triggering the end of trait-based effects +/datum/reagents/proc/end_metabolization(mob/living/carbon/C, keep_liverless = TRUE) + var/list/cached_reagents = reagent_list + for(var/datum/reagent/reagent as anything in cached_reagents) + if(QDELETED(reagent.holder)) + continue + if(keep_liverless && reagent.self_consuming) //Will keep working without a liver + continue + if(!C) + C = reagent.holder.my_atom + if(reagent.metabolizing) + reagent.metabolizing = FALSE + reagent.on_mob_end_metabolize(C) + /datum/reagents/proc/remove_addiction(datum/reagent/R) to_chat(my_atom, "You feel like you've gotten over your need for [R.name].") SEND_SIGNAL(my_atom, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose") @@ -354,21 +397,6 @@ addiction_list.Remove(R) qdel(R) -//Signals that metabolization has stopped, triggering the end of trait-based effects -/datum/reagents/proc/end_metabolization(mob/living/carbon/C, keep_liverless = TRUE) - var/list/cached_reagents = reagent_list - for(var/reagent in cached_reagents) - var/datum/reagent/R = reagent - if(QDELETED(R.holder)) - continue - if(keep_liverless && R.self_consuming) //Will keep working without a liver - continue - if(!C) - C = R.holder.my_atom - if(R.metabolizing) - R.metabolizing = FALSE - R.on_mob_end_metabolize(C) - /datum/reagents/proc/conditional_update_move(atom/A, Running = 0) var/list/cached_reagents = reagent_list for(var/reagent in cached_reagents) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 96985514b5..485ef9ce82 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -164,62 +164,55 @@ /datum/reagent/drug/methamphetamine name = "Methamphetamine" - description = "Reduces stun times by about 300%, and allows the user to quickly recover stamina while dealing a small amount of Brain damage. If overdosed the subject will move randomly, laugh randomly, drop items and suffer from Toxin and Brain damage. If addicted the subject will constantly jitter and drool, before becoming dizzy and losing motor control and eventually suffer heavy toxin damage." + description = "Reduces stun times by about 300%, speeds the user up, and allows the user to quickly recover stamina while dealing a small amount of Brain damage. If overdosed the subject will move randomly, laugh randomly, drop items and suffer from Toxin and Brain damage. If addicted the subject will constantly jitter and drool, before becoming dizzy and losing motor control and eventually suffer heavy toxin damage." reagent_state = LIQUID color = "#FAFAFA" overdose_threshold = 20 - addiction_threshold = 10 metabolization_rate = 0.75 * REAGENTS_METABOLISM - var/brain_damage = TRUE - var/jitter = TRUE - var/confusion = TRUE - pH = 5 + ph = 5 + chemical_flags = REAGENT_CAN_BE_SYNTHESIZED + addiction_threshold = 10 value = REAGENT_VALUE_UNCOMMON /datum/reagent/drug/methamphetamine/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_IGNOREDAMAGESLOWDOWN, type) - L.update_movespeed() - ADD_TRAIT(L, TRAIT_TASED_RESISTANCE, type) L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/meth) /datum/reagent/drug/methamphetamine/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_IGNOREDAMAGESLOWDOWN, type) - L.update_movespeed() - REMOVE_TRAIT(L, TRAIT_TASED_RESISTANCE, type) L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/meth) ..() -/datum/reagent/drug/methamphetamine/on_mob_life(mob/living/carbon/M) +/datum/reagent/drug/methamphetamine/on_mob_life(mob/living/carbon/M, delta_time, times_fired) var/high_message = pick("You feel hyper.", "You feel like you need to go faster.", "You feel like you can run the world.") - if(prob(5)) - to_chat(M, "[high_message]") - M.AdjustAllImmobility(-40, 0) - M.AdjustUnconscious(-40, 0) - M.adjustStaminaLoss(-7.5 * REM, 0) - if(jitter) - M.Jitter(2) - if(brain_damage) - M.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1,4)) - M.heal_overall_damage(2, 2) - if(prob(5)) + if(DT_PROB(2.5, delta_time)) + to_chat(M, span_notice("[high_message]")) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "tweaking", /datum/mood_event/stimulant_medium, name) + M.AdjustStun(-40 * REM * delta_time) + M.AdjustKnockdown(-40 * REM * delta_time) + M.AdjustUnconscious(-40 * REM * delta_time) + M.AdjustParalyzed(-40 * REM * delta_time) + M.AdjustImmobilized(-40 * REM * delta_time) + M.adjustStaminaLoss(-2 * REM * delta_time, 0) + M.Jitter(2 * REM * delta_time) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1, 4) * REM * delta_time) + if(DT_PROB(2.5, delta_time)) M.emote(pick("twitch", "shiver")) ..() - . = 1 + . = TRUE -/datum/reagent/drug/methamphetamine/overdose_process(mob/living/M) - if(CHECK_MOBILITY(M, MOBILITY_MOVE) && !ismovable(M.loc)) - for(var/i in 1 to 4) +/datum/reagent/drug/methamphetamine/overdose_process(mob/living/M, delta_time, times_fired) + if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) + for(var/i in 1 to round(4 * REM * delta_time, 1)) step(M, pick(GLOB.cardinals)) - if(prob(20)) + if(DT_PROB(10, delta_time)) M.emote("laugh") - if(prob(33)) - M.visible_message("[M]'s hands flip out and flail everywhere!") + if(DT_PROB(18, delta_time)) + M.visible_message(span_danger("[M]'s hands flip out and flail everywhere!")) M.drop_all_held_items() ..() - M.adjustToxLoss(1, 0) - M.adjustOrganLoss(ORGAN_SLOT_BRAIN, pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) - . = 1 + M.adjustToxLoss(1 * REM * delta_time, 0) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, (rand(5, 10) / 10) * REM * delta_time) + . = TRUE /datum/reagent/drug/methamphetamine/addiction_act_stage1(mob/living/M) M.Jitter(5) diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index e24268cc45..e929641367 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -188,7 +188,7 @@ needs_processing = . //Return TRUE to get whatever mob this is in to update health. -/obj/item/bodypart/proc/on_life() +/obj/item/bodypart/proc/on_life(seconds, times_fired) if(stam_heal_tick && stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life. if(heal_damage(brute = 0, burn = 0, stamina = (stam_heal_tick * (disabled ? 2 : 1)), only_robotic = FALSE, only_organic = FALSE, updating_health = FALSE)) . |= BODYPART_LIFE_UPDATE_HEALTH diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index 2037547d36..5c6b66f702 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -25,7 +25,7 @@ var/cachedmoveCalc = 1 food_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/iron = 5) -/obj/item/organ/liver/on_life() +/obj/item/organ/liver/on_life(seconds, times_fired) . = ..() if(!. || !owner)//can't process reagents with a failing liver return @@ -40,7 +40,7 @@ damage += (thisamount*toxLethality) //metabolize reagents - owner.reagents.metabolize(owner, can_overdose=TRUE) + owner.reagents.metabolize(owner, seconds, times_fired, can_overdose=TRUE) if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability to_chat(owner, "You feel a dull pain in your abdomen.") diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 6cdeadcbb3..f0f2a7ef19 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -92,18 +92,18 @@ on_death() //Kinda hate doing it like this, but I really don't want to call process directly. //Sources; life.dm process_organs -/obj/item/organ/proc/on_death() //Runs when outside AND inside. +/obj/item/organ/proc/on_death(seconds, times_fired) //Runs when outside AND inside. decay() //Applys the slow damage over time decay -/obj/item/organ/proc/decay() +/obj/item/organ/proc/decay(seconds, times_fired) if(!can_decay()) STOP_PROCESSING(SSobj, src) return is_cold() if(organ_flags & ORGAN_FROZEN) return - applyOrganDamage(maxHealth * decay_factor) + applyOrganDamage(maxHealth * decay_factor * (seconds * 0.5)) /obj/item/organ/proc/can_decay() if(CHECK_BITFIELD(organ_flags, ORGAN_NO_SPOIL | ORGAN_SYNTHETIC | ORGAN_FAILING)) @@ -151,7 +151,7 @@ organ_flags &= ~ORGAN_FROZEN return FALSE -/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing or synthetic +/obj/item/organ/proc/on_life(seconds, times_fired) //repair organ damage if the organ is not failing or synthetic if(organ_flags & ORGAN_FAILING || !owner) return FALSE if(organ_flags & ORGAN_SYNTHETIC_EMP) //Synthetic organ has been emped, is now failing. diff --git a/code/modules/unit_tests/metabolizing.dm b/code/modules/unit_tests/metabolizing.dm index b7f8fc4f6a..6c0a635b13 100644 --- a/code/modules/unit_tests/metabolizing.dm +++ b/code/modules/unit_tests/metabolizing.dm @@ -11,7 +11,7 @@ /datum/unit_test/metabolization/proc/test_reagent(mob/living/carbon/C, reagent_type) C.reagents.add_reagent(reagent_type, 10) - C.reagents.metabolize(C, can_overdose = TRUE) + C.reagents.metabolize(C, SSMOBS_DT, 1, can_overdose = TRUE) C.reagents.clear_reagents() /datum/unit_test/metabolization/Destroy() diff --git a/tgstation.dme b/tgstation.dme index ed85c32cc4..7e70fa06d5 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -109,6 +109,7 @@ #include "code\__DEFINES\sight.dm" #include "code\__DEFINES\sound.dm" #include "code\__DEFINES\spaceman_dmm.dm" +#include "code\__DEFINES\spans.dm" #include "code\__DEFINES\species.dm" #include "code\__DEFINES\stat.dm" #include "code\__DEFINES\stat_tracking.dm"