|
|
|
@@ -1,37 +1,34 @@
|
|
|
|
|
// The organ jar - a 150u bottle that can hold a single organ
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar
|
|
|
|
|
// The organ jar - a 120u beaker that can hold a single organ
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar
|
|
|
|
|
name = "organ jar"
|
|
|
|
|
desc = "A jar large enough to put an organ inside it."
|
|
|
|
|
possible_transfer_amounts = list(10, 20, 30, 50, 150)
|
|
|
|
|
// It's pretty big
|
|
|
|
|
volume = 150
|
|
|
|
|
desc = "A large shatter-resistant jar, unwieldy for the sake of chemistry, but big enough to put an organ inside of."
|
|
|
|
|
icon_state = "organ_jar"
|
|
|
|
|
fill_icon_state = "organ_jar"
|
|
|
|
|
inhand_icon_state = "atoxinbottle"
|
|
|
|
|
worn_icon_state = "bottle"
|
|
|
|
|
// The plastic makes it more shatter-proof!
|
|
|
|
|
custom_materials = list(/datum/material/glass=SHEET_MATERIAL_AMOUNT*1.25, /datum/material/plastic=SHEET_MATERIAL_AMOUNT * 1.5)
|
|
|
|
|
volume = 120
|
|
|
|
|
// Difficult to transfer from in small amounts (to discourage using it for things besides organs)
|
|
|
|
|
amount_per_transfer_from_this = 20
|
|
|
|
|
possible_transfer_amounts = list(20, 40, 60, 120)
|
|
|
|
|
fill_icon_thresholds = list(0, 1, 20, 40, 60, 80, 100)
|
|
|
|
|
w_class = WEIGHT_CLASS_SMALL // Organs are small by default, so the jar should be at least small as well
|
|
|
|
|
// The organ that is currently inside the jar
|
|
|
|
|
/// The organ that is currently inside the jar
|
|
|
|
|
var/obj/item/organ/held_organ = null
|
|
|
|
|
// Whether the jar should preserve the organ inside (which would only happen if it's full of formaldehyde)
|
|
|
|
|
/// Whether the jar is filled to capacity with formaldehyde, preserving any organ inside
|
|
|
|
|
var/full_of_formaldehyde = FALSE
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/examine(mob/user)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/examine(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
. += span_info("Any organ inside the jar will be preserved if it is filled with formaldehyde.")
|
|
|
|
|
. += span_info("Any organ inside the jar will be preserved if it is entirely filled with formaldehyde.")
|
|
|
|
|
if(held_organ && held_organ.GetComponent(/datum/component/ghostrole_on_revive))
|
|
|
|
|
. += span_smallnoticeital("The brain is twitching...") // Guaranteed to be a brain if it has that component
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/Initialize(mapload)
|
|
|
|
|
. = ..()
|
|
|
|
|
update_appearance()
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/Destroy(force)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/Destroy(force)
|
|
|
|
|
. = ..()
|
|
|
|
|
QDEL_NULL(held_organ)
|
|
|
|
|
|
|
|
|
|
// Alt click lets you take the organ out, if it's present
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/click_alt(mob/user)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/click_alt(mob/user)
|
|
|
|
|
if(held_organ)
|
|
|
|
|
balloon_alert(user, "removed [held_organ]")
|
|
|
|
|
user.put_in_hands(held_organ)
|
|
|
|
@@ -45,7 +42,7 @@
|
|
|
|
|
|
|
|
|
|
// Clicking on the jar with an organ lets you put the organ inside, if there isn't one already
|
|
|
|
|
// Otherwise it should act like a normal bottle
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
|
|
|
. = ..()
|
|
|
|
|
if(!istype(tool, /obj/item/organ))
|
|
|
|
|
return
|
|
|
|
@@ -66,7 +63,7 @@
|
|
|
|
|
// Organ icon size goes from 32 to this
|
|
|
|
|
#define JAR_INNER_ICON_SIZE 24
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/update_overlays()
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/update_overlays()
|
|
|
|
|
. = ..()
|
|
|
|
|
// Draw the organ icon inside the jar, if present
|
|
|
|
|
if(!isnull(held_organ))
|
|
|
|
@@ -83,13 +80,13 @@
|
|
|
|
|
|
|
|
|
|
#undef JAR_INNER_ICON_SIZE
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/on_reagent_change(datum/reagents/holder, ...)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/on_reagent_change(datum/reagents/holder, ...)
|
|
|
|
|
. = ..()
|
|
|
|
|
full_of_formaldehyde = !!holder.has_reagent(/datum/reagent/toxin/formaldehyde, amount = holder.maximum_volume)
|
|
|
|
|
check_organ_freeze()
|
|
|
|
|
|
|
|
|
|
// Proc that stops the held organ from rotting if the jar is full of formaldehyde
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/proc/check_organ_freeze()
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/proc/check_organ_freeze()
|
|
|
|
|
if(isnull(held_organ))
|
|
|
|
|
return
|
|
|
|
|
if(full_of_formaldehyde)
|
|
|
|
@@ -106,15 +103,15 @@
|
|
|
|
|
// A note with a "discarded brain from the recovered crew" flavor will appear upon examining more
|
|
|
|
|
#define NOTE_DISCARDED_LOST_CREW 2
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/brain_in_a_jar
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/brain_in_a_jar
|
|
|
|
|
// Which note to show when someone examins more
|
|
|
|
|
var/note_type = NOTE_STUCK_IN_MAIL
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/brain_in_a_jar/examine(mob/user)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/brain_in_a_jar/examine(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
. += span_notice("<i>You can see a note attached to the bottom..</i>")
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/brain_in_a_jar/examine_more(mob/user)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/brain_in_a_jar/examine_more(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
// Flavor for why the brain is scarred
|
|
|
|
|
switch(note_type)
|
|
|
|
@@ -132,7 +129,7 @@
|
|
|
|
|
I know you like these sorts of things. Signed, ZZZ.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/brain_in_a_jar/Initialize(mapload)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/brain_in_a_jar/Initialize(mapload)
|
|
|
|
|
. = ..()
|
|
|
|
|
note_type = rand(0, 2) // Attach a random note to it
|
|
|
|
|
var/obj/item/organ/brain/scarred_brain = new() // Make a new brain
|
|
|
|
@@ -149,7 +146,7 @@
|
|
|
|
|
update_appearance()
|
|
|
|
|
|
|
|
|
|
// All this does is add a random special brain trauma + add recovered crew antag datum for logging
|
|
|
|
|
/obj/item/reagent_containers/cup/organ_jar/brain_in_a_jar/proc/handle_revival(obj/item/organ/brain/brain_to_scar)
|
|
|
|
|
/obj/item/reagent_containers/cup/beaker/organ_jar/brain_in_a_jar/proc/handle_revival(obj/item/organ/brain/brain_to_scar)
|
|
|
|
|
brain_to_scar.gain_trauma_type(BRAIN_TRAUMA_SPECIAL, TRAUMA_RESILIENCE_ABSOLUTE, natural_gain = TRUE)
|
|
|
|
|
var/mob/living/carbon/human/owner = brain_to_scar.owner
|
|
|
|
|
owner.mind.add_antag_datum(/datum/antagonist/recovered_crew) // for tracking mostly (c)
|
|
|
|
|