diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 21ff80df749..1f28e089832 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -10,30 +10,55 @@ icon_state = "glowshroom" //replaced in New layer = 2.1 var/endurance = 30 - var/potency = 30 var/delay = 1200 var/floor = 0 - var/yield = 3 var/generation = 1 var/spreadIntoAdjacentChance = 60 - light_color = "#006622" + var/obj/item/seeds/myseed = /obj/item/seeds/glowshroom -obj/effect/glowshroom/glowcap +/obj/effect/glowshroom/glowcap name = "glowcap" + desc = "Mycena Ruthenia, a species of mushroom that, while it does glow in the dark, is not actually bioluminescent." icon_state = "glowcap" - light_color = "#8E0300" + myseed = /obj/item/seeds/glowshroom/glowcap -/obj/effect/glowshroom/single - yield = 0 +/obj/effect/glowshroom/shadowshroom + name = "shadowshroom" + desc = "Mycena Umbra, a species of mushroom that emits shadow instead of light." + icon_state = "shadowshroom" + myseed = /obj/item/seeds/glowshroom/shadowshroom + +/obj/effect/glowshroom/single/Spread() + return /obj/effect/glowshroom/examine(mob/user) . = ..() to_chat(user, "This is a [generation]\th generation [name]!") -/obj/effect/glowshroom/New() +/obj/effect/glowshroom/Destroy() + if(myseed) + qdel(myseed) + myseed = null + return ..() + +/obj/effect/glowshroom/New(loc, obj/item/seeds/newseed, mutate_stats) ..() - set_light(round(potency/10)) - dir = CalcDir() + if(newseed) + myseed = newseed.Copy() + myseed.forceMove(src) + else + myseed = new myseed(src) + if(mutate_stats) //baby mushrooms have different stats :3 + myseed.adjust_potency(rand(-3,6)) + myseed.adjust_yield(rand(-1,2)) + myseed.adjust_production(rand(-3,6)) + myseed.adjust_endurance(rand(-3,6)) + delay = delay - myseed.production * 100 //So the delay goes DOWN with better stats instead of up. :I + endurance = myseed.endurance + if(myseed.get_gene(/datum/plant_gene/trait/glow)) + var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow) + set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) + setDir(CalcDir()) var/base_icon_state = initial(icon_state) if(!floor) switch(dir) //offset to make it be on the wall rather than on the floor @@ -49,10 +74,12 @@ obj/effect/glowshroom/glowcap else //if on the floor, glowshroom on-floor sprite icon_state = "[base_icon_state]f" - addtimer(src, "Spread", delay) + addtimer(src, "Spread", delay, FALSE) /obj/effect/glowshroom/proc/Spread() - for(var/i = 1 to yield) + var/turf/ownturf = get_turf(src) + var/shrooms_planted = 0 + for(var/i in 1 to myseed.yield) if(prob(1/(generation * generation) * 100))//This formula gives you diminishing returns based on generation. 100% with 1st gen, decreasing to 25%, 11%, 6, 4, 2... var/list/possibleLocs = list() var/spreadsIntoAdjacent = FALSE @@ -61,6 +88,8 @@ obj/effect/glowshroom/glowcap spreadsIntoAdjacent = TRUE for(var/turf/simulated/floor/earth in view(3,src)) + if(!ownturf.CanAtmosPass(earth)) + continue if(spreadsIntoAdjacent || !locate(/obj/effect/glowshroom) in view(1,earth)) possibleLocs += earth CHECK_TICK @@ -81,14 +110,16 @@ obj/effect/glowshroom/glowcap if(shroomCount >= placeCount) continue - var/obj/effect/glowshroom/child = new type(newLoc)//The baby mushrooms have different stats :3 - child.potency = max(potency + rand(-3,6), 0) - child.yield = max(yield + rand(-1,2), 0) - child.delay = max(delay + rand(-30,60), 0) - child.endurance = max(endurance + rand(-3,6), 1) + var/obj/effect/glowshroom/child = new type(newLoc, myseed, TRUE) child.generation = generation + 1 + shrooms_planted++ CHECK_TICK + else + shrooms_planted++ //if we failed due to generation, don't try to plant one later + if(shrooms_planted < myseed.yield) //if we didn't get all possible shrooms planted, try again later + myseed.yield -= shrooms_planted + addtimer(src, "Spread", delay, FALSE) /obj/effect/glowshroom/proc/CalcDir(turf/location = loc) var/direction = 16 @@ -146,4 +177,4 @@ obj/effect/glowshroom/glowcap /obj/effect/glowshroom/proc/CheckEndurance() if(endurance <= 0) - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/modules/hydroponics/grown/mushrooms.dm b/code/modules/hydroponics/grown/mushrooms.dm index 346e8344ca9..935730efd9b 100644 --- a/code/modules/hydroponics/grown/mushrooms.dm +++ b/code/modules/hydroponics/grown/mushrooms.dm @@ -220,7 +220,7 @@ rarity = 20 genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - mutatelist = list(/obj/item/seeds/glowshroom/glowcap) + mutatelist = list(/obj/item/seeds/glowshroom/glowcap, /obj/item/seeds/glowshroom/shadowshroom) reagents_add = list("radium" = 0.1, "phosphorus" = 0.1, "nutriment" = 0.04) /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom @@ -235,14 +235,25 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user) if(istype(user.loc, /turf/space)) - return - var/obj/effect/glowshroom/planted = new effect_path(user.loc) - planted.delay = planted.delay - seed.production * 100 //So the delay goes DOWN with better stats instead of up. :I - planted.endurance = seed.endurance - planted.yield = seed.yield - planted.potency = seed.potency + return FALSE + if(!isturf(user.loc)) + to_chat(user, "You need more space to plant [src].") + return FALSE + var/count = 0 + var/maxcount = 1 + for(var/tempdir in cardinal) + var/turf/simulated/wall = get_step(user.loc, tempdir) + if(istype(wall)) + maxcount++ + for(var/obj/effect/glowshroom/G in user.loc) + count++ + if(count >= maxcount) + to_chat(user, "There are too many shrooms here to plant [src].") + return FALSE + new effect_path(user.loc, seed) to_chat(user, "You plant [src].") qdel(src) + return TRUE // Glowcap @@ -255,7 +266,7 @@ icon_dead = "glowshroom-dead" plantname = "Glowcaps" product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap - genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/cell_charge, /datum/plant_gene/trait/plant_type/fungal_metabolism) + genes = list(/datum/plant_gene/trait/glow/red, /datum/plant_gene/trait/cell_charge, /datum/plant_gene/trait/plant_type/fungal_metabolism) mutatelist = list() reagents_add = list("teslium" = 0.1, "nutriment" = 0.04) rarity = 30 @@ -263,7 +274,7 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap seed = /obj/item/seeds/glowshroom/glowcap name = "glowcap cluster" - desc = "Mycena Ruthenia: This species of mushroom glows in the dark, but aren't bioluminescent. They're warm to the touch..." + desc = "Mycena Ruthenia: This species of mushroom glows in the dark, but isn't actually bioluminescent. They're warm to the touch..." icon_state = "glowcap" filling_color = "#00FA9A" effect_path = /obj/effect/glowshroom/glowcap @@ -292,3 +303,26 @@ desc = "A fungus ideal for making antibacterials." icon_state = "angel" color = "#4f4331" + +//Shadowshroom +/obj/item/seeds/glowshroom/shadowshroom + name = "pack of shadowshroom mycelium" + desc = "This mycelium will grow into something shadowy." + icon_state = "mycelium-shadowshroom" + species = "shadowshroom" + icon_grow = "shadowshroom-grow" + icon_dead = "shadowshroom-dead" + plantname = "Shadowshrooms" + product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/shadowshroom + genes = list(/datum/plant_gene/trait/glow/shadow, /datum/plant_gene/trait/plant_type/fungal_metabolism) + mutatelist = list() + reagents_add = list("radium" = 0.2, "nutriment" = 0.04) + rarity = 30 + +/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/shadowshroom + seed = /obj/item/seeds/glowshroom/shadowshroom + name = "shadowshroom cluster" + desc = "Mycena Umbra: This species of mushroom emits shadow instead of light." + icon_state = "shadowshroom" + effect_path = /obj/effect/glowshroom/shadowshroom + origin_tech = "biotech=4;plasmatech=4;magnets=4" diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 5709e70e5e7..2adfb1f6226 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -300,7 +300,7 @@ if(!self_sustaining) if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow)) var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow) - set_light(G.get_lum(myseed)) + set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) else set_light(0) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index ecf38424764..cfda1499555 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -263,23 +263,40 @@ /datum/plant_gene/trait/glow // Makes plant glow. Makes plant in tray glow too. - // Adds potency*rate luminosity to products. + // Adds 1 + potency*rate light range and potency*(rate + 0.01) light_power to products. name = "Bioluminescence" - rate = 0.1 + rate = 0.03 examine_line = "It emits a soft glow." trait_id = "glow" + var/glow_color = "#AAD84B" -/datum/plant_gene/trait/glow/proc/get_lum(obj/item/seeds/S) - return round(S.potency*rate) +/datum/plant_gene/trait/glow/proc/glow_range(obj/item/seeds/S) + return 1.4 + S.potency*rate + +/datum/plant_gene/trait/glow/proc/glow_power(obj/item/seeds/S) + return max(S.potency*(rate + 0.01), 0.1) /datum/plant_gene/trait/glow/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc) ..() - G.set_light(get_lum(G.seed)) + G.set_light(glow_range(G.seed), glow_power(G.seed), glow_color) + +/datum/plant_gene/trait/glow/shadow + //makes plant emit slightly purple shadows + //adds -potency*(rate*0.05) light power to products + name = "Shadow Emission" + rate = 0.04 + +/datum/plant_gene/trait/glow/shadow/glow_power(obj/item/seeds/S) + return -max(S.potency*(rate*0.05), 0.075) + +/datum/plant_gene/trait/glow/red + name = "Red Electrical Glow" + glow_color = LIGHT_COLOR_RED /datum/plant_gene/trait/glow/berry name = "Strong Bioluminescence" - rate = 0.2 - + rate = 0.05 + glow_color = null /datum/plant_gene/trait/teleport // Makes plant teleport people when squashed or slipped on. diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index b08f66a5119..b8d6d214464 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -139,7 +139,7 @@ var/on_gs = 0 var/static_power_used = 0 var/brightness_range = 8 // luminosity when on, also used in power calculation - var/brightness_power = 3 + var/brightness_power = 1 var/brightness_color = null var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN var/flickering = 0 @@ -157,7 +157,6 @@ base_state = "bulb" fitting = "bulb" brightness_range = 4 - brightness_power = 2 brightness_color = "#a0a080" desc = "A small lighting fixture." light_type = /obj/item/weapon/light/bulb @@ -190,12 +189,10 @@ switch(fitting) if("tube") brightness_range = 8 - brightness_power = 3 if(prob(2)) broken(1) if("bulb") brightness_range = 4 - brightness_power = 2 brightness_color = "#a0a080" if(prob(5)) broken(1) @@ -608,13 +605,12 @@ item_state = "c_tube" materials = list(MAT_GLASS=100) brightness_range = 8 - brightness_power = 3 /obj/item/weapon/light/tube/large w_class = 2 name = "large light tube" brightness_range = 15 - brightness_power = 4 + brightness_power = 2 /obj/item/weapon/light/bulb name = "light bulb" @@ -624,7 +620,6 @@ item_state = "contvapour" materials = list(MAT_GLASS=100) brightness_range = 5 - brightness_power = 2 brightness_color = "#a0a080" /obj/item/weapon/light/throw_impact(atom/hit_atom) @@ -639,7 +634,6 @@ item_state = "egg4" materials = list(MAT_GLASS=100) brightness_range = 5 - brightness_power = 2 // update the icon state and description of the light diff --git a/icons/obj/hydroponics/growing_mushrooms.dmi b/icons/obj/hydroponics/growing_mushrooms.dmi index eb4405bf8bf..7a0eedbdae7 100644 Binary files a/icons/obj/hydroponics/growing_mushrooms.dmi and b/icons/obj/hydroponics/growing_mushrooms.dmi differ diff --git a/icons/obj/hydroponics/harvest.dmi b/icons/obj/hydroponics/harvest.dmi index cfd8fbacf99..d5bb7d48acb 100644 Binary files a/icons/obj/hydroponics/harvest.dmi and b/icons/obj/hydroponics/harvest.dmi differ diff --git a/icons/obj/hydroponics/seeds.dmi b/icons/obj/hydroponics/seeds.dmi index 5e28a475cf3..edc0ee4894f 100644 Binary files a/icons/obj/hydroponics/seeds.dmi and b/icons/obj/hydroponics/seeds.dmi differ diff --git a/icons/obj/lighting.dmi b/icons/obj/lighting.dmi index 06afc67979c..484417b9e83 100644 Binary files a/icons/obj/lighting.dmi and b/icons/obj/lighting.dmi differ