From f6d89ce69fb76ffd10d8d19993aaab1a526a3f22 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:16:46 +0300 Subject: [PATCH] [MIRROR] Removes the vestigial slime reagent system [MDB IGNORE] (#25397) (#937) * Removes the vestigial slime reagent system (#80068) ## About The Pull Request Slimes, unique among simple and basic mobs, had a reagent holder. During life, they removed some of the reagents in the holder, but they never actually metabolized them. Two reagents, frostoil and capsaicin did not know this, and checked every time in on mob life if the mob they were in was a slime, which was never the case. Slimes also checked if they had morphine or frostoil in them when they detected a change in their reagents, on_reagent_change, and applied a slowdown. There are not many ways to put these reagents in slimes in the first place. Chempuffs, syringes (but not hyposprays) work, and I assume smoke too. I removed this dead code. I did see this comment _"Should be moved to the reagents at some point in the future. As it is I'm in a hurry."_ and I did try to move the effects to reagents' onExpose(), creating a status effect that only applies to mobs without reagents, lasts as long as it would have lasted based on reagents, and respects that morphine and frostoil doesn't stack. However, while doing this I realized I would be making reagents 2, in a much worse, overcomplicated manner. In the end, I have decided to completely remove the reagent holder of slimes, and the morphine and frostoil effects. ## Why It's Good For The Game These systems are rather vestigial, and there isn't really much to gain from them. The interaction with heat and gas types is a much more unique system, so perhaps it will be better if we focus on them. Also makes it easier to convert them to basic mobs, and also, keeps them consistent with the rest of our mobs. ## Changelog :cl: del: Removes the slime's reagent holder. This will make them not slow down from somehow imbibing morphine or frostoil. /:cl: * Removes the vestigial slime reagent system --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: Profakos --- .../mob/living/simple_animal/slime/life.dm | 1 - .../mob/living/simple_animal/slime/slime.dm | 29 ------------------- .../chemistry/reagents/food_reagents.dm | 16 ---------- 3 files changed, 46 deletions(-) diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 078ec2749b5..e17fd09e0fa 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -19,7 +19,6 @@ handle_nutrition(seconds_per_tick, times_fired) if(QDELETED(src)) // Stop if the slime split during handle_nutrition() return - reagents.remove_all(0.5 * REAGENTS_METABOLISM * reagents.reagent_list.len * seconds_per_tick) //Slimes are such snowflakes handle_targets(seconds_per_tick, times_fired) if(ckey) return diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index b03f46d5a44..8d0770d2bf5 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -120,7 +120,6 @@ else var/datum/action/innate/slime/evolve/evolve_action = new evolve_action.Grant(src) - create_reagents(100) set_slime_type(new_type) . = ..() set_nutrition(700) @@ -147,17 +146,6 @@ /mob/living/simple_animal/slime/pet docile = TRUE -/mob/living/simple_animal/slime/create_reagents(max_vol, flags) - . = ..() - RegisterSignals(reagents, list(COMSIG_REAGENTS_NEW_REAGENT, COMSIG_REAGENTS_DEL_REAGENT), PROC_REF(on_reagent_change)) - RegisterSignal(reagents, COMSIG_QDELETING, PROC_REF(on_reagents_del)) - -/// Handles removing signal hooks incase someone is crazy enough to reset the reagents datum. -/mob/living/simple_animal/slime/proc/on_reagents_del(datum/reagents/reagents) - SIGNAL_HANDLER - UnregisterSignal(reagents, list(COMSIG_REAGENTS_NEW_REAGENT, COMSIG_REAGENTS_DEL_REAGENT, COMSIG_QDELETING)) - return NONE - /mob/living/simple_animal/slime/proc/set_slime_type(new_type) slime_type = new new_type update_name() @@ -188,23 +176,6 @@ icon_state = icon_dead ..() -/** - * Snowflake handling of reagent movespeed modifiers - * - * Should be moved to the reagents at some point in the future. As it is I'm in a hurry. - */ -/mob/living/simple_animal/slime/proc/on_reagent_change(datum/reagents/holder, ...) - SIGNAL_HANDLER - remove_movespeed_modifier(/datum/movespeed_modifier/slime_reagentmod) - var/amount = 0 - if(reagents.has_reagent(/datum/reagent/medicine/morphine)) // morphine slows slimes down - amount = 2 - if(reagents.has_reagent(/datum/reagent/consumable/frostoil)) // Frostoil also makes them move VEEERRYYYYY slow - amount = 5 - if(amount) - add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/slime_reagentmod, multiplicative_slowdown = amount) - return NONE - /mob/living/simple_animal/slime/updatehealth() . = ..() var/mod = 0 diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index f897d8f4bb2..2629a073120 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -352,20 +352,12 @@ heating = 5 if(holder.has_reagent(/datum/reagent/cryostylane)) holder.remove_reagent(/datum/reagent/cryostylane, 5 * REM * seconds_per_tick) - if(isslime(affected_mob)) - heating = rand(5, 20) if(15 to 25) heating = 10 - if(isslime(affected_mob)) - heating = rand(10, 20) if(25 to 35) heating = 15 - if(isslime(affected_mob)) - heating = rand(15, 20) if(35 to INFINITY) heating = 20 - if(isslime(affected_mob)) - heating = rand(20, 25) affected_mob.adjust_bodytemperature(heating * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick) /datum/reagent/consumable/frostoil @@ -387,24 +379,16 @@ cooling = -10 if(holder.has_reagent(/datum/reagent/consumable/capsaicin)) holder.remove_reagent(/datum/reagent/consumable/capsaicin, 5 * REM * seconds_per_tick) - if(isslime(affected_mob)) - cooling = -rand(5, 20) if(15 to 25) cooling = -20 - if(isslime(affected_mob)) - cooling = -rand(10, 20) if(25 to 35) cooling = -30 if(prob(1)) affected_mob.emote("shiver") - if(isslime(affected_mob)) - cooling = -rand(15, 20) if(35 to INFINITY) cooling = -40 if(prob(5)) affected_mob.emote("shiver") - if(isslime(affected_mob)) - cooling = -rand(20, 25) affected_mob.adjust_bodytemperature(cooling * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick, 50) /datum/reagent/consumable/frostoil/expose_turf(turf/exposed_turf, reac_volume)