mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-19 19:18:50 +01:00
Changes the plant reagent formula and makes plant potency, plant reagent % and plant volume interact sanely. (#51723)
* Initial commit and god help me if there are any botany mains left they're probably finding my address right now god save my soul * Cobby's changes and Shadark was right about my formula being slightly wack * Adjusts the examine message to suck a bit less. * Densified Chemicals now halves yield for double-power plants.
This commit is contained in:
@@ -73,10 +73,14 @@
|
||||
var/reag_txt = ""
|
||||
if(seed && P_analyzer.scan_mode == PLANT_SCANMODE_CHEMICALS)
|
||||
msg += "<br><span class='info'>*Plant Reagents:*</span>"
|
||||
var/chem_cap = 0
|
||||
for(var/reagent_id in seed.reagents_add)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id]
|
||||
var/amt = reagents.get_reagent_amount(reagent_id)
|
||||
chem_cap += seed.reagents_add[reagent_id]
|
||||
reag_txt += "\n<span class='info'>- [R.name]: [amt]</span>"
|
||||
if(chem_cap > 1)
|
||||
msg += "<br><span class='warning'>- Reagent Traits Over 100% Production</span></br>"
|
||||
|
||||
if(reag_txt)
|
||||
msg += "<br><span class='info'>*---------*</span>"
|
||||
|
||||
@@ -192,12 +192,21 @@
|
||||
|
||||
|
||||
/obj/item/seeds/proc/harvest(mob/user)
|
||||
///Reference to the tray/soil the seeds are planted in.
|
||||
var/obj/machinery/hydroponics/parent = loc //for ease of access
|
||||
///Count used for creating the correct amount of results to the harvest.
|
||||
var/t_amount = 0
|
||||
///List of plants all harvested from the same batch.
|
||||
var/list/result = list()
|
||||
///Tile of the harvester to deposit the growables.
|
||||
var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
|
||||
///Name of the grown products.
|
||||
var/product_name
|
||||
while(t_amount < getYield())
|
||||
///The Number of products produced by the plant, typically the yield. Modified by Densified Chemicals.
|
||||
var/product_count = getYield()
|
||||
if(get_gene(/datum/plant_gene/trait/maxchem))
|
||||
product_count = clamp(round(product_count/2),0,5)
|
||||
while(t_amount < product_count)
|
||||
var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
|
||||
if(parent.myseed.plantname != initial(parent.myseed.plantname))
|
||||
t_prod.name = lowertext(parent.myseed.plantname)
|
||||
@@ -221,20 +230,23 @@
|
||||
/obj/item/seeds/proc/prepare_result(var/obj/item/T)
|
||||
if(!T.reagents)
|
||||
CRASH("[T] has no reagents.")
|
||||
|
||||
var/reagent_max = 0
|
||||
for(var/rid in reagents_add)
|
||||
var/amount = max(1, round(potency * reagents_add[rid], 1)) //the plant will always have at least 1u of each of the reagents in its reagent production traits
|
||||
|
||||
var/list/data = null
|
||||
if(rid == /datum/reagent/blood) // Hack to make blood in plants always O-
|
||||
data = list("blood_type" = "O-")
|
||||
if(rid == /datum/reagent/consumable/nutriment || rid == /datum/reagent/consumable/nutriment/vitamin)
|
||||
// apple tastes of apple.
|
||||
if(istype(T, /obj/item/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/reagent_containers/food/snacks/grown/grown_edible = T
|
||||
data = grown_edible.tastes
|
||||
|
||||
T.reagents.add_reagent(rid, amount, data)
|
||||
reagent_max += reagents_add[rid]
|
||||
if(istype(T, /obj/item/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/reagent_containers/food/snacks/grown/grown_edible = T
|
||||
for(var/rid in reagents_add)
|
||||
var/reagent_overflow_mod = reagents_add[rid]
|
||||
if(reagent_max > 1)
|
||||
reagent_overflow_mod = (reagents_add[rid]/ reagent_max)
|
||||
var/edible_vol = grown_edible.reagents ? grown_edible.reagents.maximum_volume : 0
|
||||
var/amount = max(1, round((edible_vol)*(potency/100) * reagent_overflow_mod, 1)) //the plant will always have at least 1u of each of the reagents in its reagent production traits
|
||||
var/list/data
|
||||
if(rid == /datum/reagent/blood) // Hack to make blood in plants always O-
|
||||
data = list("blood_type" = "O-")
|
||||
if(rid == /datum/reagent/consumable/nutriment || rid == /datum/reagent/consumable/nutriment/vitamin)
|
||||
data = grown_edible.tastes // apple tastes of apple.
|
||||
T.reagents.add_reagent(rid, amount, data)
|
||||
|
||||
|
||||
/// Setters procs ///
|
||||
|
||||
Reference in New Issue
Block a user