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

Change how sunflower and sunflower seeds share chems #17937

Merged
merged 2 commits into from Feb 27, 2024
Merged
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
12 changes: 12 additions & 0 deletions code/obj/item/plants.dm
Expand Up @@ -599,6 +599,8 @@ ABSTRACT_TYPE(/obj/item/plant/flower)
name = "sunflower"
desc = "A rather large sunflower. Legends speak of the tasty seeds."
icon_state = "sunflower"
var/initial_seed_count = 0 //! how many seeds the flower started with
var/current_seed_count = 0 //! how many seeds the flower has left

attack_self(mob/user)
. = ..()
Expand All @@ -617,6 +619,13 @@ ABSTRACT_TYPE(/obj/item/plant/flower)
if(seeds)
boutput(user, SPAN_NOTICE("You notice some [seeds] fall out of [src]!"))
seeds.set_loc(get_turf(target))
// that's the result if you want to keep 50% of the initial chems in the sunflower at the end.
// This accomodates partially for chems injected in the sunflower if some seeds are already missing
var/chem_amount = src.reagents.total_volume / (current_seed_count + initial_seed_count)
seeds.reagents.maximum_volume = max(chem_amount, seeds.reagents.maximum_volume)
src.reagents.trans_to(seeds, chem_amount)
src.current_seed_count -= 1


HYPsetup_DNA(var/datum/plantgenes/passed_genes, var/obj/machinery/plantpot/harvested_plantpot, var/datum/plant/origin_plant, var/quality_status)
. = ..()
Expand All @@ -634,6 +643,9 @@ ABSTRACT_TYPE(/obj/item/plant/flower)
for(var/seed_num in 1 to seed_count)
var/obj/item/reagent_containers/food/snacks/plant/sunflower/P = new(src)
P.HYPsetup_DNA(passed_genes, harvested_plantpot, origin_plant, quality_status)
P.reagents.clear_reagents() //no chem duping by getting seeds out of sunflowers. We will transfer the chems from the flower onto the seeds in disperse_seeds.
src.initial_seed_count += 1
src.current_seed_count += 1

/obj/item/plant/herb/hcordata
name = "houttuynia cordata"
Expand Down