mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-25 00:22:39 +00:00
-Committing SuperSayu's patch for slimey grenades. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5770 316c924e-a436-60f5-8080-3fe189b3f50e
63 lines
1.7 KiB
Plaintext
63 lines
1.7 KiB
Plaintext
/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."
|
|
icon = 'icons/obj/hydroponics.dmi'
|
|
icon_state = "sextractor"
|
|
density = 1
|
|
anchored = 1
|
|
|
|
obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
|
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>" |