This commit is contained in:
Ghommie
2019-07-03 03:24:28 +02:00
328 changed files with 9909 additions and 6862 deletions

View File

@@ -21,7 +21,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)
@@ -29,6 +31,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
@@ -267,6 +272,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)
@@ -313,6 +321,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)
@@ -466,6 +489,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

View File

@@ -51,7 +51,8 @@
//these become available once upgraded.
var/list/upgrade_reagents = list(
"oil",
"ammonia"
"ammonia",
"ash"
)
var/list/upgrade_reagents2 = list(
@@ -250,13 +251,8 @@
work_animation()
. = TRUE
if("eject")
if(beaker)
beaker.forceMove(drop_location())
if(Adjacent(usr) && !issilicon(usr))
usr.put_in_hands(beaker)
beaker = null
update_icon()
. = TRUE
replace_beaker(usr)
. = TRUE //no afterattack
if("dispense_recipe")
if(!is_operational() || QDELETED(cell))
return
@@ -269,7 +265,7 @@
if(beaker && dispensable_reagents.Find(r_id)) // but since we verify we have the reagent, it'll be fine
var/datum/reagents/R = beaker.reagents
var/free = R.maximum_volume - R.total_volume
var/actual = min(round(chemicals_to_dispense[key], res), (cell.charge * powerefficiency)*10, free)
var/actual = min(max(chemicals_to_dispense[key], res), (cell.charge * powerefficiency)*10, free)
if(actual)
if(!cell.use(actual / powerefficiency))
say("Not enough energy to complete operation!")
@@ -322,14 +318,12 @@
return
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
var/obj/item/reagent_containers/B = I
. = 1 //no afterattack
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
return
. = TRUE //no afterattack
if(!user.transferItemToLoc(B, src))
return
beaker = B
replace_beaker(user, B)
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
updateUsrDialog()
update_icon()
else if(user.a_intent != INTENT_HARM && !istype(I, /obj/item/card/emag))
to_chat(user, "<span class='warning'>You can't load [I] into [src]!</span>")
@@ -381,7 +375,17 @@
dispensable_reagents |= upgrade_reagents3
powerefficiency = round(newpowereff, 0.01)
/obj/machinery/chem_dispenser/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)
beaker.forceMove(drop_location())
if(user && Adjacent(user) && !issiliconoradminghost(user))
user.put_in_hands(beaker)
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
/obj/machinery/chem_dispenser/on_deconstruction()
cell = null
@@ -417,6 +421,12 @@
final_list += list(avoid_assoc_duplicate_keys(fuck[1],key_list) = text2num(fuck[2]))
return final_list
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
/obj/machinery/chem_dispenser/drinks/Initialize()
. = ..()
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE)
@@ -480,9 +490,16 @@
"tomatojuice",
"lemonjuice",
"menthol"
) //prevents the soda machine from obtaining chemical upgrades. .
upgrade_reagents = null
upgrade_reagents2 = null
)
upgrade_reagents = list(
"mushroomhallucinogen",
"nothing",
"cryoxadone"
)
upgrade_reagents2 = list(
"banana",
"berryjuice"
)
upgrade_reagents3 = null
emagged_reagents = list(
"thirteenloko",
@@ -535,18 +552,19 @@
"creme_de_cacao",
"triple_sec",
"sake"
)//prevents the booze machine from obtaining chemical upgrades.
upgrade_reagents = null
)
upgrade_reagents = list(
"ethanol",
"fernet"
)
upgrade_reagents2 = null
upgrade_reagents3 = null
emagged_reagents = list(
"ethanol",
"iron",
"alexander",
"clownstears",
"minttoxin",
"atomicbomb",
"fernet",
"aphro",
"aphro+"
)

View File

@@ -28,13 +28,23 @@
else
icon_state = "mixer0b"
/obj/machinery/chem_heater/proc/eject_beaker(mob/user)
/obj/machinery/chem_heater/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)
beaker.forceMove(drop_location())
if(Adjacent(user) && !issilicon(user))
if(user && Adjacent(user) && !issiliconoradminghost(user))
user.put_in_hands(beaker)
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
/obj/machinery/chem_heater/RefreshParts()
heater_coefficient = 0.1
@@ -58,21 +68,19 @@
return
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = 1 //no afterattack
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
. = TRUE //no afterattack
var/obj/item/reagent_containers/B = I
if(!user.transferItemToLoc(B, src))
return
if(!user.transferItemToLoc(I, src))
return
beaker = I
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
replace_beaker(user, B)
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
updateUsrDialog()
update_icon()
return
return ..()
/obj/machinery/chem_heater/on_deconstruction()
eject_beaker()
replace_beaker()
return ..()
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
@@ -122,5 +130,5 @@
target_temperature = CLAMP(target, 0, 1000)
if("eject")
on = FALSE
eject_beaker(usr)
replace_beaker(usr)
. = TRUE

View File

@@ -60,16 +60,6 @@
else
icon_state = "mixer0"
/obj/machinery/chem_master/proc/eject_beaker(mob/user)
if(beaker)
beaker.forceMove(drop_location())
if(Adjacent(user) && !issilicon(user))
user.put_in_hands(beaker)
else
adjust_item_drop_location(beaker)
beaker = null
update_icon()
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
if (prob(50))
qdel(src)
@@ -85,36 +75,49 @@
return
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = 1 // no afterattack
. = TRUE // no afterattack
if(panel_open)
to_chat(user, "<span class='warning'>You can't use the [src.name] while its panel is opened!</span>")
return
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
var/obj/item/reagent_containers/B = I
if(!user.transferItemToLoc(B, src))
return
if(!user.transferItemToLoc(I, src))
return
beaker = I
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
src.updateUsrDialog()
replace_beaker(user, B)
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
updateUsrDialog()
update_icon()
else if(!condi && istype(I, /obj/item/storage/pill_bottle))
if(bottle)
to_chat(user, "<span class='warning'>A pill bottle is already loaded into [src]!</span>")
return
if(!user.transferItemToLoc(I, src))
return
bottle = I
to_chat(user, "<span class='notice'>You add [I] into the dispenser slot.</span>")
src.updateUsrDialog()
updateUsrDialog()
else
return ..()
/obj/machinery/chem_master/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
/obj/machinery/chem_master/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)
beaker.forceMove(drop_location())
if(user && Adjacent(user) && !issiliconoradminghost(user))
user.put_in_hands(beaker)
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
/obj/machinery/chem_master/on_deconstruction()
eject_beaker()
replace_beaker(usr)
if(bottle)
bottle.forceMove(drop_location())
adjust_item_drop_location(bottle)
@@ -164,7 +167,7 @@
return
switch(action)
if("eject")
eject_beaker(usr)
replace_beaker(usr)
. = TRUE
if("ejectp")

View File

@@ -19,6 +19,12 @@
var/speed = 1
var/list/holdingitems
var/static/radial_examine = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine")
var/static/radial_eject = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_eject")
var/static/radial_grind = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_grind")
var/static/radial_juice = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_juice")
var/static/radial_mix = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_mix")
/obj/machinery/reagentgrinder/Initialize()
. = ..()
holdingitems = list()
@@ -51,7 +57,6 @@
if(A == beaker)
beaker = null
update_icon()
updateUsrDialog()
if(holdingitems[A])
holdingitems -= A
@@ -67,6 +72,18 @@
else
icon_state = "juicer0"
/obj/machinery/reagentgrinder/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)
beaker.forceMove(drop_location())
if(user && Adjacent(user) && !issiliconoradminghost(user))
user.put_in_hands(beaker)
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
//You can only screw open empty grinder
if(!beaker && !length(holdingitems) && default_deconstruction_screwdriver(user, icon_state, icon_state, I))
@@ -82,17 +99,14 @@
return TRUE
if (istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
if (!beaker)
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return TRUE
to_chat(user, "<span class='notice'>You slide [I] into [src].</span>")
beaker = I
update_icon()
updateUsrDialog()
else
to_chat(user, "<span class='warning'>There's already a container inside [src].</span>")
return TRUE //no afterattack
var/obj/item/reagent_containers/B = I
. = TRUE
if(!user.transferItemToLoc(B, src))
return
replace_beaker(user, B)
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
update_icon()
return
if(holdingitems.len >= limit)
to_chat(user, "<span class='warning'>[src] is filled to capacity!</span>")
@@ -108,8 +122,6 @@
to_chat(user, "<span class='notice'>You empty [I] into [src].</span>")
else
to_chat(user, "<span class='notice'>You fill [src] to the brim.</span>")
updateUsrDialog()
return TRUE
if(!I.grind_results && !I.juice_results)
@@ -125,104 +137,89 @@
if(user.transferItemToLoc(I, src))
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
holdingitems[I] = TRUE
updateUsrDialog()
return FALSE
/obj/machinery/reagentgrinder/ui_interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
. = ..()
var/is_chamber_empty = FALSE
var/is_beaker_ready = FALSE
var/processing_chamber = ""
var/beaker_contents = ""
var/dat = ""
if(!operating)
for (var/i in holdingitems)
var/obj/item/O = i
processing_chamber += "\A [O.name]<BR>"
if(operating || !user.canUseTopic(src, !issilicon(user)))
return
if (!processing_chamber)
is_chamber_empty = TRUE
processing_chamber = "Nothing."
if (!beaker)
beaker_contents = "<B>No beaker attached.</B><br>"
else
is_beaker_ready = TRUE
beaker_contents = "<B>The beaker contains:</B><br>"
var/anything = FALSE
for(var/datum/reagent/R in beaker.reagents.reagent_list)
anything = TRUE
beaker_contents += "[R.volume] - [R.name]<br>"
if(!anything)
beaker_contents += "Nothing<br>"
var/list/options = list()
dat = {"
<b>Processing chamber contains:</b><br>
[processing_chamber]<br>
[beaker_contents]<hr>
"}
if (is_beaker_ready)
if(!is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
dat += "<A href='?src=[REF(src)];action=grind'>Grind the reagents</a><BR>"
dat += "<A href='?src=[REF(src)];action=juice'>Juice the reagents</a><BR><BR>"
else if (beaker.reagents.total_volume)
dat += "<A href='?src=[REF(src)];action=mix'>Mix the reagents</a><BR><BR>"
if(length(holdingitems))
dat += "<A href='?src=[REF(src)];action=eject'>Eject the reagents</a><BR>"
if(beaker)
dat += "<A href='?src=[REF(src)];action=detach'>Detach the beaker</a><BR>"
if(beaker || length(holdingitems))
options["eject"] = radial_eject
if(isAI(user))
if(stat & NOPOWER)
return
options["examine"] = radial_examine
// if there is no power or it's broken, the procs will fail but the buttons will still show
if(length(holdingitems))
options["grind"] = radial_grind
options["juice"] = radial_juice
else if(beaker?.reagents.total_volume)
options["mix"] = radial_mix
var/choice
if(length(options) < 1)
return
if(length(options) == 1)
for(var/key in options)
choice = key
else
dat += "Please wait..."
choice = show_radial_menu(user, src, options, require_near = !issilicon(user))
var/datum/browser/popup = new(user, "reagentgrinder", "All-In-One Grinder")
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
popup.open(1)
return
// post choice verification
if(operating || (isAI(user) && stat & NOPOWER) || !user.canUseTopic(src, !issilicon(user)))
return
/obj/machinery/reagentgrinder/Topic(href, href_list)
if(..())
return
var/mob/user = usr
if(!user.canUseTopic(src))
return
if(stat & (NOPOWER|BROKEN))
return
user.set_machine(src)
if(operating)
updateUsrDialog()
return
switch(href_list["action"])
if ("grind")
switch(choice)
if("eject")
eject(user)
if("grind")
grind(user)
if("juice")
juice(user)
if("mix")
mix(user)
if("eject")
eject(user)
if("detach")
detach(user)
updateUsrDialog()
if("examine")
examine(user)
/obj/machinery/reagentgrinder/proc/detach(mob/user)
if(!beaker)
/obj/machinery/reagentgrinder/examine(mob/user)
. = ..()
if(!in_range(user, src) && !issilicon(user) && !isobserver(user))
to_chat(user, "<span class='warning'>You're too far away to examine [src]'s contents and display!</span>")
return
beaker.forceMove(drop_location())
if(Adjacent(user) && !issilicon(user))
user.put_in_hands(beaker)
beaker = null
update_icon()
updateUsrDialog()
if(operating)
to_chat(user, "<span class='warning'>\The [src] is operating.</span>")
return
if(beaker || length(holdingitems))
to_chat(user, "<span class='notice'>\The [src] contains:</span>")
if(beaker)
to_chat(user, "<span class='notice'>- \A [beaker].</span>")
for(var/i in holdingitems)
var/obj/item/O = i
to_chat(user, "<span class='notice'>- \A [O.name].</span>")
if(!(stat & (NOPOWER|BROKEN)))
to_chat(user, "<span class='notice'>The status display reads:</span>")
to_chat(user, "<span class='notice'>- Grinding reagents at <b>[speed*100]%</b>.<span>")
if(beaker)
for(var/datum/reagent/R in beaker.reagents.reagent_list)
to_chat(user, "<span class='notice'>- [R.volume] units of [R.name].</span>")
/obj/machinery/reagentgrinder/proc/eject(mob/user)
if(!length(holdingitems))
return
for(var/i in holdingitems)
var/obj/item/O = i
O.forceMove(drop_location())
holdingitems -= O
updateUsrDialog()
if(beaker)
replace_beaker(user)
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
holdingitems -= O
@@ -240,7 +237,6 @@
/obj/machinery/reagentgrinder/proc/operate_for(time, silent = FALSE, juicing = FALSE)
shake_for(time / speed)
updateUsrDialog()
operating = TRUE
if(!silent)
if(!juicing)
@@ -251,11 +247,10 @@
/obj/machinery/reagentgrinder/proc/stop_operating()
operating = FALSE
updateUsrDialog()
/obj/machinery/reagentgrinder/proc/juice()
power_change()
if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
if(!beaker || stat & (NOPOWER|BROKEN) || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
return
operate_for(50, juicing = TRUE)
for(var/obj/item/i in holdingitems)
@@ -274,7 +269,7 @@
/obj/machinery/reagentgrinder/proc/grind()
power_change()
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
if(!beaker || stat & (NOPOWER|BROKEN) || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
return
operate_for(60)
for(var/i in holdingitems)
@@ -296,13 +291,13 @@
/obj/machinery/reagentgrinder/proc/mix(mob/user)
//For butter and other things that would change upon shaking or mixing
power_change()
if(!beaker)
if(!beaker || stat & (NOPOWER|BROKEN))
return
operate_for(50, juicing = TRUE)
addtimer(CALLBACK(src, /obj/machinery/reagentgrinder/proc/mix_complete), 50)
/obj/machinery/reagentgrinder/proc/mix_complete()
if(beaker && beaker.reagents.total_volume)
if(beaker?.reagents.total_volume)
//Recipe to make Butter
var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF, 1)
beaker.reagents.remove_reagent("milk", MILK_TO_BUTTER_COEFF * butter_amt)

View File

@@ -33,6 +33,10 @@
var/addiction_stage4_end = 40
var/overdosed = 0 // You fucked up and this is now triggering its overdose effects, purge that shit quick.
var/self_consuming = FALSE
var/metabolizing = FALSE
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
. = ..()
@@ -68,6 +72,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

View File

@@ -111,7 +111,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
@@ -569,13 +569,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
@@ -593,7 +593,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!
@@ -605,7 +605,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)
@@ -671,7 +671,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))
@@ -722,7 +722,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
@@ -1534,7 +1534,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_desc = "If you're feeling low, count on the buttery flavor of our own bastion bourbon."
shot_glass_icon_state = "shotglassgreen"
/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
@@ -1618,7 +1618,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
@@ -1661,7 +1661,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)
@@ -1675,7 +1675,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>")
@@ -1796,7 +1796,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
@@ -1820,7 +1820,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

View File

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

View File

@@ -213,15 +213,15 @@
glass_desc = "White and nutritious goodness!"
/datum/reagent/consumable/milk/on_mob_life(mob/living/carbon/M)
if(M.getBruteLoss() && prob(20))
M.heal_bodypart_damage(1,0, 0)
if(HAS_TRAIT(M, TRAIT_CALCIUM_HEALER))
M.heal_bodypart_damage(1.5,0, 0)
. = 1
else
if(M.getBruteLoss() && prob(20))
M.heal_bodypart_damage(1,0, 0)
. = 1
if(holder.has_reagent("capsaicin"))
holder.remove_reagent("capsaicin", 2)
var/datum/dna/Mdna = M.has_dna()
if(Mdna && Mdna.species && (Mdna.species.id == "plasmaman" || Mdna.species.id == "skeleton"))
M.heal_bodypart_damage(1,0, 0)
. = 1
..()
/datum/reagent/consumable/soymilk
@@ -390,11 +390,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)
..()

View File

@@ -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")
@@ -168,11 +168,11 @@
var/jitter = TRUE
var/confusion = TRUE
/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)
..()
@@ -262,7 +262,7 @@
taste_description = "salt" // because they're bathsalts?
var/datum/brain_trauma/special/psychotic_brawling/bath_salts/rage
/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)
@@ -271,7 +271,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)
@@ -381,7 +381,7 @@
addiction_stage3_end = 40
addiction_stage4_end = 240
/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
@@ -392,7 +392,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

View File

@@ -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
@@ -401,7 +403,7 @@
metabolization_rate = 0.2 * REAGENTS_METABOLISM
taste_description = "mushroom"
/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)
@@ -686,7 +688,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
@@ -711,3 +713,14 @@
nutriment_factor = 5 * REAGENTS_METABOLISM
color = "#eef442" // rgb: 238, 244, 66
taste_description = "mournful honking"
/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

View File

@@ -366,7 +366,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
@@ -483,16 +483,24 @@
reagent_state = LIQUID
color = "#E6FFF0"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
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
/datum/reagent/medicine/sal_acid
name = "Salicyclic Acid"
id = "sal_acid"
@@ -630,11 +638,11 @@
overdose_threshold = 30
addiction_threshold = 25
/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)
..()
@@ -875,11 +883,11 @@
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 60
/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)
..()
@@ -1102,7 +1110,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)
@@ -1113,7 +1121,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
@@ -1188,11 +1196,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)
..()
@@ -1210,11 +1218,11 @@
color = "#F5F5F5"
self_consuming = TRUE
/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)
..()
@@ -1223,11 +1231,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)
@@ -1242,11 +1250,11 @@
taste_description = "salt" // it actually does taste salty
var/overdose_progress = 0 // to track overdose progress
/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)
..()

View File

@@ -196,11 +196,11 @@
glass_name = "glass of holy water"
glass_desc = "A glass of holy water."
/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)
..()
@@ -1241,12 +1241,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)
..()
@@ -1266,11 +1266,11 @@
color = "90560B"
taste_description = "burning"
/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)
..()
@@ -1723,7 +1723,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()
..()
@@ -1777,11 +1777,11 @@
taste_description = "water"
metabolization_rate = 0.25 * REAGENTS_METABOLISM
/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)
..()
@@ -1793,11 +1793,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)
@@ -1814,14 +1814,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)
@@ -1830,14 +1830,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)

View File

@@ -156,11 +156,11 @@
toxpwr = 0.5
taste_description = "death"
/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)
..()
@@ -178,11 +178,11 @@
toxpwr = 0.8
taste_description = "death"
/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)
..()
@@ -626,7 +626,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)
@@ -742,7 +742,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)
@@ -779,7 +779,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)
@@ -798,7 +798,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)
@@ -882,8 +882,69 @@
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)
/datum/reagent/toxin/bonehurtingjuice //oof ouch
name = "Bone Hurting Juice"
id = "bonehurtingjuice"
description = "A strange substance that looks a lot like water. Drinking it is oddly tempting. Oof ouch."
color = "#AAAAAA77" //RGBA: 170, 170, 170, 77
toxpwr = 0
taste_description = "bone hurting"
overdose_threshold = 20
/datum/reagent/toxin/bonehurtingjuice/on_mob_add(mob/living/carbon/M)
M.say("oof ouch my bones", forced = /datum/reagent/toxin/bonehurtingjuice)
/datum/reagent/toxin/bonehurtingjuice/on_mob_life(mob/living/carbon/M)
M.adjustStaminaLoss(7.5, 0)
if(HAS_TRAIT(M, TRAIT_CALCIUM_HEALER))
M.adjustBruteLoss(3.5, 0)
if(prob(12))
switch(rand(1, 3))
if(1)
var/list/possible_says = list("oof.", "ouch!", "my bones.", "oof ouch.", "oof ouch my bones.")
M.say(pick(possible_says), forced = /datum/reagent/toxin/bonehurtingjuice)
if(2)
var/list/possible_mes = list("oofs softly.", "looks like their bones hurt.", "grimaces, as though their bones hurt.")
M.say("*custom " + pick(possible_mes), forced = /datum/reagent/toxin/bonehurtingjuice)
if(3)
to_chat(M, "<span class='warning'>Your bones hurt!</span>")
return ..()
/datum/reagent/toxin/bonehurtingjuice/overdose_process(mob/living/carbon/M)
if(prob(6) && iscarbon(M)) //big oof
var/selected_part
switch(rand(1, 4)) //God help you if the same limb gets picked twice quickly.
if(1)
selected_part = BODY_ZONE_L_ARM
if(2)
selected_part = BODY_ZONE_R_ARM
if(3)
selected_part = BODY_ZONE_L_LEG
if(4)
selected_part = BODY_ZONE_R_LEG
var/obj/item/bodypart/bp = M.get_bodypart(selected_part)
if(M.dna.species.type != /datum/species/skeleton || M.dna.species.type != /datum/species/plasmaman || M.dna.species.type != /datum/species/golem/bone) //We're so sorry skeletons, you're so misunderstood
if(bp)
bp.receive_damage(0, 0, 200)
playsound(M, get_sfx("desceration"), 50, TRUE, -1)
M.visible_message("<span class='warning'>[M]'s bones hurt too much!!</span>", "<span class='danger'>Your bones hurt too much!!</span>")
M.say("OOF!!", forced = /datum/reagent/toxin/bonehurtingjuice)
else //SUCH A LUST FOR REVENGE!!!
to_chat(M, "<span class='warning'>A phantom limb hurts!</span>")
M.say("Why are we still here, just to suffer?", forced = /datum/reagent/toxin/bonehurtingjuice)
else //you just want to socialize
if(bp)
playsound(M, get_sfx("desceration"), 50, TRUE, -1)
M.visible_message("<span class='warning'>[M] rattles loudly and flails around!!</span>", "<span class='danger'>Your bones hurt so much that your missing muscles spasm!!</span>")
M.say("OOF!!", forced=/datum/reagent/toxin/bonehurtingjuice)
bp.receive_damage(200, 0, 0) //But I don't think we should
else
to_chat(M, "<span class='warning'>Your missing arm aches from wherever you left it.</span>")
M.emote("sigh")
return ..()

View File

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

View File

@@ -64,8 +64,8 @@
strengthdiv = 8
for(var/mob/living/simple_animal/revenant/R in get_hearers_in_view(7,get_turf(holder.my_atom)))
var/deity
if(SSreligion.deity)
deity = SSreligion.deity
if(GLOB.deity)
deity = GLOB.deity
else
deity = "Christ"
to_chat(R, "<span class='userdanger'>The power of [deity] compels you!</span>")

View File

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

View File

@@ -119,3 +119,10 @@
id = "mimesbane"
results = list("mimesbane" = 3)
required_reagents = list("radium" = 1, "mutetoxin" = 1, "nothing" = 1)
/datum/chemical_reaction/bonehurtingjuice
name = "Bone Hurting Juice"
id = "bonehurtingjuice"
results = list("bonehurtingjuice" = 5)
required_reagents = list("mutagen" = 1, "itching_powder" = 3, "milk" = 1)
mix_message = "<span class='danger'>The mixture suddenly becomes clear and looks a lot like water. You feel a strong urge to drink it.</span>"

View File

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