Skip to content

Commit 8693aaf

Browse files
authored
Prevent Life and similar reactions from occuring in plants (#4728)
1 parent b228eed commit 8693aaf

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

code/__DEFINES/reagents.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
#define REACTION_REAL_TIME_SPLIT (1<<7)
112112
///Should this reaction use purity
113113
#define REACTION_USES_PURITY (1<<8)
114+
/// This reaction should never occur in grown plants (monkestation addition)
115+
#define REACTION_NOT_IN_PLANTS (1<<9)
114116

115117
///Used for overheat_temp - This sets the overheat so high it effectively has no overheat temperature.
116118
#define NO_OVERHEAT 99999

code/modules/reagents/chemistry/holder.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,12 @@
913913
if((reaction.reaction_flags & REACTION_NON_INSTANT))
914914
granularity = CHEMICAL_VOLUME_MINIMUM
915915

916+
// monkestation start
917+
var/banned_due_to_plant = FALSE
918+
if((reaction.reaction_flags & REACTION_NOT_IN_PLANTS) && istype(cached_my_atom, /obj/item/food/grown))
919+
banned_due_to_plant = TRUE
920+
// monkestation end
921+
916922
for(var/req_reagent in cached_required_reagents)
917923
if(!has_reagent(req_reagent, (cached_required_reagents[req_reagent]*granularity)))
918924
break
@@ -947,7 +953,7 @@
947953
else
948954
meets_ph_requirement = TRUE
949955

950-
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other)
956+
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other && !banned_due_to_plant)
951957
if(meets_temp_requirement && meets_ph_requirement)
952958
possible_reactions += reaction
953959
else
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/datum/chemical_reaction/life
2+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS
3+
4+
/datum/chemical_reaction/life_friendly
5+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS
6+
7+
/datum/chemical_reaction/corgium
8+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS
9+
10+
/datum/chemical_reaction/monkey
11+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS
12+
13+
/datum/chemical_reaction/butterflium
14+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS
15+
16+
/datum/chemical_reaction/ant_slurry
17+
reaction_flags = parent_type::reaction_flags | REACTION_NOT_IN_PLANTS

tgstation.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7927,6 +7927,7 @@
79277927
#include "monkestation\code\modules\reagents\chemistry\reagents\drug_reagents.dm"
79287928
#include "monkestation\code\modules\reagents\chemistry\reagents\other_reagents.dm"
79297929
#include "monkestation\code\modules\reagents\chemistry\reagents\drinks\glass_styles\mixed_drinks.dm"
7930+
#include "monkestation\code\modules\reagents\chemistry\recipes\others.dm"
79307931
#include "monkestation\code\modules\reagents\fun\austrialium.dm"
79317932
#include "monkestation\code\modules\reagents\fun\liquid_justice.dm"
79327933
#include "monkestation\code\modules\reagents\fun\shakeium.dm"

0 commit comments

Comments
 (0)