diff --git a/code/datums/hydroponics/plant_mutations.dm b/code/datums/hydroponics/plant_mutations.dm index 8ff4ca41..dc8e2688 100644 --- a/code/datums/hydroponics/plant_mutations.dm +++ b/code/datums/hydroponics/plant_mutations.dm @@ -4,12 +4,15 @@ var/special_dmi = null // same as in base plant thing really var/iconmod = null // name of the sprite files in hydro_mutants.dmi var/harvest_override = 0 // If 1, you can harvest it irregardless of the plant's base harvestability + var/harvested_proc_override = 0 var/special_proc_override = 0 + var/attacked_proc_override = 0 // If 0, just use the base plant's settings // If 1, use the mutation's special_proc instead // If anything else, use both the base and the mutant procs + // Ranges various genes have to be in to get the mutation to appear - lower and upper bound var/list/GTrange = list(null,null) // null means there is no limit so an upper bound of 25 var/list/HTrange = list(null,null) // and no lower bound means the mutation will occur when @@ -41,6 +44,15 @@ special_proc_override = 0 return lasterr + proc/HYPattacked_proc_M(var/obj/machinery/plantpot/POT,var/mob/user) + lasterr = 0 + if (!POT) lasterr = 501 + if (POT.dead || !POT.current) lasterr = 502 + if (lasterr) + logTheThing("debug", null, null, "Plant HYP [src] in pot [POT] failed with error [.]") + attacked_proc_override = 0 + return lasterr + // Tomato Mutations /datum/plantmutation/tomato/explosive @@ -63,12 +75,24 @@ crop = /obj/critter/killertomato iconmod = "kiltom" +// Corn Mutations +/datum/plantmutation/corn/clear + crop = /obj/item/reagent_containers/food/snacks/plant/corn/clear + iconmod = "Clearcorn" + assoc_reagents = list("ethanol") + // Grape Mutations /datum/plantmutation/grapes/green crop = /obj/item/reagent_containers/food/snacks/plant/grape/green iconmod = "Ggrape" +/datum/plantmutation/grapes/plasma + name = "Plasma Grapes" + crop = /obj/item/reagent_containers/food/snacks/plant/grape/plasma + iconmod = "Plasgrape" + assoc_reagents = list("plasma") + // Orange Mutations /datum/plantmutation/orange/blood @@ -218,6 +242,33 @@ assoc_reagents = list("oculine","mannitol","mutadone") chance = 5 +// Houttuynia Cordata Mutations + +/datum/plantmutation/hcordata/fish + name = "Wholetuna Cordata" + iconmod = "Wcordata" + crop = /obj/item/fish/random + special_proc_override = 1 + + HYPspecial_proc_M(var/obj/machinery/plantpot/POT) + ..() + if (.) return + var/datum/plant/P = POT.current + var/datum/plantgenes/DNA = POT.plantgenes + + if (POT.growth > (P.harvtime + DNA.harvtime) && prob(10)) + var/list/nerds = list() + // I know that this seems weird, but consider how many plants clutter botany at any given time. Looping through mobs and checking distance is + // less of a pain than looping through potentially hundreds of random seeds and crap in view(1) to see if they're mobs. + for (var/mob/living/L in mobs) + if (get_dist(L.loc,POT.loc) <= 1) + nerds += L + else + continue + if (nerds.len >= 1) + POT.visible_message("[POT.name] slaps [pick(nerds)] with a fish!") + playsound(get_turf(POT), pick('sound/weapons/slimyhit1.ogg', 'sound/weapons/slimyhit2.ogg'), 50, 1, -1) + // Cannabis Mutations /datum/plantmutation/cannabis/rainbow @@ -351,4 +402,32 @@ name = "Money Tree" iconmod = "Cash" crop = /obj/item/spacecash - chance = 20 \ No newline at end of file + chance = 20 + +/datum/plantmutation/tree/dog + name = "Dogwood Tree" + iconmod = "Dogwood" + special_proc_override = 1 + attacked_proc_override = 1 + + HYPspecial_proc_M(var/obj/machinery/plantpot/POT) + ..() + if (.) return + var/datum/plant/P = POT.current + var/datum/plantgenes/DNA = POT.plantgenes + + if (POT.growth > (P.growtime + DNA.growtime) && prob(5)) + POT.visible_message("[POT.name] [pick("howls","bays","whines","barks","croons")]!") + playsound(get_turf(POT), pick("sound/misc/howl1.ogg","sound/misc/howl2.ogg","sound/misc/howl3.ogg","sound/misc/howl4.ogg","sound/misc/howl5.ogg","sound/misc/howl6.ogg"), 30, 1,-1) + + HYPattacked_proc_M(var/obj/machinery/plantpot/POT,var/mob/user) + ..() + if (.) return + var/datum/plant/P = POT.current + var/datum/plantgenes/DNA = POT.plantgenes + + if (POT.growth < (P.growtime + DNA.growtime)) return 0 + playsound(get_turf(POT), pick("sound/misc/howl1.ogg","sound/misc/howl2.ogg","sound/misc/howl3.ogg","sound/misc/howl4.ogg","sound/misc/howl5.ogg","sound/misc/howl6.ogg"), 30, 1,-1) + boutput(user, "[POT.name] angrily bites you!") + random_brute_damage(user, 3) + return prob(50) // fights back, but doesn't always succeed \ No newline at end of file diff --git a/code/datums/hydroponics/plants.dm b/code/datums/hydroponics/plants.dm index f2216237..af53f8a4 100644 --- a/code/datums/hydroponics/plants.dm +++ b/code/datums/hydroponics/plants.dm @@ -53,6 +53,7 @@ // proc 200: HYPattacked // proc 300: HYPharvested // proc 400: HYPspecial_M + // proc 500: HYPattacked_M // error 1: called with null pot // error 2: called when plant is dead or no plant exists // error 3: called with a plant that is not ready to harvest diff --git a/code/datums/hydroponics/plants_crop.dm b/code/datums/hydroponics/plants_crop.dm index 79412d27..5b7e46c8 100644 --- a/code/datums/hydroponics/plants_crop.dm +++ b/code/datums/hydroponics/plants_crop.dm @@ -64,9 +64,11 @@ harvests = 3 endurance = 2 genome = 10 + mutations = list(/datum/plantmutation/corn/clear) commuts = list(/datum/plant_gene_strain/photosynthesis,/datum/plant_gene_strain/splicing/bad) assoc_reagents = list("cornstarch") + /datum/plant/synthmeat name = "Synthmeat" category = "Miscellaneous" @@ -173,7 +175,9 @@ harvests = 10 endurance = 5 genome = 20 + special_proc = 1 // for dogwood tree force_seed_on_harvest = 1 vending = 1 - mutations = list(/datum/plantmutation/tree/money) + attacked_proc = 1 // for dogwood tree + mutations = list(/datum/plantmutation/tree/money, /datum/plantmutation/tree/dog) commuts = list(/datum/plant_gene_strain/metabolism_fast,/datum/plant_gene_strain/metabolism_slow,/datum/plant_gene_strain/resistance_drought) \ No newline at end of file diff --git a/code/datums/hydroponics/plants_fruit.dm b/code/datums/hydroponics/plants_fruit.dm index 4e260f53..4ba5c69a 100644 --- a/code/datums/hydroponics/plants_fruit.dm +++ b/code/datums/hydroponics/plants_fruit.dm @@ -39,7 +39,7 @@ endurance = 0 genome = 20 nectarlevel = 10 - mutations = list(/datum/plantmutation/grapes/green) + mutations = list(/datum/plantmutation/grapes/green,/datum/plantmutation/grapes/plasma) commuts = list(/datum/plant_gene_strain/metabolism_fast,/datum/plant_gene_strain/seedless) /datum/plant/orange diff --git a/code/datums/hydroponics/plants_herb.dm b/code/datums/hydroponics/plants_herb.dm index 2270077c..79c34bf4 100644 --- a/code/datums/hydroponics/plants_herb.dm +++ b/code/datums/hydroponics/plants_herb.dm @@ -118,4 +118,24 @@ isgrass = 1 vending = 2 genome = 1 - assoc_reagents = list("catonium") \ No newline at end of file + assoc_reagents = list("catonium") + +/datum/plant/hcordata + name = "Houttuynia Cordata" + category = "Herb" + seedcolor = "#00CA70" + crop = /obj/item/plant/herb/hcordata + mutations = list(/datum/plantmutation/hcordata/fish) + starthealth = 10 + growtime = 30 + harvtime = 80 + cropsize = 6 + harvests = 1 + force_seed_on_harvest = 1 + special_proc = 1 // for tuna plant + harvested_proc = 1 // for tuna plant + isgrass = 0 // for some reason, isgrass forces you not to gave a G3 sprite and stops a bunch of the "fully grown plant" shit from happening :[ + endurance = 0 + vending = 1 + genome = 1 + assoc_reagents = list("mercury") \ No newline at end of file diff --git a/code/obj/item/food/plants.dm b/code/obj/item/food/plants.dm index a95effd2..f4418e64 100644 --- a/code/obj/item/food/plants.dm +++ b/code/obj/item/food/plants.dm @@ -117,6 +117,17 @@ new /obj/item/reagent_containers/food/snacks/popcorn(get_turf(src)) qdel(src) +/obj/item/reagent_containers/food/snacks/plant/corn/clear + name = "clear corn cob" + desc = "Pure grain ethanol in a vague corn shape." + icon_state = "clearcorn" + planttype = /datum/plant/corn + amount = 3 + heal_amt = 3 + food_color = "#FFFFFF" + plant_reagent = "ethanol" + brew_result = "ethanol" + /obj/item/reagent_containers/food/snacks/plant/soy name = "soybean pod" desc = "These soybeans are as close as two beans in a pod. Probably because they are literally beans in a pod." @@ -231,6 +242,16 @@ food_color = "#AAFFAA" brew_result = "white_wine" +/obj/item/reagent_containers/food/snacks/plant/grape/plasma + name = "grapes" + desc = "Definitely not the green ones." + icon_state = "plasgrape" + amount = 3 + heal_amt = 0 + food_color = "#FF00FF" + brew_result = "plasma" + plant_reagent = "plasma" + /obj/item/reagent_containers/food/snacks/plant/melon/ name = "melon" desc = "You should cut it into slices first!" diff --git a/code/obj/item/kitchen.dm b/code/obj/item/kitchen.dm index 2438616e..8df69898 100644 --- a/code/obj/item/kitchen.dm +++ b/code/obj/item/kitchen.dm @@ -281,4 +281,11 @@ MISC KITCHENWARE qdel(src) return ..() - return \ No newline at end of file + return + +/obj/item/fish/random // used by the Wholetuna Cordata plant + New() + spawn(0) + var/fish = pick(/obj/item/fish/salmon,/obj/item/fish/carp,/obj/item/fish/bass) + new fish(get_turf(src)) + qdel(src) \ No newline at end of file diff --git a/code/obj/item/plants.dm b/code/obj/item/plants.dm index 09740650..27faa31b 100644 --- a/code/obj/item/plants.dm +++ b/code/obj/item/plants.dm @@ -198,3 +198,8 @@ brew_result = "catdrugs" module_research = list("vice" = 3) module_research_type = /obj/item/plant/herb/cannabis + +/obj/item/plant/herb/hcordata + name = "houttuynia cordata" + desc = "Also known as fish mint or heart leaf, used in cuisine for its distinct fishy flavor." + icon_state = "hcordata" \ No newline at end of file diff --git a/code/obj/machinery/plantpot.dm b/code/obj/machinery/plantpot.dm index 8597f093..a65beb15 100644 --- a/code/obj/machinery/plantpot.dm +++ b/code/obj/machinery/plantpot.dm @@ -357,9 +357,24 @@ if (src.current) var/datum/plant/growing = src.current if (growing.attacked_proc) - if (growing.HYPattacked_proc(src,user,W)) return // It will fight back if possible, and halts the attack if it returns // anything other than zero from the attack proc. + if (plantgenes.mutation) + // If we've got a mutation, we want to check if the mutation has its own special + // proc that overrides the regular one. + var/datum/plantmutation/MUT = plantgenes.mutation + switch (MUT.attacked_proc_override) + if(0) + // There's no attacked proc for this mutation, so just use the regular one. + if (growing.HYPattacked_proc(src,user,W)) return + if(1) + // The mutation overrides the base proc to use its own. + if (MUT.HYPattacked_proc_M(src,user,W)) return + else + // Any other value means we use BOTH procs. + if (growing.HYPattacked_proc(src,user,W) || MUT.HYPattacked_proc_M(src,user,W)) return + else + if (growing.HYPattacked_proc(src,user,W)) return if (src.dead) src.visible_message("[src] goes up in flames!") @@ -375,7 +390,24 @@ if (src.current) var/datum/plant/growing = src.current if (growing.attacked_proc) - if (growing.HYPattacked_proc(src,user,W)) return + // It will fight back if possible, and halts the attack if it returns + // anything other than zero from the attack proc. + if (plantgenes.mutation) + // If we've got a mutation, we want to check if the mutation has its own special + // proc that overrides the regular one. + var/datum/plantmutation/MUT = plantgenes.mutation + switch (MUT.attacked_proc_override) + if(0) + // There's no attacked proc for this mutation, so just use the regular one. + if (growing.HYPattacked_proc(src,user,W)) return + if(1) + // The mutation overrides the base proc to use its own. + if (MUT.HYPattacked_proc_M(src,user,W)) return + else + // Any other value means we use BOTH procs. + if (growing.HYPattacked_proc(src,user,W) || MUT.HYPattacked_proc_M(src,user,W)) return + else + if (growing.HYPattacked_proc(src,user,W)) return if (src.dead) src.visible_message("[src] is is destroyed by [user.name]'s [W]!") @@ -531,9 +563,24 @@ if (src.current) var/datum/plant/growing = src.current if (growing.attacked_proc) - if (growing.HYPattacked_proc(src,usr,null)) return - // Plants that can fight back can halt your attempt to clear them, and will also - // run whatever is in their attacked proc. Same as harvesting really. + // It will fight back if possible, and halts the attack if it returns + // anything other than zero from the attack proc. + if (plantgenes.mutation) + // If we've got a mutation, we want to check if the mutation has its own special + // proc that overrides the regular one. + var/datum/plantmutation/MUT = plantgenes.mutation + switch (MUT.attacked_proc_override) + if(0) + // There's no attacked proc for this mutation, so just use the regular one. + if (growing.HYPattacked_proc(src,usr,null)) return + if(1) + // The mutation overrides the base proc to use its own. + if (MUT.HYPattacked_proc_M(src,usr,null)) return + else + // Any other value means we use BOTH procs. + if (growing.HYPattacked_proc(src,usr,null) || MUT.HYPattacked_proc_M(src,usr,null)) return + else + if (growing.HYPattacked_proc(src,usr,null)) return if (growing.growthmode == "weed") if (alert("Clear this tray?",,"Yes","No") == "Yes") diff --git a/icons/obj/foodNdrink/food_produce.dmi b/icons/obj/foodNdrink/food_produce.dmi index f11585aa..1a9ad20b 100644 Binary files a/icons/obj/foodNdrink/food_produce.dmi and b/icons/obj/foodNdrink/food_produce.dmi differ diff --git a/icons/obj/hydroponics/hydro_mutants.dmi b/icons/obj/hydroponics/hydro_mutants.dmi index b517eadd..3e4c2ea0 100644 Binary files a/icons/obj/hydroponics/hydro_mutants.dmi and b/icons/obj/hydroponics/hydro_mutants.dmi differ diff --git a/icons/obj/hydroponics/hydromisc.dmi b/icons/obj/hydroponics/hydromisc.dmi index 03d618af..f481462b 100644 Binary files a/icons/obj/hydroponics/hydromisc.dmi and b/icons/obj/hydroponics/hydromisc.dmi differ diff --git a/icons/obj/hydroponics/hydroponics.dmi b/icons/obj/hydroponics/hydroponics.dmi index d67ee845..eec0cdd6 100644 Binary files a/icons/obj/hydroponics/hydroponics.dmi and b/icons/obj/hydroponics/hydroponics.dmi differ