mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
* 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>
This commit is contained in:
co-authored by
vincentiusvin
parent
36f173ed03
commit
e698aaf3fb
@@ -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())
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user