From 43e06e4ebb718b44409930f862f73a4278bf2485 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Fri, 23 Nov 2012 23:01:04 +0000 Subject: [PATCH] AIs in intellicards will not be able to move their camera anymore. Limiting them to their own core vision. Committing Zelack's cleanup and fixes from here: http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=11056 Plantbags now correctly pick up plants from trays. Using a hoe or injecting reagents updates the tray icon. Plant Analysers now work on seed bags. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5173 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/hydro.dm | 10 + code/game/machinery/hydroponics.dm | 865 +++++++++--------- .../mob/living/silicon/ai/freelook/eye.dm | 10 +- html/changelog.html | 5 + 4 files changed, 454 insertions(+), 436 deletions(-) diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm index 4e38ed56e88..731a4b2c33f 100644 --- a/code/defines/obj/hydro.dm +++ b/code/defines/obj/hydro.dm @@ -33,6 +33,16 @@ var/growthstages = 0 var/plant_type = 0 // 0 = 'normal plant'; 1 = weed; 2 = shroom +/obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob) + if (istype(O, /obj/item/device/analyzer/plant_analyzer)) + user << "*** [plantname] ***" + user << "-Plant Endurance: \blue [endurance]" + user << "-Plant Lifespan: \blue [lifespan]" + if(yield != -1) + user << "-Plant Yield: \blue [yield]" + user << "-Plant Production: \blue [production]" + if(potency != -1) + user << "-Plant Potency: \blue [potency]" /obj/item/seeds/chiliseed name = "pack of chili seeds" diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index d289a0d3cab..d6fb4156016 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -23,140 +23,128 @@ /obj/machinery/hydroponics/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. if(istype(Proj ,/obj/item/projectile/energy/floramut)) - if(src.planted) - src.mutate() + if(planted) + mutate() else if(istype(Proj ,/obj/item/projectile/energy/florayield)) - if(src.planted && src.myseed.yield == 0)//Oh god don't divide by zero you'll doom us all. - src.myseed.yield += 1 - //world << "Yield increased by 1, from 0, to a total of [src.myseed.yield]" - else if (src.planted && (prob(1/(src.myseed.yield * src.myseed.yield) *100)))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2... - src.myseed.yield += 1 - //world << "Yield increased by 1, to a total of [src.myseed.yield]" + if(planted && myseed.yield == 0)//Oh god don't divide by zero you'll doom us all. + myseed.yield += 1 + //world << "Yield increased by 1, from 0, to a total of [myseed.yield]" + else if (planted && (prob(1/(myseed.yield * myseed.yield) *100)))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2... + myseed.yield += 1 + //world << "Yield increased by 1, to a total of [myseed.yield]" else ..() return -/obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) - ..() - if (istype(O, /obj/item/weapon/plantbag)) - src.attack_hand(user) - var/obj/item/weapon/plantbag/S = O - for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z)) - if (S.contents.len < S.capacity) - S.contents += G; - else - user << "\blue The plant bag is full." - return - obj/machinery/hydroponics/process() if(myseed && (myseed.loc != src)) myseed.loc = src - if(world.time > (src.lastcycle + src.cycledelay)) - src.lastcycle = world.time - if(src.planted && !src.dead) + if(world.time > (lastcycle + cycledelay)) + lastcycle = world.time + if(planted && !dead) // Advance age - src.age++ + age++ //Nutrients////////////////////////////////////////////////////////////// // Nutrients deplete slowly - if(src.nutrilevel > 0) + if(nutrilevel > 0) if(prob(50)) - src.nutrilevel -= 1 + nutrilevel -= 1 // Lack of nutrients hurts non-weeds - if(src.nutrilevel <= 0 && src.myseed.plant_type != 1) - src.health -= rand(1,3) + if(nutrilevel <= 0 && myseed.plant_type != 1) + health -= rand(1,3) //Water////////////////////////////////////////////////////////////////// // Drink random amount of water - src.waterlevel = max(src.waterlevel - rand(1,6), 0) + waterlevel = max(waterlevel - rand(1,6), 0) // If the plant is dry, it loses health pretty fast, unless mushroom - if(src.waterlevel <= 10 && src.myseed.plant_type != 2) - src.health -= rand(0,1) - if(src.waterlevel <= 0) - src.health -= rand(0,2) + if(waterlevel <= 10 && myseed.plant_type != 2) + health -= rand(0,1) + if(waterlevel <= 0) + health -= rand(0,2) // Sufficient water level and nutrient level = plant healthy - else if(src.waterlevel > 10 && src.nutrilevel > 0) - src.health += rand(1,2) + else if(waterlevel > 10 && nutrilevel > 0) + health += rand(1,2) if(prob(5)) //5 percent chance the weed population will increase - src.weedlevel += 1 + weedlevel += 1 //Toxins///////////////////////////////////////////////////////////////// // Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly - if(src.toxic >= 40 && src.toxic < 80) - src.health -= 1 - src.toxic -= rand(1,10) - else if(src.toxic >= 80) // I don't think it ever gets here tbh unless above is commented out - src.health -= 3 - src.toxic -= rand(1,10) - else if(src.toxic < 0) // Make sure it won't go overoboard - src.toxic = 0 + if(toxic >= 40 && toxic < 80) + health -= 1 + toxic -= rand(1,10) + else if(toxic >= 80) // I don't think it ever gets here tbh unless above is commented out + health -= 3 + toxic -= rand(1,10) + else if(toxic < 0) // Make sure it won't go overoboard + toxic = 0 //Pests & Weeds////////////////////////////////////////////////////////// // Too many pests cause the plant to be sick - if (src.pestlevel > 10 ) // Make sure it won't go overoboard - src.pestlevel = 10 + if (pestlevel > 10 ) // Make sure it won't go overoboard + pestlevel = 10 - else if(src.pestlevel >= 5) - src.health -= 1 + else if(pestlevel >= 5) + health -= 1 // If it's a weed, it doesn't stunt the growth - if(src.weedlevel >= 5 && src.myseed.plant_type != 1 ) - src.health -= 1 + if(weedlevel >= 5 && myseed.plant_type != 1 ) + health -= 1 //Health & Age/////////////////////////////////////////////////////////// // Don't go overboard with the health - if(src.health > src.myseed.endurance) - src.health = src.myseed.endurance + if(health > myseed.endurance) + health = myseed.endurance // Plant dies if health <= 0 - else if(src.health <= 0) - src.dead = 1 - src.harvest = 0 - src.weedlevel += 1 // Weeds flourish - src.pestlevel = 0 // Pests die + else if(health <= 0) + dead = 1 + harvest = 0 + weedlevel += 1 // Weeds flourish + pestlevel = 0 // Pests die // If the plant is too old, lose health fast - if(src.age > src.myseed.lifespan) - src.health -= rand(1,5) + if(age > myseed.lifespan) + health -= rand(1,5) // Harvest code - if(src.age > src.myseed.production && (src.age - src.lastproduce) > src.myseed.production && (!src.harvest && !src.dead)) + if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead)) for(var/i = 0; i < mutmod; i++) if(prob(85)) - src.mutate() + mutate() else if(prob(30)) - src.hardmutate() + hardmutate() else if(prob(5)) - src.mutatespecie() + mutatespecie() - if(src.yieldmod > 0 && src.myseed.yield != -1) // Unharvestable shouldn't be harvested - src.harvest = 1 + if(yieldmod > 0 && myseed.yield != -1) // Unharvestable shouldn't be harvested + harvest = 1 else - src.lastproduce = src.age + lastproduce = age if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase - src.pestlevel += 1 + pestlevel += 1 else - if(src.waterlevel > 10 && src.nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10% - src.weedlevel += 1 - if(src.weedlevel > 10) - src.weedlevel = 10 + if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10% + weedlevel += 1 + if(weedlevel > 10) + weedlevel = 10 // Weeeeeeeeeeeeeeedddssss - if (src.weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. - if(src.planted) - if(src.myseed.plant_type == 0) // If a normal plant - src.weedinvasion() + if (weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. + if(planted) + if(myseed.plant_type == 0) // If a normal plant + weedinvasion() else - src.weedinvasion() // Weed invasion into empty tray - src.updateicon() + weedinvasion() // Weed invasion into empty tray + updateicon() return @@ -164,34 +152,34 @@ obj/machinery/hydroponics/process() obj/machinery/hydroponics/proc/updateicon() //Refreshes the icon and sets the luminosity overlays = null - if(src.planted) + if(planted) if(dead) - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-dead") - else if(src.harvest) - if(src.myseed.plant_type == 2) // Shrooms don't have a -harvest graphic - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-dead") + else if(harvest) + if(myseed.plant_type == 2) // Shrooms don't have a -harvest graphic + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[myseed.growthstages]") else - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-harvest") - else if(src.age < src.myseed.maturation) - var/t_growthstate = ((src.age / src.myseed.maturation) * src.myseed.growthstages ) // Make sure it won't crap out due to HERPDERP 6 stages only - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") - src.lastproduce = src.age //Cheating by putting this here, it means that it isn't instantly ready to harvest + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-harvest") + else if(age < myseed.maturation) + var/t_growthstate = ((age / myseed.maturation) * myseed.growthstages ) // Make sure it won't crap out due to HERPDERP 6 stages only + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[round(t_growthstate)]") + lastproduce = age //Cheating by putting this here, it means that it isn't instantly ready to harvest else - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") // Same + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[myseed.growthstages]") // Same - if(src.waterlevel <= 10) + if(waterlevel <= 10) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lowwater3") - if(src.nutrilevel <= 2) + if(nutrilevel <= 2) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lownutri3") - if(src.health <= (src.myseed.endurance / 2)) + if(health <= (myseed.endurance / 2)) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lowhealth3") - if(src.weedlevel >= 5) + if(weedlevel >= 5) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") - if(src.pestlevel >= 5) + if(pestlevel >= 5) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") - if(src.toxic >= 40) + if(toxic >= 40) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") - if(src.harvest) + if(harvest) overlays += image('icons/obj/hydroponics.dmi', icon_state="over_harvest3") if(istype(myseed,/obj/item/seeds/glowshroom)) @@ -204,222 +192,222 @@ obj/machinery/hydroponics/proc/updateicon() obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens. - src.dead = 0 - if(src.myseed) // In case there's nothing in the tray beforehand - del(src.myseed) + dead = 0 + if(myseed) // In case there's nothing in the tray beforehand + del(myseed) switch(rand(1,18)) // randomly pick predominative weed if(16 to 18) - src.myseed = new /obj/item/seeds/reishimycelium + myseed = new /obj/item/seeds/reishimycelium if(14 to 15) - src.myseed = new /obj/item/seeds/nettleseed + myseed = new /obj/item/seeds/nettleseed if(12 to 13) - src.myseed = new /obj/item/seeds/harebell + myseed = new /obj/item/seeds/harebell if(10 to 11) - src.myseed = new /obj/item/seeds/amanitamycelium + myseed = new /obj/item/seeds/amanitamycelium if(8 to 9) - src.myseed = new /obj/item/seeds/chantermycelium + myseed = new /obj/item/seeds/chantermycelium if(6 to 7) // implementation for tower caps still kinda missing ~ Not Anymore! -Cheridan - src.myseed = new /obj/item/seeds/towermycelium + myseed = new /obj/item/seeds/towermycelium if(4 to 5) - src.myseed = new /obj/item/seeds/plumpmycelium + myseed = new /obj/item/seeds/plumpmycelium else - src.myseed = new /obj/item/seeds/weeds - src.planted = 1 - src.age = 0 - src.health = src.myseed.endurance - src.lastcycle = world.time - src.harvest = 0 - src.weedlevel = 0 // Reset - src.pestlevel = 0 // Reset - src.updateicon() - src.visible_message("\blue [src] has been overtaken by [src.myseed.plantname].") + myseed = new /obj/item/seeds/weeds + planted = 1 + age = 0 + health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset + pestlevel = 0 // Reset + updateicon() + visible_message("\blue [src] has been overtaken by [myseed.plantname].") return obj/machinery/hydroponics/proc/mutate() // Mutates the current seed - src.myseed.lifespan += rand(-2,2) - if(src.myseed.lifespan < 10) - src.myseed.lifespan = 10 - else if(src.myseed.lifespan > 30) - src.myseed.lifespan = 30 + myseed.lifespan += rand(-2,2) + if(myseed.lifespan < 10) + myseed.lifespan = 10 + else if(myseed.lifespan > 30) + myseed.lifespan = 30 - src.myseed.endurance += rand(-5,5) - if(src.myseed.endurance < 10) - src.myseed.endurance = 10 - else if(src.myseed.endurance > 100) - src.myseed.endurance = 100 + myseed.endurance += rand(-5,5) + if(myseed.endurance < 10) + myseed.endurance = 10 + else if(myseed.endurance > 100) + myseed.endurance = 100 - src.myseed.production += rand(-1,1) - if(src.myseed.production < 2) - src.myseed.production = 2 - else if(src.myseed.production > 10) - src.myseed.production = 10 + myseed.production += rand(-1,1) + if(myseed.production < 2) + myseed.production = 2 + else if(myseed.production > 10) + myseed.production = 10 - if(src.myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable - src.myseed.yield += rand(-2,2) - if(src.myseed.yield < 0) - src.myseed.yield = 0 - else if(src.myseed.yield > 10) - src.myseed.yield = 10 - if(src.myseed.yield == 0 && src.myseed.plant_type == 2) - src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1. + if(myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable + myseed.yield += rand(-2,2) + if(myseed.yield < 0) + myseed.yield = 0 + else if(myseed.yield > 10) + myseed.yield = 10 + if(myseed.yield == 0 && myseed.plant_type == 2) + myseed.yield = 1 // Mushrooms always have a minimum yield of 1. - if(src.myseed.potency != -1) //Not all plants have a potency - src.myseed.potency += rand(-25,25) - if(src.myseed.potency < 0) - src.myseed.potency = 0 - else if(src.myseed.potency > 100) - src.myseed.potency = 100 + if(myseed.potency != -1) //Not all plants have a potency + myseed.potency += rand(-25,25) + if(myseed.potency < 0) + myseed.potency = 0 + else if(myseed.potency > 100) + myseed.potency = 100 return obj/machinery/hydroponics/proc/hardmutate() // Strongly mutates the current seed. - src.myseed.lifespan += rand(-4,4) - if(src.myseed.lifespan < 10) - src.myseed.lifespan = 10 - else if(src.myseed.lifespan > 30 && !istype(myseed,/obj/item/seeds/glowshroom)) //hack to prevent glowshrooms from always resetting to 30 sec delay - src.myseed.lifespan = 30 + myseed.lifespan += rand(-4,4) + if(myseed.lifespan < 10) + myseed.lifespan = 10 + else if(myseed.lifespan > 30 && !istype(myseed,/obj/item/seeds/glowshroom)) //hack to prevent glowshrooms from always resetting to 30 sec delay + myseed.lifespan = 30 - src.myseed.endurance += rand(-10,10) - if(src.myseed.endurance < 10) - src.myseed.endurance = 10 - else if(src.myseed.endurance > 100) - src.myseed.endurance = 100 + myseed.endurance += rand(-10,10) + if(myseed.endurance < 10) + myseed.endurance = 10 + else if(myseed.endurance > 100) + myseed.endurance = 100 - src.myseed.production += rand(-2,2) - if(src.myseed.production < 2) - src.myseed.production = 2 - else if(src.myseed.production > 10) - src.myseed.production = 10 + myseed.production += rand(-2,2) + if(myseed.production < 2) + myseed.production = 2 + else if(myseed.production > 10) + myseed.production = 10 - if(src.myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable - src.myseed.yield += rand(-4,4) - if(src.myseed.yield < 0) - src.myseed.yield = 0 - else if(src.myseed.yield > 10) - src.myseed.yield = 10 - if(src.myseed.yield == 0 && src.myseed.plant_type == 2) - src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1. + if(myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable + myseed.yield += rand(-4,4) + if(myseed.yield < 0) + myseed.yield = 0 + else if(myseed.yield > 10) + myseed.yield = 10 + if(myseed.yield == 0 && myseed.plant_type == 2) + myseed.yield = 1 // Mushrooms always have a minimum yield of 1. - if(src.myseed.potency != -1) //Not all plants have a potency - src.myseed.potency += rand(-50,50) - if(src.myseed.potency < 0) - src.myseed.potency = 0 - else if(src.myseed.potency > 100) - src.myseed.potency = 100 + if(myseed.potency != -1) //Not all plants have a potency + myseed.potency += rand(-50,50) + if(myseed.potency < 0) + myseed.potency = 0 + else if(myseed.potency > 100) + myseed.potency = 100 return obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant! - if ( istype(src.myseed, /obj/item/seeds/nettleseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/deathnettleseed + if ( istype(myseed, /obj/item/seeds/nettleseed )) + del(myseed) + myseed = new /obj/item/seeds/deathnettleseed - else if ( istype(src.myseed, /obj/item/seeds/amanitamycelium )) - del(src.myseed) - src.myseed = new /obj/item/seeds/angelmycelium + else if ( istype(myseed, /obj/item/seeds/amanitamycelium )) + del(myseed) + myseed = new /obj/item/seeds/angelmycelium - else if ( istype(src.myseed, /obj/item/seeds/lemonseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/cashseed + else if ( istype(myseed, /obj/item/seeds/lemonseed )) + del(myseed) + myseed = new /obj/item/seeds/cashseed - else if ( istype(src.myseed, /obj/item/seeds/ambrosiavulgarisseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/ambrosiadeusseed + else if ( istype(myseed, /obj/item/seeds/ambrosiavulgarisseed )) + del(myseed) + myseed = new /obj/item/seeds/ambrosiadeusseed - else if ( istype(src.myseed, /obj/item/seeds/plumpmycelium )) - del(src.myseed) - src.myseed = new /obj/item/seeds/walkingmushroommycelium + else if ( istype(myseed, /obj/item/seeds/plumpmycelium )) + del(myseed) + myseed = new /obj/item/seeds/walkingmushroommycelium - else if ( istype(src.myseed, /obj/item/seeds/chiliseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/icepepperseed + else if ( istype(myseed, /obj/item/seeds/chiliseed )) + del(myseed) + myseed = new /obj/item/seeds/icepepperseed - else if ( istype(src.myseed, /obj/item/seeds/appleseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/goldappleseed + else if ( istype(myseed, /obj/item/seeds/appleseed )) + del(myseed) + myseed = new /obj/item/seeds/goldappleseed - else if ( istype(src.myseed, /obj/item/seeds/berryseed )) - del(src.myseed) + else if ( istype(myseed, /obj/item/seeds/berryseed )) + del(myseed) switch(rand(1,100)) if(1 to 50) - src.myseed = new /obj/item/seeds/poisonberryseed + myseed = new /obj/item/seeds/poisonberryseed if(51 to 100) - src.myseed = new /obj/item/seeds/glowberryseed + myseed = new /obj/item/seeds/glowberryseed - else if ( istype(src.myseed, /obj/item/seeds/poisonberryseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/deathberryseed + else if ( istype(myseed, /obj/item/seeds/poisonberryseed )) + del(myseed) + myseed = new /obj/item/seeds/deathberryseed - else if ( istype(src.myseed, /obj/item/seeds/tomatoseed )) - del(src.myseed) + else if ( istype(myseed, /obj/item/seeds/tomatoseed )) + del(myseed) switch(rand(1,100)) if(1 to 35) - src.myseed = new /obj/item/seeds/bluetomatoseed + myseed = new /obj/item/seeds/bluetomatoseed if(36 to 70) - src.myseed = new /obj/item/seeds/bloodtomatoseed + myseed = new /obj/item/seeds/bloodtomatoseed if(71 to 100) - src.myseed = new /obj/item/seeds/killertomatoseed + myseed = new /obj/item/seeds/killertomatoseed - else if ( istype(src.myseed, /obj/item/seeds/bluetomatoseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/bluespacetomatoseed + else if ( istype(myseed, /obj/item/seeds/bluetomatoseed )) + del(myseed) + myseed = new /obj/item/seeds/bluespacetomatoseed - else if ( istype(src.myseed, /obj/item/seeds/grapeseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/greengrapeseed + else if ( istype(myseed, /obj/item/seeds/grapeseed )) + del(myseed) + myseed = new /obj/item/seeds/greengrapeseed /* - else if ( istype(src.myseed, /obj/item/seeds/tomatoseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/gibtomatoseed + else if ( istype(myseed, /obj/item/seeds/tomatoseed )) + del(myseed) + myseed = new /obj/item/seeds/gibtomatoseed */ - else if ( istype(src.myseed, /obj/item/seeds/eggplantseed )) - del(src.myseed) - src.myseed = new /obj/item/seeds/eggyseed + else if ( istype(myseed, /obj/item/seeds/eggplantseed )) + del(myseed) + myseed = new /obj/item/seeds/eggyseed else return - src.dead = 0 - src.hardmutate() - src.planted = 1 - src.age = 0 - src.health = src.myseed.endurance - src.lastcycle = world.time - src.harvest = 0 - src.weedlevel = 0 // Reset + dead = 0 + hardmutate() + planted = 1 + age = 0 + health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset spawn(5) // Wait a while - src.updateicon() - src.visible_message("\red[src] has suddenly mutated into \blue [src.myseed.plantname]!") + updateicon() + visible_message("\red[src] has suddenly mutated into \blue [myseed.plantname]!") return obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant - if ( src.weedlevel > 5 ) - del(src.myseed) + if ( weedlevel > 5 ) + del(myseed) var/newWeed = pick(/obj/item/seeds/libertymycelium, /obj/item/seeds/angelmycelium, /obj/item/seeds/deathnettleseed, /obj/item/seeds/kudzuseed) - src.myseed = new newWeed - src.dead = 0 - src.hardmutate() - src.planted = 1 - src.age = 0 - src.health = src.myseed.endurance - src.lastcycle = world.time - src.harvest = 0 - src.weedlevel = 0 // Reset + myseed = new newWeed + dead = 0 + hardmutate() + planted = 1 + age = 0 + health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset spawn(5) // Wait a while - src.updateicon() - src.visible_message("\red The mutated weeds in [src] spawned a \blue [src.myseed.plantname]!") + updateicon() + visible_message("\red The mutated weeds in [src] spawned a \blue [myseed.plantname]!") else usr << "The few weeds in the [src] seem to react, but only for a moment..." return @@ -427,20 +415,20 @@ obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent in obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier - src.health = 0 - src.dead = 1 - src.harvest = 0 - src.updateicon() - src.visible_message("\red[src] is looking very unhealthy!") + health = 0 + dead = 1 + harvest = 0 + updateicon() + visible_message("\red[src] is looking very unhealthy!") return obj/machinery/hydroponics/proc/mutatepest() // Until someone makes a spaceworm, this is commented out - if ( src.pestlevel > 5 ) - src.visible_message("The pests seem to behave oddly...") + if ( pestlevel > 5 ) + visible_message("The pests seem to behave oddly...") // spawn(10) -// new /obj/effect/alien/spaceworm(src.loc) +// new /obj/effect/alien/spaceworm(loc) else usr << "The pests seem to behave oddly, but quickly settle down..." //Modified to give a better idea of what's happening when you inject mutagen. There's still nothing proper to spawn here though. -Cheridan return @@ -452,305 +440,318 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) //Called when mob user "attacks" it with object O if (istype(O, /obj/item/weapon/reagent_containers/glass/bucket)) var/b_amount = O.reagents.get_reagent_amount("water") - if(b_amount > 0 && src.waterlevel < 100) - if(b_amount + src.waterlevel > 100) - b_amount = 100 - src.waterlevel + if(b_amount > 0 && waterlevel < 100) + if(b_amount + waterlevel > 100) + b_amount = 100 - waterlevel O.reagents.remove_reagent("water", b_amount) - src.waterlevel += b_amount - playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1) + waterlevel += b_amount + playsound(loc, 'sound/effects/slosh.ogg', 25, 1) user << "You fill the [src] with [b_amount] units of water." // Toxicity dilutation code. The more water you put in, the lesser the toxin concentration. - src.toxic -= round(b_amount/4) - if (src.toxic < 0 ) // Make sure it won't go overoboard - src.toxic = 0 + toxic -= round(b_amount/4) + if (toxic < 0 ) // Make sure it won't go overoboard + toxic = 0 - else if(src.waterlevel >= 100) + else if(waterlevel >= 100) user << "\red The [src] is already full." else user << "\red The bucket is not filled with water." - src.updateicon() + updateicon() else if ( istype(O, /obj/item/nutrient) ) var/obj/item/nutrient/myNut = O user.u_equip(O) - src.nutrilevel = 10 - src.yieldmod = myNut.yieldmod - src.mutmod = myNut.mutmod + nutrilevel = 10 + yieldmod = myNut.yieldmod + mutmod = myNut.mutmod user << "You replace the nutrient solution in the [src]." del(O) - src.updateicon() + updateicon() else if(istype(O, /obj/item/weapon/reagent_containers/syringe)) // Syringe stuff var/obj/item/weapon/reagent_containers/syringe/S = O - if (src.planted) + if (planted) if (S.mode == 1) if(!S.reagents.total_volume) user << "\red The syringe is empty." return - user << "\red You inject the [src.myseed.plantname] with a chemical solution." + user << "\red You inject the [myseed.plantname] with a chemical solution." // There needs to be a good amount of mutagen to actually work if(S.reagents.has_reagent("mutagen", 5)) switch(rand(100)) - if (91 to 100) src.plantdies() - if (81 to 90) src.mutatespecie() - if (66 to 80) src.hardmutate() - if (41 to 65) src.mutate() + if (91 to 100) plantdies() + if (81 to 90) mutatespecie() + if (66 to 80) hardmutate() + if (41 to 65) mutate() if (21 to 41) user << "The plants don't seem to react..." - if (11 to 20) src.mutateweed() - if (1 to 10) src.mutatepest() + if (11 to 20) mutateweed() + if (1 to 10) mutatepest() else user << "Nothing happens..." // Antitoxin binds shit pretty well. So the tox goes significantly down if(S.reagents.has_reagent("anti_toxin", 1)) - src.toxic -= round(S.reagents.get_reagent_amount("anti_toxin")*2) + toxic -= round(S.reagents.get_reagent_amount("anti_toxin")*2) // NIGGA, YOU JUST WENT ON FULL RETARD. if(S.reagents.has_reagent("toxin", 1)) - src.toxic += round(S.reagents.get_reagent_amount("toxin")*2) + toxic += round(S.reagents.get_reagent_amount("toxin")*2) // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now... if(S.reagents.has_reagent("milk", 1)) - src.nutrilevel += round(S.reagents.get_reagent_amount("milk")*0.1) - src.waterlevel += round(S.reagents.get_reagent_amount("milk")*0.9) + nutrilevel += round(S.reagents.get_reagent_amount("milk")*0.1) + waterlevel += round(S.reagents.get_reagent_amount("milk")*0.9) // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? if(S.reagents.has_reagent("beer", 1)) - src.health -= round(S.reagents.get_reagent_amount("beer")*0.05) - src.nutrilevel += round(S.reagents.get_reagent_amount("beer")*0.25) - src.waterlevel += round(S.reagents.get_reagent_amount("beer")*0.7) + health -= round(S.reagents.get_reagent_amount("beer")*0.05) + nutrilevel += round(S.reagents.get_reagent_amount("beer")*0.25) + waterlevel += round(S.reagents.get_reagent_amount("beer")*0.7) // You're an idiot of thinking that one of the most corrosive and deadly gasses would be beneficial if(S.reagents.has_reagent("fluorine", 1)) - src.health -= round(S.reagents.get_reagent_amount("fluorine")*2) - src.toxic += round(S.reagents.get_reagent_amount("flourine")*2.5) - src.waterlevel -= round(S.reagents.get_reagent_amount("flourine")*0.5) - src.weedlevel -= rand(1,4) + health -= round(S.reagents.get_reagent_amount("fluorine")*2) + toxic += round(S.reagents.get_reagent_amount("flourine")*2.5) + waterlevel -= round(S.reagents.get_reagent_amount("flourine")*0.5) + weedlevel -= rand(1,4) // You're an idiot of thinking that one of the most corrosive and deadly gasses would be beneficial if(S.reagents.has_reagent("chlorine", 1)) - src.health -= round(S.reagents.get_reagent_amount("chlorine")*1) - src.toxic += round(S.reagents.get_reagent_amount("chlorine")*1.5) - src.waterlevel -= round(S.reagents.get_reagent_amount("chlorine")*0.5) - src.weedlevel -= rand(1,3) + health -= round(S.reagents.get_reagent_amount("chlorine")*1) + toxic += round(S.reagents.get_reagent_amount("chlorine")*1.5) + waterlevel -= round(S.reagents.get_reagent_amount("chlorine")*0.5) + weedlevel -= rand(1,3) // White Phosphorous + water -> phosphoric acid. That's not a good thing really. Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. if(S.reagents.has_reagent("phosphorus", 1)) - src.health -= round(S.reagents.get_reagent_amount("phosphorus")*0.75) - src.nutrilevel += round(S.reagents.get_reagent_amount("phosphorus")*0.1) - src.waterlevel -= round(S.reagents.get_reagent_amount("phosphorus")*0.5) - src.weedlevel -= rand(1,2) + health -= round(S.reagents.get_reagent_amount("phosphorus")*0.75) + nutrilevel += round(S.reagents.get_reagent_amount("phosphorus")*0.1) + waterlevel -= round(S.reagents.get_reagent_amount("phosphorus")*0.5) + weedlevel -= rand(1,2) // Plants should not have sugar, they can't use it and it prevents them getting water/ nutients, it is good for mold though... if(S.reagents.has_reagent("sugar", 1)) - src.weedlevel += rand(1,2) - src.pestlevel += rand(1,2) - src.nutrilevel+= round(S.reagents.get_reagent_amount("sugar")*0.1) + weedlevel += rand(1,2) + pestlevel += rand(1,2) + nutrilevel+= round(S.reagents.get_reagent_amount("sugar")*0.1) // It is water! if(S.reagents.has_reagent("water", 1)) - src.waterlevel += round(S.reagents.get_reagent_amount("water")*1) + waterlevel += round(S.reagents.get_reagent_amount("water")*1) // Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~ if(S.reagents.has_reagent("holywater", 1)) - src.waterlevel += round(S.reagents.get_reagent_amount("holywater")*1) - src.health += round(S.reagents.get_reagent_amount("holywater")*0.1) + waterlevel += round(S.reagents.get_reagent_amount("holywater")*1) + health += round(S.reagents.get_reagent_amount("holywater")*0.1) // A variety of nutrients are dissolved in club soda, without sugar. These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. if(S.reagents.has_reagent("sodawater", 1)) - src.waterlevel += round(S.reagents.get_reagent_amount("sodawater")*1) - src.health += round(S.reagents.get_reagent_amount("sodawater")*0.1) - src.nutrilevel += round(S.reagents.get_reagent_amount("sodawater")*0.1) + waterlevel += round(S.reagents.get_reagent_amount("sodawater")*1) + health += round(S.reagents.get_reagent_amount("sodawater")*0.1) + nutrilevel += round(S.reagents.get_reagent_amount("sodawater")*0.1) // Man, you guys are retards if(S.reagents.has_reagent("sacid", 1)) - src.health -= round(S.reagents.get_reagent_amount("sacid")*1) - src.toxic += round(S.reagents.get_reagent_amount("sacid")*1.5) - src.weedlevel -= rand(1,2) + health -= round(S.reagents.get_reagent_amount("sacid")*1) + toxic += round(S.reagents.get_reagent_amount("sacid")*1.5) + weedlevel -= rand(1,2) // SERIOUSLY if(S.reagents.has_reagent("pacid", 1)) - src.health -= round(S.reagents.get_reagent_amount("pacid")*2) - src.toxic += round(S.reagents.get_reagent_amount("pacid")*3) - src.weedlevel -= rand(1,4) + health -= round(S.reagents.get_reagent_amount("pacid")*2) + toxic += round(S.reagents.get_reagent_amount("pacid")*3) + weedlevel -= rand(1,4) // Plant-B-Gone is just as bad if(S.reagents.has_reagent("plantbgone", 1)) - src.health -= round(S.reagents.get_reagent_amount("plantbgone")*2) - src.toxic -= round(S.reagents.get_reagent_amount("plantbgone")*3) - src.weedlevel -= rand(4,8) + health -= round(S.reagents.get_reagent_amount("plantbgone")*2) + toxic -= round(S.reagents.get_reagent_amount("plantbgone")*3) + weedlevel -= rand(4,8) // Healing if(S.reagents.has_reagent("cryoxadone", 1)) - src.health += round(S.reagents.get_reagent_amount("cryoxadone")*3) - src.toxic -= round(S.reagents.get_reagent_amount("cryoxadone")*3) + health += round(S.reagents.get_reagent_amount("cryoxadone")*3) + toxic -= round(S.reagents.get_reagent_amount("cryoxadone")*3) // FINALLY IMPLEMENTED, Ammonia is bad ass. if(S.reagents.has_reagent("ammonia", 1)) - src.health += round(S.reagents.get_reagent_amount("ammonia")*0.5) - src.nutrilevel += round(S.reagents.get_reagent_amount("ammonia")*1) + health += round(S.reagents.get_reagent_amount("ammonia")*0.5) + nutrilevel += round(S.reagents.get_reagent_amount("ammonia")*1) // FINALLY IMPLEMENTED, This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. if(S.reagents.has_reagent("diethylamine", 1)) - src.health += round(S.reagents.get_reagent_amount("diethylamine")*1) - src.nutrilevel += round(S.reagents.get_reagent_amount("diethylamine")*2) - src.pestlevel -= rand(1,2) + health += round(S.reagents.get_reagent_amount("diethylamine")*1) + nutrilevel += round(S.reagents.get_reagent_amount("diethylamine")*2) + pestlevel -= rand(1,2) // Compost, effectively if(S.reagents.has_reagent("nutriment", 1)) - src.health += round(S.reagents.get_reagent_amount("nutriment")*0.5) - src.nutrilevel += round(S.reagents.get_reagent_amount("nutriment")*1) + health += round(S.reagents.get_reagent_amount("nutriment")*0.5) + nutrilevel += round(S.reagents.get_reagent_amount("nutriment")*1) // Poor man's mutagen. if(S.reagents.has_reagent("radium", 1)) - src.health -= round(S.reagents.get_reagent_amount("radium")*1.5) - src.toxic += round(S.reagents.get_reagent_amount("radium")*2) + health -= round(S.reagents.get_reagent_amount("radium")*1.5) + toxic += round(S.reagents.get_reagent_amount("radium")*2) if(S.reagents.has_reagent("radium", 10)) switch(rand(100)) - if (91 to 100) src.plantdies() - if (81 to 90) src.mutatespecie() - if (66 to 80) src.hardmutate() - if (41 to 65) src.mutate() + if (91 to 100) plantdies() + if (81 to 90) mutatespecie() + if (66 to 80) hardmutate() + if (41 to 65) mutate() if (21 to 41) user << "The plants don't seem to react..." - if (11 to 20) src.mutateweed() - if (1 to 10) src.mutatepest() + if (11 to 20) mutateweed() + if (1 to 10) mutatepest() else user << "Nothing happens..." // The best stuff there is. For testing/debugging. if(S.reagents.has_reagent("adminordrazine", 1)) - src.waterlevel += round(S.reagents.get_reagent_amount("adminordrazine")*1) - src.health += round(S.reagents.get_reagent_amount("adminordrazine")*1) - src.nutrilevel += round(S.reagents.get_reagent_amount("adminordrazine")*1) - src.pestlevel -= rand(1,5) - src.weedlevel -= rand(1,5) + waterlevel += round(S.reagents.get_reagent_amount("adminordrazine")*1) + health += round(S.reagents.get_reagent_amount("adminordrazine")*1) + nutrilevel += round(S.reagents.get_reagent_amount("adminordrazine")*1) + pestlevel -= rand(1,5) + weedlevel -= rand(1,5) if(S.reagents.has_reagent("adminordrazine", 5)) switch(rand(100)) - if (66 to 100) src.mutatespecie() - if (33 to 65) src.mutateweed() - if (1 to 32) src.mutatepest() + if (66 to 100) mutatespecie() + if (33 to 65) mutateweed() + if (1 to 32) mutatepest() else user << "Nothing happens..." S.reagents.clear_reagents() - if (src.weedlevel < 0 ) // The following checks are to prevent the stats from going out of bounds. - src.weedlevel = 0 - if (src.health < 0 ) - src.health = 0 - if (src.waterlevel > 100 ) - src.waterlevel = 100 - if (src.waterlevel < 0 ) - src.waterlevel = 0 - if (src.toxic < 0 ) - src.toxic = 0 - if (src.toxic > 100 ) - src.toxic = 100 - if (src.pestlevel < 0 ) - src.pestlevel = 0 - if (src.nutrilevel > 10 ) - src.nutrilevel = 10 + if (weedlevel < 0 ) // The following checks are to prevent the stats from going out of bounds. + weedlevel = 0 + if (health < 0 ) + health = 0 + if (waterlevel > 100 ) + waterlevel = 100 + if (waterlevel < 0 ) + waterlevel = 0 + if (toxic < 0 ) + toxic = 0 + if (toxic > 100 ) + toxic = 100 + if (pestlevel < 0 ) + pestlevel = 0 + if (nutrilevel > 10 ) + nutrilevel = 10 else user << "You can't get any extract out of this plant." else user << "There's nothing to apply the solution into." + updateicon() else if ( istype(O, /obj/item/seeds/) ) - if(!src.planted) + if(!planted) user.u_equip(O) user << "You plant the [O.name]" - src.dead = 0 - src.myseed = O - src.planted = 1 - src.age = 1 - src.health = src.myseed.endurance - src.lastcycle = world.time + dead = 0 + myseed = O + planted = 1 + age = 1 + health = myseed.endurance + lastcycle = world.time O.loc = src if((user.client && user.s_active != src)) user.client.screen -= O O.dropped(user) - src.updateicon() + updateicon() else user << "\red The [src] already has seeds in it!" else if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - if(src.planted && src.myseed) - user << "*** [src.myseed.plantname] ***" //Carn: now reports the plants growing, not the seeds. - user << "-Plant Age: \blue [src.age]" - user << "-Plant Endurance: \blue [src.myseed.endurance]" - user << "-Plant Lifespan: \blue [src.myseed.lifespan]" - if(src.myseed.yield != -1) - user << "-Plant Yield: \blue [src.myseed.yield]" - user << "-Plant Production: \blue [src.myseed.production]" - if(src.myseed.potency != -1) - user << "-Plant Potency: \blue [src.myseed.potency]" - user << "-Weed level: \blue [src.weedlevel]/10" - user << "-Pest level: \blue [src.pestlevel]/10" - user << "-Toxicity level: \blue [src.toxic]/100" - user << "-Water level: \blue [src.waterlevel]/100" - user << "-Nutrition level: \blue [src.nutrilevel]/10" + if(planted && myseed) + user << "*** [myseed.plantname] ***" //Carn: now reports the plants growing, not the seeds. + user << "-Plant Age: \blue [age]" + user << "-Plant Endurance: \blue [myseed.endurance]" + user << "-Plant Lifespan: \blue [myseed.lifespan]" + if(myseed.yield != -1) + user << "-Plant Yield: \blue [myseed.yield]" + user << "-Plant Production: \blue [myseed.production]" + if(myseed.potency != -1) + user << "-Plant Potency: \blue [myseed.potency]" + user << "-Weed level: \blue [weedlevel]/10" + user << "-Pest level: \blue [pestlevel]/10" + user << "-Toxicity level: \blue [toxic]/100" + user << "-Water level: \blue [waterlevel]/100" + user << "-Nutrition level: \blue [nutrilevel]/10" user << "" else user << "No plant found." - user << "-Weed level: \blue [src.weedlevel]/10" - user << "-Pest level: \blue [src.pestlevel]/10" - user << "-Toxicity level: \blue [src.toxic]/100" - user << "-Water level: \blue [src.waterlevel]/100" - user << "-Nutrition level: \blue [src.nutrilevel]/10" + user << "-Weed level: \blue [weedlevel]/10" + user << "-Pest level: \blue [pestlevel]/10" + user << "-Toxicity level: \blue [toxic]/100" + user << "-Water level: \blue [waterlevel]/100" + user << "-Nutrition level: \blue [nutrilevel]/10" user << "" else if (istype(O, /obj/item/weapon/reagent_containers/spray/plantbgone)) - if(src.planted && src.myseed) - src.health -= rand(5,20) + if(planted && myseed) + health -= rand(5,20) - if(src.pestlevel > 0) - src.pestlevel -= 2 // Kill kill kill + if(pestlevel > 0) + pestlevel -= 2 // Kill kill kill else - src.pestlevel = 0 + pestlevel = 0 - if(src.weedlevel > 0) - src.weedlevel -= 3 // Kill kill kill + if(weedlevel > 0) + weedlevel -= 3 // Kill kill kill else - src.weedlevel = 0 - src.toxic += 4 // Oops - src.visible_message("\red \The [src] has been sprayed with \the [O][(user ? " by [user]." : ".")]") - playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) + weedlevel = 0 + toxic += 4 // Oops + visible_message("\red \The [src] has been sprayed with \the [O][(user ? " by [user]." : ".")]") + playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) + updateicon() else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe //var/deweeding - if(src.weedlevel > 0) + if(weedlevel > 0) user.visible_message("\red [user] starts uprooting the weeds.", "\red You remove the weeds from the [src].") - src.weedlevel = 0 + weedlevel = 0 + updateicon() else user << "\red This plot is completely devoid of weeds. It doesn't need uprooting." else if ( istype(O, /obj/item/weapon/weedspray) ) var/obj/item/weedkiller/myWKiller = O user.u_equip(O) - src.toxic += myWKiller.toxicity - src.weedlevel -= myWKiller.WeedKillStr - if (src.weedlevel < 0 ) // Make sure it won't go overoboard - src.weedlevel = 0 - if (src.toxic > 100 ) // Make sure it won't go overoboard - src.toxic = 100 + toxic += myWKiller.toxicity + weedlevel -= myWKiller.WeedKillStr + if (weedlevel < 0 ) // Make sure it won't go overoboard + weedlevel = 0 + if (toxic > 100 ) // Make sure it won't go overoboard + toxic = 100 user << "You apply the weedkiller solution into the [src]." - playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) + playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) del(O) - src.updateicon() + updateicon() + + else if (istype(O, /obj/item/weapon/plantbag)) + attack_hand(user) + var/obj/item/weapon/plantbag/S = O + for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z)) + if (S.contents.len < S.capacity) + S.contents += G; + else + user << "\blue The plant bag is full." + return else if ( istype(O, /obj/item/weapon/pestspray) ) var/obj/item/pestkiller/myPKiller = O user.u_equip(O) - src.toxic += myPKiller.toxicity - src.pestlevel -= myPKiller.PestKillStr - if (src.pestlevel < 0 ) // Make sure it won't go overoboard - src.pestlevel = 0 - if (src.toxic > 100 ) // Make sure it won't go overoboard - src.toxic = 100 + toxic += myPKiller.toxicity + pestlevel -= myPKiller.PestKillStr + if (pestlevel < 0 ) // Make sure it won't go overoboard + pestlevel = 0 + if (toxic > 100 ) // Make sure it won't go overoboard + toxic = 100 user << "You apply the pestkiller solution into the [src]." - playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) + playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) del(O) - src.updateicon() + updateicon() else if(istype(O, /obj/item/weapon/wrench)) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) anchored = !anchored @@ -765,28 +766,28 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/hydroponics/attack_hand(mob/user as mob) if(istype(usr,/mob/living/silicon)) //How does AI know what plant is? return - if(src.harvest) + if(harvest) if(!user in range(1,src)) return myseed.harvest() - else if(src.dead) - src.planted = 0 - src.dead = 0 + else if(dead) + planted = 0 + dead = 0 usr << text("You remove the dead plant from the [src].") - del(src.myseed) - src.updateicon() + del(myseed) + updateicon() else - if(src.planted && !src.dead) - usr << text("The [src] has \blue [src.myseed.plantname] \black planted.") - if(src.health <= (src.myseed.endurance / 2)) + if(planted && !dead) + usr << text("The [src] has \blue [myseed.plantname] \black planted.") + if(health <= (myseed.endurance / 2)) usr << text("The plant looks unhealthy") else usr << text("The [src] is empty.") - usr << text("Water: [src.waterlevel]/100") - usr << text("Nutrient: [src.nutrilevel]/10") - if(src.weedlevel >= 5) // Visual aid for those blind + usr << text("Water: [waterlevel]/100") + usr << text("Nutrient: [nutrilevel]/10") + if(weedlevel >= 5) // Visual aid for those blind usr << text("The [src] is filled with weeds!") - if(src.pestlevel >= 5) // Visual aid for those blind + if(pestlevel >= 5) // Visual aid for those blind usr << text("The [src] is filled with tiny worms!") usr << text ("") // Empty line for readability. @@ -986,11 +987,11 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/hydroponics/proc/update_tray(mob/user = usr) harvest = 0 - lastproduce = src.age + lastproduce = age if((yieldmod * myseed.yield) <= 0) user << text("\red You fail to harvest anything useful.") else - user << text("You harvest from the [src.myseed.plantname]") + user << text("You harvest from the [myseed.plantname]") if(myseed.oneharvest) del(myseed) planted = 0 @@ -1007,20 +1008,20 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) ..() updateicon() // Same as normal but with the overlays removed - Cheridan. overlays = null - if(src.planted) + if(planted) if(dead) - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-dead") - else if(src.harvest) - if(src.myseed.plant_type == 2) // Shrooms don't have a -harvest graphic - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-dead") + else if(harvest) + if(myseed.plant_type == 2) // Shrooms don't have a -harvest graphic + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[myseed.growthstages]") else - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-harvest") - else if(src.age < src.myseed.maturation) - var/t_growthstate = ((src.age / src.myseed.maturation) * src.myseed.growthstages ) - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") - src.lastproduce = src.age + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-harvest") + else if(age < myseed.maturation) + var/t_growthstate = ((age / myseed.maturation) * myseed.growthstages ) + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[round(t_growthstate)]") + lastproduce = age else - overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-grow[myseed.growthstages]") if(!luminosity) if(istype(myseed,/obj/item/seeds/glowshroom)) diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index b522841e8e2..cb182a6a3e4 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -36,10 +36,13 @@ // It will also stream the chunk that the new loc is in. /mob/aiEye/proc/setLoc(var/T) - T = get_turf(T) - loc = T - cameranet.visibility(src) + if(ai) + if(!isturf(ai.loc)) + return + T = get_turf(T) + loc = T + cameranet.visibility(src) if(ai.client) ai.client.eye = src //Holopad @@ -114,7 +117,6 @@ user.sprint = initial user.cameraFollow = null - src.eye = user.eyeobj //user.unset_machine() //Uncomment this if it causes problems. //user.lightNearbyCamera() diff --git a/html/changelog.html b/html/changelog.html index cf9ac74f8ca..1716ff9dce6 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -54,6 +54,11 @@ should be listed in the changelog upon commit tho. Thanks. -->
  • Simplified detective stuff. The high-res scanner is gone and instead the detective's normal scanner will instantly report all fingerprints, dna and cloth fibers in full. This was needed because the system took too long to work with and disencouraged detectives. Not only that, it made detectives less of a threat for antagonists and made possible scenerios, such as framing someone by changing fingerprints with someone else, impratical. To replace the computer, the detective will have a full medical computer with access to it. Not only that, but his useless filing cabinet will be replaced with an empty one for serious investigators. Along with this, are fingerprint cards and built-in PDA scanning, as all of security had access to it which was really the detective's thing. The new scanner will also log every finding and you can print them out as a report by clicking the scanner while it is in your active hand.
  • You can toggle the pressure of your sprayer by clicking on it while it is in your active hand. With pressure, the sprayer will spray 10 units on the floor, otherwise it sprays 5. You'll need to turn pressure on to spray water on the floor and make it slippery.
  • +
  • AIs in intellicards can no longer move their camera. This will limit them in ability but without making creating and carding an AI to have as a personel door opener impossible.
  • +
+

Zelacks updated:

+
    +