[MIRROR] Fix Botany chemical gene grafts (#2566)

* Fix chemical grafts (#56000)

Fixes chemical grafts in botany so their seeds actually gain the reagents they offer.

For those who didn't know, Spaceman's Trumpet is the only plant (for now) that allows you you graft it and get a chemical instead of a trait (Polypyrylium Oligomers). Only this graft doesn't work. It shows up in the plant, but on harvest there is none of that chemical inside of it. Now it works.

* Fix Botany chemical gene grafts

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-01-08 18:43:06 +01:00
committed by GitHub
co-authored by MrMelbert
parent 32cb8a3c2c
commit 409506bcc3
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
attack_verb_continuous = list("plants", "vegitizes", "crops", "reaps", "farms")
attack_verb_simple = list("plant", "vegitize", "crop", "reap", "farm")
///The stored trait taken from the parent plant. Defaults to perenial growth.
var/datum/plant_gene/trait/stored_trait
var/datum/plant_gene/stored_trait
///Determines the appearance of the graft. Rudimentary right now so it just picks randomly.
var/graft_appearance
///Seed that the graft was taken from, used for applying parent stats. Can be unexpectedly nulled by the parent plant getting deleted.
+4 -1
View File
@@ -634,7 +634,7 @@
* - [snip][/obj/item/graft]: The graft being used applied to this plant.
*/
/obj/item/seeds/proc/apply_graft(obj/item/graft/snip)
var/datum/plant_gene/trait/new_trait = snip.stored_trait
var/datum/plant_gene/new_trait = snip.stored_trait
if(new_trait?.can_add(src))
genes += new_trait.Copy()
@@ -646,4 +646,7 @@
src.weed_chance = round(clamp(max(src.weed_chance, (src.weed_chance+(2/3)*(snip.weed_chance-src.weed_chance) )),0,100))
src.yield = round(clamp(max(src.yield, (src.yield +(2/3)*(snip.yield -src.yield) )),0,10 ))
// Add in any reagents, too.
reagents_from_genes()
return TRUE