Standardises time-based reagent effects (#31757)

* Standardises time-based reagent effects

* Disambiguates a bit

Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
kane-f
2022-01-03 13:24:51 +00:00
committed by GitHub
parent 1cd91c17d8
commit a426e956cb
3 changed files with 56 additions and 126 deletions

View File

@@ -246,8 +246,6 @@
#define isrighelmet(O) (istype(O, /obj/item/clothing/head/helmet/space/rig)) #define isrighelmet(O) (istype(O, /obj/item/clothing/head/helmet/space/rig))
#define isNonTimeDataReagent(R) (is_type_in_list(R, list( /datum/reagent/citalopram, /datum/reagent/paroxetine)))
#define isinvisible(A) (A.invisibility || A.alpha <= 1) #define isinvisible(A) (A.invisibility || A.alpha <= 1)
#define format_examine(A,B) "<span class = 'info'><a HREF='?src=\ref[user];lookitem=\ref[A]'>[B].</a></span>" #define format_examine(A,B) "<span class = 'info'><a HREF='?src=\ref[user];lookitem=\ref[A]'>[B].</a></span>"

View File

@@ -541,7 +541,7 @@ Subject's pulse: ??? BPM"})
if(O.reagents.reagent_list.len) if(O.reagents.reagent_list.len)
for(var/datum/reagent/R in O.reagents.reagent_list) for(var/datum/reagent/R in O.reagents.reagent_list)
var/reagent_percent = (R.volume/O.reagents.total_volume)*100 var/reagent_percent = (R.volume/O.reagents.total_volume)*100
dat += "<br><span class='notice'>[R] [details ? "([R.volume] units, [reagent_percent]%[R.data && isnum(R.data) && !isNonTimeDataReagent(R) ? ", time in system: [R.data*2] seconds" : ""])" : ""]</span>" dat += "<br><span class='notice'>[R][details ? " ([R.volume] units, [reagent_percent]%, time in system: [R.real_tick*2] seconds" : ""]</span>"
if(dat) if(dat)
to_chat(user, "<span class='notice'>Chemicals found in \the [O]:[dat]</span>") to_chat(user, "<span class='notice'>Chemicals found in \the [O]:[dat]</span>")
else else

View File

@@ -31,7 +31,8 @@
var/custom_plant_metabolism = HYDRO_SPEED_MULTIPLIER var/custom_plant_metabolism = HYDRO_SPEED_MULTIPLIER
var/overdose_am = 0 var/overdose_am = 0
var/overdose_tick = 0 var/overdose_tick = 0
var/tick var/tick = 0
var/real_tick = 0 // For advanced reagent scanners
//var/list/viruses = list() //var/list/viruses = list()
var/color = "#000000" //rgb: 0, 0, 0 (does not support alpha channels - yet!) var/color = "#000000" //rgb: 0, 0, 0 (does not support alpha channels - yet!)
var/alpha = 255 var/alpha = 255
@@ -143,6 +144,7 @@
/datum/reagent/proc/metabolize(var/mob/living/M) /datum/reagent/proc/metabolize(var/mob/living/M)
tick++ tick++
real_tick++
if(ishuman(M)) if(ishuman(M))
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"] var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"]
@@ -1022,7 +1024,6 @@
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#E895CC" //rgb: 232, 149, 204 color = "#E895CC" //rgb: 232, 149, 204
custom_metabolism = 0.1 custom_metabolism = 0.1
data = 1 //Used as a tally
density = 3.56 density = 3.56
specheatcap = 17.15 specheatcap = 17.15
@@ -1031,7 +1032,7 @@
if(..()) if(..())
return 1 return 1
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.eye_blurry = max(M.eye_blurry, 10) M.eye_blurry = max(M.eye_blurry, 10)
if(15 to 25) if(15 to 25)
@@ -1039,7 +1040,6 @@
if(25 to INFINITY) if(25 to INFINITY)
M.Paralyse(20) M.Paralyse(20)
M.drowsyness = max(M.drowsyness, 30) M.drowsyness = max(M.drowsyness, 30)
data++
/datum/reagent/srejuvenate /datum/reagent/srejuvenate
name = "Soporific Rejuvenant" name = "Soporific Rejuvenant"
@@ -1049,7 +1049,6 @@
color = "#C8A5DC" //rgb: 200, 165, 220 color = "#C8A5DC" //rgb: 200, 165, 220
overdose_am = REAGENTS_OVERDOSE overdose_am = REAGENTS_OVERDOSE
custom_metabolism = 0.2 custom_metabolism = 0.2
data = 1 //Used as a tally
density = 1.564 density = 1.564
specheatcap = 1.725 specheatcap = 1.725
@@ -1060,7 +1059,7 @@
if(M.losebreath >= 10) if(M.losebreath >= 10)
M.losebreath = max(10, M.losebreath - 10) M.losebreath = max(10, M.losebreath - 10)
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.eye_blurry = max(M.eye_blurry, 10) M.eye_blurry = max(M.eye_blurry, 10)
if(15 to 25) if(15 to 25)
@@ -1077,7 +1076,6 @@
M.confused = 0 M.confused = 0
M.remove_jitter() M.remove_jitter()
M.hallucination = 0 M.hallucination = 0
data++
/datum/reagent/inaprovaline /datum/reagent/inaprovaline
name = "Inaprovaline" name = "Inaprovaline"
@@ -2385,7 +2383,7 @@
if(..()) if(..())
return 1 return 1
switch(data) switch(tick)
if(1 to 10) if(1 to 10)
M.adjustBruteLoss(3 * REM) //soft tissue damage M.adjustBruteLoss(3 * REM) //soft tissue damage
if(10 to INFINITY) if(10 to INFINITY)
@@ -2396,7 +2394,6 @@
H.drip(10) H.drip(10)
else if(prob(5)) else if(prob(5))
H.vomit() H.vomit()
data++
M.color = "" M.color = ""
if(ishuman(M)) if(ishuman(M))
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
@@ -3236,8 +3233,6 @@
var/has_had_heart_explode = 0 //We've applied permanent damage. var/has_had_heart_explode = 0 //We've applied permanent damage.
custom_metabolism = 0.04 custom_metabolism = 0.04
var/oldspeed = 0 var/oldspeed = 0
data = 0
/datum/reagent/hypozine/reagent_deleted() /datum/reagent/hypozine/reagent_deleted()
if(..()) if(..())
@@ -3251,7 +3246,7 @@
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
if(!has_been_hypozined) if(!has_been_hypozined)
return return
var/timedmg = ((data - 60) / 2) var/timedmg = ((tick - 60) / 2)
if (timedmg > 0) if (timedmg > 0)
dehypozine(H, timedmg, 1, 0) dehypozine(H, timedmg, 1, 0)
@@ -3262,20 +3257,20 @@
M.reagents.add_reagent ("hyperzine", 0.03) //To pretend it's all okay. M.reagents.add_reagent ("hyperzine", 0.03) //To pretend it's all okay.
if(ishuman(M)) if(ishuman(M))
if(data<121 && !has_been_hypozined) if(tick<121 && !has_been_hypozined)
has_been_hypozined = 1 has_been_hypozined = 1
has_had_heart_explode = 0 //Fuck them UP after they're done going fast. has_had_heart_explode = 0 //Fuck them UP after they're done going fast.
switch(data) switch(tick)
if(60 to 99) //Speed up after a minute if(60 to 99) //Speed up after a minute
if(data==60) if(tick==60)
to_chat(M, "<span class='notice'>You feel faster.") to_chat(M, "<span class='notice'>You feel faster.")
M.movement_speed_modifier += 0.5 M.movement_speed_modifier += 0.5
oldspeed += 0.5 oldspeed += 0.5
if(prob(5)) if(prob(5))
to_chat(M, "<span class='notice'>[pick("Your leg muscles pulsate", "You feel invigorated", "You feel like running")].") to_chat(M, "<span class='notice'>[pick("Your leg muscles pulsate", "You feel invigorated", "You feel like running")].")
if(100 to 114) //painfully fast if(100 to 114) //painfully fast
if(data==100) if(tick==100)
to_chat(M, "<span class='notice'>Your muscles start to feel pretty hot.") to_chat(M, "<span class='notice'>Your muscles start to feel pretty hot.")
M.movement_speed_modifier += 0.5 M.movement_speed_modifier += 0.5
oldspeed += 0.5 oldspeed += 0.5
@@ -3288,7 +3283,7 @@
to_chat(M, "<span class='notice'>[pick("Your legs are heating up", "Your body is aching to move", "You feel like running as far as you can")]!") to_chat(M, "<span class='notice'>[pick("Your legs are heating up", "Your body is aching to move", "You feel like running as far as you can")]!")
H.adjustFireLoss(0.1) H.adjustFireLoss(0.1)
if(115 to 120) //traverse at a velocity exceeding the norm if(115 to 120) //traverse at a velocity exceeding the norm
if(data==115) if(tick==115)
to_chat(M, "<span class='alert'>Your muscles are burning up!") to_chat(M, "<span class='alert'>Your muscles are burning up!")
M.movement_speed_modifier += 2 M.movement_speed_modifier += 2
oldspeed += 2 oldspeed += 2
@@ -3304,7 +3299,6 @@
H.adjustFireLoss(2) H.adjustFireLoss(2)
if(121 to INFINITY) //went2fast if(121 to INFINITY) //went2fast
dehypozine(M) dehypozine(M)
data++
/datum/reagent/hypozine/proc/dehypozine(var/mob/living/M, heartdamage = 30, override_remove = 0, explodeheart = 1) /datum/reagent/hypozine/proc/dehypozine(var/mob/living/M, heartdamage = 30, override_remove = 0, explodeheart = 1)
M.movement_speed_modifier -= oldspeed M.movement_speed_modifier -= oldspeed
@@ -3357,7 +3351,7 @@
H.adjustToxLoss(heartdamage) H.adjustToxLoss(heartdamage)
else else
M.gib() M.gib()
data = 0 tick = 0
oldspeed = 0 oldspeed = 0
/datum/reagent/cryoxadone /datum/reagent/cryoxadone
@@ -3429,7 +3423,6 @@
color = "#669900" //rgb: 102, 153, 0 color = "#669900" //rgb: 102, 153, 0
overdose_am = REAGENTS_OVERDOSE overdose_am = REAGENTS_OVERDOSE
overdose_tick = 35 overdose_tick = 35
data = 1 //Used as a tally
density = 109.81 density = 109.81
specheatcap = 13.59 specheatcap = 13.59
@@ -3438,7 +3431,7 @@
if(..()) if(..())
return 1 return 1
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.adjustCloneLoss(-1) M.adjustCloneLoss(-1)
M.heal_organ_damage(1, 1) M.heal_organ_damage(1, 1)
@@ -3455,8 +3448,6 @@
else if(!H.isUnconscious()) else if(!H.isUnconscious())
to_chat(H,"<span class='notice'>You feel your face shifting and repairing itself!</span>") to_chat(H,"<span class='notice'>You feel your face shifting and repairing itself!</span>")
data++
/datum/reagent/rezadone/on_overdose(var/mob/living/M) /datum/reagent/rezadone/on_overdose(var/mob/living/M)
M.adjustToxLoss(1) M.adjustToxLoss(1)
M.Dizzy(5) M.Dizzy(5)
@@ -3714,13 +3705,12 @@
if(..()) if(..())
return 1 return 1
if(data >= 165) if(tick >= 165)
M.adjustToxLoss(0.2) M.adjustToxLoss(0.2)
M.adjustBrainLoss(5) M.adjustBrainLoss(5)
M.hallucination += 100 M.hallucination += 100
M.dizziness += 100 M.dizziness += 100
M.confused += 2 M.confused += 2
data++
/datum/reagent/methylin /datum/reagent/methylin
name = "Methylin" name = "Methylin"
@@ -3967,7 +3957,6 @@
custom_metabolism = 0.01 custom_metabolism = 0.01
var/has_been_armstrong = 0 var/has_been_armstrong = 0
var/armstronged_at = 0 //world.time var/armstronged_at = 0 //world.time
data = 1 //Used as a tally
density = 134.21 density = 134.21
specheatcap = 5143.18 specheatcap = 5143.18
@@ -4020,9 +4009,6 @@
message_admins("[key_name(M)] took too many nanobots and gibbed!([formatJumpTo(M)])") message_admins("[key_name(M)] took too many nanobots and gibbed!([formatJumpTo(M)])")
data++
/datum/reagent/comnanobots/proc/dehulk(var/mob/living/carbon/human/H, damage = 0, override_remove = 1, gib = 0) /datum/reagent/comnanobots/proc/dehulk(var/mob/living/carbon/human/H, damage = 0, override_remove = 1, gib = 0)
H.hulk_time = 0 //Just to be sure. H.hulk_time = 0 //Just to be sure.
@@ -4167,14 +4153,6 @@
description = "A powerful sedative." description = "A powerful sedative."
reagent_state = REAGENT_STATE_SOLID reagent_state = REAGENT_STATE_SOLID
color = "#000067" //rgb: 0, 0, 103 color = "#000067" //rgb: 0, 0, 103
// There used to be a bug: if someone was injected with chloral once,
// and then injected with chloral a second time, this person would
// briefly wake up. proc/add_reagent, called by proc/trans_to, sets the
// data var of the destination reagent to the one of the source reagent
// if the new data was not null. Since this var was set to 1, it ended up
// resetting the data var of the existing chloralhydrate in the spessman's
// body, waking them up until the following tick.
data = null //Used as a tally
flags = CHEMFLAG_DISHONORABLE // NO CHEATING flags = CHEMFLAG_DISHONORABLE // NO CHEATING
density = 11.43 density = 11.43
specheatcap = 13.79 specheatcap = 13.79
@@ -4182,12 +4160,7 @@
/datum/reagent/chloralhydrate/on_mob_life(var/mob/living/M) /datum/reagent/chloralhydrate/on_mob_life(var/mob/living/M)
if(..()) if(..())
return 1 return 1
if(isnull(data)) switch(tick)
// This is technically not needed: the switch could check for
// null instead of 0 and "data++" would automatically convert a null
// to a 0, then increase it to 1. It would work. But this is clearer.
data = 0
switch(data)
if(0) if(0)
M.confused += 2 M.confused += 2
M.drowsyness += 2 M.drowsyness += 2
@@ -4195,8 +4168,7 @@
M.sleeping++ M.sleeping++
if(80 to INFINITY) if(80 to INFINITY)
M.sleeping++ M.sleeping++
M.toxloss += (data - 50) M.toxloss += (tick - 50)
data++
//Chloral hydrate disguised as normal beer for use by emagged brobots //Chloral hydrate disguised as normal beer for use by emagged brobots
/datum/reagent/chloralhydrate/beer2 /datum/reagent/chloralhydrate/beer2
@@ -4214,7 +4186,6 @@
description = "A name for Suxamethonium chloride. A medical full-body paralytic preferred because it is easy to purge." description = "A name for Suxamethonium chloride. A medical full-body paralytic preferred because it is easy to purge."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#CFC5E9" //rgb: 207, 197, 223 color = "#CFC5E9" //rgb: 207, 197, 223
data = null
flags = CHEMFLAG_DISHONORABLE flags = CHEMFLAG_DISHONORABLE
overdose_am = 21 overdose_am = 21
custom_metabolism = 1 custom_metabolism = 1
@@ -4222,13 +4193,9 @@
/datum/reagent/suxameth/on_mob_life(var/mob/living/M) /datum/reagent/suxameth/on_mob_life(var/mob/living/M)
if(..()) if(..())
return 1 return 1
if(isnull(data)) if(tick >= 2)
// copied from chloral for the same reasons
data = 0
if(data >= 2)
M.SetStunned(2) M.SetStunned(2)
M.SetKnockdown(2) M.SetKnockdown(2)
data++
/datum/reagent/suxameth/on_overdose(var/mob/living/M) /datum/reagent/suxameth/on_overdose(var/mob/living/M)
M.adjustOxyLoss(6) //Paralyzes the diaphragm if they go over 20 units M.adjustOxyLoss(6) //Paralyzes the diaphragm if they go over 20 units
@@ -4542,7 +4509,6 @@
description = "This is what makes chilis hot." description = "This is what makes chilis hot."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#B31008" //rgb: 179, 16, 8 color = "#B31008" //rgb: 179, 16, 8
data = 1 //Used as a tally
custom_metabolism = FOOD_METABOLISM custom_metabolism = FOOD_METABOLISM
density = 0.53 density = 0.53
specheatcap = 3.49 specheatcap = 3.49
@@ -4567,7 +4533,7 @@
var/mob/living/carbon/human/H var/mob/living/carbon/human/H
if(ishuman(M)) if(ishuman(M))
H = M H = M
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.bodytemperature += 0.6 * TEMPERATURE_DAMAGE_COEFFICIENT M.bodytemperature += 0.6 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("frostoil")) if(holder.has_reagent("frostoil"))
@@ -4588,7 +4554,6 @@
M.bodytemperature += rand(15,20) M.bodytemperature += rand(15,20)
if(isslimeperson(H)) if(isslimeperson(H))
M.bodytemperature += rand(15,20) M.bodytemperature += rand(15,20)
data++
/datum/reagent/condensedcapsaicin /datum/reagent/condensedcapsaicin
name = "Condensed Capsaicin" name = "Condensed Capsaicin"
@@ -4598,7 +4563,6 @@
color = "#B31008" //rgb: 179, 16, 8 color = "#B31008" //rgb: 179, 16, 8
density = 0.9 density = 0.9
specheatcap = 8.59 specheatcap = 8.59
data = 1
/datum/reagent/condensedcapsaicin/reaction_mob(var/mob/living/M, var/method = TOUCH, var/volume) /datum/reagent/condensedcapsaicin/reaction_mob(var/mob/living/M, var/method = TOUCH, var/volume)
@@ -4656,7 +4620,7 @@
var/mob/living/carbon/human/H var/mob/living/carbon/human/H
if(ishuman(M)) if(ishuman(M))
H = M H = M
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.bodytemperature += 0.9 * TEMPERATURE_DAMAGE_COEFFICIENT M.bodytemperature += 0.9 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("frostoil")) if(holder.has_reagent("frostoil"))
@@ -4676,7 +4640,6 @@
if(30 to 45)//Reagent dies out at about 50. Set up the vomiting to "fade out". if(30 to 45)//Reagent dies out at about 50. Set up the vomiting to "fade out".
if(prob(9)) if(prob(9))
H.vomit() H.vomit()
data++
/datum/reagent/blackcolor /datum/reagent/blackcolor
@@ -4693,7 +4656,6 @@
description = "A special oil that noticably chills the body. Extraced from Icepeppers." description = "A special oil that noticably chills the body. Extraced from Icepeppers."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#8BA6E9" //rgb: 139, 166, 233 color = "#8BA6E9" //rgb: 139, 166, 233
data = 1 //Used as a tally
custom_metabolism = FOOD_METABOLISM custom_metabolism = FOOD_METABOLISM
/datum/reagent/frostoil/on_mob_life(var/mob/living/M) /datum/reagent/frostoil/on_mob_life(var/mob/living/M)
@@ -4704,7 +4666,7 @@
var/mob/living/carbon/human/H var/mob/living/carbon/human/H
if(ishuman(M)) if(ishuman(M))
H = M H = M
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.bodytemperature = max(M.bodytemperature-0.3 * TEMPERATURE_DAMAGE_COEFFICIENT,T20C) M.bodytemperature = max(M.bodytemperature-0.3 * TEMPERATURE_DAMAGE_COEFFICIENT,T20C)
if(holder.has_reagent("capsaicin")) if(holder.has_reagent("capsaicin"))
@@ -4727,7 +4689,6 @@
M.bodytemperature -= rand(15,20) M.bodytemperature -= rand(15,20)
if(isslimeperson(H)) if(isslimeperson(H))
M.bodytemperature -= rand(15,20) M.bodytemperature -= rand(15,20)
data++
/datum/reagent/frostoil/reaction_turf(var/turf/simulated/T, var/volume) /datum/reagent/frostoil/reaction_turf(var/turf/simulated/T, var/volume)
@@ -4788,7 +4749,6 @@
var/has_ripped_and_torn = 0 //We've applied permanent damage. var/has_ripped_and_torn = 0 //We've applied permanent damage.
var/hulked_at = 0 //world.time var/hulked_at = 0 //world.time
custom_metabolism = 0.1 custom_metabolism = 0.1
data = 1 //Used as a tally
density = 6.82 density = 6.82
specheatcap = 678.67 specheatcap = 678.67
@@ -4839,8 +4799,6 @@
else if(prob(1)) else if(prob(1))
H.say(pick("YOU TRYIN' BUILD SUM MUSSLE?", "TOO SWOLE TO CONTROL", "HEY MANG", "HEY MAAAANG")) H.say(pick("YOU TRYIN' BUILD SUM MUSSLE?", "TOO SWOLE TO CONTROL", "HEY MANG", "HEY MAAAANG"))
data++
/datum/reagent/creatine/proc/dehulk(var/mob/living/carbon/human/H, damage = 200, override_remove = 0, gib = 1) /datum/reagent/creatine/proc/dehulk(var/mob/living/carbon/human/H, damage = 200, override_remove = 0, gib = 1)
if(has_been_hulk && !has_ripped_and_torn) if(has_been_hulk && !has_ripped_and_torn)
@@ -4874,7 +4832,6 @@
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#6AAA96" //rgb: 106, 170, 150 color = "#6AAA96" //rgb: 106, 170, 150
custom_metabolism = 0.05 custom_metabolism = 0.05
data = 0 //Used as a tally
density = 109.06 density = 109.06
specheatcap = ARBITRARILY_LARGE_NUMBER //Contains leporazine, better this than 6 digits specheatcap = ARBITRARILY_LARGE_NUMBER //Contains leporazine, better this than 6 digits
@@ -4883,18 +4840,16 @@
if(..()) if(..())
return 1 return 1
if(!data) if(!tick)
to_chat(M,"<span class='good'><b>You feel more carplike! [pick("Do you, perhaps...?","Maybe... just maybe...")]</b></span>") to_chat(M,"<span class='good'><b>You feel more carplike! [pick("Do you, perhaps...?","Maybe... just maybe...")]</b></span>")
if(volume < 3) if(volume < 3)
if(volume <= custom_metabolism) if(volume <= custom_metabolism)
to_chat(M,"<span class='danger'>You feel not at all carplike!</span>") to_chat(M,"<span class='danger'>You feel not at all carplike!</span>")
else if(!(data%4)) else if(!(tick%4))
to_chat(M,"<span class='warning'>You feel less carplike...</span>") to_chat(M,"<span class='warning'>You feel less carplike...</span>")
data++ var/stench_radius = clamp(tick * 0.1, 1, 6) //Stench starts out with 1 tile radius and grows after every 10 life ticks
var/stench_radius = clamp(data * 0.1, 1, 6) //Stench starts out with 1 tile radius and grows after every 10 life ticks
if(prob(5)) //5% chance of stinking per life() if(prob(5)) //5% chance of stinking per life()
for(var/mob/living/carbon/C in oview(stench_radius, M)) //All other carbons in 4 tile radius (excluding our mob) for(var/mob/living/carbon/C in oview(stench_radius, M)) //All other carbons in 4 tile radius (excluding our mob)
@@ -4968,7 +4923,6 @@
/datum/reagent/drink/hot_coco/subhuman /datum/reagent/drink/hot_coco/subhuman
id = HOT_COCO_SUBHUMAN id = HOT_COCO_SUBHUMAN
description = "Made with hate! And coco beans." description = "Made with hate! And coco beans."
data = 0
/datum/reagent/drink/hot_coco/subhuman/on_mob_life(var/mob/living/M) /datum/reagent/drink/hot_coco/subhuman/on_mob_life(var/mob/living/M)
..() ..()
@@ -5008,7 +4962,6 @@
description = "A deadly poison derived from certain species of Amanita. Sits in the victim's system for a long period of time, then ravages the body." description = "A deadly poison derived from certain species of Amanita. Sits in the victim's system for a long period of time, then ravages the body."
color = "#792300" //rgb: 121, 35, 0 color = "#792300" //rgb: 121, 35, 0
custom_metabolism = 0.01 custom_metabolism = 0.01
data = 1 //Used as a tally
var/activated = 0 var/activated = 0
/datum/reagent/amanatin/on_mob_life(var/mob/living/M) /datum/reagent/amanatin/on_mob_life(var/mob/living/M)
@@ -5016,23 +4969,23 @@
if(..()) if(..())
return 1 return 1
if(volume <= 3 && data >= 60 && !activated) //Minimum of 1 minute required to be useful if(volume <= 3 && tick >= 60 && !activated) //Minimum of 1 minute required to be useful
activated = 1 activated = 1
if(activated) if(activated)
if(ishuman(M)) if(ishuman(M))
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
if(prob(8)) if(prob(8))
H << "<span class='warning'>You feel violently ill.</span>" H << "<span class='warning'>You feel violently ill.</span>"
if(prob(min(data / 10, 100))) if(prob(min(tick / 10, 100)))
H.vomit() H.vomit()
var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"] var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"]
if(istype(L) && !L.is_broken()) if(istype(L) && !L.is_broken())
L.take_damage(data * 0.01, 0) L.take_damage(tick * 0.01, 0)
H.adjustToxLoss(round(data / 20, 1)) H.adjustToxLoss(round(tick / 20, 1))
else else
H.adjustToxLoss(round(data / 10, 1)) H.adjustToxLoss(round(tick / 10, 1))
data += 4 tick += 4
switch(data) switch(tick)
if(1 to 30) if(1 to 30)
M.druggy = max(M.druggy, 10) M.druggy = max(M.druggy, 10)
if(540 to 600) //Start barfing violently after 9 minutes if(540 to 600) //Start barfing violently after 9 minutes
@@ -5053,14 +5006,12 @@
L.take_damage(10, 0) L.take_damage(10, 0)
else else
H.adjustToxLoss(60) H.adjustToxLoss(60)
data++
/datum/reagent/psilocybin /datum/reagent/psilocybin
name = "Psilocybin" name = "Psilocybin"
id = PSILOCYBIN id = PSILOCYBIN
description = "A strong psycotropic derived from certain species of mushroom." description = "A strong psycotropic derived from certain species of mushroom."
color = "#E700E7" //rgb: 231, 0, 231 color = "#E700E7" //rgb: 231, 0, 231
data = 1 //Used as a tally
/datum/reagent/psilocybin/on_mob_life(var/mob/living/M) /datum/reagent/psilocybin/on_mob_life(var/mob/living/M)
@@ -5068,7 +5019,7 @@
return 1 return 1
M.druggy = max(M.druggy, 30) M.druggy = max(M.druggy, 30)
switch(data) switch(tick)
if(1 to 5) if(1 to 5)
if(!M.stuttering) if(!M.stuttering)
M.stuttering = 1 M.stuttering = 1
@@ -5091,7 +5042,6 @@
M.druggy = max(M.druggy, 40) M.druggy = max(M.druggy, 40)
if(prob(30)) if(prob(30))
M.emote(pick("twitch", "giggle")) M.emote(pick("twitch", "giggle"))
data++
/datum/reagent/sprinkles /datum/reagent/sprinkles
name = "Sprinkles" name = "Sprinkles"
@@ -5343,7 +5293,6 @@
description = "You can almost feel your liver failing, just by looking at it." description = "You can almost feel your liver failing, just by looking at it."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#6F884F" //rgb: 111, 136, 79 color = "#6F884F" //rgb: 111, 136, 79
data = 1 //Used as a tally
nutriment_factor = 4 * REAGENTS_METABOLISM nutriment_factor = 4 * REAGENTS_METABOLISM
/datum/reagent/discount/New() /datum/reagent/discount/New()
@@ -5716,7 +5665,6 @@
description = "It's like a carrot, but less crunchy." description = "It's like a carrot, but less crunchy."
color = "#FF8820" //rgb: 255, 136, 32 color = "#FF8820" //rgb: 255, 136, 32
nutriment_factor = 5 * REAGENTS_METABOLISM nutriment_factor = 5 * REAGENTS_METABOLISM
data = 1 //Used as a tally
glass_desc = "It's like a carrot, but less crunchy." glass_desc = "It's like a carrot, but less crunchy."
/datum/reagent/drink/carrotjuice/on_mob_life(var/mob/living/M) /datum/reagent/drink/carrotjuice/on_mob_life(var/mob/living/M)
@@ -5726,11 +5674,10 @@
M.eye_blurry = max(M.eye_blurry - 1 , 0) M.eye_blurry = max(M.eye_blurry - 1 , 0)
M.eye_blind = max(M.eye_blind - 1 , 0) M.eye_blind = max(M.eye_blind - 1 , 0)
switch(data) switch(tick)
if(21 to INFINITY) if(21 to INFINITY)
if(prob(data - 10)) if(prob(tick - 10))
M.disabilities &= ~NEARSIGHTED M.disabilities &= ~NEARSIGHTED
data++
/datum/reagent/drink/grapejuice /datum/reagent/drink/grapejuice
name = "Grape Juice" name = "Grape Juice"
@@ -6187,7 +6134,6 @@
color = "#AEE5E4" //rgb" 174, 229, 228 color = "#AEE5E4" //rgb" 174, 229, 228
adj_temp = -9 adj_temp = -9
custom_metabolism = FOOD_METABOLISM custom_metabolism = FOOD_METABOLISM
data = 1 //Used as a tally
glass_icon_state = "milkshake" glass_icon_state = "milkshake"
glass_desc = "Brings all the boys to the yard." glass_desc = "Brings all the boys to the yard."
@@ -6199,7 +6145,7 @@
var/mob/living/carbon/human/H var/mob/living/carbon/human/H
if(ishuman(M)) if(ishuman(M))
H = M H = M
switch(data) switch(tick)
if(1 to 15) if(1 to 15)
M.bodytemperature -= 0.1 * TEMPERATURE_DAMAGE_COEFFICIENT M.bodytemperature -= 0.1 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("capsaicin")) if(holder.has_reagent("capsaicin"))
@@ -6222,7 +6168,6 @@
M.bodytemperature -= rand(15,20) M.bodytemperature -= rand(15,20)
if(isslimeperson(H)) if(isslimeperson(H))
M.bodytemperature -= rand(15,20) M.bodytemperature -= rand(15,20)
data++
/datum/reagent/drink/cold/rewriter /datum/reagent/drink/cold/rewriter
name = "Rewriter" name = "Rewriter"
@@ -6260,7 +6205,6 @@
description = "You just don't get it, maaaan." description = "You just don't get it, maaaan."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#664300" //rgb: 102, 67, 0 color = "#664300" //rgb: 102, 67, 0
data = 1 //Used as a tally
glass_icon_state = "hippiesdelightglass" glass_icon_state = "hippiesdelightglass"
glass_name = "\improper Hippie's Delight" glass_name = "\improper Hippie's Delight"
glass_desc = "A drink popular in the 1960s." glass_desc = "A drink popular in the 1960s."
@@ -6271,7 +6215,7 @@
return 1 return 1
M.druggy = max(M.druggy, 50) M.druggy = max(M.druggy, 50)
switch(data) switch(tick)
if(1 to 5) if(1 to 5)
if(!M.stuttering) if(!M.stuttering)
M.stuttering = 1 M.stuttering = 1
@@ -6294,7 +6238,6 @@
M.druggy = max(M.druggy, 60) M.druggy = max(M.druggy, 60)
if(prob(30)) if(prob(30))
M.emote(pick("twitch", "giggle")) M.emote(pick("twitch", "giggle"))
data++
//ALCOHOL WOO //ALCOHOL WOO
/datum/reagent/ethanol /datum/reagent/ethanol
@@ -6314,7 +6257,7 @@
var/confused_start = 130 //Amount absorbed after which mob starts confusing directions var/confused_start = 130 //Amount absorbed after which mob starts confusing directions
var/blur_start = 260 //Amount absorbed after which mob starts getting blurred vision var/blur_start = 260 //Amount absorbed after which mob starts getting blurred vision
var/pass_out = 450 //Amount absorbed after which mob starts passing out var/pass_out = 450 //Amount absorbed after which mob starts passing out
var/common_data = 1 //Needed to add all ethanol subtype's datas var/common_tick = 1 //Needed to add all ethanol subtype's ticks
/datum/reagent/ethanol/on_mob_life(var/mob/living/M) /datum/reagent/ethanol/on_mob_life(var/mob/living/M)
@@ -6326,31 +6269,30 @@
var/sober_str =! (M_SOBER in M.mutations) ? 1 : 2 var/sober_str =! (M_SOBER in M.mutations) ? 1 : 2
M.nutrition += REM*nutriment_factor M.nutrition += REM*nutriment_factor
data++
data /= sober_str tick /= sober_str
//Make all the ethanol-based beverages work together //Make all the ethanol-based beverages work together
common_data = 0 common_tick = 0
if(holder.reagent_list) //Sanity if(holder.reagent_list) //Sanity
for(var/datum/reagent/ethanol/A in holder.reagent_list) for(var/datum/reagent/ethanol/A in holder.reagent_list)
if(isnum(A.data)) if(isnum(A.tick))
common_data += A.data common_tick += A.tick
M.dizziness += dizzy_adj M.dizziness += dizzy_adj
if(common_data >= slur_start && data < pass_out) if(common_tick >= slur_start && tick < pass_out)
if(!M.slurring) if(!M.slurring)
M.slurring = 1 M.slurring = 1
M.slurring += slurr_adj/sober_str M.slurring += slurr_adj/sober_str
if(common_data >= confused_start && prob(33)) if(common_tick >= confused_start && prob(33))
if(!M.confused) if(!M.confused)
M.confused = 1 M.confused = 1
M.confused = max(M.confused+(confused_adj/sober_str), 0) M.confused = max(M.confused+(confused_adj/sober_str), 0)
if(common_data >= blur_start) if(common_tick >= blur_start)
M.eye_blurry = max(M.eye_blurry, 10/sober_str) M.eye_blurry = max(M.eye_blurry, 10/sober_str)
M.drowsyness = max(M.drowsyness, 0) M.drowsyness = max(M.drowsyness, 0)
if(common_data >= pass_out) if(common_tick >= pass_out)
M.paralysis = max(M.paralysis, 20/sober_str) M.paralysis = max(M.paralysis, 20/sober_str)
M.drowsyness = max(M.drowsyness, 30/sober_str) M.drowsyness = max(M.drowsyness, 30/sober_str)
if(ishuman(M)) if(ishuman(M))
@@ -6448,7 +6390,6 @@
if(..()) if(..())
return 1 return 1
data++
M.hallucination += 5 M.hallucination += 5
/datum/reagent/ethanol/bwine /datum/reagent/ethanol/bwine
@@ -6497,7 +6438,7 @@
if(..()) if(..())
return 1 return 1
M.druggy = max(M.druggy, 50) M.druggy = max(M.druggy, 50)
switch(data) switch(tick)
if(1 to 25) if(1 to 25)
if(!M.stuttering) if(!M.stuttering)
M.stuttering = 1 M.stuttering = 1
@@ -6548,7 +6489,6 @@
var/datum/organ/internal/heart/L = H.internal_organs_by_name["heart"] var/datum/organ/internal/heart/L = H.internal_organs_by_name["heart"]
if(L && istype(L)) if(L && istype(L))
L.take_damage(100, 0) L.take_damage(100, 0)
data++
/datum/reagent/ethanol/karmotrine /datum/reagent/ethanol/karmotrine
name = "Karmotrine" name = "Karmotrine"
@@ -6891,7 +6831,6 @@
custom_metabolism = 1 // A bit faster to prevent easy singuloosing custom_metabolism = 1 // A bit faster to prevent easy singuloosing
dizzy_adj = 15 dizzy_adj = 15
slurr_adj = 15 slurr_adj = 15
data = 1 //Used as a tally
glass_icon_state = "gravsingulo" glass_icon_state = "gravsingulo"
glass_name = "\improper Gravitational Singulo" glass_name = "\improper Gravitational Singulo"
glass_desc = "The destructive, murderous Lord Singuloth, patron saint of Bargineering, now in grape flavor!" glass_desc = "The destructive, murderous Lord Singuloth, patron saint of Bargineering, now in grape flavor!"
@@ -6900,7 +6839,7 @@
if(..()) if(..())
return 1 return 1
switch(data) switch(tick)
if(0 to 65) if(0 to 65)
if(prob(5)) if(prob(5))
to_chat(M,"<span class='notice'>You feel [pick("dense", "heavy", "attractive")].</span>") to_chat(M,"<span class='notice'>You feel [pick("dense", "heavy", "attractive")].</span>")
@@ -6922,18 +6861,16 @@
new /obj/item/toy/spinningtoy(T) new /obj/item/toy/spinningtoy(T)
M.gib() M.gib()
//Will pull items in a range based on time in system //Will pull items in a range based on time in system
for(var/atom/X in orange((data+30)/50, M)) for(var/atom/X in orange((tick+30)/50, M))
if(X.type == /atom/movable/lighting_overlay)//since there's one on every turf if(X.type == /atom/movable/lighting_overlay)//since there's one on every turf
continue continue
X.singularity_pull(M, data/50, data/50) X.singularity_pull(M, tick/50, tick/50)
data++
/datum/reagent/drink/tea/gravsingularitea /datum/reagent/drink/tea/gravsingularitea
name = "Gravitational Singularitea" name = "Gravitational Singularitea"
id = GRAVSINGULARITEA id = GRAVSINGULARITEA
description = "Spirally!" description = "Spirally!"
custom_metabolism = 1 // A bit faster to prevent easy singuloosing custom_metabolism = 1 // A bit faster to prevent easy singuloosing
data = 1 //Used as a tally
mug_icon_state = "gravsingularitea" mug_icon_state = "gravsingularitea"
mug_name = "\improper Gravitational Singularitea" mug_name = "\improper Gravitational Singularitea"
mug_desc = "The destructive, murderous Lord Singuloth, patron saint of Bargineering, now in herbal flavour!" mug_desc = "The destructive, murderous Lord Singuloth, patron saint of Bargineering, now in herbal flavour!"
@@ -6942,7 +6879,7 @@
if(..()) if(..())
return 1 return 1
switch(data) switch(tick)
if(0 to 65) if(0 to 65)
if(prob(5)) if(prob(5))
to_chat(M,"<span class='notice'>You feel [pick("dense", "heavy", "attractive")].</span>") to_chat(M,"<span class='notice'>You feel [pick("dense", "heavy", "attractive")].</span>")
@@ -6964,11 +6901,10 @@
new /obj/item/toy/spinningtoy(T) new /obj/item/toy/spinningtoy(T)
M.gib() M.gib()
//Will pull items in a range based on time in system //Will pull items in a range based on time in system
for(var/atom/X in orange((data+30)/50, M)) for(var/atom/X in orange((tick+30)/50, M))
if(X.type == /atom/movable/lighting_overlay)//since there's one on every turf if(X.type == /atom/movable/lighting_overlay)//since there's one on every turf
continue continue
X.singularity_pull(M, data/50, data/50) X.singularity_pull(M, tick/50, tick/50)
data++
/datum/reagent/ethanol/drink /datum/reagent/ethanol/drink
id = EXPLICITLY_INVALID_REAGENT_ID id = EXPLICITLY_INVALID_REAGENT_ID
@@ -8071,7 +8007,6 @@
description = "Only for the experienced. You think you see sand floating in the glass." description = "Only for the experienced. You think you see sand floating in the glass."
nutriment_factor = FOOD_METABOLISM nutriment_factor = FOOD_METABOLISM
color = "#2E6671" //rgb: 46, 102, 113 color = "#2E6671" //rgb: 46, 102, 113
data = 1 //Used as a tally
glass_icon_state = "driestmartiniglass" glass_icon_state = "driestmartiniglass"
glass_name = "\improper Driest Martini" glass_name = "\improper Driest Martini"
@@ -8081,11 +8016,10 @@
return 1 return 1
M.dizziness += 10 M.dizziness += 10
if(data >= 55 && data < 115) if(tick >= 55 && tick < 115)
M.stuttering += 10 M.stuttering += 10
else if(data >= 115 && prob(33)) else if(tick >= 115 && prob(33))
M.confused = max(M.confused + 15, 15) M.confused = max(M.confused + 15, 15)
data++
/datum/reagent/ethanol/drink/danswhiskey /datum/reagent/ethanol/drink/danswhiskey
name = "Discount Dan's 'Malt' Whiskey" name = "Discount Dan's 'Malt' Whiskey"
@@ -9010,7 +8944,6 @@ var/global/list/tonio_doesnt_remove=list("tonio", "blood")
description = "Anthracene is a fluorophore which emits a weak green glow." description = "Anthracene is a fluorophore which emits a weak green glow."
reagent_state = REAGENT_STATE_LIQUID reagent_state = REAGENT_STATE_LIQUID
color = "#00ff00" //rgb: 0, 255, 0 color = "#00ff00" //rgb: 0, 255, 0
data = 0
var/light_intensity = 4 var/light_intensity = 4
var/initial_color = null var/initial_color = null
density = 3.46 density = 3.46
@@ -9020,11 +8953,10 @@ var/global/list/tonio_doesnt_remove=list("tonio", "blood")
if(..()) if(..())
return 1 return 1
if(!data) if(!tick)
initial_color = M.light_color initial_color = M.light_color
M.light_color = LIGHT_COLOR_GREEN M.light_color = LIGHT_COLOR_GREEN
M.set_light(light_intensity) M.set_light(light_intensity)
data++
/datum/reagent/anthracene/reagent_deleted() /datum/reagent/anthracene/reagent_deleted()
if(..()) if(..())