Fixed diona pods being mutable, fixed a few other tweaks, added cuttings.

This commit is contained in:
Zuhayr
2014-07-29 12:38:21 +09:30
parent 7f6b36e1dc
commit 7b084ed349
6 changed files with 58 additions and 15 deletions

View File

@@ -266,7 +266,10 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
/obj/item/weapon/minihoe,
/obj/item/device/analyzer/plant_analyzer,
/obj/item/clothing/gloves/botanic_leather,
/obj/item/clothing/suit/apron) // Updated with new things
/obj/item/clothing/suit/apron,
/obj/item/weapon/minihoe,
/obj/item/weapon/storage/box/botanydisk
) // Updated with new things
cost = 15
containertype = /obj/structure/closet/crate/hydroponics
containername = "Hydroponics crate"

View File

@@ -1,4 +1,8 @@
//Analyzer, pestkillers, weedkillers, nutrients, hatchets.
//Analyzer, pestkillers, weedkillers, nutrients, hatchets, cutters.
/obj/item/weapon/wirecutters/clippers
name = "plant clippers"
desc = "A tool used to take samples from plants."
/obj/item/device/analyzer/plant_analyzer
name = "plant analyzer"

View File

@@ -30,6 +30,7 @@
var/lastcycle = 0 // Cycle timing/tracking var.
var/cycledelay = 150 // Delay per cycle.
var/closed_system // If set, the tray will attempt to take atmos from a pipe.
var/force_update
// Seed details/line data.
var/datum/seed/seed = null // The currently planted seed
@@ -117,6 +118,10 @@
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
//Don't act on seeds like dionaea that shouldn't change.
if(seed && seed.immutable)
return
//Override for somatoray projectiles.
if(istype(Proj ,/obj/item/projectile/energy/floramut) && prob(20))
mutate(1)
@@ -138,8 +143,11 @@
/obj/machinery/portable_atmospherics/hydroponics/process()
// Update values every cycle rather than every process() tick.
if(world.time < (lastcycle + cycledelay))
if(force_update)
force_update = 0
else if(world.time < (lastcycle + cycledelay))
return
lastcycle = world.time
// Weeds like water and nutrients, there's a chance the weed population will increase.
@@ -380,8 +388,6 @@
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate(var/severity)
world << "Tray mutation proc called with [severity]."
// No seed, no mutations.
if(!seed)
return
@@ -439,7 +445,22 @@
/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (istype(O, /obj/item/weapon/reagent_containers/glass))
if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/weapon/scalpel))
if(!seed)
user << "There is nothing to take a sample from in \the [src]."
return
seed.harvest(user,yield_mod,1)
health -= (rand(1,5)*10)
check_level_sanity()
force_update = 1
process()
return
else if (istype(O, /obj/item/weapon/reagent_containers/glass))
var/b_amount = O.reagents.get_reagent_amount("water")
if(b_amount > 0 && waterlevel < 100)
if(b_amount + waterlevel > 100)
@@ -615,7 +636,8 @@
seed = S.seed //Grab the seed datum.
dead = 0
age = 1
health = seed.endurance
//Snowflakey, maybe move this to the seed datum
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.endurance/rand(2,5)) : seed.endurance)
lastcycle = world.time
del(O)

View File

@@ -105,8 +105,6 @@ proc/populate_seed_list()
//Mutates the plant overall (randomly).
/datum/seed/proc/mutate(var/degree,var/turf/source_turf)
world << "Seed mutation proc called with [degree]."
if(!degree || immutable) return
source_turf.visible_message("\blue \The [display_name] quivers!")
@@ -346,7 +344,7 @@ proc/populate_seed_list()
return (P ? P : 0)
//Place the plant products at the feet of the user.
/datum/seed/proc/harvest(var/mob/user,var/yield_mod)
/datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample)
if(!user)
return
@@ -358,7 +356,7 @@ proc/populate_seed_list()
if(!got_product)
user << "\red You fail to harvest anything useful."
else
user << "You harvest from the [display_name]."
user << "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name]."
//This may be a new line. Update the global if it is.
if(name == "new line" || !(name in seed_types))
@@ -366,6 +364,12 @@ proc/populate_seed_list()
name = "[uid]"
seed_types[name] = src
if(harvest_sample)
var/obj/item/seeds/seeds = new(get_turf(user))
seeds.seed_type = name
seeds.update_seed()
return
var/total_yield
if(isnull(yield_mod) || yield_mod < 1)
yield_mod = 0

View File

@@ -85,16 +85,18 @@
/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/seeds))
if(seed)
if(seed.seed.immutable)
user << "That seed is not compatible with our genetics technology."
else
user << "There is already a seed loaded."
user << "There is already a seed loaded."
var/obj/item/seeds/S =W
if(S.seed && S.seed.immutable)
user << "That seed is not compatible with our genetics technology."
else
user.drop_item(W)
W.loc = src
seed = W
user << "You load [W] into [src]."
return
if(istype(W,/obj/item/weapon/screwdriver))
open = !open
user << "\blue You [open ? "open" : "close"] the maintenance panel."

View File

@@ -32,6 +32,14 @@
if(seed && !seed.roundstart)
usr << "It's tagged as variety #[seed.uid]."
/obj/item/seeds/cutting
name = "cuttings"
desc = "Some plant cuttings."
/obj/item/seeds/cutting/update_appearance()
..()
src.name = "packet of [seed.seed_name] cuttings"
/obj/item/seeds/replicapod
seed_type = "diona"