mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
[MIRROR] Exposure fix (#687)
* Fix chemical exposure (#53491) * Exposure fix Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
This commit is contained in:
+2
-1
@@ -492,7 +492,8 @@
|
||||
* - show_message: Whether to display anything to mobs when they are exposed.
|
||||
*/
|
||||
/atom/proc/expose_reagents(list/reagents, datum/reagents/source, methods=TOUCH, volume_modifier=1, show_message=TRUE)
|
||||
if((. = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, methods, volume_modifier, show_message)) & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, methods, volume_modifier, show_message)
|
||||
if(. & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
return
|
||||
|
||||
for(var/reagent in reagents)
|
||||
|
||||
@@ -358,7 +358,8 @@
|
||||
|
||||
/// Handles exposing an object to reagents.
|
||||
/obj/expose_reagents(list/reagents, datum/reagents/source, methods=TOUCH, volume_modifier=1, show_message=TRUE)
|
||||
if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
. = ..()
|
||||
if(. & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
return
|
||||
|
||||
for(var/reagent in reagents)
|
||||
|
||||
@@ -583,7 +583,8 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
|
||||
/// Handles exposing a turf to reagents.
|
||||
/turf/expose_reagents(list/reagents, datum/reagents/source, methods=TOUCH, volume_modifier=1, show_message=TRUE)
|
||||
if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
. = ..()
|
||||
if(. & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
return
|
||||
|
||||
for(var/reagent in reagents)
|
||||
|
||||
@@ -27,9 +27,13 @@
|
||||
can_synth = FALSE
|
||||
penetrates_skin = NONE
|
||||
|
||||
|
||||
/datum/reagent/blob/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
..()
|
||||
/// Used by blob reagents to calculate the reaction volume they should use when exposing mobs.
|
||||
/datum/reagent/blob/proc/return_mob_expose_reac_volume(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
if(exposed_mob.stat == DEAD || istype(exposed_mob, /mob/living/simple_animal/hostile/blob))
|
||||
return 0 //the dead, and blob mobs, don't cause reactions
|
||||
return round(reac_volume * min(1.5 - touch_protection, 1), 0.1) //full touch protection means 50% volume, any prot below 0.5 means 100% volume.
|
||||
|
||||
/// Exists to earmark the new overmind arg used by blob reagents.
|
||||
/datum/reagent/blob/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
return ..()
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
color = "#B68D00"
|
||||
|
||||
/datum/reagent/blob/blazing_oil/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.adjust_fire_stacks(round(reac_volume/10))
|
||||
exposed_mob.IgniteMob()
|
||||
if(exposed_mob)
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
taste_description = "brain freeze"
|
||||
|
||||
/datum/reagent/blob/cryogenic_poison/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
if(exposed_mob.reagents)
|
||||
exposed_mob.reagents.add_reagent(/datum/reagent/consumable/frostoil, 0.3*reac_volume)
|
||||
exposed_mob.reagents.add_reagent(/datum/reagent/consumable/ice, 0.3*reac_volume)
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
color = "#E88D5D"
|
||||
|
||||
/datum/reagent/blob/distributed_neurons/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.apply_damage(0.6*reac_volume, TOX)
|
||||
if(overmind && ishuman(exposed_mob))
|
||||
if(exposed_mob.stat == UNCONSCIOUS || exposed_mob.stat == HARD_CRIT)
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
color = "#83ECEC"
|
||||
|
||||
/datum/reagent/blob/electromagnetic_web/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
if(prob(reac_volume*2))
|
||||
exposed_mob.emp_act(EMP_LIGHT)
|
||||
if(exposed_mob)
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
color = "#EFD65A"
|
||||
|
||||
/datum/reagent/blob/energized_jelly/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.losebreath += round(0.2*reac_volume)
|
||||
exposed_mob.adjustStaminaLoss(reac_volume * 1.2)
|
||||
if(exposed_mob)
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
color = "#8B2500"
|
||||
|
||||
/datum/reagent/blob/explosive_lattice/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
. = ..()
|
||||
var/initial_volume = reac_volume
|
||||
reac_volume = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
if(reac_volume >= 10) //if it's not a spore cloud, bad time incoming
|
||||
var/obj/effect/temp_visual/explosion/fast/ex_effect = new /obj/effect/temp_visual/explosion/fast(get_turf(exposed_mob))
|
||||
ex_effect.alpha = 150
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
color = "#4F4441"
|
||||
|
||||
/datum/reagent/blob/networked_fibers/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.apply_damage(0.6*reac_volume, BRUTE, wound_bonus=CANT_WOUND)
|
||||
if(!QDELETED(exposed_mob))
|
||||
exposed_mob.apply_damage(0.6*reac_volume, BURN, wound_bonus=CANT_WOUND)
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
color = "#AAAABB"
|
||||
|
||||
/datum/reagent/blob/pressurized_slime/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
var/turf/open/location_turf = get_turf(exposed_mob)
|
||||
if(istype(location_turf) && prob(reac_volume))
|
||||
location_turf.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
|
||||
|
||||
@@ -24,8 +24,12 @@
|
||||
taste_description = "rock"
|
||||
color = "#9ACD32"
|
||||
|
||||
/datum/reagent/blob/reactive_spines/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
..()
|
||||
/datum/reagent/blob/reactive_spines/return_mob_expose_reac_volume(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
if(exposed_mob.stat == DEAD || istype(exposed_mob, /mob/living/simple_animal/hostile/blob))
|
||||
return 0 //the dead, and blob mobs, don't cause reactions
|
||||
return reac_volume
|
||||
|
||||
/datum/reagent/blob/reactive_spines/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.adjustBruteLoss(reac_volume)
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
color = "#A88FB7"
|
||||
|
||||
/datum/reagent/blob/regenerative_materia/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.adjust_drugginess(reac_volume)
|
||||
if(exposed_mob.reagents)
|
||||
exposed_mob.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 0.2*reac_volume)
|
||||
|
||||
@@ -31,5 +31,6 @@
|
||||
color = "#7B5A57"
|
||||
|
||||
/datum/reagent/blob/replicating_foam/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.apply_damage(0.7*reac_volume, BRUTE, wound_bonus=CANT_WOUND)
|
||||
|
||||
@@ -32,5 +32,6 @@
|
||||
color = "#C8963C"
|
||||
|
||||
/datum/reagent/blob/shifting_fragments/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.apply_damage(0.7*reac_volume, BRUTE, wound_bonus=CANT_WOUND)
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
color = "#65ADA2"
|
||||
|
||||
/datum/reagent/blob/synchronous_mesh/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/overmind)
|
||||
reac_volume = ..()
|
||||
. = ..()
|
||||
reac_volume = return_mob_expose_reac_volume(exposed_mob, methods, reac_volume, show_message, touch_protection, overmind)
|
||||
exposed_mob.apply_damage(0.2*reac_volume, BRUTE, wound_bonus=CANT_WOUND)
|
||||
if(exposed_mob && reac_volume)
|
||||
for(var/obj/structure/blob/nearby_blob in range(1, exposed_mob)) //if the target is completely surrounded, this is 2.4*reac_volume bonus damage, total of 2.6*reac_volume
|
||||
|
||||
@@ -411,7 +411,8 @@
|
||||
* If the methods include VAPOR it incorporates permiability protection.
|
||||
*/
|
||||
/mob/living/expose_reagents(list/reagents, datum/reagents/source, methods=TOUCH, volume_modifier=1, show_message=TRUE)
|
||||
if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
. = ..()
|
||||
if(. & COMPONENT_NO_EXPOSE_REAGENTS)
|
||||
return
|
||||
|
||||
if(methods & INGEST)
|
||||
|
||||
@@ -95,34 +95,31 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
/datum/reagent/proc/expose_atom(atom/exposed_atom, reac_volume)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_ATOM, exposed_atom, reac_volume)
|
||||
SEND_SIGNAL(exposed_atom, COMSIG_ATOM_EXPOSE_REAGENT, src, reac_volume)
|
||||
return TRUE
|
||||
. = 0
|
||||
. |= SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_ATOM, exposed_atom, reac_volume)
|
||||
. |= SEND_SIGNAL(exposed_atom, COMSIG_ATOM_EXPOSE_REAGENT, src, reac_volume)
|
||||
|
||||
/// Applies this reagent to a [/mob/living]
|
||||
/datum/reagent/proc/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message = TRUE, touch_protection = 0)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_MOB, exposed_mob, methods, reac_volume, show_message, touch_protection)
|
||||
. = SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_MOB, exposed_mob, methods, reac_volume, show_message, touch_protection)
|
||||
if((methods & penetrates_skin) && exposed_mob.reagents) //smoke, foam, spray
|
||||
var/amount = round(reac_volume*clamp((1 - touch_protection), 0, 1), 0.1)
|
||||
if(amount >= 0.5)
|
||||
exposed_mob.reagents.add_reagent(type, amount)
|
||||
return TRUE
|
||||
|
||||
/// Applies this reagent to an [/obj]
|
||||
/datum/reagent/proc/expose_obj(obj/exposed_obj, reac_volume)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_OBJ, exposed_obj, reac_volume)
|
||||
return TRUE
|
||||
return SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_OBJ, exposed_obj, reac_volume)
|
||||
|
||||
/// Applies this reagent to a [/turf]
|
||||
/datum/reagent/proc/expose_turf(turf/exposed_turf, reac_volume)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_TURF, exposed_turf, reac_volume)
|
||||
return TRUE
|
||||
return SEND_SIGNAL(src, COMSIG_REAGENT_EXPOSE_TURF, exposed_turf, reac_volume)
|
||||
|
||||
/// Called from [/datum/reagents/proc/metabolize]
|
||||
/datum/reagent/proc/on_mob_life(mob/living/carbon/M)
|
||||
|
||||
@@ -414,12 +414,12 @@
|
||||
/datum/reagent/medicine/c2/synthflesh/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message = TRUE)
|
||||
. = ..()
|
||||
if(!iscarbon(exposed_mob))
|
||||
return TRUE
|
||||
return
|
||||
var/mob/living/carbon/carbies = exposed_mob
|
||||
if(carbies.stat == DEAD)
|
||||
show_message = 0
|
||||
if(!(methods & (PATCH|TOUCH|VAPOR)))
|
||||
return TRUE
|
||||
return
|
||||
var/harmies = min(carbies.getBruteLoss(),carbies.adjustBruteLoss(-1.25 * reac_volume)*-1)
|
||||
var/burnies = min(carbies.getFireLoss(),carbies.adjustFireLoss(-1.25 * reac_volume)*-1)
|
||||
for(var/i in carbies.all_wounds)
|
||||
@@ -432,7 +432,6 @@
|
||||
if(HAS_TRAIT_FROM(exposed_mob, TRAIT_HUSK, "burn") && carbies.getFireLoss() < THRESHOLD_UNHUSK && (carbies.reagents.get_reagent_amount(/datum/reagent/medicine/c2/synthflesh) + reac_volume >= 100))
|
||||
carbies.cure_husk("burn")
|
||||
carbies.visible_message("<span class='nicegreen'>A rubbery liquid coats [carbies]'s burns. [carbies] looks a lot healthier!") //we're avoiding using the phrases "burnt flesh" and "burnt skin" here because carbies could be a skeleton or a golem or something
|
||||
return TRUE
|
||||
|
||||
/******ORGAN HEALING******/
|
||||
/*Suffix: -rite*/
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
addtimer(CALLBACK(exposed_mob, /mob/living/proc/unfry_mob), 3)
|
||||
if(FryLoss)
|
||||
exposed_mob.adjustFireLoss(FryLoss)
|
||||
return TRUE
|
||||
|
||||
/datum/reagent/consumable/cooking_oil/expose_turf(turf/open/exposed_turf, reac_volume)
|
||||
. = ..()
|
||||
|
||||
@@ -726,7 +726,7 @@
|
||||
/datum/reagent/oxygen/expose_obj(obj/exposed_obj, reac_volume)
|
||||
. = ..()
|
||||
if((!exposed_obj) || (!reac_volume))
|
||||
return 0
|
||||
return
|
||||
var/temp = holder ? holder.chem_temp : T20C
|
||||
exposed_obj.atmos_spawn_air("o2=[reac_volume/2];TEMP=[temp]")
|
||||
|
||||
@@ -763,7 +763,7 @@
|
||||
/datum/reagent/nitrogen/expose_obj(obj/exposed_obj, reac_volume)
|
||||
. = ..()
|
||||
if((!exposed_obj) || (!reac_volume))
|
||||
return 0
|
||||
return
|
||||
var/temp = holder ? holder.chem_temp : T20C
|
||||
exposed_obj.atmos_spawn_air("n2=[reac_volume/2];TEMP=[temp]")
|
||||
|
||||
@@ -1271,7 +1271,7 @@
|
||||
/datum/reagent/carbondioxide/expose_obj(obj/exposed_obj, reac_volume)
|
||||
. = ..()
|
||||
if((!exposed_obj) || (!reac_volume))
|
||||
return 0
|
||||
return
|
||||
var/temp = holder ? holder.chem_temp : T20C
|
||||
exposed_obj.atmos_spawn_air("co2=[reac_volume/5];TEMP=[temp]")
|
||||
|
||||
@@ -1292,7 +1292,7 @@
|
||||
/datum/reagent/nitrous_oxide/expose_obj(obj/exposed_obj, reac_volume)
|
||||
. = ..()
|
||||
if((!exposed_obj) || (!reac_volume))
|
||||
return 0
|
||||
return
|
||||
var/temp = holder ? holder.chem_temp : T20C
|
||||
exposed_obj.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[temp]")
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
/datum/reagent/toxin/plasma/expose_obj(obj/exposed_obj, reac_volume)
|
||||
. = ..()
|
||||
if((!exposed_obj) || (!reac_volume))
|
||||
return 0
|
||||
return
|
||||
var/temp = holder ? holder.chem_temp : T20C
|
||||
if(temp >= LIQUID_PLASMA_BP)
|
||||
exposed_obj.atmos_spawn_air("plasma=[reac_volume];TEMP=[temp]")
|
||||
|
||||
Reference in New Issue
Block a user