Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thurible - Holy Incense Burner #26713

Merged
merged 18 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions code/game/objects/items/weapons/thurible.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/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
/// 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)
container_type = REFILLABLE
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
reagents.set_reacting(FALSE)

/obj/item/thurible/Destroy()
STOP_PROCESSING(SSobj, src)
QDEL_NULL(reagents)
return ..()

/obj/item/thurible/examine(mob/user)
. = ..()
. += "<span class='notice'>[src] can hold up to [reagents.maximum_volume] units.</span>"
. += "<span class='notice'>Contains [reagents.total_volume] units of various reagents.</span>"

/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(in_inventory)
for(var/mob/M in view(0, get_turf(loc)))
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
if(M.r_hand == src || M.l_hand == src)
M.update_inv_l_hand()
M.update_inv_r_hand()
return ..()

/obj/item/thurible/attackby(obj/item/fire_source, mob/user, params)
. = ..()
if(fire_source.get_heat())
user.visible_message(
"<span class='notice'>[user] lights [src] with [fire_source].</span>",
"<span class='notice'>You light [src] with [fire_source].</span>",
"<span class='warning'>You hear a low whoosh.</span>"
)
light(user)

/obj/item/thurible/attack_self(mob/user)
if(lit)
to_chat(user, "<span class='warning'>You extinguish [src].</span>")
put_out(user)
return ..()

/obj/item/thurible/can_enter_storage(obj/item/storage/S, mob/user)
if(lit)
to_chat(user, "<span class='warning'>[S] can't hold \the [initial(name)] while it's lit!</span>") // 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)
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
var/found_forbidden_reagent = FALSE
for(var/datum/reagent/R as anything in reagents.reagent_list)
if(R.id == "unholywater")
corrupted = TRUE
visible_message(
"<span class='notice'>You corrupt [src] with unholy water!</span>",
"<span class='warning'>You hear a strange gurgling.</span>"
)
return
if(!safe_chem_list.Find(R.id))
reagents.del_reagent(R.id)
found_forbidden_reagent = TRUE
if(found_forbidden_reagent)
visible_message(
"<span class='notice'>[src] banishes an unholy substance!</span>",
"<span class='warning'>You hear a strange fizzing.</span>"
)

/// Lights the thurible and starts processing reagents
/obj/item/thurible/proc/light(mob/user)
if(lit)
to_chat(user, "<span class='warning'>[src] is already lit!</span>")
return

if(!reagents.total_volume)
to_chat(user, "<span class='warning'>[src] is out of fuel!</span>")
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)
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
put_out()
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Binary file modified icons/mob/inhands/religion_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/religion_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/weapons/magical_weapons.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,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"
Expand Down