Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 80 additions & 1 deletion code/datums/hydroponics/plant_mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, "<b>Plant HYP</b> [src] in pot [POT] failed with error [.]")
attacked_proc_override = 0
return lasterr

// Tomato Mutations

/datum/plantmutation/tomato/explosive
Expand All @@ -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
Expand Down Expand Up @@ -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("<span style=\"color:red\"><b>[POT.name]</b> slaps [pick(nerds)] with a fish!</span>")
playsound(get_turf(POT), pick('sound/weapons/slimyhit1.ogg', 'sound/weapons/slimyhit2.ogg'), 50, 1, -1)

// Cannabis Mutations

/datum/plantmutation/cannabis/rainbow
Expand Down Expand Up @@ -351,4 +402,32 @@
name = "Money Tree"
iconmod = "Cash"
crop = /obj/item/spacecash
chance = 20
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("<span class='combat'><b>[POT.name]</b> [pick("howls","bays","whines","barks","croons")]!</span>")
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, "<span style=\"color:red\">[POT.name] angrily bites you!</span>")
random_brute_damage(user, 3)
return prob(50) // fights back, but doesn't always succeed
1 change: 1 addition & 0 deletions code/datums/hydroponics/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion code/datums/hydroponics/plants_crop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/datums/hydroponics/plants_fruit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 21 additions & 1 deletion code/datums/hydroponics/plants_herb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,24 @@
isgrass = 1
vending = 2
genome = 1
assoc_reagents = list("catonium")
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")
21 changes: 21 additions & 0 deletions code/obj/item/food/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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!"
Expand Down
9 changes: 8 additions & 1 deletion code/obj/item/kitchen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,11 @@ MISC KITCHENWARE
qdel(src)
return
..()
return
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)
5 changes: 5 additions & 0 deletions code/obj/item/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
57 changes: 52 additions & 5 deletions code/obj/machinery/plantpot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<span style=\"color:red\">[src] goes up in flames!</span>")
Expand All @@ -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("<span style=\"color:red\">[src] is is destroyed by [user.name]'s [W]!</span>")
Expand Down Expand Up @@ -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")
Expand Down
Binary file modified icons/obj/foodNdrink/food_produce.dmi
Binary file not shown.
Binary file modified icons/obj/hydroponics/hydro_mutants.dmi
Binary file not shown.
Binary file modified icons/obj/hydroponics/hydromisc.dmi
Binary file not shown.
Binary file modified icons/obj/hydroponics/hydroponics.dmi
Binary file not shown.