This is it, Luigi. We gotta move the function!

This commit is contained in:
The0bserver
2020-08-30 12:44:12 -04:00
parent af97bddf87
commit c2002aca78
2 changed files with 73 additions and 57 deletions

View File

@@ -79,24 +79,6 @@
return ..()
/obj/machinery/hydroponics/proc/FindConnected()
var/list/connected = list()
var/list/processing_atoms = list(src)
while(processing_atoms.len)
var/atom/a = processing_atoms[1]
for(var/step_dir in GLOB.cardinals)
var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir)
// Soil plots aren't dense
if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms))
processing_atoms += h
processing_atoms -= a
connected += a
return connected
/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
if(!myseed)
return ..()
@@ -132,12 +114,15 @@
needs_update = 1
//Nutrients//////////////////////////////////////////////////////////////
// Nutrients deplete slowly
if(prob(50))
adjustNutri(-1 / rating)
// Nutrients deplete at a constant rate, since new nutrients can boost stats far easier.
apply_chemicals(lastuser)
if(self_sustaining)
reagents.remove_any(min(0.5, nutridrain))
else
reagents.remove_any(nutridrain)
// Lack of nutrients hurts non-weeds
if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
if(reagents.total_volume <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-rand(1,3))
//Photosynthesis/////////////////////////////////////////////////////////
@@ -163,7 +148,7 @@
adjustHealth(-rand(0,2) / rating)
// Sufficient water level and nutrient level = plant healthy but also spawns weeds
else if(waterlevel > 10 && nutrilevel > 0)
else if(waterlevel > 10 && reagents.total_volume > 0)
adjustHealth(rand(1,2) / rating)
if(myseed && prob(myseed.weed_chance))
adjustWeeds(myseed.weed_rate)
@@ -208,6 +193,21 @@
if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-1 / rating)
//This is where stability mutations exist now.
if(myseed.instability >= 80)
var/mutation_chance = myseed.instability - 75
mutate(0, 0, 0, 0, 0, 0, 0, mutation_chance, 0) //Scaling odds of a random trait or chemical
if(myseed.instability >= 60)
if(prob((myseed.instability)/2) && !self_sustaining && length(myseed.mutatelist)) //Minimum 30%, Maximum 50% chance of mutating every age tick when not on autogrow.
mutatespecie()
myseed.instability = myseed.instability/2
if(myseed.instability >= 40)
if(prob(myseed.instability))
hardmutate()
if(myseed.instability >= 20 )
if(prob(myseed.instability))
mutate()
//Health & Age///////////////////////////////////////////////////////////
// Plant dies if plant_health <= 0
@@ -250,25 +250,6 @@
selectedtrait.on_grow(src)
return
/obj/machinery/hydroponics/proc/nutrimentMutation()
if (mutmod == 0)
return
if (mutmod == 1)
if(prob(80)) //80%
mutate()
else if(prob(75)) //15%
hardmutate()
return
if (mutmod == 2)
if(prob(50)) //50%
mutate()
else if(prob(50)) //25%
hardmutate()
else if(prob(50)) //12.5%
mutatespecie()
return
return
/obj/machinery/hydroponics/update_icon()
//Refreshes the icon and sets the luminosity
cut_overlays()
@@ -295,15 +276,6 @@
return
/obj/machinery/hydroponics/proc/update_icon_hoses()
var/n = 0
for(var/Dir in GLOB.cardinals)
var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
if(t && t.using_irrigation && using_irrigation)
n += Dir
icon_state = "hoses-[n]"
/obj/machinery/hydroponics/proc/update_icon_plant()
var/mutable_appearance/plant_overlay = mutable_appearance(myseed.growing_icon, layer = OBJ_LAYER + 0.01)
if(dead)

View File

@@ -1606,24 +1606,68 @@
/datum/reagent/plantnutriment/eznutriment
name = "E-Z-Nutrient"
description = "Cheap and extremely common type of plant nutriment."
description = "Contains electrolytes. It's what plants crave."
color = "#376400" // RBG: 50, 100, 0
tox_prob = 10
pH = 2.5
/datum/reagent/plantnutriment/eznutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_instability(0.2)
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) * 0.3))
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 0.1))
/datum/reagent/plantnutriment/left4zednutriment
name = "Left 4 Zed"
description = "Unstable nutriment that makes plants mutate more often than usual."
color = "#1A1E4D" // RBG: 26, 30, 77
tox_prob = 25
pH = 3.5
/datum/reagent/plantnutriment/left4zednutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_instability(round(chems.get_reagent_amount(src.type) * 0.2))
/datum/reagent/plantnutriment/robustharvestnutriment
name = "Robust Harvest"
description = "Very potent nutriment that prevents plants from mutating."
description = "Very potent nutriment that slows plants from mutating."
color = "#9D9D00" // RBG: 157, 157, 0
tox_prob = 15
pH = 2.5
/datum/reagent/plantnutriment/robustharvestnutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_instability(-0.25)
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 0.2))
/datum/reagent/plantnutriment/endurogrow
name = "Enduro Grow"
description = "A specialized nutriment, which decreases product quantity and potency, but strengthens the plants endurance."
color = "#a06fa7" // RBG: 160, 111, 167
tox_prob = 15
/datum/reagent/plantnutriment/endurogrow/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_potency(-round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_yield(-round(chems.get_reagent_amount(src.type) * 0.075))
myseed.adjust_endurance(round(chems.get_reagent_amount(src.type) * 0.35))
/datum/reagent/plantnutriment/liquidearthquake
name = "Liquid Earthquake"
description = "A specialized nutriment, which increases the plant's production speed, as well as it's susceptibility to weeds."
color = "#912e00" // RBG: 145, 46, 0
tox_prob = 25
/datum/reagent/plantnutriment/liquidearthquake/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_weed_rate(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_weed_chance(round(chems.get_reagent_amount(src.type) * 0.3))
myseed.adjust_production(-round(chems.get_reagent_amount(src.type) * 0.075))
// GOON OTHERS