/obj/item/reagent_containers name = "Container" desc = "..." icon = 'icons/obj/chemical.dmi' icon_state = null w_class = WEIGHT_CLASS_TINY var/amount_per_transfer_from_this = 5 var/visible_transfer_rate = TRUE var/possible_transfer_amounts = list(5,10,15,25,30) var/volume = 30 var/list/list_reagents = null var/spawned_disease = null var/disease_amount = 20 var/has_lid = FALSE // Used for containers where we want to put lids on and off var/temperature_min = 0 // To limit the temperature of a reagent container can atain when exposed to heat/cold var/temperature_max = 10000 /obj/item/reagent_containers/AltClick(mob/user) if(!Adjacent(user) || !length(possible_transfer_amounts) || !ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) return var/new_transfer_rate = tgui_input_list(user, "Amount per transfer from this:", "[src]", possible_transfer_amounts) if(!new_transfer_rate) return if(!Adjacent(user)) to_chat(user, "You have moved too far away!") return if(!ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) to_chat(user, "You can't use your hands!") return amount_per_transfer_from_this = new_transfer_rate to_chat(user, "[src] will now transfer [amount_per_transfer_from_this] units at a time.") /obj/item/reagent_containers/Initialize(mapload) . = ..() if(!reagents) // Some subtypes create their own reagents create_reagents(volume, temperature_min, temperature_max) if(spawned_disease) var/datum/disease/F = new spawned_disease(0) var/list/data = list("viruses" = list(F), "blood_color" = "#A10808") reagents.add_reagent("blood", disease_amount, data) add_initial_reagents() /obj/item/reagent_containers/proc/add_initial_reagents() if(list_reagents) reagents.add_reagent_list(list_reagents) /obj/item/reagent_containers/ex_act() if(reagents) for(var/datum/reagent/R in reagents.reagent_list) R.on_ex_act() if(!QDELETED(src)) ..() /obj/item/reagent_containers/proc/add_lid() if(has_lid) container_type ^= REFILLABLE | DRAINABLE update_icon(UPDATE_OVERLAYS) /obj/item/reagent_containers/proc/remove_lid() if(has_lid) container_type |= REFILLABLE | DRAINABLE update_icon(UPDATE_OVERLAYS) /obj/item/reagent_containers/attack_self(mob/user) if(has_lid) if(is_open_container()) to_chat(usr, "You put the lid on [src].") add_lid() else to_chat(usr, "You take the lid off [src].") remove_lid() /obj/item/reagent_containers/attack(mob/M, mob/user, def_zone) if(user.a_intent == INTENT_HARM) return ..() /obj/item/reagent_containers/wash(mob/user, atom/source) if(is_open_container()) if(reagents.total_volume >= volume) to_chat(user, "[src] is full.") return else reagents.add_reagent("water", min(volume - reagents.total_volume, amount_per_transfer_from_this)) to_chat(user, "You fill [src] from [source].") return ..() /obj/item/reagent_containers/examine(mob/user) . = ..() if(visible_transfer_rate) . += "It will transfer [amount_per_transfer_from_this] unit[amount_per_transfer_from_this != 1 ? "s" : ""] at a time." // Items that have no valid possible_transfer_amounts shouldn't say their transfer rate is variable if(possible_transfer_amounts) . += "Alt-Click to change the transfer amount."