diff --git a/code/game/objects/items/weapons/thurible.dm b/code/game/objects/items/weapons/thurible.dm new file mode 100644 index 00000000000..bf1feabf93d --- /dev/null +++ b/code/game/objects/items/weapons/thurible.dm @@ -0,0 +1,174 @@ +/obj/item/thurible + name = "thurible" + desc = "A religious artifact used to burn and spread incense when swung from the attached chain." + icon = 'icons/obj/weapons/magical_weapons.dmi' + lefthand_file = 'icons/mob/inhands/religion_lefthand.dmi' + righthand_file = 'icons/mob/inhands/religion_righthand.dmi' + icon_state = "thurible" + item_state = "thurible" + force = 10 + throwforce = 7 + w_class = WEIGHT_CLASS_NORMAL + flags = CONDUCT + container_type = REFILLABLE + /// Whether or not the thurible can be loaded with harmful chems + var/corrupted = FALSE + /// Has the thurible been ignited? + var/lit = FALSE + /// List of chemicals considered safe for the thurible + var/static/list/safe_chem_list = list("antihol", "charcoal", "epinephrine", "insulin", "teporone", "salbutamol", "omnizine", + "weak_omnizine", "godblood", "potass_iodide", "oculine", "mannitol", "spaceacillin", "salglu_solution", + "sal_acid", "cryoxadone", "sugar", "hydrocodone", "mitocholide", "rezadone", "menthol", + "mutadone", "sanguine_reagent", "iron", "ephedrine", "heparin", "corazone", "sodiumchloride", + "lavaland_extract", "synaptizine", "bicaridine", "kelotane", "water", "holywater", "lsd", "thc", "happiness", + "cbd", "space_drugs", "nicotine", "jestosterone", "nothing") + /// How many reagents are consumed with each swing? + var/swing_reagents_consumed = 2 + +/obj/item/thurible/Initialize(mapload) + . = ..() + create_reagents(50) + reagents.set_reacting(FALSE) + +/obj/item/thurible/Destroy() + STOP_PROCESSING(SSobj, src) + QDEL_NULL(reagents) + return ..() + +/obj/item/thurible/examine(mob/user) + . = ..() + . += "[src] can hold up to [reagents.maximum_volume] units." + . += "Contains [reagents.total_volume] units of various reagents." + +/obj/item/thurible/process() + swing() + +/obj/item/thurible/update_appearance() + if(lit) + icon_state = "thurible-lit" + item_state = "thurible-lit" + else + icon_state = "thurible" + item_state = "thurible" + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.r_hand == src || H.l_hand == src) + H.update_inv_l_hand() + H.update_inv_r_hand() + return ..() + +/obj/item/thurible/attackby(obj/item/fire_source, mob/user, params) + . = ..() + if(fire_source.get_heat()) + user.visible_message( + "[user] lights [src] with [fire_source].", + "You light [src] with [fire_source].", + "You hear a low whoosh." + ) + light(user) + +/obj/item/thurible/attack_self(mob/user) + if(lit) + to_chat(user, "You extinguish [src].") + put_out(user) + return ..() + +/obj/item/thurible/can_enter_storage(obj/item/storage/S, mob/user) + if(lit) + to_chat(user, "[S] can't hold \the [initial(name)] while it's lit!") // initial(name) so it doesn't say "lit" twice in a row + return FALSE + return TRUE + +/obj/item/thurible/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE) + . = ..() + light() + +/obj/item/thurible/on_reagent_change() + . = ..() + if(corrupted) + return + var/found_forbidden_reagent = FALSE + for(var/datum/reagent/R as anything in reagents.reagent_list) + if(R.id == "unholywater") + corrupted = TRUE + visible_message( + "You corrupt [src] with unholy water!", + "You hear a strange gurgling." + ) + return + if(!safe_chem_list.Find(R.id)) + reagents.del_reagent(R.id) + found_forbidden_reagent = TRUE + if(found_forbidden_reagent) + visible_message( + "[src] banishes an unholy substance!", + "You hear a strange fizzing." + ) + +/// Lights the thurible and starts processing reagents +/obj/item/thurible/proc/light(mob/user) + if(lit) + to_chat(user, "[src] is already lit!") + return + + if(!reagents.total_volume) + to_chat(user, "[src] is out of fuel!") + return + + // Plasma explodes when exposed to fire. + if(reagents.get_reagent_amount("plasma")) + var/datum/effect_system/reagents_explosion/E = new() + E.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0) + E.start() + return + + // Fuel explodes, too, but much less violently. + if(reagents.get_reagent_amount("fuel")) + var/datum/effect_system/reagents_explosion/E = new() + E.set_up(round(reagents.get_reagent_amount("fuel") / 5, 1), get_turf(src), 0, 0) + E.start() + return + + // And black powder... but more violently. + if(reagents.get_reagent_amount("blackpowder")) + var/datum/effect_system/reagents_explosion/E = new() + E.set_up(round(reagents.get_reagent_amount("blackpowder") / 2, 1), get_turf(src), 0, 0) + E.start() + return + + lit = TRUE + reagents.set_reacting(TRUE) + reagents.handle_reactions() + START_PROCESSING(SSobj, src) + set_light(2, 0.3, "#E38F46") + update_appearance() + return TRUE + +/// Extinguishes the thurible and stops processing +/obj/item/thurible/proc/put_out(mob/user) + lit = FALSE + STOP_PROCESSING(SSobj, src) + set_light(0) + update_appearance() + return TRUE + +/// Spreads reagents in a 3x3 area centered on the thurible +/obj/item/thurible/proc/swing() + var/obj/released_reagents = new + released_reagents.create_reagents(2) + reagents.trans_to(released_reagents, swing_reagents_consumed) + var/list/mobs_to_smoke = list() + for(var/atom/A in view(1, get_turf(src))) + released_reagents.reagents.reaction(A) + if(iscarbon(A)) + var/mob/living/carbon/C = A + if(C.can_breathe_gas()) + mobs_to_smoke += C + + var/percentage_to_add = released_reagents.reagents.total_volume / length(mobs_to_smoke) // Divide the amount of reagents spread around by the number of people inhaling it + + for(var/mob/living/carbon/smoker as anything in mobs_to_smoke) + released_reagents.reagents.copy_to(smoker, percentage_to_add) + + if(reagents.total_volume <= 0) + put_out() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm b/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm index ba3921954fc..ad59607aa3a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm @@ -12,3 +12,4 @@ new /obj/item/storage/fancy/candle_box/eternal(src) new /obj/item/storage/fancy/candle_box/eternal(src) new /obj/item/storage/fancy/candle_box/eternal(src) + new /obj/item/thurible(src) diff --git a/icons/mob/inhands/religion_lefthand.dmi b/icons/mob/inhands/religion_lefthand.dmi index c4338544e5d..d866505d075 100644 Binary files a/icons/mob/inhands/religion_lefthand.dmi and b/icons/mob/inhands/religion_lefthand.dmi differ diff --git a/icons/mob/inhands/religion_righthand.dmi b/icons/mob/inhands/religion_righthand.dmi index 4603a803fdd..b60de504316 100644 Binary files a/icons/mob/inhands/religion_righthand.dmi and b/icons/mob/inhands/religion_righthand.dmi differ diff --git a/icons/obj/weapons/magical_weapons.dmi b/icons/obj/weapons/magical_weapons.dmi index 78224676efe..f8be67a8c08 100644 Binary files a/icons/obj/weapons/magical_weapons.dmi and b/icons/obj/weapons/magical_weapons.dmi differ diff --git a/paradise.dme b/paradise.dme index dcfa51943b3..ae7f4217e0f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1209,6 +1209,7 @@ #include "code\game\objects\items\weapons\tape.dm" #include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\teleprod.dm" +#include "code\game\objects\items\weapons\thurible.dm" #include "code\game\objects\items\weapons\twohanded.dm" #include "code\game\objects\items\weapons\vending_items.dm" #include "code\game\objects\items\weapons\weaponry.dm"