Hydroponics

Fixed bug with mutated plants not being harvestable.
Added glowshrooms. They (maybe) glown in the dark. To get their seeds, you need to hack the seed machine. They're pretty straightforward. To plant a glowshroom on the floor, you need to click it while it's in your hand.
 Badmin
Added a "Honk" button.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1515 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-05-01 20:19:18 +00:00
parent 42a7c44325
commit f05a9843af
12 changed files with 238 additions and 3 deletions

View File

@@ -336,6 +336,23 @@
growthstages = 3
plant_type = 2
/obj/item/seeds/glowshroom
name = "Glowshroom mycelium"
icon_state = "mycelium-glowshroom"
mypath = "/obj/item/seeds/glowshroom"
species = "glowshroom"
plantname = "Glowshroom"
productname = "/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom"
lifespan = 30 //ten times that is the delay
endurance = 30
maturation = 15
production = 1
yield = 3 //-> spread
potency = 30 //-> brightness
oneharvest = 1
growthstages = 4
plant_type = 2
/obj/item/seeds/plumpmycelium
name = "Plump Helmet mycelium"
icon_state = "mycelium-plump"
@@ -733,10 +750,47 @@
..()
reagents.add_reagent("nutriment", 2)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
seed = "/obj/item/seeds/glowshroom"
name = "Glowshroom"
desc = "<i>Glowshroom</i>: These species of mushrooms glown in the dark. OR DO THEY?"
icon_state = "glowshroom"
New()
..()
reagents.add_reagent("radium",1)
if(istype(src.loc,/mob))
pickup(src.loc)
else
src.sd_SetLuminosity(potency/10)
lifespan = 30 //ten times that is the delay
endurance = 30
maturation = 15
production = 1
yield = 3
potency = 30
plant_type = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/obj/glowshroom/planted = new /obj/glowshroom(user.loc)
planted.delay = lifespan * 10
planted.endurance = endurance
planted.yield = yield
planted.potency = potency
del(src)
user << "You plant the glowshroom."
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
src.sd_SetLuminosity(0)
user.sd_SetLuminosity(user.luminosity + potency/10)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.sd_SetLuminosity(user.luminosity - potency/10)
src.sd_SetLuminosity(potency/10)
// *************************************

View File

@@ -131,8 +131,8 @@
product_paths = "/obj/item/seeds/cornseed;/obj/item/seeds/chiliseed;/obj/item/seeds/berryseed;/obj/item/seeds/eggplantseed;/obj/item/seeds/tomatoseed;/obj/item/seeds/wheatseed;/obj/item/seeds/soyaseed;/obj/item/seeds/carrotseed;/obj/item/seeds/potatoseed;/obj/item/seeds/chantermycelium;/obj/item/seeds/towermycelium;/obj/item/seeds/replicapod"
product_amounts = "2;2;2;2;2;2;2;2;2;2;2;3"
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium"
product_hideamt = "2;2;2;2"
product_hidden = "/obj/item/seeds/glowshroom;/obj/item/seeds/amanitamycelium;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium"
product_hideamt = "2;2;2;2;2"
/obj/machinery/vending/magivend
name = "MagiVend"

View File

@@ -133,7 +133,7 @@ obj/machinery/hydroponics/process()
obj/machinery/hydroponics/proc/updateicon()
//Refreshes the icon
//Refreshes the icon and sets the luminosity
overlays = null
if(src.planted)
if(dead)
@@ -164,6 +164,15 @@ obj/machinery/hydroponics/proc/updateicon()
overlays += image('hydroponics.dmi', icon_state="over_alert")
if(src.harvest)
overlays += image('hydroponics.dmi', icon_state="over_harvest")
if(myseed)
if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) //revert luminosity to 0
sd_SetLuminosity(0)
else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) //update luminosity
sd_SetLuminosity(myseed.potency/10)
else
if(luminosity)
sd_SetLuminosity(0)
return
@@ -300,6 +309,8 @@ obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant!
else
return
contents += myseed
src.dead = 0
src.hardmutate()
src.planted = 1
@@ -873,6 +884,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
else
user << text("You harvest from the [src.myseed.plantname]")
if(myseed.oneharvest)
del(myseed)
planted = 0
dead = 0
updateicon()

View File

@@ -0,0 +1,154 @@
//separate dm since hydro is getting bloated already
/obj/glowshroom
opacity = 0
density = 0
icon = 'lighting.dmi'
icon_state = "glowshroomf"
layer = 2.1
var/endurance = 30
var/potency = 30
var/delay = 300
var/floor = 0
var/yield = 3
var/spreadChance = 80
var/spreadIntoAdjacentChance = 10
var/evolveChance = 2
/obj/glowshroom/New()
..()
dir = CalcDir()
if(!floor)
switch(dir) //offset to make it be on the wall rather than on the floor
if(NORTH)
pixel_y = 32
if(SOUTH)
pixel_y = -32
if(EAST)
pixel_x = 32
if(WEST)
pixel_x = -32
icon_state = "glowshroom[rand(1,3)]"
else //if on the floor, glowshroom on-floor sprite
icon_state = "glowshroomf"
spawn(2) //allows the luminosity and spread rate to be affected by potency at the moment of creation
sd_SetLuminosity(potency/10)
spawn(delay)
if(src)
Spread()
/obj/glowshroom/proc/Spread()
set background = 1
for(var/i=1,i<=yield,i++)
if(prob(spreadChance))
var/list/possibleLocs = list()
for(var/turf/turf in view(3,src))
if(!turf.density)
possibleLocs += turf
var/turf/newLoc = pick(possibleLocs)
if(istype(newLoc,/turf/space))
continue
var/ifContinue = 0 //hacky
if(!prob(spreadIntoAdjacentChance))
for(var/obj/glowshroom in view(1,newLoc))
ifContinue = 1
break
if(ifContinue)
continue
var/shroomCount = 0 //hacky
var/placeCount = 1
for(var/obj/glowshroom/shroom in newLoc)
shroomCount++
for(var/wallDir in cardinal)
var/turf/isWall = get_step(newLoc,wallDir)
if(isWall.density)
placeCount++
if(shroomCount >= placeCount)
continue
var/obj/glowshroom/child = new /obj/glowshroom(newLoc)
child.potency = potency
child.yield = yield
child.delay = delay
child.endurance = endurance
if(prob(evolveChance)) //very low chance to evolve on its own
potency += rand(4,6)
sleep(delay)
if(src)
.()
/obj/glowshroom/proc/CalcDir(turf/location = loc)
var/direction = 16
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
direction |= wallDir
for(var/obj/glowshroom/shroom in location)
if(shroom == src)
continue
if(shroom.floor) //special
direction &= ~16
else
direction &= ~shroom.dir
var/list/dirList = list()
for(var/i=0,i<=4,i++)
if(direction & 2 ** i)
dirList += 2 ** i
if(dirList.len)
var/newDir = pick(dirList)
if(newDir == 16)
floor = 1
newDir = 1
return newDir
floor = 1
return 1
/obj/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
endurance -= W.force
CheckEndurance()
/obj/glowshroom/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
del(src)
return
if(3.0)
if (prob(5))
del(src)
return
else
return
/obj/glowshroom/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
endurance -= 5
CheckEndurance()
/obj/glowshroom/proc/CheckEndurance()
if(endurance <= 0)
del(src)

View File

@@ -153,6 +153,7 @@
src.verbs += /client/proc/play_sound
src.verbs += /client/proc/cuban_pete // -- Urist
src.verbs += /client/proc/bananaphone // -- Darem
src.verbs += /client/proc/honk_theme // -- Urist the Honky
src.verbs += /client/proc/only_one // muskets
src.verbs += /client/proc/space_asshole // --Agouri :3
src.verbs += /client/proc/strike_team //N
@@ -284,6 +285,7 @@
//src.verbs += /client/proc/object_talk // -- TLE
src.verbs += /client/proc/play_sound
src.verbs += /client/proc/cuban_pete // -- Urist
src.verbs += /client/proc/honk_theme // -- Urist the Honky
src.verbs += /client/proc/bananaphone
src.verbs += /client/proc/only_one // muskets
src.verbs += /client/proc/space_asshole // --Agouri :3
@@ -1154,6 +1156,7 @@
src.verbs -= /client/proc/object_talk // -- TLE
src.verbs -= /client/proc/play_sound
src.verbs -= /client/proc/cuban_pete // -- Urist
src.verbs -= /client/proc/honk_theme // -- Urist the Honky
src.verbs -= /client/proc/bananaphone // -- Darem
src.verbs -= /client/proc/space_asshole // --Agouri :3
src.verbs -= /client/proc/strike_team //N

View File

@@ -81,6 +81,17 @@ client/proc/space_asshole()
M << 'space_asshole.ogg'
client/proc/honk_theme()
set category = "Fun"
set name = "Honk"
message_admins("[key_name_admin(usr)] has creeped everyone out with Blackest Honks.", 1)
for(var/mob/M in world)
if(M.client)
if(M.client.midis)
M << 'honk_theme.ogg'
/*if(Debug2)
if(!src.authenticated || !src.holder)