Merge pull request #13 from Fox-McCloud/master

Seed Extractor
This commit is contained in:
ZomgPonies
2013-10-27 00:36:09 -07:00
4 changed files with 80 additions and 43 deletions
+54 -43
View File
@@ -1,3 +1,48 @@
/proc/seedify(var/obj/item/O as obj, var/t_max)
var/t_amount = 0
if(t_max == -1)
t_max = rand(1,4)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/))
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
while(t_amount < t_max)
var/obj/item/seeds/t_prod = new F.seed(O.loc)
t_prod.species = F.species
t_prod.lifespan = F.lifespan
t_prod.endurance = F.endurance
t_prod.maturation = F.maturation
t_prod.production = F.production
t_prod.yield = F.yield
t_prod.potency = F.potency
t_amount++
del(O)
return 1
else if(istype(O, /obj/item/weapon/grown/))
var/obj/item/weapon/grown/F = O
while(t_amount < t_max)
var/obj/item/seeds/t_prod = new F.seed(O.loc)
t_prod.species = F.species
t_prod.lifespan = F.lifespan
t_prod.endurance = F.endurance
t_prod.maturation = F.maturation
t_prod.production = F.production
t_prod.yield = F.yield
t_prod.potency = F.potency
t_amount++
del(O)
return 1
else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
new /obj/item/seeds/grassseed(O.loc)
S.use(1)
return 1
else
return 0
/obj/machinery/seed_extractor
name = "seed extractor"
desc = "Extracts and bags seeds from produce."
@@ -7,48 +52,14 @@
anchored = 1
obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/))
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
user.drop_item()
user << "<span class='notice'>You extract some seeds from the [F.name].</span>"
var/seed = text2path(F.seed)
var/t_amount = 0
var/t_max = rand(1,4)
while(t_amount < t_max)
var/obj/item/seeds/t_prod = new seed(loc)
t_prod.species = F.species
t_prod.lifespan = F.lifespan
t_prod.endurance = F.endurance
t_prod.maturation = F.maturation
t_prod.production = F.production
t_prod.yield = F.yield
t_prod.potency = F.potency
t_amount++
del(O)
if(isrobot(user))
return
user.drop_item()
if(O && O.loc)
O.loc = src.loc
if(seedify(O,-1))
user << "<span class='notice'>You extract some seeds.</span>"
else
user << "<span class='notice'>You can't extract any seeds from that!</span>"
else if(istype(O, /obj/item/weapon/grown/))
var/obj/item/weapon/grown/F = O
user.drop_item()
user << "<span class='notice'>You extract some seeds from the [F.name].</span>"
var/seed = text2path(F.seed)
var/t_amount = 0
var/t_max = rand(1,4)
while(t_amount < t_max)
var/obj/item/seeds/t_prod = new seed(loc)
t_prod.species = F.species
t_prod.lifespan = F.lifespan
t_prod.endurance = F.endurance
t_prod.maturation = F.maturation
t_prod.production = F.production
t_prod.yield = F.yield
t_prod.potency = F.potency
t_amount++
del(O)
else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
user << "<span class='notice'>You extract some seeds from the [S.name].</span>"
S.use(1)
new /obj/item/seeds/grassseed(loc)
return
@@ -97,6 +97,23 @@
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/grown","/obj/item/seeds","/obj/item/weapon/grown")
/obj/item/weapon/storage/bag/plants/portaseeder
name = "Portable Seed Extractor"
desc = "For the enterprising botanist on the go. Less efficient than the stationary model, it creates one seed per plant."
icon_state = "portaseeder"
origin_tech = "materials=2;biotech=2"
verb/dissolve_contents()
set name = "Activate Seed Extraction"
set category = "Object"
set desc = "Activate to convert your plants into plantable seeds."
for(var/obj/item/O in contents)
seedify(O, 1)
for(var/mob/M in range(1))
if (M.s_active == src)
src.close(M)
// -----------------------------
// Sheet Snatcher
// -----------------------------
+9
View File
@@ -1454,6 +1454,15 @@ datum/design/flora_gun
materials = list("$metal" = 2000, "$glass" = 500, "$uranium" = 500)
build_path = "/obj/item/weapon/gun/energy/floragun"
datum/design/portaseed
name = "Portaseeder"
desc = "An advanced hydroponics tool used for harvesting produce and extracting seeds."
id = "portaseed"
req_tech = list("materials" = 2, "biotech" = 3, "powerstorage" = 2)
build_type = PROTOLATHE
materials = list("$metal" = 500, "$glass" = 500)
build_path = "/obj/item/weapon/storage/bag/plants/portaseeder"
datum/design/large_grenade
name = "Large Grenade"
desc = "A grenade that affects a larger area and use larger containers."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB