Merge remote-tracking branch 'upstream/master' into cig-tweaks

This commit is contained in:
Fox McCloud
2020-03-08 22:35:49 -04:00
87 changed files with 615 additions and 427 deletions
+25 -11
View File
@@ -11,6 +11,7 @@ var/const/INGEST = 2
var/atom/my_atom = null
var/chem_temp = T20C
var/list/datum/reagent/addiction_list = new/list()
var/list/addiction_threshold_accumulated = new/list()
var/flags
var/list/reagents_generated_per_cycle = new/list()
@@ -233,6 +234,15 @@ var/const/INGEST = 2
if(M)
temperature_reagents(M.bodytemperature - 30)
if(LAZYLEN(addiction_threshold_accumulated))
for(var/thing in addiction_threshold_accumulated)
if(has_reagent(thing))
continue // if we have the reagent in our system, then don't deplete the addiction threshold
addiction_threshold_accumulated[thing] -= 0.01 // Otherwise very slowly deplete the buildup
if(addiction_threshold_accumulated[thing] <= 0)
addiction_threshold_accumulated -= thing
// a bitfield filled in by each reagent's `on_mob_life` to find out which states to update
var/update_flags = STATUS_UPDATE_NONE
for(var/A in reagent_list)
@@ -291,17 +301,21 @@ var/const/INGEST = 2
if(R.addiction_stage < 5)
if(prob(5))
R.addiction_stage++
switch(R.addiction_stage)
if(1)
update_flags |= R.addiction_act_stage1(M)
if(2)
update_flags |= R.addiction_act_stage2(M)
if(3)
update_flags |= R.addiction_act_stage3(M)
if(4)
update_flags |= R.addiction_act_stage4(M)
if(5)
update_flags |= R.addiction_act_stage5(M)
if(M.reagents.has_reagent(R.id))
R.last_addiction_dose = world.timeofday
R.addiction_stage = 1
else
switch(R.addiction_stage)
if(1)
update_flags |= R.addiction_act_stage1(M)
if(2)
update_flags |= R.addiction_act_stage2(M)
if(3)
update_flags |= R.addiction_act_stage3(M)
if(4)
update_flags |= R.addiction_act_stage4(M)
if(5)
update_flags |= R.addiction_act_stage5(M)
if(prob(20) && (world.timeofday > (R.last_addiction_dose + ADDICTION_TIME))) //Each addiction lasts 8 minutes before it can end
to_chat(M, "<span class='notice'>You no longer feel reliant on [R.name]!</span>")
addiction_list.Remove(R)
+39 -15
View File
@@ -20,6 +20,9 @@
var/can_synth = TRUE //whether or not a mech syringe gun and synthesize this reagent
var/overdose_threshold = 0
var/addiction_chance = 0
var/addiction_chance_additional = 100 // If we want to lower the chance of addiction even more, set this
var/addiction_threshold = 0 // How much of a chem do we have to absorb before we can start rolling for its ill effects?
var/minor_addiction = FALSE
var/addiction_stage = 1
var/last_addiction_dose = 0
var/overdosed = FALSE // You fucked up and this is now triggering it's overdose effects, purge that shit quick.
@@ -53,12 +56,7 @@
var/can_become_addicted = M.reagents.reaction_check(M, src)
if(can_become_addicted)
if(prob(addiction_chance) && !is_type_in_list(src, M.reagents.addiction_list))
to_chat(M, "<span class='danger'>You suddenly feel invigorated and guilty...</span>")
var/datum/reagent/new_reagent = new type()
new_reagent.last_addiction_dose = world.timeofday
M.reagents.addiction_list.Add(new_reagent)
else if(is_type_in_list(src, M.reagents.addiction_list))
if(is_type_in_list(src, M.reagents.addiction_list))
to_chat(M, "<span class='notice'>You feel slightly better, but for how long?</span>")
for(var/A in M.reagents.addiction_list)
var/datum/reagent/AD = A
@@ -75,9 +73,24 @@
/datum/reagent/proc/on_mob_life(mob/living/M)
current_cycle++
holder.remove_reagent(id, metabolization_rate * M.metabolism_efficiency * M.digestion_ratio) //By default it slowly disappears.
var/total_depletion_rate = metabolization_rate * M.metabolism_efficiency * M.digestion_ratio // Cache it
handle_addiction(M, total_depletion_rate)
holder.remove_reagent(id, total_depletion_rate) //By default it slowly disappears.
return STATUS_UPDATE_NONE
/datum/reagent/proc/handle_addiction(mob/living/M, consumption_rate)
if(addiction_chance && !is_type_in_list(src, M.reagents.addiction_list))
M.reagents.addiction_threshold_accumulated[id] += consumption_rate
var/current_threshold_accumulated = M.reagents.addiction_threshold_accumulated[id]
if(addiction_threshold < current_threshold_accumulated && prob(addiction_chance) && prob(addiction_chance_additional))
to_chat(M, "<span class='danger'>You suddenly feel invigorated and guilty...</span>")
var/datum/reagent/new_reagent = new type()
new_reagent.last_addiction_dose = world.timeofday
M.reagents.addiction_list.Add(new_reagent)
/datum/reagent/proc/on_mob_death(mob/living/M) //use this to have chems have a "death-triggered" effect
return
@@ -139,6 +152,8 @@
M.emote("twitch_s")
if(prob(8))
M.emote("shiver")
if(prob(4))
to_chat(M, "<span class='warning'>Your head hurts.</span>")
if(prob(4))
to_chat(M, "<span class='warning'>You begin craving [name]!</span>")
return STATUS_UPDATE_NONE
@@ -147,23 +162,32 @@
if(prob(8))
M.emote("twitch")
if(prob(4))
to_chat(M, "<span class='warning'>You have the strong urge for some [name]!</span>")
to_chat(M, "<span class='warning'>You have a pounding headache.</span>")
if(prob(4))
to_chat(M, "<span class='warning'>You have the strong urge for some [name]!</span>")
else if(prob(4))
to_chat(M, "<span class='warning'>You REALLY crave some [name]!</span>")
return STATUS_UPDATE_NONE
/datum/reagent/proc/addiction_act_stage5(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(minor_addiction)
if(prob(6))
M.AdjustSlowed(3)
to_chat(M, "<span class='warning'>You feel [pick("tired", "exhausted", "sluggish")].</span>")
else
if(prob(6))
to_chat(M, "<span class='warning'>Your stomach lurches painfully!</span>")
M.visible_message("<span class='warning'>[M] gags and retches!</span>")
update_flags |= M.Stun(rand(2,4), FALSE)
update_flags |= M.Weaken(rand(2,4), FALSE)
if(prob(8))
M.emote("twitch")
if(prob(6))
to_chat(M, "<span class='warning'>Your stomach lurches painfully!</span>")
M.visible_message("<span class='warning'>[M] gags and retches!</span>")
update_flags |= M.Stun(rand(2,4), FALSE)
update_flags |= M.Weaken(rand(2,4), FALSE)
M.emote(pick("twitch", "twitch_s", "shiver"))
if(prob(4))
to_chat(M, "<span class='warning'>Your head is killing you!</span>")
if(prob(5))
to_chat(M, "<span class='warning'>You feel like you can't live without [name]!</span>")
if(prob(5))
else if(prob(5))
to_chat(M, "<span class='warning'>You would DIE for some [name] right now!</span>")
return update_flags
@@ -23,6 +23,7 @@
I.receive_damage(-5, FALSE)
for(var/obj/item/organ/external/E in H.bodyparts)
E.mend_fracture()
E.internal_bleeding = FALSE
M.SetEyeBlind(0, FALSE)
M.CureNearsighted(FALSE)
M.CureBlind(FALSE)
@@ -6,6 +6,8 @@
reagent_state = LIQUID
nutriment_factor = 0 //So alcohol can fill you up! If they want to.
color = "#404030" // rgb: 64, 64, 48
addiction_chance = 1
addiction_threshold = 10
var/dizzy_adj = 3
var/alcohol_perc = 1 //percentage of ethanol in a beverage 0.0 - 1.0
taste_description = "liquid fire"
@@ -1190,15 +1192,17 @@
taste_description = "motor oil"
/datum/reagent/consumable/ethanol/synthanol/on_mob_life(mob/living/M)
if(!M.isSynthetic())
if(!(M.dna.species.reagent_tag & PROCESS_SYN))
holder.remove_reagent(id, 3.6) //gets removed from organics very fast
if(prob(25))
holder.remove_reagent(id, 15)
M.fakevomit()
return ..()
/datum/reagent/consumable/ethanol/synthanol/reaction_mob(mob/living/M, method=TOUCH, volume)
if(M.isSynthetic())
if(M.dna.species.reagent_tag & PROCESS_SYN)
return
if(method == INGEST)
to_chat(M, pick("<span class = 'danger'>That was awful!</span>", "<span class = 'danger'>Yuck!</span>"))
@@ -276,7 +276,10 @@
adj_sleepy = -2
adj_temp_hot = 25
overdose_threshold = 45
addiction_chance = 1 // It's true.
addiction_chance = 2 // It's true.
addiction_chance_additional = 20
addiction_threshold = 10
minor_addiction = TRUE
heart_rate_increase = 1
drink_icon = "glass_brown"
drink_name = "Glass of coffee"
@@ -367,6 +370,10 @@
adj_drowsy = -1
adj_sleepy = -3
adj_temp_hot = 20
addiction_chance = 1
addiction_chance_additional = 1
addiction_threshold = 10
minor_addiction = TRUE
drink_icon = "glass_brown"
drink_name = "Glass of Tea"
drink_desc = "A glass of hot tea. Perhaps a cup with a handle would have been smarter?"
@@ -35,7 +35,8 @@
reagent_state = LIQUID
color = "#9087A2"
metabolization_rate = 0.2
addiction_chance = 65
addiction_chance = 15
addiction_threshold = 10
heart_rate_decrease = 1
taste_description = "a synthetic high"
@@ -88,7 +89,9 @@
reagent_state = LIQUID
color = "#60A584" // rgb: 96, 165, 132
overdose_threshold = 35
addiction_chance = 70
addiction_chance = 15
addiction_threshold = 10
minor_addiction = TRUE
heart_rate_increase = 1
taste_description = "calm"
@@ -154,7 +157,8 @@
reagent_state = LIQUID
color = "#60A584" // rgb: 96, 165, 132
overdose_threshold = 20
addiction_chance = 50
addiction_chance = 10
addiction_threshold = 5
taste_description = "bitterness"
/datum/reagent/crank/on_mob_life(mob/living/M)
@@ -227,7 +231,8 @@
reagent_state = LIQUID
color = "#0264B4"
overdose_threshold = 20
addiction_chance = 50
addiction_chance = 10
addiction_threshold = 10
taste_description = "very poor life choices"
@@ -299,7 +304,8 @@
reagent_state = LIQUID
color = "#60A584" // rgb: 96, 165, 132
overdose_threshold = 20
addiction_chance = 60
addiction_chance = 10
addiction_threshold = 5
metabolization_rate = 0.6
heart_rate_increase = 1
taste_description = "speed"
@@ -360,7 +366,8 @@
reagent_state = SOLID
color = "#FAFAFA"
overdose_threshold = 20
addiction_chance = 80
addiction_chance = 15
addiction_threshold = 5
metabolization_rate = 0.6
taste_description = "WAAAAGH"
@@ -460,7 +467,8 @@
description = "Jenkem is a prison drug made from fermenting feces in a solution of urine. Extremely disgusting."
reagent_state = LIQUID
color = "#644600"
addiction_chance = 30
addiction_chance = 5
addiction_threshold = 5
taste_description = "the inside of a toilet... or worse"
/datum/reagent/jenkem/on_mob_life(mob/living/M)
@@ -517,6 +525,32 @@
M.Drowsy(10)
return ..()
/datum/reagent/cbd
name = "Cannabidiol"
id = "cbd"
description = "A non-psychoactive phytocannabinoid extracted from the cannabis plant."
reagent_state = LIQUID
color = "#00e100"
taste_description = "relaxation"
/datum/reagent/cbd/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(prob(5))
M.emote(pick("hsigh", "yawn"))
if(prob(5))
to_chat(M, "<span class='notice'>[pick("You feel peaceful.", "You breathe softly.", "You feel chill.", "You vibe.")]</span>")
if(prob(10))
M.AdjustConfused(-5)
update_flags |= M.SetWeakened(0, FALSE)
if(volume >= 70 && prob(25))
if(M.reagents.has_reagent("thc") <= 20)
M.Drowsy(10)
if(prob(25))
update_flags |= M.adjustBruteLoss(-2, FALSE)
update_flags |= M.adjustFireLoss(-2, FALSE)
return ..() | update_flags
/datum/reagent/fliptonium
name = "Fliptonium"
id = "fliptonium"
@@ -526,7 +560,9 @@
metabolization_rate = 0.2
overdose_threshold = 15
process_flags = ORGANIC | SYNTHETIC //Flipping for everyone!
addiction_chance = 10
addiction_chance = 1
addiction_chance_additional = 20
addiction_threshold = 10
taste_description = "flips"
/datum/reagent/fliptonium/on_mob_life(mob/living/M)
@@ -631,7 +667,8 @@
color = "#1BB1FF"
process_flags = SYNTHETIC
overdose_threshold = 20
addiction_chance = 60
addiction_chance = 10
addiction_threshold = 5
metabolization_rate = 0.6
taste_description = "wiper fluid"
@@ -684,7 +721,8 @@
process_flags = SYNTHETIC
overdose_threshold = 20
addiction_chance = 50
addiction_chance = 10
addiction_threshold = 5
taste_description = "silicon"
@@ -149,6 +149,10 @@
description = "This is what makes chilis hot."
reagent_state = LIQUID
color = "#B31008" // rgb: 179, 16, 8
addiction_chance = 1
addiction_chance_additional = 10
addiction_threshold = 2
minor_addiction = TRUE
taste_description = "<span class='warning'>HOTNESS</span>"
taste_mult = 1.5
@@ -651,6 +655,10 @@
reagent_state = LIQUID
color = "#B2B139"
overdose_threshold = 50
addiction_chance = 2
addiction_chance_additional = 10
addiction_threshold = 5
minor_addiction = TRUE
harmless = FALSE
taste_description = "cheese?"
@@ -667,7 +675,10 @@
description = "Hell, I don't even know if this IS cheese. Whatever it is, it ain't normal. If you want to, pour it out to make it solid."
reagent_state = SOLID
color = "#50FF00"
addiction_chance = 5
addiction_chance = 1
addiction_chance_additional = 10
addiction_threshold = 5
minor_addiction = TRUE
taste_description = "cheeeeeese...?"
/datum/reagent/consumable/weird_cheese/on_mob_life(mob/living/M)
@@ -6,7 +6,11 @@
/datum/reagent/medicine/on_mob_life(mob/living/M)
current_cycle++
holder.remove_reagent(id, (metabolization_rate / M.metabolism_efficiency) * M.digestion_ratio) //medicine reagents stay longer if you have a better metabolism
var/total_depletion_rate = (metabolization_rate / M.metabolism_efficiency) * M.digestion_ratio // Cache it
handle_addiction(M, total_depletion_rate)
holder.remove_reagent(id, total_depletion_rate) //medicine reagents stay longer if you have a better metabolism
return STATUS_UPDATE_NONE
/datum/reagent/medicine/hydrocodone
@@ -293,7 +297,9 @@
color = "#C8A5DC"
metabolization_rate = 0.2
overdose_threshold = 30
addiction_chance = 5
addiction_chance = 1
addiction_chance_additional = 20
addiction_threshold = 5
harmless = FALSE
taste_description = "health"
@@ -459,7 +465,9 @@
reagent_state = LIQUID
color = "#C8A5DC"
metabolization_rate = 0.2
addiction_chance = 20
addiction_chance = 1
addiction_chance_additional = 20
addiction_threshold = 10
harmless = FALSE
taste_description = "oxygenation"
@@ -481,7 +489,9 @@
color = "#C8A5DC"
metabolization_rate = 0.3
overdose_threshold = 35
addiction_chance = 25
addiction_chance = 1
addiction_chance = 10
addiction_threshold = 10
harmless = FALSE
taste_description = "stimulation"
@@ -531,7 +541,8 @@
description = "Anti-allergy medication. May cause drowsiness, do not operate heavy machinery while using this."
reagent_state = LIQUID
color = "#5BCBE1"
addiction_chance = 10
addiction_chance = 1
addiction_threshold = 10
harmless = FALSE
taste_description = "antihistamine"
@@ -554,7 +565,8 @@
reagent_state = LIQUID
color = "#C8A5DC"
overdose_threshold = 20
addiction_chance = 50
addiction_chance = 10
addiction_threshold = 15
shock_reduction = 50
harmless = FALSE
taste_description = "a delightful numbing"
@@ -902,7 +914,9 @@
description = "This experimental plasma-based compound seems to regulate body temperature."
reagent_state = LIQUID
color = "#D782E6"
addiction_chance = 20
addiction_chance = 1
addiction_chance_additional = 10
addiction_threshold = 10
overdose_threshold = 50
taste_description = "warmth and stability"
@@ -198,6 +198,7 @@
if(!S.reagents)
S.create_reagents(volume)
S.reagents.add_reagent("thermite", volume)
S.thermite = TRUE
S.overlays.Cut()
S.overlays = image('icons/effects/effects.dmi', icon_state = "thermite")
if(S.active_hotspot)