From e698aaf3fb40494c7d2656e06c0bd68bca0b82b2 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 22 Aug 2021 15:54:10 +0200 Subject: [PATCH] Fixes hot ice using the wrong numbers for the plasma. (#60406) (#7697) * Implements a combustible_flooder component on plasma and hot ice. Numbers made to preserve old behaviour as much as possible for plasma. Nerfs hot ice to be in line with the original tweak PR * Limited to only hot ice, removed traces of override temp * Renamed gas_name into gas_id Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> --- code/datums/components/combustible_flooder.dm | 56 +++++++++++++++++++ code/datums/components/hot_ice.dm | 40 ------------- code/datums/materials/basemats.dm | 4 +- tgstation.dme | 2 +- 4 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 code/datums/components/combustible_flooder.dm delete mode 100644 code/datums/components/hot_ice.dm diff --git a/code/datums/components/combustible_flooder.dm b/code/datums/components/combustible_flooder.dm new file mode 100644 index 00000000000..7007cde65e5 --- /dev/null +++ b/code/datums/components/combustible_flooder.dm @@ -0,0 +1,56 @@ +/datum/component/combustible_flooder + // Gas type, molar count, and temperature. All self explanatory. + var/gas_id + var/gas_amount + var/temp_amount + +/datum/component/combustible_flooder/Initialize(gas_id, gas_amount, temp_amount) + + src.gas_id = gas_id + src.gas_amount = gas_amount + src.temp_amount = temp_amount + + RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/attackby_react) + RegisterSignal(parent, COMSIG_ATOM_FIRE_ACT, .proc/flame_react) + +/datum/component/combustible_flooder/UnregisterFromParent() + UnregisterSignal(parent, COMSIG_PARENT_ATTACKBY) + UnregisterSignal(parent, COMSIG_ATOM_FIRE_ACT) + +/// Do the flooding. +/datum/component/combustible_flooder/proc/flood(mob/user, temp_amount) + var/turf/open/flooded_turf = get_turf(parent) + flooded_turf.atmos_spawn_air("[gas_id]=[gas_amount];TEMP=[temp_amount]") + + // Logging-related + var/admin_message = "[parent] ignited in [ADMIN_VERBOSEJMP(flooded_turf)]" + var/log_message = "[parent] ignited in [AREACOORD(flooded_turf)]" + if(user) + admin_message += " by [ADMIN_LOOKUPFLW(user)]" + log_message += " by [key_name(user)]" + else + admin_message += " by fire" + log_message += " by fire" + message_admins(admin_message) + log_game(log_message) + + // For floors + if(isturf(parent)) + var/turf/K = parent + K.ScrapeAway(1, CHANGETURF_INHERIT_AIR) + else + qdel(parent) + +/// Hotspot related flooding reaction. +/datum/component/combustible_flooder/proc/flame_react(datum/source, exposed_temperature, exposed_volume) + SIGNAL_HANDLER + + if(exposed_temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) + flood(temp_amount = exposed_temperature) + +/// Being attacked by something +/datum/component/combustible_flooder/proc/attackby_react(datum/source, obj/item/thing, mob/user, params) + SIGNAL_HANDLER + + if(thing.get_temperature() > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) + flood(user, thing.get_temperature()) diff --git a/code/datums/components/hot_ice.dm b/code/datums/components/hot_ice.dm deleted file mode 100644 index 018dfe800d1..00000000000 --- a/code/datums/components/hot_ice.dm +++ /dev/null @@ -1,40 +0,0 @@ -/datum/component/hot_ice - var/gas_name - var/gas_amount - var/temp_amount - -/datum/component/hot_ice/Initialize(gas_name, gas_amount, temp_amount) - - src.gas_name = gas_name - src.gas_amount = gas_amount - src.temp_amount = temp_amount - - RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/attackby_react) - RegisterSignal(parent, COMSIG_ATOM_FIRE_ACT, .proc/flame_react) - -/datum/component/hot_ice/UnregisterFromParent() - UnregisterSignal(parent, COMSIG_PARENT_ATTACKBY) - UnregisterSignal(parent, COMSIG_ATOM_FIRE_ACT) - -/datum/component/hot_ice/proc/hot_ice_melt(mob/user) - var/turf/open/T = get_turf(parent) - T.atmos_spawn_air("[gas_name]=[gas_amount];TEMP=[temp_amount]") - message_admins("Hot Ice ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(T)]") - log_game("Hot Ice ignited by [key_name(user)] in [AREACOORD(T)]") - if(isturf(parent)) - var/turf/K = parent - K.ScrapeAway(1, CHANGETURF_INHERIT_AIR) - else - qdel(parent) - -/datum/component/hot_ice/proc/flame_react(datum/source, exposed_temperature, exposed_volume) - SIGNAL_HANDLER - - if(exposed_temperature > T0C + 100) - hot_ice_melt() - -/datum/component/hot_ice/proc/attackby_react(datum/source, obj/item/thing, mob/user, params) - SIGNAL_HANDLER - - if(thing.get_temperature()) - hot_ice_melt(user) diff --git a/code/datums/materials/basemats.dm b/code/datums/materials/basemats.dm index 7aa35fbe355..dde92886869 100644 --- a/code/datums/materials/basemats.dm +++ b/code/datums/materials/basemats.dm @@ -333,10 +333,10 @@ Unless you know what you're doing, only use the first three numbers. They're in /datum/material/hot_ice/on_applied(atom/source, amount, material_flags) . = ..() - source.AddComponent(/datum/component/hot_ice, "plasma", amount*150, amount*20+300) + source.AddComponent(/datum/component/combustible_flooder, "plasma", amount*1.5, amount*0.2+300) /datum/material/hot_ice/on_removed(atom/source, amount, material_flags) - qdel(source.GetComponent(/datum/component/hot_ice, "plasma", amount*150, amount*20+300)) + qdel(source.GetComponent(/datum/component/combustible_flooder)) return ..() /datum/material/hot_ice/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) diff --git a/tgstation.dme b/tgstation.dme index 3b489eaec39..47f2ef4aa43 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -552,6 +552,7 @@ #include "code\datums\components\caltrop.dm" #include "code\datums\components\chasm.dm" #include "code\datums\components\codeword_hearing.dm" +#include "code\datums\components\combustible_flooder.dm" #include "code\datums\components\connect_loc_behalf.dm" #include "code\datums\components\construction.dm" #include "code\datums\components\cracked.dm" @@ -575,7 +576,6 @@ #include "code\datums\components\gunpoint.dm" #include "code\datums\components\heirloom.dm" #include "code\datums\components\holderloving.dm" -#include "code\datums\components\hot_ice.dm" #include "code\datums\components\igniter.dm" #include "code\datums\components\infective.dm" #include "code\datums\components\itempicky.dm"