adds shadowshrooms from tgstation, nerf glowshroom glow a bit and add new vars for glow, add new shadow and red light genes

This commit is contained in:
uraniummeltdown
2017-03-11 13:36:04 +04:00
parent 98526aa020
commit 658e0f6a82
8 changed files with 112 additions and 34 deletions
+46 -18
View File
@@ -10,30 +10,54 @@
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
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 +73,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 +87,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 +109,14 @@ 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
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 +174,4 @@ obj/effect/glowshroom/glowcap
/obj/effect/glowshroom/proc/CheckEndurance()
if(endurance <= 0)
qdel(src)
qdel(src)
+41 -8
View File
@@ -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
@@ -236,11 +236,21 @@
/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
if(!isturf(user.loc))
to_chat(user, "<span class='warning'>You need more space to plant [src].</span>")
return
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, "<span class='warning'>There are too many shrooms here to plant [src].</span>")
return
new effect_path(user.loc, seed)
to_chat(user, "<span class='notice'>You plant [src].</span>")
qdel(src)
@@ -255,7 +265,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 +273,7 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap
seed = /obj/item/seeds/glowshroom/glowcap
name = "glowcap cluster"
desc = "<I>Mycena Ruthenia</I>: This species of mushroom glows in the dark, but aren't bioluminescent. They're warm to the touch..."
desc = "<I>Mycena Ruthenia</I>: 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 +302,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 = "<I>Mycena Umbra</I>: 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"
+1 -1
View File
@@ -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)
+24 -7
View File
@@ -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 = "<span class='info'>It emits a soft glow.</span>"
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.2) 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.2), 0.2)
/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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 72 KiB