Updates Hydroponics, Nerfs it, Adds Onions

This commit is contained in:
Fox-McCloud
2017-08-01 17:58:23 -04:00
parent 3ef33173fe
commit ca49a28f02
20 changed files with 235 additions and 62 deletions
@@ -2490,3 +2490,11 @@
icon_state = "tatortot"
list_reagents = list("nutriment" = 4)
filling_color = "FFD700"
/obj/item/weapon/reagent_containers/food/snacks/onionrings
name = "onion rings"
desc = "Onion slices coated in batter."
icon_state = "onionrings"
list_reagents = list("nutriment" = 3)
filling_color = "#C0C9A0"
gender = PLURAL
@@ -541,6 +541,10 @@ datum/recipe/microwave/slimesandwich
being_cooked.reagents.del_reagent("toxin")
return being_cooked
/datum/recipe/microwave/onionrings
items = list(/obj/item/weapon/reagent_containers/food/snacks/onion_slice)
result = /obj/item/weapon/reagent_containers/food/snacks/onionrings
////////////////////////////FOOD ADDITTIONS///////////////////////////////
/datum/recipe/microwave/wrap
+72 -19
View File
@@ -15,11 +15,12 @@
var/datum/plant_gene/target
var/operation = ""
var/rating = 0
var/max_extract_pot = 50
// The cap on potency gene extraction.
// This number is for T1, each upgraded part adds 5% for a tech level above T1.
// At T4, it reaches 95%.
var/max_potency = 50 // See RefreshParts() for how these work
var/max_yield = 2
var/min_production = 12
var/max_endurance = 10 // IMPT: ALSO AFFECTS LIFESPAN
var/min_wchance = 67
var/min_wrate = 10
/obj/machinery/plantgenes/New()
..()
@@ -40,13 +41,27 @@
QDEL_NULL(disk)
return ..()
/obj/machinery/plantgenes/RefreshParts()
rating = 0
for(var/I in component_parts)
if(istype(I, /obj/item/weapon/stock_parts))
var/obj/item/weapon/stock_parts/S = I
rating += S.rating-1
max_extract_pot = initial(max_extract_pot) + rating*5
/obj/machinery/plantgenes/RefreshParts() // Comments represent the max you can set per tier, respectively. seeds.dm [219] clamps these for us but we don't want to mislead the viewer.
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
if(M.rating > 3)
max_potency = 95
else
max_potency = initial(max_potency) + (M.rating**3) // 53,59,77,95 Clamps at 100
max_yield = initial(max_yield) + (M.rating*2) // 4,6,8,10 Clamps at 10
for(var/obj/item/weapon/stock_parts/scanning_module/SM in component_parts)
if(SM.rating > 3) //If you create t5 parts I'm a step ahead mwahahaha!
min_production = 1
else
min_production = 12 - (SM.rating * 3) //9,6,3,1. Requires if to avoid going below clamp [1]
max_endurance = initial(max_endurance) + (SM.rating * 25) // 35,60,85,100 Clamps at 10min 100max
for(var/obj/item/weapon/stock_parts/micro_laser/ML in component_parts)
var/wratemod = ML.rating * 2.5
min_wrate = Floor(10-wratemod) // 7,5,2,0 Clamps at 0 and 10 You want this low
min_wchance = 67-(ML.rating*16) // 48,35,19,3 Clamps at 0 and 67 You want this low
/obj/machinery/plantgenes/update_icon()
..()
@@ -133,11 +148,36 @@
if("extract")
dat += "<span class='highlight'>[target.get_name()]</span> gene from \the <span class='highlight'>[seed]</span>?<br>"
dat += "<span class='bad'>The sample will be destroyed in process!</span>"
if(istype(target, /datum/plant_gene/core/potency))
if(istype(target, /datum/plant_gene/core))
var/datum/plant_gene/core/gene = target
if(gene.value > max_extract_pot)
dat += "<br><br>This device's extraction capabilities are currently limited to [max_extract_pot] potency. "
dat += "Target gene will be degraded to [max_extract_pot] potency on extraction."
if(istype(target, /datum/plant_gene/core/potency))
if(gene.value > max_potency)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[max_potency]</span> potency. "
dat += "Target gene will be degraded to <span class='highlight'>[max_potency]</span> potency on extraction."
else if(istype(target, /datum/plant_gene/core/lifespan))
if(gene.value > max_endurance)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[max_endurance]</span> lifespan. "
dat += "Target gene will be degraded to <span class='highlight'>[max_endurance]</span> Lifespan on extraction."
else if(istype(target, /datum/plant_gene/core/endurance))
if(gene.value > max_endurance)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[max_endurance]</span> endurance. "
dat += "Target gene will be degraded to <span class='highlight'>[max_endurance]</span> endurance on extraction."
else if(istype(target, /datum/plant_gene/core/yield))
if(gene.value > max_yield)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[max_yield]</span> yield. "
dat += "Target gene will be degraded to <span class='highlight'>[max_yield]</span> yield on extraction."
else if(istype(target, /datum/plant_gene/core/production))
if(gene.value < min_production)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[min_production]</span> production. "
dat += "Target gene will be degraded to <span class='highlight'>[min_production]</span> production on extraction."
else if(istype(target, /datum/plant_gene/core/weed_rate))
if(gene.value < min_wrate)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[min_wrate]</span> weed rate. "
dat += "Target gene will be degraded to <span class='highlight'>[min_wrate]</span> weed rate on extraction."
else if(istype(target, /datum/plant_gene/core/weed_chance))
if(gene.value < min_wchance)
dat += "<br><br>This device's extraction capabilities are currently limited to <span class='highlight'>[min_wchance]</span> weed chance. "
dat += "Target gene will be degraded to <span class='highlight'>[min_wchance]</span> weed chance on extraction."
if("replace")
dat += "<span class='highlight'>[target.get_name()]</span> gene with <span class='highlight'>[disk.gene.get_name()]</span>?<br>"
if("insert")
@@ -292,9 +332,22 @@
if("extract")
if(disk && !disk.read_only)
disk.gene = G.Copy()
if(istype(disk.gene, /datum/plant_gene/core/potency))
if(istype(disk.gene, /datum/plant_gene/core))
var/datum/plant_gene/core/gene = disk.gene
gene.value = min(gene.value, max_extract_pot)
if(istype(disk.gene, /datum/plant_gene/core/potency))
gene.value = min(gene.value, max_potency)
else if(istype(disk.gene, /datum/plant_gene/core/lifespan))
gene.value = min(gene.value, max_endurance) //INTENDED
else if(istype(disk.gene, /datum/plant_gene/core/endurance))
gene.value = min(gene.value, max_endurance)
else if(istype(disk.gene, /datum/plant_gene/core/production))
gene.value = max(gene.value, min_production)
else if(istype(disk.gene, /datum/plant_gene/core/yield))
gene.value = min(gene.value, max_yield)
else if(istype(disk.gene, /datum/plant_gene/core/weed_rate))
gene.value = max(gene.value, min_wrate)
else if(istype(disk.gene, /datum/plant_gene/core/weed_chance))
gene.value = max(gene.value, min_wchance)
disk.update_name()
QDEL_NULL(seed)
update_icon()
@@ -397,7 +450,7 @@
/obj/item/weapon/disk/plantgene/proc/update_name()
if(gene)
name = "plant data disk - '[gene.get_name()]'"
name = "[gene.get_name()] (Plant Data Disk)"
else
name = "plant data disk"
+1
View File
@@ -112,6 +112,7 @@
for(var/datum/plant_gene/trait/trait in seed.genes)
trait.on_squash(src, target)
reagents.reaction(T)
for(var/A in T)
if(reagents)
reagents.reaction(A)
+24 -10
View File
@@ -1,18 +1,32 @@
// Weeds
/obj/item/seeds/weeds
name = "pack of weed seeds"
desc = "Yo mang, want some weeds?"
icon_state = "seed"
species = "weeds"
// Starthistle
/obj/item/seeds/starthistle
name = "pack of starthistle seeds"
desc = "A robust species of weed that often springs up in-between the cracks of spaceship parking lots"
icon_state = "seed-starthistle"
species = "starthistle"
plantname = "Starthistle"
lifespan = 100
lifespan = 70
endurance = 50 // damm pesky weeds
maturation = 5
production = 1
yield = -1
potency = -1
growthstages = 4
yield = 2
potency = 10
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
genes = list(/datum/plant_gene/trait/plant_type/weed_hardy)
mutatelist = list(/obj/item/seeds/harebell)
/obj/item/seeds/starthistle/harvest(mob/user)
var/obj/machinery/hydroponics/parent = loc
var/seed_count = yield
if(prob(getYield() * 20))
seed_count++
var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc
for(var/i in 1 to seed_count)
var/obj/item/seeds/starthistle/harvestseeds = Copy()
harvestseeds.forceMove(output_loc)
parent.update_tray()
// Cabbage
+61
View File
@@ -0,0 +1,61 @@
/obj/item/seeds/onion
name = "pack of onion seeds"
desc = "These seeds grow into onions."
icon_state = "seed-onion"
species = "onion"
plantname = "Onion Sprouts"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/onion
lifespan = 20
maturation = 3
production = 4
yield = 6
endurance = 25
growthstages = 3
weed_chance = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
reagents_add = list("vitamin" = 0.04, "plantmatter" = 0.1)
mutatelist = list(/obj/item/seeds/onion/red)
/obj/item/weapon/reagent_containers/food/snacks/grown/onion
seed = /obj/item/seeds/onion
name = "onion"
desc = "Nothing to cry over."
icon_state = "onion"
filling_color = "#C0C9A0"
bitesize_mod = 2
slice_path = /obj/item/weapon/reagent_containers/food/snacks/onion_slice
slices_num = 2
/obj/item/seeds/onion/red
name = "pack of red onion seeds"
desc = "For growing exceptionally potent onions."
icon_state = "seed-onionred"
species = "onion_red"
plantname = "Red Onion Sprouts"
weed_chance = 1
product = /obj/item/weapon/reagent_containers/food/snacks/grown/onion/red
reagents_add = list("vitamin" = 0.04, "plantmatter" = 0.1, "onionjuice" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/onion/red
seed = /obj/item/seeds/onion/red
name = "red onion"
desc = "Purple despite the name."
icon_state = "onion_red"
filling_color = "#C29ACF"
slice_path = /obj/item/weapon/reagent_containers/food/snacks/onion_slice/red
/obj/item/weapon/reagent_containers/food/snacks/onion_slice
name = "onion slices"
desc = "Rings, not for wearing."
icon_state = "onionslice"
list_reagents = list("plantmatter" = 5, "vitamin" = 2)
filling_color = "#C0C9A0"
gender = PLURAL
cooked_type = /obj/item/weapon/reagent_containers/food/snacks/onionrings
/obj/item/weapon/reagent_containers/food/snacks/onion_slice/red
name = "red onion slices"
desc = "They shine like exceptionally low quality amethyst."
icon_state = "onionslice_red"
filling_color = "#C29ACF"
list_reagents = list("plantmatter" = 5, "vitamin" = 2, "onionjuice" = 2.5)
+5 -2
View File
@@ -50,6 +50,9 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus,
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat)
/obj/item/weapon/grown/log/New()
..()
accepted = typecacheof(accepted)
/obj/item/weapon/grown/log/attackby(obj/item/weapon/W, mob/user, params)
if(is_sharp(W))
@@ -66,7 +69,7 @@
to_chat(user, "<span class='notice'>You add the newly-formed [plank_name] to the stack. It now contains [plank.amount] [plank_name].</span>")
qdel(src)
if(is_type_in_list(W,accepted))
if(is_type_in_typecache(W, accepted))
var/obj/item/weapon/reagent_containers/food/snacks/grown/leaf = W
if(leaf.dry)
user.show_message("<span class='notice'>You wrap \the [W] around the log, turning it into a torch!</span>")
@@ -138,7 +141,7 @@
/obj/structure/bonfire/proc/CheckOxygen()
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G.oxygen > 16)
if(G.oxygen > 13)
return 1
return 0
+20 -28
View File
@@ -30,6 +30,8 @@
var/lid_state = 0
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses
var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood.
var/self_sufficiency_progress = 0
var/self_sustaining = FALSE //If the tray generates nutrients and water on its own
hud_possible = list (PLANT_NUTRIENT_HUD, PLANT_WATER_HUD, PLANT_STATUS_HUD, PLANT_HEALTH_HUD, PLANT_TOXIN_HUD, PLANT_PEST_HUD, PLANT_WEED_HUD)
@@ -358,6 +360,9 @@
if(!self_sustaining)
to_chat(user, "<span class='info'>Water: [waterlevel]/[maxwater]</span>")
to_chat(user, "<span class='info'>Nutrient: [nutrilevel]/[maxnutri]</span>")
if(self_sufficiency_progress > 0)
var/percent_progress = round(self_sufficiency_progress * 100 / self_sufficiency_req)
to_chat(user, "<span class='info'>Treatment for self-sustenance are [percent_progress]% complete.</span>")
else
to_chat(user, "<span class='info'>It doesn't require any water or nutrients.</span>")
@@ -392,7 +397,7 @@
if(4 to 5)
myseed = new /obj/item/seeds/plump(src)
else
myseed = new /obj/item/seeds/weeds(src)
myseed = new /obj/item/seeds/starthistle(src)
age = 0
plant_health = myseed.endurance
lastcycle = world.time
@@ -546,6 +551,14 @@
adjustNutri(round(S.get_reagent_amount("fishwater") * 0.75))
adjustWater(round(S.get_reagent_amount("fishwater") * 1))
// Ambrosia Gaia produces earthsblood.
if(S.has_reagent("earthsblood"))
self_sufficiency_progress += S.get_reagent_amount("earthsblood")
if(self_sufficiency_progress >= self_sufficiency_req)
become_self_sufficient()
else if(!self_sustaining)
to_chat(user, "<span class='notice'>[src] warms as it might on a spring day under a genuine Sun.</span>")
// Antitoxin binds shit pretty well. So the tox goes significantly down
if(S.has_reagent("charcoal", 1))
adjustToxic(-round(S.get_reagent_amount("charcoal") * 2))
@@ -720,33 +733,7 @@
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params)
//Called when mob user "attacks" it with object O
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/gaia)) //Checked early on so it doesn't have to deal with composting checks
if(self_sustaining)
to_chat(user, "<span class='warning'>This [name] is already self-sustaining!</span>")
return
if(myseed || weedlevel)
to_chat(user, "<span class='warning'>[src] needs to be clear of plants and weeds!</span>")
return
if(alert(user, "This will make [src] self-sustaining but consume [O] forever. Are you sure?", "[name]", "I'm Sure", "Abort") == "Abort" || !user)
return
if(!O || qdeleted(O))
return
if(!Adjacent(user))
return
if(self_sustaining)
to_chat(user, "<span class='warning'>This [name] is already self-sustaining!</span>")
return
if(myseed || weedlevel)
to_chat(user, "<span class='warning'>[src] needs to be clear of plants and weeds!</span>")
return
user.visible_message("<span class='notice'>[user] gently pulls open the soil for [O] and places it inside.</span>", "<span class='notice'>You tenderly root [O] into [src].</span>")
user.drop_item()
qdel(O)
visible_message("<span class='boldnotice'>[src] begins to glow with a beautiful light!</span>")
self_sustaining = TRUE
update_icon()
else if(istype(O, /obj/item/weapon/reagent_containers) ) // Syringe stuff (and other reagent containers now too)
if(istype(O, /obj/item/weapon/reagent_containers) ) // Syringe stuff (and other reagent containers now too)
var/obj/item/weapon/reagent_containers/reagent_source = O
if(istype(reagent_source, /obj/item/weapon/reagent_containers/syringe))
@@ -988,6 +975,11 @@
var/mob/living/simple_animal/hostile/C = new chosen
C.faction = list("plants")
/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect
visible_message("<span class='boldnotice'>[src] begins to glow with a beautiful light!</span>")
self_sustaining = TRUE
update_icon()
///Diona Nymph Related Procs///
/obj/machinery/hydroponics/CanPass(atom/movable/mover, turf/target, height=0) //So nymphs can climb over top of trays.
if(height==0)
+2 -1
View File
@@ -267,7 +267,7 @@
rate = 0.03
examine_line = "<span class='info'>It emits a soft glow.</span>"
trait_id = "glow"
var/glow_color = "#AAD84B"
var/glow_color = "#C3E381"
/datum/plant_gene/trait/glow/proc/glow_range(obj/item/seeds/S)
return 1.4 + S.potency*rate
@@ -284,6 +284,7 @@
//adds -potency*(rate*0.05) light power to products
name = "Shadow Emission"
rate = 0.04
glow_color = "#AAD84B"
/datum/plant_gene/trait/glow/shadow/glow_power(obj/item/seeds/S)
return -max(S.potency*(rate*0.05), 0.075)
@@ -40,3 +40,7 @@
if(D.IsSpreadByTouch())
ContractDisease(D)
return 0
/mob/living/carbon/is_mouth_covered(head_only = FALSE, mask_only = FALSE)
if((!mask_only && head && (head.flags_cover & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)))
return TRUE
@@ -393,3 +393,10 @@ emp_act
..()
species.water_act(src,volume,temperature,source)
/mob/living/carbon/human/is_eyes_covered(check_glasses = TRUE, check_head = TRUE, check_mask = TRUE)
if(check_glasses && glasses && (glasses.flags_cover & GLASSESCOVERSEYES))
return TRUE
if(check_head && head && (head.flags_cover & HEADCOVERSEYES))
return TRUE
if(check_mask && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH))
return TRUE
@@ -37,6 +37,11 @@
/mob/living/proc/getarmor(var/def_zone, var/type)
return 0
/mob/living/proc/is_mouth_covered(head_only = FALSE, mask_only = FALSE)
return FALSE
/mob/living/proc/is_eyes_covered(check_glasses = TRUE, check_head = TRUE, check_mask = TRUE)
return FALSE
/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone)
//Armor
@@ -492,6 +492,25 @@
M.adjustFireLoss(-1)
..()
/datum/reagent/consumable/onion
name = "Concentrated Onion Juice"
id = "onionjuice"
description = "A strong tasting substance that can induce partial blindness."
color = "#c0c9a0"
taste_message = "bitterness"
/datum/reagent/consumable/onion/reaction_mob(mob/living/M, method = TOUCH, volume)
if(method == TOUCH)
if(!M.is_mouth_covered() && !M.is_eyes_covered())
if(!M.get_organ_slot("eyes")) //can't blind somebody with no eyes
to_chat(M, "<span class = 'notice'>Your eye sockets feel wet.</span>")
else
if(!M.eye_blurry)
to_chat(M, "<span class = 'warning'>Tears well up in your eyes!</span>")
M.EyeBlind(2)
M.EyeBlurry(5)
..()
/datum/reagent/consumable/chocolate
name = "Chocolate"
id = "chocolate"