Merge pull request #6406 from VOREStation/upstream-merge-6592

[MIRROR] Xenoflora expansion take2
This commit is contained in:
Novacat
2020-01-08 17:18:49 -05:00
committed by GitHub
17 changed files with 272 additions and 741 deletions

View File

@@ -57,4 +57,50 @@
#define TRAIT_BIOLUM 36
#define TRAIT_BIOLUM_COLOUR 37
#define TRAIT_IMMUTABLE 38
#define TRAIT_FLESH_COLOUR 39
#define TRAIT_FLESH_COLOUR 39
#define TRAIT_SPORING 40
#define TRAIT_BENEFICIAL_REAG 41
#define TRAIT_MUTAGENIC_REAG 42
#define TRAIT_TOXIC_REAG 43
// Global list initialization for plants.
GLOBAL_LIST_INIT(plant_mob_products, list(
/mob/living/simple_mob/creature = 10,
/mob/living/simple_mob/blob/spore = 20,
/mob/living/simple_mob/tomato = 30,
/mob/living/simple_mob/animal/passive/dog = 5,
/mob/living/simple_mob/animal/passive/chicken = 5,
/mob/living/simple_mob/animal/passive/crab = 5,
/mob/living/simple_mob/animal/passive/lizard = 4,
/mob/living/simple_mob/animal/passive/lizard/large = 1,
/mob/living/simple_mob/animal/giant_spider/pepper = 1,
/mob/living/simple_mob/animal/giant_spider/frost = 1,
/mob/living/simple_mob/animal/giant_spider/webslinger = 1,
/mob/living/simple_mob/animal/passive/mouse = 1,
/mob/living/simple_mob/animal/space/carp = 1,
/mob/living/carbon/human/monkey = 1,
/mob/living/carbon/alien/diona = 1
))
GLOBAL_LIST_INIT(plant_item_products, list(
/obj/item/stack/material/cloth = 30,
/obj/item/stack/material/wax = 20,
/obj/item/stack/material/log = 30,
/obj/item/stack/material/resin = 10,
/obj/item/weapon/material/shard/shrapnel = 2,
/obj/item/weapon/ore = 5,
/obj/item/weapon/ore/iron = 2,
/obj/item/weapon/ore/coal = 2,
/obj/item/weapon/reagent_containers/food/snacks/meat = 3,
/obj/random/meat = 1,
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk = 2,
/obj/item/weapon/reagent_containers/food/drinks/smallmilk = 2,
/obj/item/ammo_casing/a145 = 1,
/obj/item/ammo_casing/chemdart/small = 1,
/obj/item/ammo_casing/chemdart = 1,
/obj/item/organ/internal/brain/grey = 1,
/obj/item/organ/internal/heart/grey = 1,
/obj/item/weapon/spacecash/c1 = 3,
/obj/item/weapon/spacecash/c10 = 1
))

View File

@@ -26,6 +26,11 @@
var/has_item_product // Item products. (Eggy)
var/force_layer
// Making the assumption anything in HYDRO-ponics is capable of processing water, and nutrients commonly associated with it, leaving us with the below to be tweaked.
var/list/beneficial_reagents // Reagents considered uniquely 'beneficial' by a plant.
var/list/mutagenic_reagents // Reagents considered uniquely 'mutagenic' by a plant.
var/list/toxic_reagents // Reagents considered uniquely 'toxic' by a plant.
/datum/seed/New()
set_trait(TRAIT_IMMUTABLE, 0) // If set, plant will never mutate. If -1, plant is highly mutable.
@@ -63,6 +68,10 @@
set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin.
set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick.
set_trait(TRAIT_PLANT_COLOUR, "#46B543") // Colour of the plant icon.
set_trait(TRAIT_SPORING, 0) // Is the plant able to periodically produce spores when in a tray. 1, plant produces chem clouds, 0 it does not.
set_trait(TRAIT_BENEFICIAL_REAG, null) // Reagents considered uniquely 'beneficial' by a plant. This should be an associated list of lists, or null. Examples in tray.dm. nested list: health, yield, mut
set_trait(TRAIT_MUTAGENIC_REAG, null) // Reagents considered uniquely 'mutagenic' by a plant. This should be an associated list, or null. Examples in tray.dm
set_trait(TRAIT_TOXIC_REAG, null) // Reagents considered uniquely 'toxic' by a plant. This should be an associated list, or null. Examples in tray.dm
spawn(5)
sleep(-1)
@@ -295,9 +304,20 @@
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
// Handle gas production.
if(exude_gasses && exude_gasses.len && !check_only)
for(var/gas in exude_gasses)
environment.adjust_gas(gas, max(1,round((exude_gasses[gas]*(get_trait(TRAIT_POTENCY)/5))/exude_gasses.len)))
if(!check_only)
if(exude_gasses && exude_gasses.len)
for(var/gas in exude_gasses)
environment.adjust_gas(gas, max(1,round((exude_gasses[gas]*(get_trait(TRAIT_POTENCY)/5))/exude_gasses.len)))
if(get_trait(TRAIT_SPORING))
var/can_spore = TRUE
var/obj/machinery/portable_atmospherics/hydroponics/hometray = locate(/obj/machinery/portable_atmospherics/hydroponics) in current_turf
if(health_change > 2 || (hometray && hometray.closed_system))
can_spore = FALSE
if(can_spore && prob(5))
create_spores(current_turf)
// Handle light requirements.
if(!light_supplied)
@@ -445,6 +465,30 @@
banned_chems += new_chem
chems[new_chem] = list(rand(1,10),rand(10,20))
if(prob(5))
var/unique_beneficial_count = rand(1, 5)
if(!beneficial_reagents)
beneficial_reagents = list()
for(var/x = 1 to unique_beneficial_count)
beneficial_reagents[pick(SSchemistry.chemical_reagents)] = list(round(rand(-100, 100) / 10), round(rand(-100, 100) / 10), round(rand(-100, 100) / 10))
set_trait(TRAIT_BENEFICIAL_REAG, beneficial_reagents)
if(prob(5))
var/unique_mutagenic_count = rand(1, 5)
if(!mutagenic_reagents)
mutagenic_reagents = list()
for(var/x = 1 to unique_mutagenic_count)
mutagenic_reagents[pick(SSchemistry.chemical_reagents)] = rand(0, 20)
set_trait(TRAIT_MUTAGENIC_REAG, mutagenic_reagents)
if(prob(5))
var/unique_toxic_count = rand(1, 5)
if(!toxic_reagents)
toxic_reagents = list()
for(var/x = 1 to unique_toxic_count)
toxic_reagents[pick(SSchemistry.chemical_reagents)] = round(rand(-100, 100) / 10)
set_trait(TRAIT_TOXIC_REAG, toxic_reagents)
if(prob(90))
set_trait(TRAIT_REQUIRES_NUTRIENTS,1)
set_trait(TRAIT_NUTRIENT_CONSUMPTION,rand(25)/25)
@@ -492,6 +536,15 @@
set_trait(TRAIT_BIOLUM,1)
set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]")
if(prob(3))
set_trait(TRAIT_SPORING,1)
if(prob(5))
if(prob(30))
has_mob_product = pickweight(GLOB.plant_mob_products)
else
has_item_product = pickweight(GLOB.plant_item_products)
set_trait(TRAIT_ENDURANCE,rand(60,100))
set_trait(TRAIT_YIELD,rand(3,15))
set_trait(TRAIT_MATURATION,rand(5,15))
@@ -534,6 +587,13 @@
set_trait(TRAIT_LIGHT_TOLERANCE, get_trait(TRAIT_LIGHT_TOLERANCE)+(rand(-2,2)*degree),10,0)
if(4)
set_trait(TRAIT_TOXINS_TOLERANCE, get_trait(TRAIT_TOXINS_TOLERANCE)+(rand(-2,2)*degree),10,0)
if(prob(degree*3))
var/unique_toxic_count = rand(1, 5)
if(!toxic_reagents)
toxic_reagents = list()
for(var/x = 1 to unique_toxic_count)
toxic_reagents[pick(SSchemistry.chemical_reagents)] = round(rand(-100, 100) / 10)
set_trait(TRAIT_TOXIC_REAG, toxic_reagents)
if(5)
set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0)
if(prob(degree*5))
@@ -547,6 +607,13 @@
if(7)
if(get_trait(TRAIT_YIELD) != -1)
set_trait(TRAIT_YIELD, get_trait(TRAIT_YIELD)+(rand(-2,2)*degree),10,0)
if(prob(degree*3))
var/unique_mutagenic_count = rand(1, 5)
if(!mutagenic_reagents)
mutagenic_reagents = list()
for(var/x = 1 to unique_mutagenic_count)
mutagenic_reagents[pick(SSchemistry.chemical_reagents)] = rand(0, 20)
set_trait(TRAIT_MUTAGENIC_REAG, mutagenic_reagents)
if(8)
set_trait(TRAIT_ENDURANCE, get_trait(TRAIT_ENDURANCE)+(rand(-5,5)*degree),100,10)
set_trait(TRAIT_PRODUCTION, get_trait(TRAIT_PRODUCTION)+(rand(-1,1)*degree),10, 1)
@@ -554,10 +621,19 @@
if(prob(degree*5))
set_trait(TRAIT_SPREAD, get_trait(TRAIT_SPREAD)+rand(-1,1),2, 0)
source_turf.visible_message("<span class='notice'>\The [display_name] spasms visibly, shifting in the tray.</span>")
if(prob(degree*3))
set_trait(TRAIT_SPORING, !get_trait(TRAIT_SPORING))
if(9)
set_trait(TRAIT_MATURATION, get_trait(TRAIT_MATURATION)+(rand(-1,1)*degree),30, 0)
if(prob(degree*5))
set_trait(TRAIT_HARVEST_REPEAT, !get_trait(TRAIT_HARVEST_REPEAT))
if(prob(degree*3))
var/unique_beneficial_count = rand(1, 5)
if(!beneficial_reagents)
beneficial_reagents = list()
for(var/x = 1 to unique_beneficial_count)
beneficial_reagents[pick(SSchemistry.chemical_reagents)] = list(round(rand(-100, 100) / 10), round(rand(-100, 100) / 10), round(rand(-100, 100) / 10))
set_trait(TRAIT_BENEFICIAL_REAG, beneficial_reagents)
if(10)
if(prob(degree*2))
set_trait(TRAIT_BIOLUM, !get_trait(TRAIT_BIOLUM))
@@ -612,8 +688,17 @@
for(var/gas in exude_gasses)
exude_gasses[gas] = max(1,round(exude_gasses[gas]*0.8))
set_trait(TRAIT_BENEFICIAL_REAG, gene.values["[TRAIT_BENEFICIAL_REAG]"].Copy())
set_trait(TRAIT_MUTAGENIC_REAG, gene.values["[TRAIT_MUTAGENIC_REAG]"].Copy())
set_trait(TRAIT_TOXIC_REAG, gene.values["[TRAIT_TOXIC_REAG]"].Copy())
gene.values["[TRAIT_EXUDE_GASSES]"] = null
gene.values["[TRAIT_CHEMS]"] = null
gene.values["[TRAIT_BENEFICIAL_REAG]"] = null
gene.values["[TRAIT_MUTAGENIC_REAG]"] = null
gene.values["[TRAIT_TOXIC_REAG]"] = null
if(GENE_DIET)
var/list/new_gasses = gene.values["[TRAIT_CONSUME_GASSES]"]
@@ -643,7 +728,7 @@
if(GENE_BIOCHEMISTRY)
P.values["[TRAIT_CHEMS]"] = chems
P.values["[TRAIT_EXUDE_GASSES]"] = exude_gasses
traits_to_copy = list(TRAIT_POTENCY)
traits_to_copy = list(TRAIT_POTENCY, TRAIT_SPORING, TRAIT_BENEFICIAL_REAG, TRAIT_MUTAGENIC_REAG, TRAIT_TOXIC_REAG)
if(GENE_OUTPUT)
traits_to_copy = list(TRAIT_PRODUCES_POWER,TRAIT_BIOLUM)
if(GENE_ATMOSPHERE)
@@ -680,6 +765,10 @@
if(!user)
return
if(get_trait(TRAIT_SPORING) && prob(round(30 * yield_mod)))
var/turf/T = get_turf(user)
create_spores(T)
if(!force_amount && get_trait(TRAIT_YIELD) == 0 && !harvest_sample)
if(istype(user)) user << "<span class='danger'>You fail to harvest anything useful.</span>"
else

View File

@@ -317,7 +317,7 @@
seed_name = "ambrosia deus"
display_name = "ambrosia deus"
kitchen_tag = "ambrosiadeus"
mutants = null
mutants = list("ambrosiainfernus")
chems = list("nutriment" = list(1), "bicaridine" = list(1,8), "synaptizine" = list(1,8,1), "hyperzine" = list(1,10,1), "space_drugs" = list(1,10))
/datum/seed/ambrosia/deus/New()
@@ -325,6 +325,19 @@
set_trait(TRAIT_PRODUCT_COLOUR,"#A3F0AD")
set_trait(TRAIT_PLANT_COLOUR,"#2A9C61")
/datum/seed/ambrosia/infernus
name = "ambrosiainfernus"
seed_name = "ambrosia infernus"
display_name = "ambrosia infernus"
kitchen_tag = "ambrosiainfernus"
mutants = null
chems = list("nutriment" = list(1,3), "oxycodone" = list(1,8), "impedrezene" = list(1,10), "mindbreaker" = list(1,10))
/datum/seed/ambrosia/infernus/New()
..()
set_trait(TRAIT_PRODUCT_COLOUR,"#dc143c")
set_trait(TRAIT_PLANT_COLOUR,"#b22222")
//Mushrooms/varieties.
/datum/seed/mushroom
name = "mushrooms"
@@ -507,6 +520,25 @@
set_trait(TRAIT_PLANT_COLOUR,"#E6E6E6")
set_trait(TRAIT_PLANT_ICON,"mushroom10")
/datum/seed/mushroom/spore
name = "sporeshroom"
seed_name = "corpellian"
display_name = "corpellian"
mutants = null
chems = list("serotrotium" = list(5,10), "mold" = list(1,10))
/datum/seed/mushroom/spore/New()
..()
set_trait(TRAIT_MATURATION,15)
set_trait(TRAIT_PRODUCTION,5)
set_trait(TRAIT_YIELD,4)
set_trait(TRAIT_POTENCY,20)
set_trait(TRAIT_PRODUCT_ICON,"mushroom5")
set_trait(TRAIT_PRODUCT_COLOUR,"#e29cd2")
set_trait(TRAIT_PLANT_COLOUR,"#f8e6f4")
set_trait(TRAIT_PLANT_ICON,"mushroom9")
set_trait(TRAIT_SPORING, TRUE)
//Flowers/varieties
/datum/seed/flower
name = "harebells"
@@ -746,7 +778,7 @@
seed_name = "peanut"
display_name = "peanut vines"
kitchen_tag = "peanut"
chems = list("nutriment" = list(1,10), "peanutoil" = list(1,3))
chems = list("nutriment" = list(1,10), "peanutoil" = list(3,10))
/datum/seed/peanuts/New()
..()
@@ -755,7 +787,7 @@
set_trait(TRAIT_PRODUCTION,6)
set_trait(TRAIT_YIELD,6)
set_trait(TRAIT_POTENCY,10)
set_trait(TRAIT_PRODUCT_ICON,"potato")
set_trait(TRAIT_PRODUCT_ICON,"nuts")
set_trait(TRAIT_PRODUCT_COLOUR,"#C4AE7A")
set_trait(TRAIT_PLANT_ICON,"bush2")
set_trait(TRAIT_IDEAL_LIGHT, 6)
@@ -765,7 +797,7 @@
seed_name = "vanilla"
display_name = "vanilla"
kitchen_tag = "vanilla"
chems = list("nutriment" = list(1,10), "vanilla" = list(0,3), "sugar" = list(0, 1))
chems = list("nutriment" = list(1,10), "vanilla" = list(2,8), "sugar" = list(1, 4))
/datum/seed/vanilla/New()
..()
@@ -829,7 +861,7 @@
seed_name = "corn"
display_name = "ears of corn"
kitchen_tag = "corn"
chems = list("nutriment" = list(1,10), "cornoil" = list(1,10))
chems = list("nutriment" = list(1,10), "cornoil" = list(3,15))
trash_type = /obj/item/weapon/corncob
/datum/seed/corn/New()
@@ -906,7 +938,7 @@
seed_name = "wheat"
display_name = "wheat stalks"
kitchen_tag = "wheat"
chems = list("nutriment" = list(1,25), "flour" = list(15,15))
chems = list("nutriment" = list(1,25), "flour" = list(10,30))
/datum/seed/wheat/New()
..()

View File

@@ -182,6 +182,12 @@ GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds)
/obj/item/seeds/plumpmycelium
seed_type = "plumphelmet"
/obj/item/seeds/plastellmycelium
seed_type = "plastic"
/obj/item/seeds/sporemycelium
seed_type = "sporeshroom"
/obj/item/seeds/nettleseed
seed_type = "nettle"
@@ -218,6 +224,9 @@ GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds)
/obj/item/seeds/ambrosiadeusseed
seed_type = "ambrosiadeus"
/obj/item/seeds/ambrosiainfernusseed
seed_type = "ambrosiainfernus"
/obj/item/seeds/whitebeetseed
seed_type = "whitebeet"

View File

@@ -135,6 +135,7 @@
/obj/item/seeds/tomatoseed = 3,
/obj/item/seeds/towermycelium = 3,
/obj/item/seeds/vanilla = 3,
/obj/item/seeds/wabback = 2,
/obj/item/seeds/watermelonseed = 3,
/obj/item/seeds/wheatseed = 3,
/obj/item/seeds/whitebeetseed = 3

View File

@@ -40,6 +40,9 @@
seed.do_thorns(victim,src)
seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg"))
if(seed.get_trait(TRAIT_SPORING) && prob(round(seed.get_trait(TRAIT_POTENCY)/2)))
seed.create_spores(get_turf(victim))
/obj/effect/plant/proc/unbuckle()
if(has_buckled_mobs())
for(var/A in buckled_mobs)

View File

@@ -46,7 +46,7 @@
// Reagent information for process(), consider moving this to a controller along
// with cycle information under 'mechanical concerns' at some point.
var/global/list/toxic_reagents = list(
var/static/list/toxic_reagents = list(
"anti_toxin" = -2,
"toxin" = 2,
"fluorine" = 2.5,
@@ -57,7 +57,7 @@
"cryoxadone" = -3,
"radium" = 2
)
var/global/list/nutrient_reagents = list(
var/static/list/nutrient_reagents = list(
"milk" = 0.1,
"beer" = 0.25,
"phosphorus" = 0.1,
@@ -71,7 +71,7 @@
"robustharvest" = 1,
"left4zed" = 1
)
var/global/list/weedkiller_reagents = list(
var/static/list/weedkiller_reagents = list(
"fluorine" = -4,
"chlorine" = -3,
"phosphorus" = -2,
@@ -81,12 +81,12 @@
"plantbgone" = -8,
"adminordrazine" = -5
)
var/global/list/pestkiller_reagents = list(
var/static/list/pestkiller_reagents = list(
"sugar" = 2,
"diethylamine" = -2,
"adminordrazine" = -5
)
var/global/list/water_reagents = list(
var/static/list/water_reagents = list(
"water" = 1,
"adminordrazine" = 1,
"milk" = 0.9,
@@ -98,8 +98,8 @@
"sodawater" = 1,
)
// Beneficial reagents also have values for modifying yield_mod and mut_mod (in that order).
var/global/list/beneficial_reagents = list(
// Beneficial reagents also have values for modifying health, yield_mod and mut_mod (in that order).
var/static/list/beneficial_reagents = list(
"beer" = list( -0.05, 0, 0 ),
"fluorine" = list( -2, 0, 0 ),
"chlorine" = list( -1, 0, 0 ),
@@ -120,7 +120,7 @@
// Mutagen list specifies minimum value for the mutation to take place, rather
// than a bound as the lists above specify.
var/global/list/mutagenic_reagents = list(
var/static/list/mutagenic_reagents = list(
"radium" = 8,
"mutagen" = 15
)
@@ -250,24 +250,37 @@
var/reagent_total = temp_chem_holder.reagents.get_reagent_amount(R.id)
if(seed && !dead)
//Handle some general level adjustments.
if(toxic_reagents[R.id])
toxins += toxic_reagents[R.id] * reagent_total
if(weedkiller_reagents[R.id])
weedlevel -= weedkiller_reagents[R.id] * reagent_total
if(pestkiller_reagents[R.id])
pestlevel += pestkiller_reagents[R.id] * reagent_total
// Beneficial reagents have a few impacts along with health buffs.
if(beneficial_reagents[R.id])
if(seed.beneficial_reagents && seed.beneficial_reagents[R.id])
health += seed.beneficial_reagents[R.id][1] * reagent_total
yield_mod += seed.beneficial_reagents[R.id][2] * reagent_total
mutation_mod += seed.beneficial_reagents[R.id][3] * reagent_total
else if(beneficial_reagents[R.id])
health += beneficial_reagents[R.id][1] * reagent_total
yield_mod += beneficial_reagents[R.id][2] * reagent_total
mutation_mod += beneficial_reagents[R.id][3] * reagent_total
// Mutagen is distinct from the previous types and mostly has a chance of proccing a mutation.
if(mutagenic_reagents[R.id])
if(seed.mutagenic_reagents && seed.mutagenic_reagents[R.id])
mutation_level += reagent_total*seed.mutagenic_reagents[R.id]+mutation_mod
else if(mutagenic_reagents[R.id])
mutation_level += reagent_total*mutagenic_reagents[R.id]+mutation_mod
// Toxic reagents can possibly differ between plants.
if(seed.toxic_reagents && seed.toxic_reagents[R.id])
toxins += seed.toxic_reagents[R.id] * reagent_total
else if(toxic_reagents[R.id])
toxins += toxic_reagents[R.id] * reagent_total
//Handle some general level adjustments. These values are independent of plants existing.
if(weedkiller_reagents[R.id])
weedlevel -= weedkiller_reagents[R.id] * reagent_total
if(pestkiller_reagents[R.id])
pestlevel += pestkiller_reagents[R.id] * reagent_total
// Handle nutrient refilling.
if(nutrient_reagents[R.id])
nutrilevel += nutrient_reagents[R.id] * reagent_total