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

Recoup of atom exposure (Part 1) and miscellaneous chemical holder fixes #11498

Merged
merged 27 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cb09fe1
aheals fix addiction
Tsar-Salat Sep 15, 2024
75c2c4f
reagent transfer
Tsar-Salat Sep 15, 2024
ec1b698
fix reaction chambers sometimes not working
Tsar-Salat Sep 15, 2024
a1b18ca
oranges addiction fix
Tsar-Salat Sep 15, 2024
de8aca4
cleaning skill (without the skill)
Tsar-Salat Sep 15, 2024
120fc96
chem holdover
Tsar-Salat Sep 15, 2024
14e3ca2
autodoc
Tsar-Salat Sep 15, 2024
af9184e
Revert "fix reaction chambers sometimes not working"
Tsar-Salat Sep 15, 2024
50f02bd
gettem
Tsar-Salat Sep 15, 2024
349a9ff
exposure code
Tsar-Salat Sep 15, 2024
b923241
reagent transfer fix
Tsar-Salat Sep 15, 2024
34d0ae2
fixing jupyter's shit
Tsar-Salat Sep 15, 2024
1dea661
bad pathing
Tsar-Salat Sep 15, 2024
8ca27f9
Merge branch 'master' into reagentrerun
Tsar-Salat Oct 3, 2024
9edcfad
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Oct 19, 2024
790cdfb
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Nov 13, 2024
214e3b3
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Nov 18, 2024
3cd9031
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Nov 27, 2024
323142a
xeonmations(fucking sucks at porting)
Tsar-Salat Dec 4, 2024
e9334ac
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Dec 8, 2024
d4bd5a1
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Jan 9, 2025
9826ec5
clean up
Tsar-Salat Jan 9, 2025
2fde9b0
fixes the issue
Tsar-Salat Jan 9, 2025
95b88ae
what a mess
Tsar-Salat Jan 9, 2025
822bed4
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Jan 9, 2025
df3c34a
args SUCK
Tsar-Salat Jan 11, 2025
bf8e240
Merge remote-tracking branch 'BeeStation/master' into reagentrerun
Tsar-Salat Jan 23, 2025
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
5 changes: 5 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
/// called when an atom stops orbiting another atom: (atom)
#define COMSIG_ATOM_ORBIT_STOP "atom_orbit_stop"

///from base of atom/expose_reagents():
#define COMSIG_ATOM_EXPOSE_REAGENTS "atom_expose_reagents"
/// Prevents the atom from being exposed to reagents if returned on [COMPONENT_ATOM_EXPOSE_REAGENTS]
#define COMPONENT_NO_EXPOSE_REAGENTS (1<<0)

///This signal return value bitflags can be found in __DEFINES/misc.dm
///called for each movable in a turf contents on /turf/attempt_z_impact(): (atom/movable/A, levels)
#define COMSIG_ATOM_INTERCEPT_Z_FALL "movable_intercept_z_impact"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
// If we consumed them in our crafting, we should dump their contents out before qdeling them.
if(istype(DL, /obj/item/reagent_containers))
var/obj/item/reagent_containers/container = DL
container.reagents.reaction(container.loc, TOUCH)
container.reagents.expose(container.loc, TOUCH)
else if(istype(DL, /obj/item/storage))
var/obj/item/storage/container = DL
container.emptyStorage()
Expand Down
15 changes: 12 additions & 3 deletions code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, PROC_REF(add_event))
RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, PROC_REF(clear_event))
RegisterSignal(parent, COMSIG_MOVABLE_ENTERED_AREA, PROC_REF(check_area_mood))
RegisterSignal(parent, COMSIG_LIVING_REVIVE, PROC_REF(on_revive))

RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, PROC_REF(modify_hud))
RegisterSignal(parent, COMSIG_HERETIC_MASK_ACT, PROC_REF(direct_sanity_drain))
Expand Down Expand Up @@ -93,7 +94,8 @@
msg += thought_msg
to_chat(user || parent, EXAMINE_BLOCK(msg))

/datum/component/mood/proc/update_mood() //Called whenever a mood event is added or removed
///Called after moodevent/s have been added/removed.
/datum/component/mood/proc/update_mood()
mood = 0
shown_mood = 0
for(var/i in mood_events)
Expand Down Expand Up @@ -294,14 +296,14 @@
category = REF(category)
return mood_events[category]

/datum/component/mood/proc/remove_temp_moods(var/admin) //Removes all temp moods
/datum/component/mood/proc/remove_temp_moods() //Removes all temp moods
for(var/i in mood_events)
var/datum/mood_event/moodlet = mood_events[i]
if(!moodlet || !moodlet.timeout)
continue
mood_events -= moodlet.category
qdel(moodlet)
update_mood()
update_mood()


/datum/component/mood/proc/modify_hud(datum/source)
Expand Down Expand Up @@ -380,6 +382,13 @@
else
clear_event(null, "area")

///Called when parent is ahealed.
/datum/component/mood/proc/on_revive(datum/source, full_heal)
if(!full_heal)
return
remove_temp_moods()
setSanity(initial(sanity))

#undef MINOR_INSANITY_PEN
#undef MAJOR_INSANITY_PEN

Expand Down
6 changes: 3 additions & 3 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@
/datum/status_effect/syringe/on_apply()
. = ..()
var/amount = syringe.initial_inject
syringe.reagents.reaction(owner, INJECT)
syringe.reagents.expose(owner, INJECT)
syringe.reagents.trans_to(owner, max(3.1, amount * injectmult))
owner.throw_alert("syringealert", /atom/movable/screen/alert/syringe)

/datum/status_effect/syringe/tick()
. = ..()
var/amount = syringe.units_per_tick
syringe.reagents.reaction(owner, INJECT, amount / 10)//so the slow drip-feed of reagents isn't exploited
syringe.reagents.expose(owner, INJECT, amount / 10)//so the slow drip-feed of reagents isn't exploited
syringe.reagents.trans_to(owner, amount * injectmult)


Expand Down Expand Up @@ -302,7 +302,7 @@
else
to_chat(C, span_userdanger("You screw up, and inject yourself with more chemicals by mistake!"))
var/amount = syringe.initial_inject
syringe.reagents.reaction(C, INJECT)
syringe.reagents.expose(C, INJECT)
syringe.reagents.trans_to(C, amount)
syringe.forceMove(C.loc)
qdel(syringestatus)
Expand Down
20 changes: 20 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,26 @@ CREATION_TEST_IGNORE_SUBTYPES(/atom)
/atom/proc/is_drainable()
return reagents && (reagents.flags & DRAINABLE)

/** Handles exposing this atom to a list of reagents.
*
* Sends COMSIG_ATOM_EXPOSE_REAGENTS
* Calls expose_atom() for every reagent in the reagent list.
*
* Arguments:
* - [reagents][/list]: The list of reagents the atom is being exposed to.
* - [source][/datum/reagents]: The reagent holder the reagents are being sourced from.
* - method: How the atom is being exposed to the reagents.
* - volume_modifier: Volume multiplier.
* - show_message: Whether to display anything to mobs when they are exposed.
*/
/atom/proc/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE)
if((. = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, method, volume_modifier, show_message)) & COMPONENT_NO_EXPOSE_REAGENTS)
return

for(var/reagent in reagents)
var/datum/reagent/R = reagent
. |= R.expose_atom(src, reagents[R])

/// Is this atom grindable to get reagents
/atom/proc/is_grindable()
return reagents && (reagents.flags & ABSOLUTELY_GRINDABLE)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
if (alert(user, "Are you sure you want to empty the cloning pod?", "Empty Reagent Storage:", "Yes", "No") != "Yes")
return
to_chat(user, span_notice("You empty \the [src]'s release valve onto the floor."))
reagents.reaction(user.loc)
reagents.expose(user.loc)
src.reagents.clear_reagents()

/obj/machinery/clonepod/attack_silicon(mob/user)
Expand Down
4 changes: 1 addition & 3 deletions code/game/machinery/iv_drip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@
if(istype(beaker, /obj/item/reagent_containers/blood))
// speed up transfer on blood packs
transfer_amount *= 2
var/fraction = min(transfer_amount*delta_time/beaker.reagents.total_volume, 1) //the fraction that is transfered of the total volume
beaker.reagents.reaction(attached, INJECT, fraction, FALSE) //make reagents reacts, but don't spam messages
beaker.reagents.trans_to(attached, transfer_amount)
beaker.reagents.trans_to(attached, transfer_amount * delta_time * 0.5, method = INJECT, show_message = FALSE) //make reagents reacts, but don't spam messages
update_icon()

// Take blood
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/decals/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
lifetime--
else if(travelled_max_distance)
lifetime--
reagents?.reaction(turf_atom, VAPOR)
reagents?.expose(turf_atom, VAPOR)
if(user)
log_combat(user, turf_atom, "sprayed", sprayer, addition="which had [puff_reagents_string]")

if(lifetime >= 0 && (!stream || travelled_max_distance))
reagents?.reaction(our_turf, VAPOR)
reagents?.expose(our_turf, VAPOR)
lifetime--
if(user)
log_combat(user, our_turf, "sprayed", sprayer, addition="which had [puff_reagents_string]")
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/effects/effect_system/effects_foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@
if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(O, TRAIT_T_RAY_VISIBLE))
continue
if(lifetime % reagent_divisor)
reagents.reaction(O, VAPOR, fraction)
reagents.expose(O, VAPOR, fraction)
var/hit = 0
for(var/mob/living/L in get_turf(src))
hit += foam_mob(L)
if(hit)
lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate.
var/T = get_turf(src)
if(lifetime % reagent_divisor)
reagents.reaction(T, VAPOR, fraction)
reagents.expose(T, VAPOR, fraction)

if(--amount < 0)
return
Expand All @@ -185,7 +185,7 @@
return 0
var/fraction = 1/initial(reagent_divisor)
if(lifetime % reagent_divisor)
reagents.reaction(L, VAPOR, fraction)
reagents.expose(L, VAPOR, fraction)
lifetime--
return 1

Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/effects/effect_system/effects_smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@
for(var/atom/movable/AM in T)
if(AM.type == src.type)
continue
reagents.reaction(AM, TOUCH, fraction)
reagents.expose(AM, TOUCH, fraction)

reagents.reaction(T, TOUCH, fraction)
reagents.expose(T, TOUCH, fraction)
return 1

/obj/effect/particle_effect/smoke/chem/smoke_mob(mob/living/carbon/M)
Expand All @@ -256,7 +256,7 @@
return 0
var/fraction = 1/initial(lifetime)
reagents.copy_to(C, fraction*reagents.total_volume)
reagents.reaction(M, INGEST, fraction)
reagents.expose(M, INGEST, fraction)
if(isapid(C))
C.SetSleeping(50) // Bees sleep when smoked
M.log_message("breathed in some smoke with reagents [english_list(reagents.reagent_list)]", LOG_ATTACK, null, FALSE) // Do not log globally b/c spam
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/effects/effect_system/effects_water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/obj/effect/particle_effect/water/Bump(atom/A)
if(reagents)
reagents.reaction(A)
reagents.expose(A)
return ..()

///Extinguisher snowflake
Expand All @@ -31,9 +31,9 @@
. = ..()
if(!reagents)
return
reagents.reaction(get_turf(src))
reagents.expose(get_turf(src))
for(var/atom/thing as anything in get_turf(src))
reagents.reaction(thing)
reagents.expose(thing)

/////////////////////////////////////////////
// GENERIC STEAM SPREAD SYSTEM
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/airlock_painter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
// make some colorful reagent, and apply it to the lungs
L.create_reagents(10)
L.reagents.add_reagent(/datum/reagent/colorful_reagent, 10)
L.reagents.reaction(L, TOUCH, 1)
L.reagents.expose(L, TOUCH, 1)

// TODO maybe add some colorful vomit?

Expand All @@ -128,7 +128,7 @@
else if(can_use(user) && !L)
user.visible_message(span_suicide("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide."))
user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1)
user.reagents.reaction(user, TOUCH, 1)
user.reagents.expose(user, TOUCH, 1)
return TOXLOSS

else
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if (smoke_all)
to_smoke = reagents.total_volume / (smoketime / dragtime)

reagents.reaction(C, INGEST, fraction)
reagents.expose(C, INGEST, fraction)
if(!reagents.trans_to(C, to_smoke))
reagents.remove_any(to_smoke)
return
Expand Down Expand Up @@ -974,7 +974,7 @@ CREATION_TEST_IGNORE_SUBTYPES(/obj/item/clothing/mask/vape)
var/mob/living/carbon/C = loc
if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob
var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1) //this will react instantly, making them a little more dangerous than cigarettes
reagents.reaction(C, INGEST, fraction)
reagents.expose(C, INGEST, fraction)
if(!reagents.trans_to(C, REAGENTS_METABOLISM))
reagents.remove_any(REAGENTS_METABOLISM)
if(reagents.get_reagent_amount(/datum/reagent/fuel))
Expand Down
10 changes: 5 additions & 5 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
if(affected_turfs.len)
fraction /= affected_turfs.len
for(var/t in affected_turfs)
reagents.reaction(t, TOUCH, fraction * volume_multiplier)
reagents.expose(t, TOUCH, fraction * volume_multiplier)
reagents.trans_to(t, ., volume_multiplier, transfered_by = user)
check_empty(user)

Expand All @@ -414,7 +414,7 @@
if(check_empty(user)) //Prevents divsion by zero
return
var/fraction = min(eaten / reagents.total_volume, 1)
reagents.reaction(M, INGEST, fraction * volume_multiplier)
reagents.expose(M, INGEST, fraction * volume_multiplier)
reagents.trans_to(M, eaten, volume_multiplier, transfered_by = user)
// check_empty() is called during afterattack
else
Expand Down Expand Up @@ -627,7 +627,7 @@
H.update_body()
var/used = use_charges(user, 10, FALSE)
var/fraction = min(1, used / reagents.maximum_volume)
reagents.reaction(user, VAPOR, fraction * volume_multiplier)
reagents.expose(user, VAPOR, fraction * volume_multiplier)
reagents.trans_to(user, used, volume_multiplier, transfered_by = user)
return OXYLOSS

Expand Down Expand Up @@ -684,7 +684,7 @@

. = use_charges(user, 10, FALSE)
var/fraction = min(1, . / reagents.maximum_volume)
reagents.reaction(C, VAPOR, fraction * volume_multiplier)
reagents.expose(C, VAPOR, fraction * volume_multiplier)

return

Expand Down Expand Up @@ -719,7 +719,7 @@
if(!.)
return FALSE
var/fraction = min(1, . / reagents.maximum_volume)
reagents.reaction(target, TOUCH, fraction * volume_multiplier)
reagents.expose(target, TOUCH, fraction * volume_multiplier)
reagents.trans_to(target, ., volume_multiplier, transfered_by = user)

if(pre_noise || post_noise)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/food/egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if(!..()) //was it caught by a mob?
var/turf/T = get_turf(hit_atom)
new/obj/effect/decal/cleanable/food/egg_smudge(T)
reagents.reaction(hit_atom, TOUCH)
reagents.expose(hit_atom, TOUCH)
qdel(src)

/obj/item/food/egg/attackby(obj/item/W, mob/user, params)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/food/pie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
var/turf/hit_turf = get_turf(hit_atom)
new/obj/effect/decal/cleanable/food/pie_smudge(hit_turf)
if(reagents?.total_volume)
reagents.reaction(hit_atom, TOUCH)
reagents.expose(hit_atom, TOUCH)
var/is_creamable = TRUE
if(isliving(hit_atom))
var/mob/living/living_target_getting_hit = hit_atom
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/kitchen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
if(!M.can_inject(user, 1))
amount_inject = 1
var/amount = min(amount_inject/reagents.total_volume,1)
reagents.reaction(M,INJECT,amount)
reagents.expose(M,INJECT,amount)
reagents.trans_to(M,amount_inject)

/obj/item/knife/kitchen
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/mop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/obj/item/mop/proc/clean(turf/A, mob/living/cleaner)
if(reagents.has_reagent(/datum/reagent/water, 1) || reagents.has_reagent(/datum/reagent/water/holywater, 1) || reagents.has_reagent(/datum/reagent/consumable/ethanol/vodka, 1) || reagents.has_reagent(/datum/reagent/space_cleaner, 1))
A.wash(CLEAN_SCRUB)
reagents.reaction(A, TOUCH, 10) //Needed for proper floor wetting.
reagents.expose(A, TOUCH, 10) //Needed for proper floor wetting.
reagents.remove_any(1) //reaction() doesn't use up the reagents


Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ CREATION_TEST_IGNORE_SUBTYPES(/obj/item/stack/medical)

user.visible_message(span_green("[user] applies [src] to [M]."), span_green("You apply [src] to [M]."))
if(reagent)
reagents.reaction(M, PATCH, affecting = affecting)
reagents.expose(M, PATCH, affecting = affecting)
M.reagents.add_reagent_list(reagent) //Stack size is reduced by one instead of actually removing reagents from the stack.
C.update_damage_overlays()
use(1)
Expand Down
19 changes: 19 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,25 @@
new /obj/item/multitool/abductor(src)
new /obj/item/stack/cable_coil/white(src)

//Im pissed off at the amount of times I have to do this. So its a belt now
/obj/item/storage/belt/military/abductor/med
name = "agent belt"
desc = "A belt used by abductor agents."
icon = 'icons/obj/abductor.dmi'
icon_state = "belt"
item_state = "security"
worn_icon_state = "security"

/obj/item/storage/belt/military/abductor/med/PopulateContents()
new /obj/item/scalpel/alien(src)
new /obj/item/hemostat/alien(src)
new /obj/item/retractor/alien(src)
new /obj/item/circular_saw/alien(src)
new /obj/item/surgicaldrill/alien(src)
new /obj/item/cautery/alien(src)
new /obj/item/surgical_drapes(src)
new /obj/item/blood_filter(src)

/obj/item/storage/belt/military/army
name = "army belt"
desc = "A belt used by military forces."
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tanks/watertank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
return

var/used_amount = (injection_amount * delta_time) /usage_ratio
reagents.reaction(user, INJECT,injection_amount,0)
reagents.expose(user, INJECT,injection_amount,0)
reagents.trans_to(user,used_amount,multiplier=usage_ratio)
update_icon()
user.update_inv_back() //for overlays update
4 changes: 2 additions & 2 deletions code/game/objects/items/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
else
T = get_turf(src)
T.visible_message(span_danger("[src] bursts!"),span_italics("You hear a pop and a splash."))
reagents.reaction(T)
reagents.expose(T)
for(var/atom/A in T)
reagents.reaction(A)
reagents.expose(A)
icon_state = "burst"
qdel(src)

Expand Down
Loading
Loading