Files
Bubberstation/code/datums/elements/easy_ignite.dm
Alexis 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

107 lines
3.5 KiB
Plaintext

/// Creates a hotspot and deletes the owner atom upon being exposed to high temperatures, by Melbert
/datum/element/easy_ignite
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY|ELEMENT_BESPOKE // because turfs
argument_hash_start_idx = 2
/// Temp required for ignition
var/required_temp = 480
/datum/element/easy_ignite/Attach(datum/target, required_temp = 480)
. = ..()
if(!isatom(target) || isarea(target))
return ELEMENT_INCOMPATIBLE
src.required_temp = required_temp
RegisterSignal(target, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(attackby_react))
RegisterSignal(target, COMSIG_ATOM_FIRE_ACT, PROC_REF(flame_react))
RegisterSignal(target, COMSIG_ATOM_BULLET_ACT, PROC_REF(projectile_react))
RegisterSignal(target, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER), PROC_REF(welder_react))
if(isturf(target))
RegisterSignal(target, COMSIG_TURF_EXPOSE, PROC_REF(hotspots_react))
/datum/element/easy_ignite/Detach(datum/source, ...)
. = ..()
UnregisterSignal(source, COMSIG_ATOM_ITEM_INTERACTION)
UnregisterSignal(source, COMSIG_ATOM_FIRE_ACT)
UnregisterSignal(source, COMSIG_ATOM_BULLET_ACT)
UnregisterSignal(source, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER))
if(isturf(source))
UnregisterSignal(source, COMSIG_TURF_EXPOSE)
/datum/element/easy_ignite/proc/ignite(atom/igniting, mob/user)
var/delete_after = TRUE
igniting.visible_message(span_warning("[igniting] catch[igniting.p_es()] fire!"), span_warning("You ignite into flames!"))
new /obj/effect/hotspot(isturf(igniting) ? igniting : igniting.loc)
if(isturf(igniting))
var/turf/parent_turf = igniting
parent_turf.ScrapeAway(1, CHANGETURF_INHERIT_AIR)
delete_after = FALSE
// Logging-related
var/log_message = "ignited [igniting]"
if(user)
user.log_message(log_message, LOG_ATTACK, log_globally = FALSE)//only individual log
else
log_message = "[key_name(user)] " + log_message + " by fire"
log_attack(log_message)
if(delete_after && !QDELETED(igniting))
qdel(igniting)
/datum/element/easy_ignite/proc/flame_react(obj/item/source, exposed_temperature, exposed_volume)
SIGNAL_HANDLER
if(exposed_temperature > required_temp)
ignite(source)
/datum/element/easy_ignite/proc/hotspots_react(obj/item/source, air, exposed_temperature)
SIGNAL_HANDLER
if(exposed_temperature > required_temp)
ignite(source)
/datum/element/easy_ignite/proc/attackby_react(obj/item/source, mob/user, obj/item/tool, modifiers)
SIGNAL_HANDLER
if(tool.get_temperature() < FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
return NONE
if (!item_ignition(source, tool, user))
return ITEM_INTERACT_BLOCKING
ignite(source, user)
return ITEM_INTERACT_SUCCESS
/datum/element/easy_ignite/proc/projectile_react(obj/item/source, obj/projectile/shot)
SIGNAL_HANDLER
if(shot.damage_type == BURN && shot.damage > 0)
ignite(source, shot.firer)
/datum/element/easy_ignite/proc/welder_react(obj/item/source, mob/user, obj/item/tool)
SIGNAL_HANDLER
if(tool.get_temperature() < FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
return NONE
if (!item_ignition(source, tool, user))
return ITEM_INTERACT_BLOCKING
return ITEM_INTERACT_SUCCESS
/datum/element/easy_ignite/proc/item_ignition(obj/item/source, obj/item/tool, mob/user)
if(tool.get_temperature() >= required_temp)
source.visible_message(
span_warning("[user] ignites [source] with [tool]!"),
span_warning("You ignite [source] with [tool]!"),
)
ignite(source, user)
return TRUE
source.visible_message(
span_warning("[user] tries to ignite [source] with [tool]!"),
span_warning("You try to ignite [source] with [tool], but it's not hot enough!"),
)
return FALSE