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

Changes tree mutations to use infusions #11229

Merged
merged 2 commits into from Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/modules/chemistry/Reagents-Misc.dm
Expand Up @@ -2308,9 +2308,11 @@ datum

reaction_turf(var/turf/T, var/volume)
if (!istype(T, /turf/space))
if (volume >= 10)
if (volume >= 10 && holder.total_temperature < T0C + 180)
if (!locate(/obj/item/material_piece/rubber/latex) in T)
new /obj/item/material_piece/rubber/latex(T)
else
return TRUE

flubber
name = "Liquified space rubber"
Expand Down
8 changes: 5 additions & 3 deletions code/modules/hydroponics/plant_mutations.dm
Expand Up @@ -22,6 +22,8 @@
var/list/PTrange = list(null,null)
var/list/ENrange = list(null,null)
var/commut = null // is a paticular common mutation required for this? (keeping it to 1 for now)
/// Is a particular other mutation required for this? (type not instance)
var/datum/plantmutation/required_mutation = null
var/chance = 8 // How likely out of 100% is this mutation to appear when conditions are met?
var/list/assoc_reagents = list() // Used for extractions, harvesting, etc

Expand Down Expand Up @@ -673,15 +675,16 @@
name_prefix = "Money "
iconmod = "TreeCash"
crop = /obj/item/spacecash
chance = 20
required_mutation = /datum/plantmutation/tree/paper
PTrange = list(30, null)
chance = 50

/datum/plantmutation/tree/paper
name = "Paper Tree"
dont_rename_crop = true
name_prefix = "Paper "
iconmod = "TreePaper"
crop = /obj/item/paper
chance = 20

/datum/plantmutation/tree/dog
name = "Dogwood Tree"
Expand Down Expand Up @@ -720,7 +723,6 @@
name_prefix = "Rubber "
iconmod = "TreeRubber"
crop = /obj/item/material_piece/rubber/latex
chance = 20

/datum/plantmutation/tree/sassafras
name = "Sassafras Tree"
Expand Down
12 changes: 10 additions & 2 deletions code/modules/hydroponics/plants_crop.dm
Expand Up @@ -259,8 +259,16 @@ ABSTRACT_TYPE(/datum/plant/crop)
..()
var/datum/plantgenes/DNA = S.plantgenes
if (!DNA) return
if (reagent == "radium")
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/tree/glowstick)
switch (reagent)
if ("radium")
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/tree/glowstick)
if ("paper")
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/tree/paper)
if ("wolfsbane")
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/tree/dog)
if ("rubber")
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/tree/rubber)


/datum/plant/crop/coffee
name = "Coffee"
Expand Down
11 changes: 11 additions & 0 deletions code/modules/materials/Mat_MaterialProcs.dm
Expand Up @@ -680,3 +680,14 @@ triggerOnEntered(var/atom/owner, var/atom/entering)
return


/datum/materialProc/rubber_temp
execute(var/atom/location, var/temp)
if (istype(owner.owner, /obj/cable) || istype(owner.owner, /obj/item/cable_coil) || isturf(owner.owner)) //let's just not deal with that
return
if (temp >= T0C + 180) //wikipedia told me rubber melts at 180C
var/datum/reagents/temp_reagents = new(10)
temp_reagents.add_reagent("rubber", 10)
temp_reagents.set_reagent_temp(temp)
temp_reagents.reaction(get_turf(owner.owner))
qdel(temp_reagents)
qdel(owner.owner)
1 change: 1 addition & 0 deletions code/modules/materials/Mat_Materials.dm
Expand Up @@ -1460,6 +1460,7 @@ ABSTRACT_TYPE(/datum/material/rubber)
. = ..()
material_flags |= MATERIAL_RUBBER
setProperty("electrical", 3)
addTrigger(triggersTemp, new /datum/materialProc/rubber_temp())

/datum/material/rubber/latex
mat_id = "latex"
Expand Down
17 changes: 9 additions & 8 deletions code/obj/machinery/plantpot.dm
Expand Up @@ -1795,14 +1795,15 @@ proc/HYPmutationcheck_full(var/datum/plant/growing,var/datum/plantgenes/DNA,var/
// have to appear, and if all of them are matchedit gives the green light to go ahead and
// add it - though there's still a % chance involved after this check passes which is handled
// where this check is called, usually.
if(!HYPmutationcheck_sub(MUT.GTrange[1],MUT.GTrange[2],DNA.growtime)) return 0
if(!HYPmutationcheck_sub(MUT.HTrange[1],MUT.HTrange[2],DNA.harvtime)) return 0
if(!HYPmutationcheck_sub(MUT.HVrange[1],MUT.HVrange[2],DNA.harvests)) return 0
if(!HYPmutationcheck_sub(MUT.CZrange[1],MUT.CZrange[2],DNA.cropsize)) return 0
if(!HYPmutationcheck_sub(MUT.PTrange[1],MUT.PTrange[2],DNA.potency)) return 0
if(!HYPmutationcheck_sub(MUT.ENrange[1],MUT.ENrange[2],DNA.endurance)) return 0
if(MUT.commut && !HYPCheckCommut(DNA,MUT.commut)) return 0
return 1
if(!HYPmutationcheck_sub(MUT.GTrange[1],MUT.GTrange[2],DNA.growtime)) return FALSE
if(!HYPmutationcheck_sub(MUT.HTrange[1],MUT.HTrange[2],DNA.harvtime)) return FALSE
if(!HYPmutationcheck_sub(MUT.HVrange[1],MUT.HVrange[2],DNA.harvests)) return FALSE
if(!HYPmutationcheck_sub(MUT.CZrange[1],MUT.CZrange[2],DNA.cropsize)) return FALSE
if(!HYPmutationcheck_sub(MUT.PTrange[1],MUT.PTrange[2],DNA.potency)) return FALSE
if(!HYPmutationcheck_sub(MUT.ENrange[1],MUT.ENrange[2],DNA.endurance)) return FALSE
if(MUT.commut && !HYPCheckCommut(DNA,MUT.commut)) return FALSE
if(MUT.required_mutation && !istype(DNA.mutation, MUT.required_mutation)) return FALSE
return TRUE

proc/HYPmutationcheck_sub(var/lowerbound,var/upperbound,var/checkedvariable)
// Part of mutationcheck_full. Just a simple mathematical check to keep the prior proc
Expand Down