scope creep lmao

This commit is contained in:
silicons
2021-06-28 12:29:18 -07:00
parent 392111dc74
commit a73ca4be46
12 changed files with 281 additions and 119 deletions

114
code/__DEFINES/spans.dm Normal file
View File

@@ -0,0 +1,114 @@
// Sorted alphabetically
#define span_abductor(str) ("<span class='abductor'>" + str + "</span>")
#define span_admin(str) ("<span class='admin'>" + str + "</span>")
#define span_adminhelp(str) ("<span class='adminhelp'>" + str + "</span>")
#define span_adminnotice(str) ("<span class='adminnotice'>" + str + "</span>")
#define span_adminobserverooc(str) ("<span class='adminobserverooc'>" + str + "</span>")
#define span_adminooc(str) ("<span class='adminooc'>" + str + "</span>")
#define span_adminsay(str) ("<span class='adminsay'>" + str + "</span>")
#define span_aiprivradio(str) ("<span class='aiprivradio'>" + str + "</span>")
#define span_alert(str) ("<span class='alert'>" + str + "</span>")
#define span_alertalien(str) ("<span class='alertalien'>" + str + "</span>")
#define span_alertsyndie(str) ("<span class='alertsyndie'>" + str + "</span>")
#define span_alertwarning(str) ("<span class='alertwarning'>" + str + "</span>")
#define span_alien(str) ("<span class='alien'>" + str + "</span>")
#define span_announce(str) ("<span class='announce'>" + str + "</span>")
#define span_big(str) ("<span class='big'>" + str + "</span>")
#define span_bigicon(str) ("<span class='bigicon'>" + str + "</span>")
#define span_binarysay(str) ("<span class='binarysay'>" + str + "</span>")
#define span_blue(str) ("<span class='blue'>" + str + "</span>")
#define span_blueteamradio(str) ("<span class='blueteamradio'>" + str + "</span>")
#define span_bold(str) ("<span class='bold'>" + str + "</span>")
#define span_boldannounce(str) ("<span class='boldannounce'>" + str + "</span>")
#define span_boldnotice(str) ("<span class='boldnotice'>" + str + "</span>")
#define span_boldwarning(str) ("<span class='boldwarning'>" + str + "</span>")
#define span_centcomradio(str) ("<span class='centcomradio'>" + str + "</span>")
#define span_changeling(str) ("<span class='changeling'>" + str + "</span>")
#define span_clown(str) ("<span class='clown'>" + str + "</span>")
#define span_colossus(str) ("<span class='colossus'>" + str + "</span>")
#define span_command_headset(str) ("<span class='command_headset'>" + str + "</span>")
#define span_comradio(str) ("<span class='comradio'>" + str + "</span>")
#define span_cult(str) ("<span class='cult'>" + str + "</span>")
#define span_cultbold(str) ("<span class='cultbold'>" + str + "</span>")
#define span_cultboldtalic(str) ("<span class='cultboldtalic'>" + str + "</span>")
#define span_cultitalic(str) ("<span class='cultitalic'>" + str + "</span>")
#define span_cultlarge(str) ("<span class='cultlarge'>" + str + "</span>")
#define span_danger(str) ("<span class='danger'>" + str + "</span>")
#define span_deadsay(str) ("<span class='deadsay'>" + str + "</span>")
#define span_deconversion_message(str) ("<span class='deconversion_message'>" + str + "</span>")
#define span_drone(str) ("<span class='drone'>" + str + "</span>")
#define span_engradio(str) ("<span class='engradio'>" + str + "</span>")
#define span_extremelybig(str) ("<span class='extremelybig'>" + str + "</span>")
#define span_ghostalert(str) ("<span class='ghostalert'>" + str + "</span>")
#define span_green(str) ("<span class='green'>" + str + "</span>")
#define span_greenannounce(str) ("<span class='greenannounce'>" + str + "</span>")
#define span_greenteamradio(str) ("<span class='greenteamradio'>" + str + "</span>")
#define span_greentext(str) ("<span class='greentext'>" + str + "</span>")
#define span_hear(str) ("<span class='hear'>" + str + "</span>")
#define span_hidden(str) ("<span class='hidden'>" + str + "</span>")
#define span_hierophant(str) ("<span class='hierophant'>" + str + "</span>")
#define span_hierophant_warning(str) ("<span class='hierophant_warning'>" + str + "</span>")
#define span_highlight(str) ("<span class='highlight'>" + str + "</span>")
#define span_his_grace(str) ("<span class='his_grace'>" + str + "</span>")
#define span_holoparasite(str) ("<span class='holoparasite'>" + str + "</span>")
#define span_hypnophrase(str) ("<span class='hypnophrase'>" + str + "</span>")
#define span_icon(str) ("<span class='icon'>" + str + "</span>")
#define span_info(str) ("<span class='info'>" + str + "</span>")
#define span_interface(str) ("<span class='interface'>" + str + "</span>")
#define span_looc(str) ("<span class='looc'>" + str + "</span>")
#define span_medal(str) ("<span class='medal'>" + str + "</span>")
#define span_medradio(str) ("<span class='medradio'>" + str + "</span>")
#define span_memo(str) ("<span class='memo'>" + str + "</span>")
#define span_memoedit(str) ("<span class='memoedit'>" + str + "</span>")
#define span_mind_control(str) ("<span class='mind_control'>" + str + "</span>")
#define span_minorannounce(str) ("<span class='minorannounce'>" + str + "</span>")
#define span_monkey(str) ("<span class='monkey'>" + str + "</span>")
#define span_monkeyhive(str) ("<span class='monkeyhive'>" + str + "</span>")
#define span_monkeylead(str) ("<span class='monkeylead'>" + str + "</span>")
#define span_name(str) ("<span class='name'>" + str + "</span>")
#define span_narsie(str) ("<span class='narsie'>" + str + "</span>")
#define span_narsiesmall(str) ("<span class='narsiesmall'>" + str + "</span>")
#define span_nicegreen(str) ("<span class='nicegreen'>" + str + "</span>")
#define span_notice(str) ("<span class='notice'>" + str + "</span>")
#define span_noticealien(str) ("<span class='noticealien'>" + str + "</span>")
#define span_ooc(str) ("<span class='ooc'>" + str + "</span>")
#define span_papyrus(str) ("<span class='papyrus'>" + str + "</span>")
#define span_phobia(str) ("<span class='phobia'>" + str + "</span>")
#define span_prefix(str) ("<span class='prefix'>" + str + "</span>")
#define span_purple(str) ("<span class='purple'>" + str + "</span>")
#define span_radio(str) ("<span class='radio'>" + str + "</span>")
#define span_reallybig(str) ("<span class='reallybig'>" + str + "</span>")
#define span_red(str) ("<span class='red'>" + str + "</span>")
#define span_redteamradio(str) ("<span class='redteamradio'>" + str + "</span>")
#define span_redtext(str) ("<span class='redtext'>" + str + "</span>")
#define span_resonate(str) ("<span class='resonate'>" + str + "</span>")
#define span_revenbignotice(str) ("<span class='revenbignotice'>" + str + "</span>")
#define span_revenboldnotice(str) ("<span class='revenboldnotice'>" + str + "</span>")
#define span_revendanger(str) ("<span class='revendanger'>" + str + "</span>")
#define span_revenminor(str) ("<span class='revenminor'>" + str + "</span>")
#define span_revennotice(str) ("<span class='revennotice'>" + str + "</span>")
#define span_revenwarning(str) ("<span class='revenwarning'>" + str + "</span>")
#define span_robot(str) ("<span class='robot'>" + str + "</span>")
#define span_rose(str) ("<span class='rose'>" + str + "</span>")
#define span_sans(str) ("<span class='sans'>" + str + "</span>")
#define span_sciradio(str) ("<span class='sciradio'>" + str + "</span>")
#define span_secradio(str) ("<span class='secradio'>" + str + "</span>")
#define span_servradio(str) ("<span class='servradio'>" + str + "</span>")
#define span_singing(str) ("<span class='singing'>" + str + "</span>")
#define span_slime(str) ("<span class='slime'>" + str + "</span>")
#define span_small(str) ("<span class='small'>" + str + "</span>")
#define span_smallnotice(str) ("<span class='smallnotice'>" + str + "</span>")
#define span_smallnoticeital(str) ("<span class='smallnoticeital'>" + str + "</span>")
#define span_spider(str) ("<span class='spider'>" + str + "</span>")
#define span_suicide(str) ("<span class='suicide'>" + str + "</span>")
#define span_suppradio(str) ("<span class='suppradio'>" + str + "</span>")
#define span_swarmer(str) ("<span class='swarmer'>" + str + "</span>")
#define span_syndradio(str) ("<span class='syndradio'>" + str + "</span>")
#define span_tape_recorder(str) ("<span class='tape_recorder'>" + str + "</span>")
#define span_tinynotice(str) ("<span class='tinynotice'>" + str + "</span>")
#define span_tinynoticeital(str) ("<span class='tinynoticeital'>" + str + "</span>")
#define span_unconscious(str) ("<span class='unconscious'>" + str + "</span>")
#define span_userdanger(str) ("<span class='userdanger'>" + str + "</span>")
#define span_warning(str) ("<span class='warning'>" + str + "</span>")
#define span_yell(str) ("<span class='yell'>" + str + "</span>")
#define span_yellowteamradio(str) ("<span class='yellowteamradio'>" + str + "</span>")

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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, "<span class='notice'>You feel like you've gotten over your need for [R.name].</span>")
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)

View File

@@ -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, "<span class='notice'>[high_message]</span>")
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("<span class='danger'>[M]'s hands flip out and flail everywhere!</span>")
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)

View File

@@ -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

View File

@@ -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, "<span class='warning'>You feel a dull pain in your abdomen.</span>")

View File

@@ -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.

View File

@@ -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()

View File

@@ -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"