diff --git a/code/__DEFINES/hydroponics.dm b/code/__DEFINES/hydroponics.dm index a53e66f0a0f..f6693b0bcfc 100644 --- a/code/__DEFINES/hydroponics.dm +++ b/code/__DEFINES/hydroponics.dm @@ -56,4 +56,5 @@ #define TRAIT_BIOLUM 36 #define TRAIT_BIOLUM_COLOUR 37 #define TRAIT_IMMUTABLE 38 -#define TRAIT_RARITY 39 \ No newline at end of file +#define TRAIT_RARITY 39 +#define TRAIT_BATTERY_RECHARGE 40 \ No newline at end of file diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 9190e94cbbd..b39ca263d02 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -491,4 +491,21 @@ return reagents.remove_any(rand(1,3)) //Todo, make it actually remove the reagents the seed uses. seed.do_thorns(H,src) - seed.do_sting(H,src,pick("r_hand","l_hand")) \ No newline at end of file + seed.do_sting(H,src,pick("r_hand","l_hand")) + + +/obj/item/weapon/reagent_containers/food/snacks/grown/On_Consume() + if(seed && seed.get_trait(TRAIT_BATTERY_RECHARGE)) + if(!reagents.total_volume) + var/batteries_recharged = 0 + for(var/obj/item/weapon/stock_parts/cell/C in usr.GetAllContents()) + var/newcharge = (potency*0.01)*C.maxcharge + if(C.charge < newcharge) + C.charge = newcharge + if(isobj(C.loc)) + var/obj/O = C.loc + O.update_icon() //update power meters and such + batteries_recharged = 1 + if(batteries_recharged) + usr << "Battery has recovered." + ..() \ No newline at end of file diff --git a/code/modules/hydroponics/grown_predefined.dm b/code/modules/hydroponics/grown_predefined.dm index 523974abac3..44c9c3a1943 100644 --- a/code/modules/hydroponics/grown_predefined.dm +++ b/code/modules/hydroponics/grown_predefined.dm @@ -43,4 +43,7 @@ plantname = "aloe" /obj/item/weapon/reagent_containers/food/snacks/grown/comfrey - plantname = "comfrey" \ No newline at end of file + plantname = "comfrey" + +/obj/item/weapon/reagent_containers/food/snacks/grown/glowcap + plantname = "glowcap" \ No newline at end of file diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index d206c8f8e3a..86a4f19630d 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -42,6 +42,7 @@ set_trait(TRAIT_MATURATION, 0) // Time taken before the plant is mature. set_trait(TRAIT_PRODUCTION, 0) // Time before harvesting can be undertaken again. set_trait(TRAIT_TELEPORTING, 0) // Uses the bluespace tomato effect. + set_trait(TRAIT_BATTERY_RECHARGE, 0) // Used for glowcaps; recharges batteries on a user. set_trait(TRAIT_BIOLUM, 0) // Plant is bioluminescent. set_trait(TRAIT_ALTER_TEMP, 0) // If set, the plant will periodically alter local temp by this amount. set_trait(TRAIT_PRODUCT_ICON, 0) // Icon to use for fruit coming from this plant. @@ -675,7 +676,7 @@ P.values["[TRAIT_EXUDE_GASSES]"] = exude_gasses traits_to_copy = list(TRAIT_POTENCY) if(GENE_OUTPUT) - traits_to_copy = list(TRAIT_PRODUCES_POWER,TRAIT_BIOLUM) + traits_to_copy = list(TRAIT_PRODUCES_POWER,TRAIT_BIOLUM,TRAIT_BATTERY_RECHARGE) if(GENE_ATMOSPHERE) traits_to_copy = list(TRAIT_HEAT_TOLERANCE,TRAIT_LOWKPA_TOLERANCE,TRAIT_HIGHKPA_TOLERANCE) if(GENE_HARDINESS) diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 58ee1a8a666..28cd89843ac 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -655,7 +655,7 @@ name = "glowshroom" seed_name = "glowshroom" display_name = "glowshrooms" - mutants = null + mutants = list("glowcap") chems = list("radium" = list(1,20)) preset_icon = "glowshroom" @@ -673,6 +673,20 @@ set_trait(TRAIT_PLANT_ICON,"mushroom7") set_trait(TRAIT_RARITY,20) +/datum/seed/mushroom/glowshroom/glowcap + name = "glowcap" + seed_name = "glowcap" + display_name = "glowcaps" + mutants = null + preset_icon = "glowcap" + +/datum/seed/mushroom/glowshroom/glowcap/New() + ..() + set_trait(TRAIT_BIOLUM_COLOUR,"#8E0300") + set_trait(TRAIT_PRODUCT_COLOUR,"#C65680") + set_trait(TRAIT_PLANT_COLOUR,"#B72D68") + set_trait(TRAIT_BATTERY_RECHARGE,1) + /datum/seed/mushroom/plastic name = "plastic" seed_name = "plastellium" diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 18645c4f531..568af7a89ec 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -179,6 +179,9 @@ var/global/list/plant_seed_sprites = list() /obj/item/seeds/glowshroom seed_type = "glowshroom" +/obj/item/seeds/glowcap + seed_type = "glowcap" + /obj/item/seeds/plumpmycelium seed_type = "plumphelmet" diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index a18ed380196..147f02f69c1 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -234,6 +234,9 @@ if(grown_seed.get_trait(TRAIT_PRODUCES_POWER)) dat += "
The fruit will function as a battery if prepared appropriately." + if(grown_seed.get_trait(TRAIT_BATTERY_RECHARGE)) + dat += "
The fruit hums with an odd electrical energy." + if(grown_seed.get_trait(TRAIT_STINGS)) dat += "
The fruit is covered in stinging spines." diff --git a/icons/obj/harvest.dmi b/icons/obj/harvest.dmi index fb06ace12ef..0b7045cc64c 100644 Binary files a/icons/obj/harvest.dmi and b/icons/obj/harvest.dmi differ