Merge branch 'pr/18'
This commit is contained in:
@@ -20,7 +20,9 @@
|
||||
if(GLOB.chemical_reactions_list)
|
||||
return
|
||||
|
||||
var/paths = subtypesof(/datum/chemical_reaction)
|
||||
|
||||
//Randomized need to go last since they need to check against conflicts with normal recipes
|
||||
var/paths = subtypesof(/datum/chemical_reaction) - typesof(/datum/chemical_reaction/randomized) + subtypesof(/datum/chemical_reaction/randomized)
|
||||
GLOB.chemical_reactions_list = list()
|
||||
|
||||
for(var/path in paths)
|
||||
@@ -28,6 +30,9 @@
|
||||
var/datum/chemical_reaction/D = new path()
|
||||
var/list/reaction_ids = list()
|
||||
|
||||
if(!D.id)
|
||||
continue
|
||||
|
||||
if(D.required_reagents && D.required_reagents.len)
|
||||
for(var/reaction in D.required_reagents)
|
||||
reaction_ids += reaction
|
||||
@@ -276,6 +281,9 @@
|
||||
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)
|
||||
@@ -322,6 +330,21 @@
|
||||
C.update_stamina()
|
||||
update_total()
|
||||
|
||||
//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)
|
||||
@@ -697,6 +720,9 @@
|
||||
if(R.id == reagent)
|
||||
if(my_atom && isliving(my_atom))
|
||||
var/mob/living/M = my_atom
|
||||
if(R.metabolizing)
|
||||
R.metabolizing = FALSE
|
||||
R.on_mob_end_metabolize(M)
|
||||
R.on_mob_delete(M)
|
||||
qdel(R)
|
||||
reagent_list -= R
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
var/InverseChem = "fermiTox"// What chem is metabolised when purity is below InverseChemVal, this shouldn't be made, but if it does, well, I guess I'll know about it.
|
||||
var/DoNotSplit = FALSE // If impurity is handled within the main chem itself
|
||||
var/OnMobMergeCheck = FALSE //Call on_mob_life proc when reagents are merging.
|
||||
var/metabolizing = FALSE
|
||||
|
||||
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
|
||||
. = ..()
|
||||
@@ -78,6 +79,14 @@
|
||||
/datum/reagent/proc/on_mob_delete(mob/living/L)
|
||||
return
|
||||
|
||||
// Called when this reagent first starts being metabolized by a liver
|
||||
/datum/reagent/proc/on_mob_metabolize(mob/living/L)
|
||||
return
|
||||
|
||||
// Called when this reagent stops being metabolized by a liver
|
||||
/datum/reagent/proc/on_mob_end_metabolize(mob/living/L)
|
||||
return
|
||||
|
||||
/datum/reagent/proc/on_move(mob/M)
|
||||
return
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
M.add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/beer/green/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/beer/green/on_mob_end_metabolize(mob/living/M)
|
||||
M.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, color)
|
||||
|
||||
/datum/reagent/consumable/ethanol/kahlua
|
||||
@@ -593,13 +593,13 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_desc = "Tequila and Coffee liqueur, brought together in a mouthwatering mixture. Drink up."
|
||||
var/tough_text
|
||||
|
||||
/datum/reagent/consumable/ethanol/brave_bull/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/brave_bull/on_mob_metabolize(mob/living/M)
|
||||
tough_text = pick("brawny", "tenacious", "tough", "hardy", "sturdy") //Tuff stuff
|
||||
to_chat(M, "<span class='notice'>You feel [tough_text]!</span>")
|
||||
M.maxHealth += 10 //Brave Bull makes you sturdier, and thus capable of withstanding a tiny bit more punishment.
|
||||
M.health += 10
|
||||
|
||||
/datum/reagent/consumable/ethanol/brave_bull/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/brave_bull/on_mob_end_metabolize(mob/living/M)
|
||||
to_chat(M, "<span class='notice'>You no longer feel [tough_text].</span>")
|
||||
M.maxHealth -= 10
|
||||
M.health = min(M.health - 10, M.maxHealth) //This can indeed crit you if you're alive solely based on alchol ingestion
|
||||
@@ -617,7 +617,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_desc = "Oh great, now you feel nostalgic about sunrises back on Terra..."
|
||||
var/obj/effect/light_holder
|
||||
|
||||
/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_metabolize(mob/living/M)
|
||||
to_chat(M, "<span class='notice'>You feel gentle warmth spread through your body!</span>")
|
||||
light_holder = new(M)
|
||||
light_holder.set_light(3, 0.7, "#FFCC00") //Tequila Sunrise makes you radiate dim light, like a sunrise!
|
||||
@@ -629,7 +629,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
light_holder.forceMove(M)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_end_metabolize(mob/living/M)
|
||||
to_chat(M, "<span class='notice'>The warmth in your body fades.</span>")
|
||||
QDEL_NULL(light_holder)
|
||||
|
||||
@@ -696,7 +696,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_desc = "A manly concoction made from Ale and Beer. Intended for true men only."
|
||||
var/dorf_mode
|
||||
|
||||
/datum/reagent/consumable/ethanol/manly_dorf/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/manly_dorf/on_mob_metabolize(mob/living/M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.dna.check_mutation(DWARFISM) || HAS_TRAIT(H, TRAIT_ALCOHOL_TOLERANCE))
|
||||
@@ -747,7 +747,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_desc = "Kahlua, Irish Cream, and cognac. You will get bombed."
|
||||
shot_glass_icon_state = "b52glass"
|
||||
|
||||
/datum/reagent/consumable/ethanol/b52/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/b52/on_mob_metabolize(mob/living/M)
|
||||
playsound(M, 'sound/effects/explosion_distant.ogg', 100, FALSE)
|
||||
|
||||
/datum/reagent/consumable/ethanol/irishcoffee
|
||||
@@ -1560,7 +1560,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
shot_glass_icon_state = "shotglassgreen"
|
||||
pH = 4
|
||||
|
||||
/datum/reagent/consumable/ethanol/bastion_bourbon/on_mob_add(mob/living/L)
|
||||
/datum/reagent/consumable/ethanol/bastion_bourbon/on_mob_metabolize(mob/living/L)
|
||||
var/heal_points = 10
|
||||
if(L.health <= 0)
|
||||
heal_points = 20 //heal more if we're in softcrit
|
||||
@@ -1644,7 +1644,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_name = "Crevice Spike"
|
||||
glass_desc = "It'll either knock the drunkenness out of you or knock you out cold. Both, probably."
|
||||
|
||||
/datum/reagent/consumable/ethanol/crevice_spike/on_mob_add(mob/living/L) //damage only applies when drink first enters system and won't again until drink metabolizes out
|
||||
/datum/reagent/consumable/ethanol/crevice_spike/on_mob_metabolize(mob/living/L) //damage only applies when drink first enters system and won't again until drink metabolizes out
|
||||
L.adjustBruteLoss(3 * min(5,volume)) //minimum 3 brute damage on ingestion to limit non-drink means of injury - a full 5 unit gulp of the drink trucks you for the full 15
|
||||
|
||||
/datum/reagent/consumable/ethanol/sake
|
||||
@@ -1687,7 +1687,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_desc = "A creamy, indulgent delight that is stronger than it seems."
|
||||
var/obj/item/shield/mighty_shield
|
||||
|
||||
/datum/reagent/consumable/ethanol/alexander/on_mob_add(mob/living/L)
|
||||
/datum/reagent/consumable/ethanol/alexander/on_mob_metabolize(mob/living/L)
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/thehuman = L
|
||||
for(var/obj/item/shield/theshield in thehuman.contents)
|
||||
@@ -1701,7 +1701,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
if(mighty_shield && !(mighty_shield in L.contents)) //If you had a shield and lose it, you lose the reagent as well. Otherwise this is just a normal drink.
|
||||
L.reagents.del_reagent("alexander")
|
||||
|
||||
/datum/reagent/consumable/ethanol/alexander/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/consumable/ethanol/alexander/on_mob_end_metabolize(mob/living/L)
|
||||
if(mighty_shield)
|
||||
mighty_shield.block_chance -= 10
|
||||
to_chat(L,"<span class='notice'>You notice [mighty_shield] looks worn again. Weird.</span>")
|
||||
@@ -1822,7 +1822,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
M.overeatduration = 0
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/fanciulli/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/fanciulli/on_mob_metabolize(mob/living/M)
|
||||
if(M.health > 0)
|
||||
M.adjustStaminaLoss(20)
|
||||
. = TRUE
|
||||
@@ -1846,7 +1846,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
M.adjust_bodytemperature(-20 * TEMPERATURE_DAMAGE_COEFFICIENT, T0C)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/branca_menta/on_mob_add(mob/living/M)
|
||||
/datum/reagent/consumable/ethanol/branca_menta/on_mob_metabolize(mob/living/M)
|
||||
if(M.health > 0)
|
||||
M.adjustStaminaLoss(35)
|
||||
. = TRUE
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
C.hal_screwyhud = SCREWYHUD_HEALTHY //fully healed, honest
|
||||
..()
|
||||
|
||||
/datum/reagent/blob/regenerative_materia/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/blob/regenerative_materia/on_mob_end_metabolize(mob/living/M)
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/N = M
|
||||
N.hal_screwyhud = 0
|
||||
|
||||
@@ -392,11 +392,11 @@
|
||||
glass_name = "glass of Nuka Cola"
|
||||
glass_desc = "Don't cry, Don't raise your eye, It's only nuclear wasteland."
|
||||
|
||||
/datum/reagent/consumable/nuka_cola/on_mob_add(mob/living/L)
|
||||
/datum/reagent/consumable/nuka_cola/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
|
||||
/datum/reagent/consumable/nuka_cola/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/consumable/nuka_cola/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
..()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
taste_description = "bitterness"
|
||||
var/trippy = TRUE //Does this drug make you trip?
|
||||
|
||||
/datum/reagent/drug/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/drug/on_mob_end_metabolize(mob/living/M)
|
||||
if(trippy)
|
||||
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[id]_high")
|
||||
|
||||
@@ -173,11 +173,11 @@
|
||||
var/confusion = TRUE
|
||||
pH = 5
|
||||
|
||||
/datum/reagent/drug/methamphetamine/on_mob_add(mob/living/L)
|
||||
/datum/reagent/drug/methamphetamine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.ignore_slowdown(id)
|
||||
|
||||
/datum/reagent/drug/methamphetamine/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/drug/methamphetamine/on_mob_end_metabolize(mob/living/L)
|
||||
L.unignore_slowdown(id)
|
||||
..()
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
var/datum/brain_trauma/special/psychotic_brawling/bath_salts/rage
|
||||
pH = 8.2
|
||||
|
||||
/datum/reagent/drug/bath_salts/on_mob_add(mob/living/L)
|
||||
/datum/reagent/drug/bath_salts/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_STUNIMMUNE, id)
|
||||
ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id)
|
||||
@@ -277,7 +277,7 @@
|
||||
rage = new()
|
||||
C.gain_trauma(rage, TRAUMA_RESILIENCE_ABSOLUTE)
|
||||
|
||||
/datum/reagent/drug/bath_salts/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/drug/bath_salts/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id)
|
||||
REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id)
|
||||
if(rage)
|
||||
@@ -467,7 +467,7 @@
|
||||
addiction_stage4_end = 240
|
||||
pH = 12.5
|
||||
|
||||
/datum/reagent/drug/skooma/on_mob_add(mob/living/L)
|
||||
/datum/reagent/drug/skooma/on_mob_metabolize(mob/living/L)
|
||||
. = ..()
|
||||
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
L.next_move_modifier *= 2
|
||||
@@ -478,7 +478,7 @@
|
||||
if(H.dna && H.dna.species)
|
||||
H.dna.species.punchdamagehigh *= 5
|
||||
|
||||
/datum/reagent/drug/skooma/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/drug/skooma/on_mob_end_metabolize(mob/living/L)
|
||||
. = ..()
|
||||
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
L.next_move_modifier *= 0.5
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_verygood)
|
||||
if (DRINK_FANTASTIC)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_fantastic)
|
||||
if (FOOD_AMAZING)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_food", /datum/mood_event/amazingtaste)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/nutriment
|
||||
@@ -404,7 +406,7 @@
|
||||
taste_description = "mushroom"
|
||||
pH = 11
|
||||
|
||||
/datum/reagent/mushroomhallucinogen/on_mob_life(mob/living/carbon/M)
|
||||
/datum/reagent/drug/mushroomhallucinogen/on_mob_life(mob/living/carbon/M)
|
||||
M.slurring = max(M.slurring,50)
|
||||
switch(current_cycle)
|
||||
if(1 to 5)
|
||||
@@ -692,7 +694,7 @@
|
||||
/datum/reagent/consumable/tinlux/reaction_mob(mob/living/M)
|
||||
M.set_light(2)
|
||||
|
||||
/datum/reagent/consumable/tinlux/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/consumable/tinlux/on_mob_end_metabolize(mob/living/M)
|
||||
M.set_light(-2)
|
||||
|
||||
/datum/reagent/consumable/vitfro
|
||||
@@ -719,3 +721,15 @@
|
||||
color = "#eef442" // rgb: 238, 244, 66
|
||||
taste_description = "mournful honking"
|
||||
pH = 9.2
|
||||
|
||||
/datum/reagent/consumable/secretsauce
|
||||
name = "secret sauce"
|
||||
id = "secret_sauce"
|
||||
description = "What could it be."
|
||||
nutriment_factor = 2 * REAGENTS_METABOLISM
|
||||
color = "#792300"
|
||||
taste_description = "indescribable"
|
||||
quality = FOOD_AMAZING
|
||||
taste_mult = 100
|
||||
can_synth = FALSE
|
||||
pH = 6.1
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
to_chat(M, "<span class='danger'>You feel your wounds fade away to nothing!</span>" )
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/mine_salve/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/medicine/mine_salve/on_mob_end_metabolize(mob/living/M)
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/N = M
|
||||
N.hal_screwyhud = SCREWYHUD_NONE
|
||||
@@ -510,16 +510,25 @@
|
||||
color = "#E6FFF0"
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
pH = -1 //One of the best buffers,
|
||||
var/healtoxinlover = FALSE
|
||||
|
||||
/datum/reagent/medicine/pen_acid/on_mob_life(mob/living/carbon/M)
|
||||
M.radiation -= max(M.radiation-RAD_MOB_SAFE, 0)/50
|
||||
M.adjustToxLoss(-2*REM, 0)
|
||||
M.adjustToxLoss(-2*REM, 0, healtoxinlover)
|
||||
for(var/datum/reagent/R in M.reagents.reagent_list)
|
||||
if(R != src)
|
||||
M.reagents.remove_reagent(R.id,2)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/medicine/pen_acid/pen_jelly
|
||||
name = "Pentetic Jelly"
|
||||
id = "pen_jelly"
|
||||
description = "Reduces massive amounts of radiation and toxin damage while purging other chemicals from the body. Slimepeople friendly!"
|
||||
color = "#91D865"
|
||||
healtoxinlover = TRUE
|
||||
pH = 14//invert
|
||||
|
||||
/datum/reagent/medicine/sal_acid
|
||||
name = "Salicyclic Acid"
|
||||
id = "sal_acid"
|
||||
@@ -663,11 +672,11 @@
|
||||
addiction_threshold = 25
|
||||
pH = 8.96
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_add(mob/living/L)
|
||||
/datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.ignore_slowdown(id)
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/medicine/morphine/on_mob_end_metabolize(mob/living/L)
|
||||
L.unignore_slowdown(id)
|
||||
..()
|
||||
|
||||
@@ -929,11 +938,11 @@
|
||||
overdose_threshold = 60
|
||||
pH = 8.7
|
||||
|
||||
/datum/reagent/medicine/stimulants/on_mob_add(mob/living/L)
|
||||
/datum/reagent/medicine/stimulants/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
|
||||
/datum/reagent/medicine/stimulants/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/medicine/stimulants/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
..()
|
||||
|
||||
@@ -1165,7 +1174,7 @@
|
||||
M.adjustBruteLoss(-3 * REM, 0)
|
||||
M.adjustFireLoss(-3 * REM, 0)
|
||||
M.adjustOxyLoss(-15 * REM, 0)
|
||||
M.adjustToxLoss(-3 * REM, 0)
|
||||
M.adjustToxLoss(-3 * REM, 0, TRUE) //Heals TOXINLOVERS
|
||||
M.adjustBrainLoss(2 * REM, 150) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that!
|
||||
M.adjustCloneLoss(-1 * REM, 0)
|
||||
M.adjustStaminaLoss(-30 * REM, 0)
|
||||
@@ -1176,7 +1185,7 @@
|
||||
|
||||
/datum/reagent/medicine/earthsblood/overdose_process(mob/living/M)
|
||||
M.hallucination = min(max(0, M.hallucination + 5), 60)
|
||||
M.adjustToxLoss(5 * REM, 0)
|
||||
M.adjustToxLoss(8 * REM, 0, TRUE) //Hurts TOXINLOVERS
|
||||
..()
|
||||
. = 1
|
||||
|
||||
@@ -1253,11 +1262,11 @@
|
||||
color = "#C8A5DC"
|
||||
metabolization_rate = 1
|
||||
|
||||
/datum/reagent/medicine/changelinghaste/on_mob_add(mob/living/L)
|
||||
/datum/reagent/medicine/changelinghaste/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id)
|
||||
|
||||
/datum/reagent/medicine/changelinghaste/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/medicine/changelinghaste/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id)
|
||||
..()
|
||||
|
||||
@@ -1276,11 +1285,11 @@
|
||||
self_consuming = TRUE
|
||||
pH = 12.5
|
||||
|
||||
/datum/reagent/medicine/corazone/on_mob_add(mob/living/M)
|
||||
/datum/reagent/medicine/corazone/on_mob_metabolize(mob/living/M)
|
||||
..()
|
||||
ADD_TRAIT(M, TRAIT_STABLEHEART, id)
|
||||
|
||||
/datum/reagent/medicine/corazone/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/medicine/corazone/on_mob_end_metabolize(mob/living/M)
|
||||
REMOVE_TRAIT(M, TRAIT_STABLEHEART, id)
|
||||
..()
|
||||
|
||||
@@ -1289,11 +1298,11 @@
|
||||
id = "muscle_stimulant"
|
||||
description = "A potent chemical that allows someone under its influence to be at full physical ability even when under massive amounts of pain."
|
||||
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_add(mob/living/M)
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_metabolize(mob/living/M)
|
||||
. = ..()
|
||||
M.ignore_slowdown(id)
|
||||
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/medicine/muscle_stimulant/on_mob_end_metabolize(mob/living/M)
|
||||
. = ..()
|
||||
M.unignore_slowdown(id)
|
||||
|
||||
@@ -1309,11 +1318,11 @@
|
||||
var/overdose_progress = 0 // to track overdose progress
|
||||
pH = 7.89
|
||||
|
||||
/datum/reagent/medicine/modafinil/on_mob_add(mob/living/M)
|
||||
/datum/reagent/medicine/modafinil/on_mob_metabolize(mob/living/M)
|
||||
ADD_TRAIT(M, TRAIT_SLEEPIMMUNE, id)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/modafinil/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/medicine/modafinil/on_mob_end_metabolize(mob/living/M)
|
||||
REMOVE_TRAIT(M, TRAIT_SLEEPIMMUNE, id)
|
||||
..()
|
||||
|
||||
|
||||
@@ -199,11 +199,11 @@
|
||||
glass_desc = "A glass of holy water."
|
||||
pH = 7.5 //God is alkaline
|
||||
|
||||
/datum/reagent/water/holywater/on_mob_add(mob/living/L)
|
||||
/datum/reagent/water/holywater/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_HOLY, id)
|
||||
|
||||
/datum/reagent/water/holywater/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/water/holywater/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_HOLY, id)
|
||||
..()
|
||||
|
||||
@@ -1280,12 +1280,12 @@
|
||||
color = "E1A116"
|
||||
taste_description = "sourness"
|
||||
|
||||
/datum/reagent/stimulum/on_mob_add(mob/living/L)
|
||||
/datum/reagent/stimulum/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_STUNIMMUNE, id)
|
||||
ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id)
|
||||
|
||||
/datum/reagent/stimulum/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/stimulum/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id)
|
||||
REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id)
|
||||
..()
|
||||
@@ -1306,11 +1306,11 @@
|
||||
taste_description = "burning"
|
||||
pH = 2
|
||||
|
||||
/datum/reagent/nitryl/on_mob_add(mob/living/L)
|
||||
/datum/reagent/nitryl/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
|
||||
/datum/reagent/nitryl/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/nitryl/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id)
|
||||
..()
|
||||
|
||||
@@ -1783,7 +1783,7 @@
|
||||
H.update_transform()
|
||||
..()
|
||||
|
||||
/datum/reagent/growthserum/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/growthserum/on_mob_end_metabolize(mob/living/M)
|
||||
M.resize = 1/current_size
|
||||
M.update_transform()
|
||||
..()
|
||||
@@ -1839,11 +1839,11 @@
|
||||
metabolization_rate = 0.25 * REAGENTS_METABOLISM
|
||||
pH = 15
|
||||
|
||||
/datum/reagent/pax/on_mob_add(mob/living/L)
|
||||
/datum/reagent/pax/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_PACIFISM, id)
|
||||
|
||||
/datum/reagent/pax/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/pax/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_PACIFISM, id)
|
||||
..()
|
||||
|
||||
@@ -1855,11 +1855,11 @@
|
||||
taste_description = "acrid cinnamon"
|
||||
metabolization_rate = 0.2 * REAGENTS_METABOLISM
|
||||
|
||||
/datum/reagent/bz_metabolites/on_mob_add(mob/living/L)
|
||||
/datum/reagent/bz_metabolites/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id)
|
||||
|
||||
/datum/reagent/bz_metabolites/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/bz_metabolites/on_mob_end_metabolize(mob/living/L)
|
||||
..()
|
||||
REMOVE_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id)
|
||||
|
||||
@@ -1876,14 +1876,14 @@
|
||||
description = "A colorless liquid that suppresses violence on the subjects. Cheaper to synthetize, but wears out faster than normal Pax."
|
||||
metabolization_rate = 1.5 * REAGENTS_METABOLISM
|
||||
|
||||
/datum/reagent/peaceborg/confuse
|
||||
/datum/reagent/peaceborg_confuse
|
||||
name = "Dizzying Solution"
|
||||
id = "dizzysolution"
|
||||
description = "Makes the target off balance and dizzy"
|
||||
metabolization_rate = 1.5 * REAGENTS_METABOLISM
|
||||
taste_description = "dizziness"
|
||||
|
||||
/datum/reagent/peaceborg/confuse/on_mob_life(mob/living/carbon/M)
|
||||
/datum/reagent/peaceborg_confuse/on_mob_life(mob/living/carbon/M)
|
||||
if(M.confused < 6)
|
||||
M.confused = CLAMP(M.confused + 3, 0, 5)
|
||||
if(M.dizziness < 6)
|
||||
@@ -1892,14 +1892,14 @@
|
||||
to_chat(M, "You feel confused and disorientated.")
|
||||
..()
|
||||
|
||||
/datum/reagent/peaceborg/tire
|
||||
/datum/reagent/peaceborg_tire
|
||||
name = "Tiring Solution"
|
||||
id = "tiresolution"
|
||||
description = "An extremely weak stamina-toxin that tires out the target. Completely harmless."
|
||||
metabolization_rate = 1.5 * REAGENTS_METABOLISM
|
||||
taste_description = "tiredness"
|
||||
|
||||
/datum/reagent/peaceborg/tire/on_mob_life(mob/living/carbon/M)
|
||||
/datum/reagent/peaceborg_tire/on_mob_life(mob/living/carbon/M)
|
||||
var/healthcomp = (100 - M.health) //DOES NOT ACCOUNT FOR ADMINBUS THINGS THAT MAKE YOU HAVE MORE THAN 200/210 HEALTH, OR SOMETHING OTHER THAN A HUMAN PROCESSING THIS.
|
||||
if(M.getStaminaLoss() < (45 - healthcomp)) //At 50 health you would have 200 - 150 health meaning 50 compensation. 60 - 50 = 10, so would only do 10-19 stamina.)
|
||||
M.adjustStaminaLoss(10)
|
||||
|
||||
@@ -164,11 +164,11 @@
|
||||
taste_description = "death"
|
||||
pH = 13
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_add(mob/living/L)
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.fakedeath(id)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_end_metabolize(mob/living/L)
|
||||
L.cure_fakedeath(id)
|
||||
..()
|
||||
|
||||
@@ -187,11 +187,11 @@
|
||||
taste_description = "death"
|
||||
pH = 14.5
|
||||
|
||||
/datum/reagent/toxin/ghoulpowder/on_mob_add(mob/living/L)
|
||||
/datum/reagent/toxin/ghoulpowder/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
ADD_TRAIT(L, TRAIT_FAKEDEATH, id)
|
||||
|
||||
/datum/reagent/toxin/ghoulpowder/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/toxin/ghoulpowder/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_FAKEDEATH, id)
|
||||
..()
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
toxpwr = 0
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
|
||||
/datum/reagent/toxin/amanitin/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/toxin/amanitin/on_mob_end_metabolize(mob/living/M)
|
||||
var/toxdamage = current_cycle*3*REM
|
||||
M.log_message("has taken [toxdamage] toxin damage from amanitin toxin", LOG_ATTACK)
|
||||
M.adjustToxLoss(toxdamage)
|
||||
@@ -762,7 +762,7 @@
|
||||
animate(transform = matrix(-rotation, MATRIX_ROTATE), time = 5, easing = QUAD_EASING)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/toxin/rotatium/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/toxin/rotatium/on_mob_end_metabolize(mob/living/M)
|
||||
if(M && M.hud_used)
|
||||
var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"])
|
||||
for(var/whole_screen in screens)
|
||||
@@ -799,7 +799,7 @@
|
||||
*/
|
||||
return ..()
|
||||
|
||||
/datum/reagent/toxin/skewium/on_mob_delete(mob/living/M)
|
||||
/datum/reagent/toxin/skewium/on_mob_end_metabolize(mob/living/M)
|
||||
if(M && M.hud_used)
|
||||
var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"])
|
||||
for(var/whole_screen in screens)
|
||||
@@ -818,7 +818,7 @@
|
||||
|
||||
/datum/reagent/toxin/anacea/on_mob_life(mob/living/carbon/M)
|
||||
var/remove_amt = 5
|
||||
if(holder.has_reagent("calomel") || holder.has_reagent("pen_acid"))
|
||||
if(holder.has_reagent("calomel") || holder.has_reagent("pen_acid") || holder.has_reagent("pen_jelly"))
|
||||
remove_amt = 0.5
|
||||
for(var/datum/reagent/medicine/R in M.reagents.reagent_list)
|
||||
M.reagents.remove_reagent(R.id,remove_amt)
|
||||
@@ -903,8 +903,8 @@
|
||||
toxpwr = 0
|
||||
taste_description = "stillness"
|
||||
|
||||
/datum/reagent/toxin/mimesbane/on_mob_add(mob/living/L)
|
||||
/datum/reagent/toxin/mimesbane/on_mob_metabolize(mob/living/L)
|
||||
ADD_TRAIT(L, TRAIT_EMOTEMUTE, id)
|
||||
|
||||
/datum/reagent/toxin/mimesbane/on_mob_delete(mob/living/L)
|
||||
/datum/reagent/toxin/mimesbane/on_mob_end_metabolize(mob/living/L)
|
||||
REMOVE_TRAIT(L, TRAIT_EMOTEMUTE, id)
|
||||
|
||||
@@ -94,6 +94,12 @@
|
||||
results = list("pen_acid" = 6)
|
||||
required_reagents = list("welding_fuel" = 1, "chlorine" = 1, "ammonia" = 1, "formaldehyde" = 1, "sodium" = 1, "cyanide" = 1)
|
||||
|
||||
/datum/chemical_reaction/pen_jelly
|
||||
name = "Pentetic Jelly"
|
||||
id = "pen_jelly"
|
||||
results = list("pen_jelly" = 2)
|
||||
required_reagents = list("pen_acid" = 1, "slimejelly" = 1)
|
||||
|
||||
/datum/chemical_reaction/sal_acid
|
||||
name = "Salicyclic Acid"
|
||||
id = "sal_acid"
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related food types
|
||||
|
||||
/proc/build_reagents_to_food()
|
||||
. = list()
|
||||
for (var/type in subtypesof(/obj/item/reagent_containers/food))
|
||||
var/obj/item/reagent_containers/food/item = new type()
|
||||
for(var/r in item.list_reagents)
|
||||
if (!.[r])
|
||||
.[r] = list()
|
||||
.[r] += type
|
||||
qdel(item)
|
||||
//dang plant snowflake
|
||||
for (var/type in subtypesof(/obj/item/seeds))
|
||||
var/obj/item/seeds/item = new type()
|
||||
for(var/r in item.reagents_add)
|
||||
if (!.[r])
|
||||
.[r] = list()
|
||||
.[r] += type
|
||||
qdel(item)
|
||||
|
||||
|
||||
#define RNGCHEM_INPUT "input"
|
||||
#define RNGCHEM_CATALYSTS "catalysts"
|
||||
#define RNGCHEM_OUTPUT "output"
|
||||
|
||||
/datum/chemical_reaction/randomized
|
||||
name = "semi randomized reaction"
|
||||
|
||||
var/persistent = FALSE
|
||||
var/persistence_period = 7 //Will reset every x days
|
||||
var/created //creation timestamp
|
||||
|
||||
var/randomize_container = FALSE
|
||||
var/list/possible_containers = list()
|
||||
|
||||
var/randomize_req_temperature = TRUE
|
||||
var/min_temp = 1
|
||||
var/max_temp = 600
|
||||
|
||||
var/randomize_inputs = TRUE
|
||||
var/min_input_reagent_amount = 1
|
||||
var/max_input_reagent_amount = 10
|
||||
var/min_input_reagents = 2
|
||||
var/max_input_reagents = 5
|
||||
var/list/possible_reagents = list()
|
||||
var/min_catalysts = 0
|
||||
var/max_catalysts = 2
|
||||
var/list/possible_catalysts = list()
|
||||
|
||||
var/randomize_results = FALSE
|
||||
var/min_output_reagent_amount = 1
|
||||
var/max_output_reagent_amount = 5
|
||||
var/min_result_reagents = 1
|
||||
var/max_result_reagents = 1
|
||||
var/list/possible_results = list()
|
||||
|
||||
/datum/chemical_reaction/randomized/proc/GenerateRecipe()
|
||||
created = world.time
|
||||
if(randomize_container)
|
||||
required_container = pick(possible_containers)
|
||||
if(randomize_req_temperature)
|
||||
required_temp = rand(min_temp,max_temp)
|
||||
is_cold_recipe = pick(TRUE,FALSE)
|
||||
|
||||
if(randomize_results)
|
||||
results = list()
|
||||
var/list/remaining_possible_results = GetPossibleReagents(RNGCHEM_OUTPUT)
|
||||
var/out_reagent_count = min(rand(min_result_reagents,max_result_reagents),remaining_possible_results.len)
|
||||
for(var/i in 1 to out_reagent_count)
|
||||
var/r_id = pick_n_take(remaining_possible_results)
|
||||
results[r_id] = rand(min_output_reagent_amount,max_output_reagent_amount)
|
||||
|
||||
if(randomize_inputs)
|
||||
var/list/remaining_possible_reagents = GetPossibleReagents(RNGCHEM_INPUT)
|
||||
var/list/remaining_possible_catalysts = GetPossibleReagents(RNGCHEM_CATALYSTS)
|
||||
|
||||
//We're going to assume we're not doing any weird partial reactions for now.
|
||||
for(var/reagent_type in results)
|
||||
remaining_possible_catalysts -= reagent_type
|
||||
remaining_possible_reagents -= reagent_type
|
||||
|
||||
var/in_reagent_count = min(rand(min_input_reagents,max_input_reagents),remaining_possible_reagents.len)
|
||||
if(in_reagent_count <= 0)
|
||||
return FALSE
|
||||
|
||||
required_reagents = list()
|
||||
for(var/i in 1 to in_reagent_count)
|
||||
var/r_id = pick_n_take(remaining_possible_reagents)
|
||||
required_reagents[r_id] = rand(min_input_reagent_amount,max_input_reagent_amount)
|
||||
remaining_possible_catalysts -= r_id //Can't have same reagents both as catalyst and reagent. Or can we ?
|
||||
|
||||
required_catalysts = list()
|
||||
var/in_catalyst_count = min(rand(min_catalysts,max_catalysts),remaining_possible_catalysts.len)
|
||||
for(var/i in 1 to in_catalyst_count)
|
||||
var/r_id = pick_n_take(remaining_possible_catalysts)
|
||||
required_catalysts[r_id] = rand(min_input_reagent_amount,max_input_reagent_amount)
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/chemical_reaction/randomized/proc/GetPossibleReagents(kind)
|
||||
switch(kind)
|
||||
if(RNGCHEM_INPUT)
|
||||
return possible_reagents.Copy()
|
||||
if(RNGCHEM_CATALYSTS)
|
||||
return possible_catalysts.Copy()
|
||||
if(RNGCHEM_OUTPUT)
|
||||
return possible_results.Copy()
|
||||
|
||||
/datum/chemical_reaction/randomized/proc/HasConflicts()
|
||||
for(var/x in required_reagents)
|
||||
for(var/datum/chemical_reaction/R in GLOB.chemical_reactions_list[x])
|
||||
if(chem_recipes_do_conflict(R,src))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/chemical_reaction/randomized/proc/unwrap_reagent_list(list/textreagents)
|
||||
. = list()
|
||||
for(var/R in textreagents)
|
||||
var/pathR = text2path(R)
|
||||
if(!pathR)
|
||||
return null
|
||||
.[pathR] = textreagents[R]
|
||||
|
||||
/datum/chemical_reaction/randomized/proc/LoadOldRecipe(recipe_data)
|
||||
created = text2num(recipe_data["timestamp"])
|
||||
|
||||
var/req_reag = unwrap_reagent_list(recipe_data["required_reagents"])
|
||||
if(!req_reag)
|
||||
return FALSE
|
||||
required_reagents = req_reag
|
||||
|
||||
var/req_catalysts = unwrap_reagent_list(recipe_data["required_catalysts"])
|
||||
if(!req_catalysts)
|
||||
return FALSE
|
||||
required_catalysts = req_catalysts
|
||||
|
||||
required_temp = recipe_data["required_temp"]
|
||||
is_cold_recipe = recipe_data["is_cold_recipe"]
|
||||
|
||||
var/temp_results = unwrap_reagent_list(recipe_data["results"])
|
||||
if(!temp_results)
|
||||
return FALSE
|
||||
results = temp_results
|
||||
var/containerpath = text2path(recipe_data["required_container"])
|
||||
if(!containerpath)
|
||||
return FALSE
|
||||
required_container = containerpath
|
||||
return TRUE
|
||||
|
||||
/datum/chemical_reaction/randomized/secret_sauce
|
||||
name = "secret sauce creation"
|
||||
id = "secretsauce"
|
||||
persistent = TRUE
|
||||
persistence_period = 7 //Reset every week
|
||||
randomize_container = TRUE
|
||||
possible_containers = list(/obj/item/reagent_containers/glass/bucket) //easy way to ensure no common conflicts
|
||||
randomize_req_temperature = TRUE
|
||||
results = list("secret_sauce" =1)
|
||||
|
||||
/datum/chemical_reaction/randomized/secret_sauce/GetPossibleReagents(kind)
|
||||
switch(kind)
|
||||
if(RNGCHEM_INPUT,RNGCHEM_CATALYSTS)
|
||||
var/food_reagent_ids = list()
|
||||
for(var/key in GLOB.food_reagents)
|
||||
food_reagent_ids += key
|
||||
return food_reagent_ids
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/paper/secretrecipe
|
||||
name = "old recipe"
|
||||
var/recipe_id = "secretsauce"
|
||||
|
||||
/obj/item/paper/secretrecipe/examine(mob/user) //Extra secret
|
||||
if(isobserver(user))
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/paper/secretrecipe/Initialize()
|
||||
. = ..()
|
||||
if(SSpersistence.initialized)
|
||||
UpdateInfo()
|
||||
else
|
||||
SSticker.OnRoundstart(CALLBACK(src,.proc/UpdateInfo))
|
||||
|
||||
/obj/item/paper/secretrecipe/proc/UpdateInfo()
|
||||
var/datum/chemical_reaction/recipe = get_chemical_reaction(recipe_id)
|
||||
if(!recipe)
|
||||
info = "This recipe is illegible."
|
||||
var/list/dat = list("<ul>")
|
||||
for(var/rid in recipe.required_reagents)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[rid]
|
||||
dat += "<li>[recipe.required_reagents[rid]]u of [R.name]</li>"
|
||||
dat += "</ul>"
|
||||
if(recipe.required_catalysts.len)
|
||||
dat += "With following present: <ul>"
|
||||
for(var/rid in recipe.required_catalysts)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[rid]
|
||||
dat += "<li>[recipe.required_catalysts[rid]]u of [R.name]</li>"
|
||||
dat += "</ul>"
|
||||
dat += "Mix slowly"
|
||||
if(recipe.required_container)
|
||||
var/obj/item/I = recipe.required_container
|
||||
dat += " in [initial(I.name)]"
|
||||
if(recipe.required_temp != 0)
|
||||
if(recipe.is_cold_recipe)
|
||||
dat += " below [recipe.required_temp] degrees"
|
||||
else
|
||||
dat += " above [recipe.required_temp] degrees"
|
||||
dat += "."
|
||||
info = dat.Join("")
|
||||
update_icon()
|
||||
@@ -259,3 +259,92 @@
|
||||
|
||||
/obj/item/reagent_containers/syringe/get_belt_overlay()
|
||||
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch")
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart
|
||||
name = "medicinal smartdart"
|
||||
desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented."
|
||||
volume = 20
|
||||
amount_per_transfer_from_this = 20
|
||||
icon_state = "empty"
|
||||
item_state = "syringe_empty"
|
||||
var/emptrig = FALSE
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity)
|
||||
|
||||
if(busy)
|
||||
return
|
||||
if(!proximity)
|
||||
return
|
||||
if(!target.reagents)
|
||||
return
|
||||
|
||||
var/mob/living/L
|
||||
if(isliving(target))
|
||||
L = target
|
||||
if(!L.can_inject(user, 1))
|
||||
return
|
||||
|
||||
switch(mode)
|
||||
if(SYRINGE_DRAW)
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>The dart is full!</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
to_chat(user, "<span class='warning'>You can't draw blood using a dart!</span>")
|
||||
return
|
||||
|
||||
else //if not mob
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
if(!target.is_drawable())
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You soak the [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
|
||||
if (reagents.total_volume >= reagents.maximum_volume)
|
||||
mode=!mode
|
||||
update_icon()
|
||||
|
||||
if(SYRINGE_INJECT)
|
||||
src.visible_message("<span class='danger'>The smartdart gives a frustrated boop! It's fully saturated; You need to shoot someone with it!</span>")
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/attack_self(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/update_icon()
|
||||
cut_overlays()
|
||||
var/rounded_vol
|
||||
|
||||
rounded_vol = "empty"
|
||||
if(reagents && reagents.total_volume)
|
||||
if(volume/reagents.total_volume == 1)
|
||||
rounded_vol="full"
|
||||
|
||||
icon_state = "[rounded_vol]"
|
||||
item_state = "syringe_[rounded_vol]"
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
var/injoverlay
|
||||
switch(mode)
|
||||
if (SYRINGE_DRAW)
|
||||
injoverlay = "draw"
|
||||
if (SYRINGE_INJECT)
|
||||
injoverlay = "ready"
|
||||
add_overlay(injoverlay)
|
||||
M.update_inv_hands()
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/emp_act(severity)
|
||||
emptrig = TRUE
|
||||
..()
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/bluespace
|
||||
name = "bluespace smartdart"
|
||||
desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented. Has an extended volume capacity thanks to bluespace foam."
|
||||
amount_per_transfer_from_this = 50
|
||||
volume = 50
|
||||
|
||||
Reference in New Issue
Block a user