diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 6ef7d778b6..ad339b8e39 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -566,6 +566,8 @@ my_atom.on_reagent_change() if(!no_react) handle_reactions() + if(isliving(my_atom)) + R.on_mob_add(my_atom) return TRUE else diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index bc98badc51..342e2154f8 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -58,6 +58,10 @@ holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. return +// Called when this reagent is first added to a mob +/datum/reagent/proc/on_mob_add(mob/M) + return + // Called when this reagent is removed while inside a mob /datum/reagent/proc/on_mob_delete(mob/M) return diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 5e3bf0f749..f89c89377e 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -470,6 +470,13 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_name = "Bloody Mary" glass_desc = "Tomato juice, mixed with Vodka and a lil' bit of lime. Tastes like liquid murder." +/datum/reagent/consumable/ethanol/bloody_mary/on_mob_life(mob/living/M) + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(C.blood_volume < BLOOD_VOLUME_NORMAL) + C.blood_volume = min(BLOOD_VOLUME_NORMAL, C.blood_volume + 3) //Bloody Mary quickly restores blood loss. + ..() + /datum/reagent/consumable/ethanol/brave_bull name = "Brave Bull" id = "bravebull" @@ -480,16 +487,18 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_icon_state = "bravebullglass" glass_name = "Brave Bull" 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_life(mob/living/M) - if(M.maxHealth == initial(M.maxHealth)) //Brave Bull makes you sturdier, and thus capable of withstanding a tiny bit more punishment. - M.maxHealth += 5 - M.health += 5 - return ..() +/datum/reagent/consumable/ethanol/brave_bull/on_mob_add(mob/living/M) + tough_text = pick("brawny", "tenacious", "tough", "hardy", "sturdy") //Tuff stuff + to_chat(M, "You feel [tough_text]!") + 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) - if(M.maxHealth != initial(M.maxHealth)) - M.maxHealth = initial(M.maxHealth) + to_chat(M, "You no longer feel [tough_text].") + 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 /datum/reagent/consumable/ethanol/tequila_sunrise name = "Tequila Sunrise" @@ -501,6 +510,23 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_icon_state = "tequilasunriseglass" glass_name = "tequila Sunrise" 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) + to_chat(M, "You feel gentle warmth spread through your body!") + light_holder = new(M) + light_holder.set_light(3, 0.7, "#FFCC00") //Tequila Sunrise makes you radiate dim light, like a sunrise! + +/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_life(mob/living/M) + if(QDELETED(light_holder)) + M.reagents.del_reagent("tequilasunrise") //If we lost our light object somehow, remove the reagent + else if(light_holder.loc != M) + light_holder.forceMove(M) + return ..() + +/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_delete(mob/living/M) + to_chat(M, "The warmth in your body fades.") + QDEL_NULL(light_holder) /datum/reagent/consumable/ethanol/toxins_special name = "Toxins Special" @@ -556,6 +582,21 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_icon_state = "manlydorfglass" glass_name = "The Manly Dorf" 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) + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.dna.check_mutation(DWARFISM)) + to_chat(H, "Now THAT is MANLY!") + boozepwr = 5 //We've had worse in the mines + dorf_mode = TRUE + +/datum/reagent/consumable/ethanol/manly_dorf/on_mob_life(mob/living/M) + if(dorf_mode) + M.adjustBruteLoss(-2) + M.adjustFireLoss(-2) + return ..() /datum/reagent/consumable/ethanol/longislandicedtea name = "Long Island Iced Tea" @@ -592,6 +633,9 @@ 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) + playsound(M, 'sound/effects/explosion_distant.ogg', 100, FALSE) + /datum/reagent/consumable/ethanol/irishcoffee name = "Irish Coffee" id = "irishcoffee"