Skip to content

Commit

Permalink
Merge branch 'botany/3' of https://github.com/RafRoq/Monkestation2.0
Browse files Browse the repository at this point in the history
…into botany/3
  • Loading branch information
RafRoq committed Jul 2, 2024
2 parents 2c11107 + 199683a commit f551d70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
18 changes: 9 additions & 9 deletions code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
var/alt_icon
/// Should we pixel offset ourselves at init? for mapping
var/offset_at_init = TRUE
// this volume can be altered by densified chemicals trait
var/volume_rate = 1
//This volume can be altered by densified chemicals trait
var/volume_rate = 1 //Monkestation Edit

/obj/item/food/grown/Initialize(mapload, obj/item/seeds/new_seed)
if(!tastes)
Expand All @@ -67,26 +67,26 @@
make_dryable()

// Go through all traits in their genes and call on_new_plant from them.
// TODO: we need a priority queue for traits,some of them need to be called first
//TODO: We need a priority queue for traits,some of them need to be called first
for(var/datum/plant_gene/trait/trait in seed.genes)
trait.on_new_plant(src, loc)

// needs to be run after traits are called because some of them alter max_volume and volume_rate
// since traits do not know in which order they were run we need to do it here
max_volume *= volume_rate
//Needs to be run after traits are called because some of them alter max_volume and volume_rate
//Since traits do not know in which order they were run we need to do it here
max_volume *= volume_rate //Monkestation Edit

// Set our default bitesize: bite size = 1 + (potency * 0.05) * (max_volume * 0.01) * modifier
// A 100 potency, non-densified plant = 1 + (5 * 1 * modifier) = 6u bite size
// For reference, your average 100 potency tomato has 14u of reagents - So, with no modifier it is eaten in 3 bites
bite_consumption = 1 + round(max((seed.potency * BITE_SIZE_POTENCY_MULTIPLIER), 1) * (max_volume * BITE_SIZE_VOLUME_MULTIPLIER) * bite_consumption_mod)

. = ..() //Only call it here because we want all the genes and shit to be applied before we add edibility. God this code is a mess.

// we want this trait to run after reagents component is added to the plant
//Monkestation Edit Begin
//We want this trait to run after reagents component is added to the plant
var/datum/plant_gene/trait/trait_noreact = seed.get_gene(/datum/plant_gene/trait/noreact)
if(trait_noreact)
trait_noreact.on_new_plant(src, loc)

//Monkestation Edit End
seed.prepare_result(src)
transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency!

Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/plant_genes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@

var/obj/item/food/grown/grown_plant = our_plant
if(istype(grown_plant, /obj/item/food/grown))
grown_plant.volume_rate = rate
grown_plant.volume_rate = rate //Monkestation Edit
else
//Grown inedibles however just use a reagents holder, so.
our_plant.reagents?.maximum_volume *= rate
Expand Down
1 change: 0 additions & 1 deletion code/modules/hydroponics/unique_plant_genes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@
. = ..()
if(!.)
return

var/obj/item/food/grown/grown_plant = our_plant
if(istype(grown_plant))
grown_plant.max_volume = new_capcity
Expand Down

0 comments on commit f551d70

Please sign in to comment.