mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 09:34:21 +01:00
Botany Rework
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
item_state = "apron"
|
||||
blood_overlay_type = "armor"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO
|
||||
allowed = list (/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/analyzer/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/bottle/fertilizer,/obj/item/weapon/minihoe)
|
||||
allowed = list(/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/cultivator,/obj/item/weapon/reagent_containers/spray/pestspray,/obj/item/weapon/hatchet,/obj/item/weapon/storage/bag/plants)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
|
||||
@@ -421,7 +421,7 @@
|
||||
/obj/item/clothing/suit/hooded/wintercoat/hydro
|
||||
name = "hydroponics winter coat"
|
||||
icon_state = "wintercoat_hydro"
|
||||
allowed = list(/obj/item/weapon/reagent_containers/spray, /obj/item/device/analyzer/plant_analyzer, /obj/item/seeds, /obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/hatchet, /obj/item/weapon/storage/bag/plants)
|
||||
allowed = list(/obj/item/weapon/reagent_containers/spray, /obj/item/device/plant_analyzer, /obj/item/seeds, /obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/hatchet, /obj/item/weapon/storage/bag/plants)
|
||||
hoodtype = /obj/item/clothing/head/winterhood/hydro
|
||||
|
||||
/obj/item/clothing/head/winterhood/hydro
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
var/eatverb
|
||||
var/wrapped = 0
|
||||
var/dried_type = null
|
||||
var/dry = 0
|
||||
var/cooktype[0]
|
||||
var/cooked_type = null //for microwave cooking. path of the resulting item after microwaving
|
||||
|
||||
|
||||
//Placeholder for effect that trigger on eating that aren't tied to reagents.
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
|
||||
/datum/recipe/microwave/poppypretzel
|
||||
items = list(
|
||||
/obj/item/seeds/poppyseed,
|
||||
/obj/item/seeds/poppy,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/poppypretzel
|
||||
|
||||
@@ -14,16 +14,9 @@
|
||||
/mob/living/simple_animal/hostile/poison/bees/bee_friendly()
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/bot/bee_friendly()
|
||||
if(paicard)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/diona/bee_friendly()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/bee_friendly()
|
||||
if(get_species() == "Diona") //bees pollinate plants, duh.
|
||||
if(dna && dna.species && dna.species.id == "pod") //bees pollinate plants, duh.
|
||||
return 1
|
||||
if((wear_suit && (wear_suit.flags & THICKMATERIAL)) && (head && (head.flags & THICKMATERIAL)))
|
||||
return 1
|
||||
@@ -33,7 +26,7 @@
|
||||
/obj/structure/beebox
|
||||
name = "apiary"
|
||||
desc = "Dr Miles Manners is just your average Wasp themed super hero by day, but by night he becomes DR BEES!"
|
||||
icon = 'icons/obj/apiary_bees.dmi'
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "beebox"
|
||||
anchored = 1
|
||||
density = 1
|
||||
@@ -82,7 +75,7 @@
|
||||
honey_frames += HF
|
||||
|
||||
for(var/i in 1 to get_max_bees())
|
||||
var/mob/living/simple_animal/hostile/poison/bees/worker/B = new(src)
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = new(src)
|
||||
bees += B
|
||||
B.beehome = src
|
||||
B.assign_reagent(R)
|
||||
@@ -109,7 +102,7 @@
|
||||
if((bee_resources >= BEE_RESOURCE_NEW_BEE_COST && prob(BEE_PROB_NEW_BEE)) || freebee)
|
||||
if(!freebee)
|
||||
bee_resources = max(bee_resources - BEE_RESOURCE_NEW_BEE_COST, 0)
|
||||
var/mob/living/simple_animal/hostile/poison/bees/worker/B = new(src)
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = new(src)
|
||||
B.beehome = src
|
||||
B.assign_reagent(queen_bee.beegent)
|
||||
bees += B
|
||||
@@ -154,7 +147,7 @@
|
||||
if(honey_frames.len < BEEBOX_MAX_FRAMES)
|
||||
visible_message("<span class='notice'>[user] adds a frame to the apiary.</span>")
|
||||
user.unEquip(HF)
|
||||
HF.forceMove(src)
|
||||
HF.loc = src
|
||||
honey_frames += HF
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's no room for anymore frames in the apiary!</span>")
|
||||
@@ -171,7 +164,7 @@
|
||||
var/obj/item/queen_bee/qb = I
|
||||
user.unEquip(qb)
|
||||
|
||||
qb.queen.forceMove(src)
|
||||
qb.queen.loc = src
|
||||
bees += qb.queen
|
||||
queen_bee = qb.queen
|
||||
qb.queen = null
|
||||
@@ -180,12 +173,12 @@
|
||||
visible_message("<span class='notice'>[user] sets [qb] down inside the apiary, making it their new home.</span>")
|
||||
var/relocated = 0
|
||||
for(var/b in bees)
|
||||
var/mob/living/simple_animal/hostile/poison/bees/worker/B = b
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = b
|
||||
if(B.reagent_incompatible(queen_bee))
|
||||
bees -= B
|
||||
B.beehome = null
|
||||
if(B.loc == src)
|
||||
B.forceMove(get_turf(src))
|
||||
B.loc = get_turf(src)
|
||||
relocated++
|
||||
if(relocated)
|
||||
to_chat(user, "<span class='warning'>This queen has a different reagent to some of the bees who live here, those bees will not return to this apiary!</span>")
|
||||
@@ -197,58 +190,57 @@
|
||||
|
||||
|
||||
/obj/structure/beebox/attack_hand(mob/user)
|
||||
if(ishuman(user))
|
||||
if(!user.bee_friendly())
|
||||
//Time to get stung!
|
||||
var/bees = FALSE
|
||||
for(var/b in bees) //everyone who's ever lived here now instantly hates you, suck it assistant!
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = b
|
||||
if(B.isqueen)
|
||||
continue
|
||||
if(B.loc == src)
|
||||
B.forceMove(get_turf(src))
|
||||
B.target = user
|
||||
bees = TRUE
|
||||
if(bees)
|
||||
visible_message("<span class='danger'>[user] disturbs the bees!</span>")
|
||||
else
|
||||
var/option = input(user, "What Action do you wish to perform?", "Apiary") as null|anything in list("Remove a Honey Frame","Remove the Queen Bee")
|
||||
if(!Adjacent(user) || !option)
|
||||
return
|
||||
switch(option)
|
||||
if("Remove a Honey Frame")
|
||||
if(!honey_frames.len)
|
||||
to_chat(user, "<span class='warning'>There are no honey frames to remove!</span>")
|
||||
return
|
||||
if(!user.bee_friendly())
|
||||
//Time to get stung!
|
||||
var/bees = FALSE
|
||||
for(var/b in bees) //everyone who's ever lived here now instantly hates you, suck it assistant!
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = b
|
||||
if(B.isqueen)
|
||||
continue
|
||||
if(B.loc == src)
|
||||
B.loc = get_turf(src)
|
||||
B.target = user
|
||||
bees = TRUE
|
||||
if(bees)
|
||||
visible_message("<span class='danger'>[user] disturbs the bees!</span>")
|
||||
else
|
||||
var/option = alert(user, "What Action do you wish to perform?","Apiary","Remove a Honey Frame","Remove the Queen Bee")
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
switch(option)
|
||||
if("Remove a Honey Frame")
|
||||
if(!honey_frames.len)
|
||||
to_chat(user, "<span class='warning'>There are no honey frames to remove!</span>")
|
||||
return
|
||||
|
||||
var/obj/item/honey_frame/HF = pick_n_take(honey_frames)
|
||||
if(HF)
|
||||
if(!user.put_in_active_hand(HF))
|
||||
HF.forceMove(get_turf(src))
|
||||
visible_message("<span class='notice'>[user] removes a frame from the apiary.</span>")
|
||||
var/obj/item/honey_frame/HF = pick_n_take(honey_frames)
|
||||
if(HF)
|
||||
if(!user.put_in_active_hand(HF))
|
||||
HF.loc = get_turf(src)
|
||||
visible_message("<span class='notice'>[user] removes a frame from the apiary.</span>")
|
||||
|
||||
var/amtH = HF.honeycomb_capacity
|
||||
var/fallen = 0
|
||||
while(honeycombs.len && amtH) //let's pretend you always grab the frame with the most honeycomb on it
|
||||
var/obj/item/weapon/reagent_containers/honeycomb/HC = pick_n_take(honeycombs)
|
||||
if(HC)
|
||||
HC.forceMove(get_turf(src))
|
||||
amtH--
|
||||
fallen++
|
||||
if(fallen)
|
||||
var/multiple = fallen > 1
|
||||
visible_message("<span class='notice'>[user] scrapes [multiple ? "[fallen]" : "a"] honeycomb[multiple ? "s" : ""] off of the frame.</span>")
|
||||
var/amtH = HF.honeycomb_capacity
|
||||
var/fallen = 0
|
||||
while(honeycombs.len && amtH) //let's pretend you always grab the frame with the most honeycomb on it
|
||||
var/obj/item/weapon/reagent_containers/honeycomb/HC = pick_n_take(honeycombs)
|
||||
if(HC)
|
||||
HC.loc = get_turf(user)
|
||||
amtH--
|
||||
fallen++
|
||||
if(fallen)
|
||||
var/multiple = fallen > 1
|
||||
visible_message("<span class='notice'>[user] scrapes [multiple ? "[fallen]" : "a"] honeycomb[multiple ? "s" : ""] off of the frame.</span>")
|
||||
|
||||
if("Remove the Queen Bee")
|
||||
if(!queen_bee || queen_bee.loc != src)
|
||||
to_chat(user, "<span class='warning'>There is no queen bee to remove!</span>")
|
||||
return
|
||||
var/obj/item/queen_bee/QB = new()
|
||||
queen_bee.forceMove(QB)
|
||||
bees -= queen_bee
|
||||
QB.queen = queen_bee
|
||||
QB.name = queen_bee.name
|
||||
if(!user.put_in_active_hand(QB))
|
||||
QB.forceMove(get_turf(src))
|
||||
visible_message("<span class='notice'>[user] removes the queen from the apiary.</span>")
|
||||
queen_bee = null
|
||||
if("Remove the Queen Bee")
|
||||
if(!queen_bee || queen_bee.loc != src)
|
||||
to_chat(user, "<span class='warning'>There is no queen bee to remove!</span>")
|
||||
return
|
||||
var/obj/item/queen_bee/QB = new()
|
||||
queen_bee.loc = QB
|
||||
bees -= queen_bee
|
||||
QB.queen = queen_bee
|
||||
QB.name = queen_bee.name
|
||||
if(!user.put_in_active_hand(QB))
|
||||
QB.loc = get_turf(src)
|
||||
visible_message("<span class='notice'>[user] removes the queen from the apiary.</span>")
|
||||
queen_bee = null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/obj/item/clothing/head/beekeeper_head
|
||||
name = "beekeeper hat"
|
||||
desc = "Keeps the li'l buzzing buggers out of your eyes."
|
||||
desc = "Keeps the lil buzzing buggers out of your eyes."
|
||||
icon_state = "beekeeper"
|
||||
item_state = "beekeeper"
|
||||
flags = THICKMATERIAL
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/obj/item/clothing/suit/beekeeper_suit
|
||||
name = "beekeeper suit"
|
||||
desc = "Keeps the li'l buzzing buggers away from your squishy bits."
|
||||
desc = "Keeps the lil buzzing buggers away from your squishy bits."
|
||||
icon_state = "beekeeper"
|
||||
item_state = "beekeeper"
|
||||
flags = THICKMATERIAL
|
||||
allowed = list (/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/analyzer/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/bottle/fertilizer,/obj/item/weapon/minihoe)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
/obj/item/honey_frame
|
||||
name = "honey frame"
|
||||
desc = "a scaffold for bees to build honeycomb on"
|
||||
icon = 'icons/obj/apiary_bees.dmi'
|
||||
desc = "A scaffold for bees to build honeycomb on."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "honey_frame"
|
||||
var/honeycomb_capacity = 10 //10 Honeycomb per frame by default, researchable frames perhaps?
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/honeycomb
|
||||
name = "honeycomb"
|
||||
desc = "a hexagonal mesh of honeycomb"
|
||||
icon = 'icons/obj/apiary_bees.dmi'
|
||||
desc = "A hexagonal mesh of honeycomb."
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
icon_state = "honeycomb"
|
||||
possible_transfer_amounts = list()
|
||||
disease_amount = 0
|
||||
@@ -22,10 +22,10 @@
|
||||
overlays.Cut()
|
||||
var/image/honey
|
||||
if(honey_color)
|
||||
honey = image(icon = 'icons/obj/apiary_bees.dmi', icon_state = "greyscale_honey")
|
||||
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "greyscale_honey")
|
||||
honey.color = honey_color
|
||||
else
|
||||
honey = image(icon = 'icons/obj/apiary_bees.dmi', icon_state = "honey")
|
||||
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "honey")
|
||||
overlays += honey
|
||||
|
||||
|
||||
@@ -37,4 +37,4 @@
|
||||
reagents.add_reagent(R.id,5)
|
||||
else
|
||||
honey_color = ""
|
||||
update_icon()
|
||||
update_icon()
|
||||
@@ -0,0 +1,325 @@
|
||||
/obj/machinery/biogenerator
|
||||
name = "Biogenerator"
|
||||
desc = "Converts plants into biomass, which can be used to construct useful items."
|
||||
icon = 'icons/obj/biogenerator.dmi'
|
||||
icon_state = "biogen-empty"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 40
|
||||
var/processing = 0
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/points = 0
|
||||
var/menustat = "menu"
|
||||
var/efficiency = 0
|
||||
var/productivity = 0
|
||||
var/max_items = 40
|
||||
var/datum/research/files
|
||||
var/list/show_categories = list("Food", "Botany Chemicals", "Leather and Cloth")
|
||||
var/list/timesFiveCategories = list("Food", "Botany Chemicals")
|
||||
|
||||
/obj/machinery/biogenerator/New()
|
||||
..()
|
||||
files = new /datum/research/biogenerator(src)
|
||||
create_reagents(1000)
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/biogenerator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/biogenerator/Destroy()
|
||||
if(beaker)
|
||||
qdel(beaker)
|
||||
beaker = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/biogenerator/ex_act(severity)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity)
|
||||
|
||||
/obj/machinery/biogenerator/RefreshParts()
|
||||
var/E = 0
|
||||
var/P = 0
|
||||
var/max_storage = 40
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
P += B.rating
|
||||
max_storage = 40 * B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = E
|
||||
productivity = P
|
||||
max_items = max_storage
|
||||
|
||||
/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/biogenerator/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "biogen-empty-o"
|
||||
else if(!beaker)
|
||||
icon_state = "biogen-empty"
|
||||
else if(!processing)
|
||||
icon_state = "biogen-stand"
|
||||
else
|
||||
icon_state = "biogen-work"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attackby(obj/item/O, mob/user, params)
|
||||
if(user.a_intent == I_HARM)
|
||||
return ..()
|
||||
|
||||
if(processing)
|
||||
to_chat(user, "<span class='warning'>The biogenerator is currently processing.</span>")
|
||||
return
|
||||
|
||||
if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O))
|
||||
if(beaker)
|
||||
var/obj/item/weapon/reagent_containers/glass/B = beaker
|
||||
B.loc = loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
. = 1 //no afterattack
|
||||
if(!panel_open)
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A container is already loaded into the machine.</span>")
|
||||
else
|
||||
if(!user.drop_item())
|
||||
return
|
||||
O.loc = src
|
||||
beaker = O
|
||||
to_chat(user, "<span class='notice'>You add the container to the machine.</span>")
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Close the maintenance panel first.</span>")
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/obj/item/weapon/storage/bag/plants/PB = O
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= max_items)
|
||||
to_chat(user, "<span class='warning'>The biogenerator is already full! Activate it.</span>")
|
||||
else
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in PB.contents)
|
||||
if(i >= max_items)
|
||||
break
|
||||
PB.remove_from_storage(G, src)
|
||||
i++
|
||||
if(i<max_items)
|
||||
to_chat(user, "<span class='info'>You empty the plant bag into the biogenerator.</span>")
|
||||
else if(PB.contents.len == 0)
|
||||
to_chat(user, "<span class='info'>You empty the plant bag into the biogenerator, filling it to its capacity.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>You fill the biogenerator to its capacity.</span>")
|
||||
return 1 //no afterattack
|
||||
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= max_items)
|
||||
to_chat(user, "<span class='warning'>The biogenerator is full! Activate it.</span>")
|
||||
else
|
||||
user.unEquip(O)
|
||||
O.loc = src
|
||||
to_chat(user, "<span class='info'>You put [O.name] in [name]</span>")
|
||||
return 1 //no afterattack
|
||||
else if (istype(O, /obj/item/weapon/disk/design_disk))
|
||||
user.visible_message("[user] begins to load [O] in [src]...",
|
||||
"You begin to load a design from [O]...",
|
||||
"You hear the chatter of a floppy drive.")
|
||||
processing = 1
|
||||
var/obj/item/weapon/disk/design_disk/D = O
|
||||
if(do_after(user, 10, target = src))
|
||||
files.AddDesign2Known(D.blueprint)
|
||||
processing = 0
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You cannot put this in [name]!</span>")
|
||||
|
||||
/obj/machinery/biogenerator/interact(mob/user)
|
||||
if(stat & BROKEN || panel_open)
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(processing)
|
||||
dat += "<div class='statusDisplay'>Biogenerator is processing! Please wait...</div><BR>"
|
||||
else
|
||||
switch(menustat)
|
||||
if("nopoints")
|
||||
dat += "<div class='statusDisplay'>You do not have enough biomass to create products.<BR>Please, put growns into reactor and activate it.</div>"
|
||||
menustat = "menu"
|
||||
if("complete")
|
||||
dat += "<div class='statusDisplay'>Operation complete.</div>"
|
||||
menustat = "menu"
|
||||
if("void")
|
||||
dat += "<div class='statusDisplay'>Error: No growns inside.<BR>Please, put growns into reactor.</div>"
|
||||
menustat = "menu"
|
||||
if("nobeakerspace")
|
||||
dat += "<div class='statusDisplay'>Not enough space left in container. Unable to create product.</div>"
|
||||
menustat = "menu"
|
||||
if(beaker)
|
||||
var/categories = show_categories.Copy()
|
||||
for(var/V in categories)
|
||||
categories[V] = list()
|
||||
for(var/V in files.known_designs)
|
||||
var/datum/design/D = files.known_designs[V]
|
||||
for(var/C in categories)
|
||||
if(C in D.category)
|
||||
categories[C] += D
|
||||
|
||||
dat += "<div class='statusDisplay'>Biomass: [points] units.</div><BR>"
|
||||
dat += "<A href='?src=\ref[src];activate=1'>Activate</A><A href='?src=\ref[src];detach=1'>Detach Container</A>"
|
||||
for(var/cat in categories)
|
||||
dat += "<h3>[cat]:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
for(var/V in categories[cat])
|
||||
var/datum/design/D = V
|
||||
dat += "[D.name]: <A href='?src=\ref[src];create=\ref[D];amount=1'>Make</A>"
|
||||
if(cat in timesFiveCategories)
|
||||
dat += "<A href='?src=\ref[src];create=\ref[D];amount=5'>x5</A>"
|
||||
if(ispath(D.build_path, /obj/item/stack))
|
||||
dat += "<A href='?src=\ref[src];create=\ref[D];amount=10'>x10</A>"
|
||||
dat += "([D.materials[MAT_BIOMASS]/efficiency])<br>"
|
||||
dat += "</div>"
|
||||
else
|
||||
dat += "<div class='statusDisplay'>No container inside, please insert container.</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "biogen", name, 350, 520)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attack_hand(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/biogenerator/proc/activate()
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(stat != 0) //NOPOWER etc
|
||||
return
|
||||
if(processing)
|
||||
to_chat(usr, "<span class='warning'>The biogenerator is in the process of working.</span>")
|
||||
return
|
||||
var/S = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/I in contents)
|
||||
S += 5
|
||||
if(I.reagents.get_reagent_amount("nutriment") < 0.1)
|
||||
points += 1*productivity
|
||||
else
|
||||
points += I.reagents.get_reagent_amount("nutriment")*10*productivity
|
||||
qdel(I)
|
||||
if(S)
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
playsound(loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
use_power(S*30)
|
||||
sleep(S+15/productivity)
|
||||
processing = 0
|
||||
update_icon()
|
||||
else
|
||||
menustat = "void"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = 1)
|
||||
if(materials.len != 1 || materials[1] != MAT_BIOMASS)
|
||||
return 0
|
||||
if (materials[MAT_BIOMASS]*multiplier/efficiency > points)
|
||||
menustat = "nopoints"
|
||||
return 0
|
||||
else
|
||||
if(remove_points)
|
||||
points -= materials[MAT_BIOMASS]*multiplier/efficiency
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/proc/check_container_volume(list/reagents, multiplier = 1)
|
||||
var/sum_reagents = 0
|
||||
for(var/R in reagents)
|
||||
sum_reagents += reagents[R]
|
||||
sum_reagents *= multiplier
|
||||
|
||||
if(beaker.reagents.total_volume + sum_reagents > beaker.reagents.maximum_volume)
|
||||
menustat = "nobeakerspace"
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/proc/create_product(datum/design/D, amount)
|
||||
if(!beaker || !loc)
|
||||
return 0
|
||||
|
||||
if(ispath(D.build_path, /obj/item/stack))
|
||||
if(!check_container_volume(D.make_reagents, amount))
|
||||
return 0
|
||||
if(!check_cost(D.materials, amount))
|
||||
return 0
|
||||
|
||||
var/obj/item/stack/product = new D.build_path(loc)
|
||||
product.amount = amount
|
||||
for(var/R in D.make_reagents)
|
||||
beaker.reagents.add_reagent(R, D.make_reagents[R]*amount)
|
||||
else
|
||||
var/i = amount
|
||||
while(i > 0)
|
||||
if(!check_container_volume(D.make_reagents))
|
||||
return .
|
||||
if(!check_cost(D.materials))
|
||||
return .
|
||||
if(D.build_path)
|
||||
new D.build_path(loc)
|
||||
for(var/R in D.make_reagents)
|
||||
beaker.reagents.add_reagent(R, D.make_reagents[R])
|
||||
. = 1
|
||||
--i
|
||||
|
||||
menustat = "complete"
|
||||
update_icon()
|
||||
return .
|
||||
|
||||
/obj/machinery/biogenerator/proc/detach()
|
||||
if(beaker)
|
||||
beaker.loc = loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["activate"])
|
||||
activate()
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["detach"])
|
||||
detach()
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["create"])
|
||||
var/amount = (text2num(href_list["amount"]))
|
||||
var/datum/design/D = locate(href_list["create"])
|
||||
create_product(D, amount)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["menu"])
|
||||
menustat = "menu"
|
||||
updateUsrDialog()
|
||||
@@ -0,0 +1,420 @@
|
||||
/obj/machinery/plantgenes
|
||||
name = "plant DNA manipulator"
|
||||
desc = "An advanced device designed to manipulate plant genetic makeup."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "dnamod"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/obj/item/seeds/seed
|
||||
var/obj/item/weapon/disk/plantgene/disk
|
||||
|
||||
var/list/core_genes = list()
|
||||
var/list/reagent_genes = list()
|
||||
var/list/trait_genes = list()
|
||||
|
||||
var/datum/plant_gene/target
|
||||
var/operation = ""
|
||||
var/rating = 0
|
||||
var/max_extract_pot = 50
|
||||
// The cap on potency gene extraction.
|
||||
// This number is for T1, each upgraded part adds 5% for a tech level above T1.
|
||||
// At T4, it reaches 95%.
|
||||
|
||||
/obj/machinery/plantgenes/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/plantgenes(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
RefreshParts()
|
||||
|
||||
/obj/item/weapon/circuitboard/plantgenes
|
||||
name = "Plant DNA Manipulator (Machine Board)"
|
||||
build_path = /obj/machinery/plantgenes
|
||||
origin_tech = "programming=3;biotech=3"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1)
|
||||
|
||||
/obj/machinery/plantgenes/RefreshParts()
|
||||
rating = 0
|
||||
for(var/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/stock_parts))
|
||||
var/obj/item/weapon/stock_parts/S = I
|
||||
rating += S.rating-1
|
||||
max_extract_pot = initial(max_extract_pot) + rating*5
|
||||
|
||||
/obj/machinery/plantgenes/update_icon()
|
||||
..()
|
||||
overlays.Cut()
|
||||
if((stat & (BROKEN|NOPOWER)))
|
||||
icon_state = "dnamod-off"
|
||||
else
|
||||
icon_state = "dnamod"
|
||||
if(seed)
|
||||
overlays += "dnamod-dna"
|
||||
if(panel_open)
|
||||
overlays += "dnamod-open"
|
||||
|
||||
/obj/machinery/plantgenes/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "dnamod", "dnamod", I))
|
||||
update_icon()
|
||||
return
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/seeds))
|
||||
if(seed)
|
||||
to_chat(user, "<span class='warning'>A sample is already loaded into the machine!</span>")
|
||||
else
|
||||
if(!user.drop_item())
|
||||
return
|
||||
insert_seed(I)
|
||||
to_chat(user, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
interact(user)
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/disk/plantgene))
|
||||
if(disk)
|
||||
to_chat(user, "<span class='warning'>A data disk is already loaded into the machine!</span>")
|
||||
else
|
||||
if(!user.drop_item())
|
||||
return
|
||||
disk = I
|
||||
disk.loc = src
|
||||
to_chat(user, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
interact(user)
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/plantgenes/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
if(!user)
|
||||
return
|
||||
|
||||
var/datum/browser/popup = new(user, "plantdna", "Plant DNA Manipulator", 450, 600)
|
||||
if(!(in_range(src, user) || issilicon(user)))
|
||||
popup.close()
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
|
||||
if(operation)
|
||||
if(!seed || (!target && operation != "insert"))
|
||||
operation = ""
|
||||
target = null
|
||||
interact(user)
|
||||
return
|
||||
if((operation == "replace" || operation == "insert") && (!disk || !disk.gene))
|
||||
operation = ""
|
||||
target = null
|
||||
interact(user)
|
||||
return
|
||||
|
||||
dat += "<div class='line'><h3>Confirm Operation</h3></div>"
|
||||
dat += "<div class='statusDisplay'>Are you sure you want to [operation] "
|
||||
switch(operation)
|
||||
if("remove")
|
||||
dat += "<span class='highlight'>[target.get_name()]</span> gene from \the <span class='highlight'>[seed]</span>?<br>"
|
||||
if("extract")
|
||||
dat += "<span class='highlight'>[target.get_name()]</span> gene from \the <span class='highlight'>[seed]</span>?<br>"
|
||||
dat += "<span class='bad'>The sample will be destroyed in process!</span>"
|
||||
if(istype(target, /datum/plant_gene/core/potency))
|
||||
var/datum/plant_gene/core/gene = target
|
||||
if(gene.value > max_extract_pot)
|
||||
dat += "<br><br>This device's extraction capabilities are currently limited to [max_extract_pot] potency. "
|
||||
dat += "Target gene will be degraded to [max_extract_pot] potency on extraction."
|
||||
if("replace")
|
||||
dat += "<span class='highlight'>[target.get_name()]</span> gene with <span class='highlight'>[disk.gene.get_name()]</span>?<br>"
|
||||
if("insert")
|
||||
dat += "<span class='highlight'>[disk.gene.get_name()]</span> gene into \the <span class='highlight'>[seed]</span>?<br>"
|
||||
dat += "</div><div class='line'><a href='?src=\ref[src];gene=\ref[target];op=[operation]'>Confirm</a> "
|
||||
dat += "<a href='?src=\ref[src];abort=1'>Abort</a></div>"
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
dat+= "<div class='statusDisplay'>"
|
||||
|
||||
dat += "<div class='line'><div class='statusLabel'>Plant Sample:</div><div class='statusValue'><a href='?src=\ref[src];eject_seed=1'>"
|
||||
dat += seed ? seed.name : "None"
|
||||
dat += "</a></div></div>"
|
||||
|
||||
dat += "<div class='line'><div class='statusLabel'>Data Disk:</div><div class='statusValue'><a href='?src=\ref[src];eject_disk=1'>"
|
||||
if(!disk)
|
||||
dat += "None"
|
||||
else if(!disk.gene)
|
||||
dat += "Empty Disk"
|
||||
else
|
||||
dat += disk.gene.get_name()
|
||||
if(disk && disk.read_only)
|
||||
dat += " (RO)"
|
||||
dat += "</a></div></div>"
|
||||
|
||||
dat += "<br></div>"
|
||||
|
||||
if(seed)
|
||||
var/can_insert = disk && disk.gene && disk.gene.can_add(seed)
|
||||
var/can_extract = disk && !disk.read_only
|
||||
|
||||
dat += "<div class='line'><h3>Core Genes</h3></div><div class='statusDisplay'><table>"
|
||||
for(var/a in core_genes)
|
||||
var/datum/plant_gene/G = a
|
||||
if(!G)
|
||||
continue
|
||||
dat += "<tr><td width='260px'>[G.get_name()]</td><td>"
|
||||
if(can_extract)
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=extract'>Extract</a>"
|
||||
if(can_insert && istype(disk.gene, G.type))
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=replace'>Replace</a>"
|
||||
dat += "</td></tr>"
|
||||
dat += "</table></div>"
|
||||
|
||||
if(seed.yield != -1)
|
||||
dat += "<div class='line'><h3>Content Genes</h3></div><div class='statusDisplay'>"
|
||||
if(reagent_genes.len)
|
||||
dat += "<table>"
|
||||
for(var/a in reagent_genes)
|
||||
var/datum/plant_gene/G = a
|
||||
dat += "<tr><td width='260px'>[G.get_name()]</td><td>"
|
||||
if(can_extract)
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=extract'>Extract</a>"
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=remove'>Remove</a>"
|
||||
dat += "</td></tr>"
|
||||
dat += "</table>"
|
||||
else
|
||||
dat += "No content-related genes detected in sample.<br>"
|
||||
dat += "</div>"
|
||||
if(can_insert && istype(disk.gene, /datum/plant_gene/reagent))
|
||||
dat += "<a href='?src=\ref[src];op=insert'>Insert: [disk.gene.get_name()]</a>"
|
||||
|
||||
dat += "<div class='line'><h3>Trait Genes</h3></div><div class='statusDisplay'>"
|
||||
if(trait_genes.len)
|
||||
dat += "<table>"
|
||||
for(var/a in trait_genes)
|
||||
var/datum/plant_gene/G = a
|
||||
dat += "<tr><td width='260px'>[G.get_name()]</td><td>"
|
||||
if(can_extract)
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=extract'>Extract</a>"
|
||||
dat += "<a href='?src=\ref[src];gene=\ref[G];op=remove'>Remove</a>"
|
||||
dat += "</td></tr>"
|
||||
dat += "</table>"
|
||||
else
|
||||
dat += "No trait-related genes detected in sample.<br>"
|
||||
if(can_insert && istype(disk.gene, /datum/plant_gene/trait))
|
||||
dat += "<a href='?src=\ref[src];op=insert'>Insert: [disk.gene.get_name()]</a>"
|
||||
dat += "</div>"
|
||||
else
|
||||
dat += "<br>No sample found.<br><span class='highlight'>Please, insert a plant sample to use this device.</span>"
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
/obj/machinery/plantgenes/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["eject_seed"] && !operation)
|
||||
if (seed)
|
||||
seed.loc = loc
|
||||
seed.verb_pickup()
|
||||
seed = null
|
||||
update_genes()
|
||||
update_icon()
|
||||
else
|
||||
var/obj/item/I = usr.get_active_held_item()
|
||||
if (istype(I, /obj/item/seeds))
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
insert_seed(I)
|
||||
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
update_icon()
|
||||
else if(href_list["eject_disk"] && !operation)
|
||||
if (disk)
|
||||
disk.loc = loc
|
||||
disk.verb_pickup()
|
||||
disk = null
|
||||
update_genes()
|
||||
else
|
||||
var/obj/item/I = usr.get_active_held_item()
|
||||
if(istype(I, /obj/item/weapon/disk/plantgene))
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
disk = I
|
||||
disk.loc = src
|
||||
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
else if(href_list["op"] == "insert" && disk && disk.gene && seed)
|
||||
if(!operation) // Wait for confirmation
|
||||
operation = "insert"
|
||||
else
|
||||
if(!istype(disk.gene, /datum/plant_gene/core) && disk.gene.can_add(seed))
|
||||
seed.genes += disk.gene.Copy()
|
||||
if(istype(disk.gene, /datum/plant_gene/reagent))
|
||||
seed.reagents_from_genes()
|
||||
update_genes()
|
||||
repaint_seed()
|
||||
operation = ""
|
||||
target = null
|
||||
|
||||
else if(href_list["gene"] && seed)
|
||||
var/datum/plant_gene/G = seed.get_gene(href_list["gene"])
|
||||
if(!G || !href_list["op"] || !(href_list["op"] in list("remove", "extract", "replace")))
|
||||
interact(usr)
|
||||
return
|
||||
|
||||
if(!operation || target != G) // Wait for confirmation
|
||||
target = G
|
||||
operation = href_list["op"]
|
||||
|
||||
else if(operation == href_list["op"] && target == G)
|
||||
switch(href_list["op"])
|
||||
if("remove")
|
||||
if(!istype(G, /datum/plant_gene/core))
|
||||
seed.genes -= G
|
||||
if(istype(G, /datum/plant_gene/reagent))
|
||||
seed.reagents_from_genes()
|
||||
repaint_seed()
|
||||
if("extract")
|
||||
if(disk && !disk.read_only)
|
||||
disk.gene = G
|
||||
if(istype(G, /datum/plant_gene/core/potency))
|
||||
var/datum/plant_gene/core/gene = G
|
||||
gene.value = min(gene.value, max_extract_pot)
|
||||
disk.update_name()
|
||||
qdel(seed)
|
||||
seed = null
|
||||
update_icon()
|
||||
if("replace")
|
||||
if(disk && disk.gene && istype(disk.gene, G.type) && istype(G, /datum/plant_gene/core))
|
||||
seed.genes -= G
|
||||
var/datum/plant_gene/core/C = disk.gene.Copy()
|
||||
seed.genes += C
|
||||
C.apply_stat(seed)
|
||||
repaint_seed()
|
||||
if("insert")
|
||||
if(disk && disk.gene && !istype(disk.gene, /datum/plant_gene/core) && disk.gene.can_add(seed))
|
||||
seed.genes += disk.gene.Copy()
|
||||
if(istype(disk.gene, /datum/plant_gene/reagent))
|
||||
seed.reagents_from_genes()
|
||||
repaint_seed()
|
||||
|
||||
update_genes()
|
||||
operation = ""
|
||||
target = null
|
||||
else if(href_list["abort"])
|
||||
operation = ""
|
||||
target = null
|
||||
|
||||
interact(usr)
|
||||
|
||||
/obj/machinery/plantgenes/proc/insert_seed(obj/item/seeds/S)
|
||||
if(!istype(S) || seed)
|
||||
return
|
||||
S.loc = src
|
||||
seed = S
|
||||
update_genes()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/plantgenes/proc/update_genes()
|
||||
core_genes = list()
|
||||
reagent_genes = list()
|
||||
trait_genes = list()
|
||||
|
||||
if(seed)
|
||||
var/gene_paths = list(
|
||||
/datum/plant_gene/core/potency,
|
||||
/datum/plant_gene/core/yield,
|
||||
/datum/plant_gene/core/production,
|
||||
/datum/plant_gene/core/endurance,
|
||||
/datum/plant_gene/core/lifespan,
|
||||
/datum/plant_gene/core/weed_rate,
|
||||
/datum/plant_gene/core/weed_chance
|
||||
)
|
||||
for(var/a in gene_paths)
|
||||
core_genes += seed.get_gene(a)
|
||||
|
||||
for(var/datum/plant_gene/reagent/G in seed.genes)
|
||||
reagent_genes += G
|
||||
for(var/datum/plant_gene/trait/G in seed.genes)
|
||||
trait_genes += G
|
||||
|
||||
/obj/machinery/plantgenes/proc/repaint_seed()
|
||||
if(!seed)
|
||||
return
|
||||
if(copytext(seed.name, 1, 13) == "experimental")
|
||||
return // Already modded name and icon
|
||||
seed.name = "experimental " + seed.name
|
||||
seed.icon_state = "seed-x"
|
||||
|
||||
/*
|
||||
* Plant DNA disk
|
||||
*/
|
||||
|
||||
/obj/item/weapon/disk/plantgene
|
||||
name = "plant data disk"
|
||||
desc = "A disk for storing plant genetic data."
|
||||
icon_state = "datadisk2"
|
||||
materials = list(MAT_METAL=30, MAT_GLASS=10)
|
||||
var/datum/plant_gene/gene
|
||||
var/read_only = 0 //Well, it's still a floppy disk
|
||||
|
||||
/obj/item/weapon/disk/plantgene/New()
|
||||
..()
|
||||
overlays += "datadisk_gene"
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/weapon/disk/plantgene/attackby(obj/item/weapon/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = stripped_input(user, "What would you like the label to be?", name, null)
|
||||
if(user.get_active_held_item() != W)
|
||||
return
|
||||
if(!in_range(src, user) && loc != user)
|
||||
return
|
||||
if(t)
|
||||
name = "plant data disk - '[t]'"
|
||||
else
|
||||
name = "plant data disk"
|
||||
|
||||
/obj/item/weapon/disk/plantgene/proc/update_name()
|
||||
if(gene)
|
||||
name = "plant data disk - '[gene.get_name()]'"
|
||||
else
|
||||
name = "plant data disk"
|
||||
|
||||
/obj/item/weapon/disk/plantgene/attack_self(mob/user)
|
||||
read_only = !read_only
|
||||
to_chat(user, "<span class='notice'>You flip the write-protect tab to [read_only ? "protected" : "unprotected"].</span>")
|
||||
|
||||
/obj/item/weapon/disk/plantgene/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "The write-protect tab is set to [read_only ? "protected" : "unprotected"].")
|
||||
|
||||
|
||||
/*
|
||||
* Plant DNA Disks Box
|
||||
*/
|
||||
/obj/item/weapon/storage/box/disks_plantgene
|
||||
name = "plant data disks box"
|
||||
icon_state = "disk_kit"
|
||||
|
||||
/obj/item/weapon/storage/box/disks_plantgene/New()
|
||||
..()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/weapon/disk/plantgene(src)
|
||||
+140
-520
@@ -1,535 +1,155 @@
|
||||
//Grown foods.
|
||||
// ***********************************************************
|
||||
// Foods that are produced from hydroponics ~~~~~~~~~~
|
||||
// Data from the seeds carry over to these grown foods
|
||||
// ***********************************************************
|
||||
|
||||
// Base type. Subtypes are found in /grown dir.
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
name = "fruit"
|
||||
icon = 'icons/obj/hydroponics_products.dmi'
|
||||
icon_state = "blank"
|
||||
desc = "Nutritious! Probably."
|
||||
|
||||
var/plantname
|
||||
var/datum/seed/seed
|
||||
var/potency = -1
|
||||
var/awakening = 0
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item.
|
||||
var/plantname = ""
|
||||
var/bitesize_mod = 0
|
||||
var/splat_type = /obj/effect/decal/cleanable/plant_smudge
|
||||
// If set, bitesize = 1 + round(reagents.total_volume / bitesize_mod)
|
||||
dried_type = -1
|
||||
// Saves us from having to define each stupid grown's dried_type as itself.
|
||||
// If you don't want a plant to be driable (watermelons) set this to null in the time definition.
|
||||
burn_state = FLAMMABLE
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc,planttype)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc, var/obj/item/seeds/new_seed = null)
|
||||
..()
|
||||
if(!dried_type)
|
||||
if(new_seed)
|
||||
seed = new_seed.Copy()
|
||||
else if(ispath(seed))
|
||||
// This is for adminspawn or map-placed growns. They get the default stats of their seed type.
|
||||
seed = new seed()
|
||||
seed.adjust_potency(50-seed.potency)
|
||||
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
if(dried_type == -1)
|
||||
dried_type = type
|
||||
src.pixel_x = rand(-5.0, 5)
|
||||
src.pixel_y = rand(-5.0, 5)
|
||||
|
||||
// Fill the object up with the appropriate reagents.
|
||||
if(planttype)
|
||||
plantname = planttype
|
||||
|
||||
if(!plantname)
|
||||
return
|
||||
|
||||
if(!plant_controller)
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
to_chat(world, "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
seed = plant_controller.seeds[plantname]
|
||||
|
||||
if(!seed)
|
||||
return
|
||||
|
||||
name = "[seed.seed_name]"
|
||||
|
||||
if(seed.modular_icon == 1)
|
||||
update_icon()
|
||||
else
|
||||
icon = 'icons/obj/harvest.dmi'
|
||||
icon_state = seed.preset_icon
|
||||
|
||||
if(!seed.chems)
|
||||
return
|
||||
|
||||
potency = seed.get_trait(TRAIT_POTENCY)
|
||||
|
||||
for(var/rid in seed.chems)
|
||||
var/list/reagent_data = seed.chems[rid]
|
||||
if(reagent_data && reagent_data.len)
|
||||
var/rtotal = reagent_data[1]
|
||||
if(reagent_data.len > 1 && potency > 0)
|
||||
rtotal += round(potency/reagent_data[2])
|
||||
reagents.add_reagent(rid,max(1,rtotal))
|
||||
update_desc()
|
||||
update_trash()
|
||||
if(reagents.total_volume > 0)
|
||||
bitesize = 1+round(reagents.total_volume / 2, 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_trash()
|
||||
if(!seed)
|
||||
return
|
||||
trash = seed.trash_type
|
||||
if(seed.kitchen_tag)
|
||||
if(seed.kitchen_tag == "watermelon") // 15% chance to leave behind a pack of watermelon seeds
|
||||
if(prob(15))
|
||||
var/obj/item/seeds/seeds = new()
|
||||
seeds.seed = seed
|
||||
seeds.update_seed()
|
||||
trash = seeds
|
||||
else
|
||||
trash = null
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_desc()
|
||||
|
||||
if(!seed)
|
||||
return
|
||||
if(!plant_controller)
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
to_chat(world, "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(plant_controller.product_descs["[seed.uid]"])
|
||||
desc = plant_controller.product_descs["[seed.uid]"]
|
||||
else
|
||||
var/list/descriptors = list()
|
||||
if(reagents.has_reagent("sugar") || reagents.has_reagent("cherryjelly") || reagents.has_reagent("honey") || reagents.has_reagent("berryjuice"))
|
||||
descriptors |= "sweet"
|
||||
if(reagents.has_reagent("charcoal"))
|
||||
descriptors |= "astringent"
|
||||
if(reagents.has_reagent("frostoil"))
|
||||
descriptors |= "numbing"
|
||||
if(reagents.has_reagent("nutriment"))
|
||||
descriptors |= "nutritious"
|
||||
if(reagents.has_reagent("condensedcapsaicin") || reagents.has_reagent("capsaicin"))
|
||||
descriptors |= "spicy"
|
||||
if(reagents.has_reagent("cocoa"))
|
||||
descriptors |= "bitter"
|
||||
if(reagents.has_reagent("orangejuice") || reagents.has_reagent("lemonjuice") || reagents.has_reagent("limejuice"))
|
||||
descriptors |= "sweet-sour"
|
||||
if(reagents.has_reagent("radium") || reagents.has_reagent("uranium"))
|
||||
descriptors |= "radioactive"
|
||||
if(reagents.has_reagent("amanitin") || reagents.has_reagent("toxin") || reagents.has_reagent("carpotoxin"))
|
||||
descriptors |= "poisonous"
|
||||
if(reagents.has_reagent("lsd") || reagents.has_reagent("space_drugs") || reagents.has_reagent("psilocybin"))
|
||||
descriptors |= "hallucinogenic"
|
||||
if(reagents.has_reagent("styptic_powder"))
|
||||
descriptors |= "medicinal"
|
||||
if(reagents.has_reagent("gold") || reagents.has_reagent("silver"))
|
||||
descriptors |= "shiny"
|
||||
if(reagents.has_reagent("lube"))
|
||||
descriptors |= "slippery"
|
||||
if(reagents.has_reagent("facid") || reagents.has_reagent("sacid"))
|
||||
descriptors |= "acidic"
|
||||
if(reagents.has_reagent("fuel"))
|
||||
descriptors |= "flammable"
|
||||
if(reagents.has_reagent("moonshine"))
|
||||
descriptors |= "intoxicating"
|
||||
if(seed.get_trait(TRAIT_JUICY))
|
||||
descriptors |= "juicy"
|
||||
if(seed.get_trait(TRAIT_STINGS))
|
||||
descriptors |= "stinging"
|
||||
if(seed.get_trait(TRAIT_TELEPORTING))
|
||||
descriptors |= "glowing"
|
||||
if(seed.get_trait(TRAIT_EXPLOSIVE))
|
||||
descriptors |= "bulbous"
|
||||
|
||||
var/descriptor_num = rand(2,4)
|
||||
var/descriptor_count = descriptor_num
|
||||
desc = "A"
|
||||
while(descriptors.len && descriptor_num > 0)
|
||||
var/chosen = pick(descriptors)
|
||||
descriptors -= chosen
|
||||
desc += "[(descriptor_count>1 && descriptor_count!=descriptor_num) ? "," : "" ] [chosen]"
|
||||
descriptor_num--
|
||||
if(seed.seed_noun == "spores")
|
||||
desc += " mushroom"
|
||||
else
|
||||
desc += " fruit"
|
||||
plant_controller.product_descs["[seed.uid]"] = desc
|
||||
desc += ". Delicious! Probably."
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/update_icon()
|
||||
if(!seed || !plant_controller || !plant_controller.plant_icon_cache)
|
||||
return
|
||||
if(seed.modular_icon != 1)
|
||||
return
|
||||
overlays.Cut()
|
||||
var/image/plant_icon
|
||||
var/icon_key = "fruit-[seed.get_trait(TRAIT_PRODUCT_ICON)]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"
|
||||
if(plant_controller.plant_icon_cache[icon_key])
|
||||
plant_icon = plant_controller.plant_icon_cache[icon_key]
|
||||
else
|
||||
plant_icon = image('icons/obj/hydroponics_products.dmi',"blank")
|
||||
var/image/fruit_base = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-product")
|
||||
fruit_base.color = "[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"
|
||||
plant_icon.overlays |= fruit_base
|
||||
if("[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf" in icon_states('icons/obj/hydroponics_products.dmi'))
|
||||
var/image/fruit_leaves = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf")
|
||||
fruit_leaves.color = "[seed.get_trait(TRAIT_PLANT_COLOUR)]"
|
||||
plant_icon.overlays |= fruit_leaves
|
||||
plant_controller.plant_icon_cache[icon_key] = plant_icon
|
||||
overlays |= plant_icon
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/Crossed(var/mob/living/M)
|
||||
if(seed && seed.get_trait(TRAIT_JUICY) == 2)
|
||||
if(istype(M))
|
||||
|
||||
if(M.buckled)
|
||||
return
|
||||
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.shoes && H.shoes.flags & NOSLIP)
|
||||
return
|
||||
|
||||
M.stop_pulling()
|
||||
to_chat(M, "<span class='notice'>You slipped on the [name]!</span>")
|
||||
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
M.Stun(8)
|
||||
M.Weaken(5)
|
||||
seed.thrown_at(src,M)
|
||||
sleep(-1)
|
||||
if(src) qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
|
||||
..()
|
||||
if(seed) seed.thrown_at(src,hit_atom)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
|
||||
if(seed)
|
||||
if(seed.get_trait(TRAIT_PRODUCES_POWER) && istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.use(5))
|
||||
//TODO: generalize this.
|
||||
to_chat(user, "<span class='notice'>You add some cable to the [src.name] and slide it inside the battery casing.</span>")
|
||||
var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(get_turf(user))
|
||||
if(src.loc == user && !(user.l_hand && user.r_hand) && istype(user,/mob/living/carbon/human))
|
||||
user.put_in_hands(pocell)
|
||||
pocell.maxcharge = src.potency * 10
|
||||
pocell.charge = pocell.maxcharge
|
||||
qdel(src)
|
||||
return
|
||||
else if(W.sharp)
|
||||
var/reagents_per_slice
|
||||
var/obj/slice
|
||||
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
|
||||
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
|
||||
new /obj/item/clothing/head/hardhat/pumpkinhead (user.loc)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.kitchen_tag == "potato")
|
||||
to_chat(user, "You slice \the [src] into sticks.")
|
||||
reagents_per_slice = reagents.total_volume
|
||||
slice = new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(get_turf(src))
|
||||
reagents.trans_to(slice, reagents_per_slice)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.kitchen_tag == "carrot")
|
||||
to_chat(user, "You slice \the [src] into sticks.")
|
||||
reagents_per_slice = reagents.total_volume
|
||||
slice = new /obj/item/weapon/reagent_containers/food/snacks/carrotfries(get_turf(src))
|
||||
reagents.trans_to(slice, reagents_per_slice)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.kitchen_tag == "watermelon")
|
||||
to_chat(user, "You slice \the [src] into large slices.")
|
||||
reagents_per_slice = reagents.total_volume/5
|
||||
for(var/i=0,i<5,i++)
|
||||
slice = new /obj/item/weapon/reagent_containers/food/snacks/watermelonslice(get_turf(src))
|
||||
reagents.trans_to(slice, reagents_per_slice)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.kitchen_tag == "soybeans")
|
||||
to_chat(user, "You roughly chop up \the [src].")
|
||||
reagents_per_slice = reagents.total_volume
|
||||
slice = new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src))
|
||||
reagents.trans_to(slice, reagents_per_slice)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.chems)
|
||||
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
|
||||
user.show_message("<span class='notice'>You make planks out of \the [src]!</span>", 1)
|
||||
for(var/i=0,i<2,i++)
|
||||
var/obj/item/stack/sheet/wood/NG = new (user.loc)
|
||||
NG.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
for(var/obj/item/stack/sheet/wood/G in user.loc)
|
||||
if(G==NG)
|
||||
continue
|
||||
if(G.amount>=G.max_amount)
|
||||
continue
|
||||
G.attackby(NG, user)
|
||||
to_chat(user, "You add the newly-formed wood to the stack. It now contains [NG.amount] planks.")
|
||||
qdel(src)
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/rollingpaper))
|
||||
if(seed.kitchen_tag == "ambrosia" || seed.kitchen_tag == "ambrosiadeus" || seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
|
||||
user.unEquip(W)
|
||||
if(seed.kitchen_tag == "ambrosia")
|
||||
var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc)
|
||||
J.chem_volume = src.reagents.total_volume
|
||||
src.reagents.trans_to(J, J.chem_volume)
|
||||
qdel(W)
|
||||
user.put_in_active_hand(J)
|
||||
else if(seed.kitchen_tag == "ambrosiadeus")
|
||||
var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc)
|
||||
J.chem_volume = src.reagents.total_volume
|
||||
src.reagents.trans_to(J, J.chem_volume)
|
||||
qdel(W)
|
||||
user.put_in_active_hand(J)
|
||||
else if(seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
|
||||
var/obj/item/clothing/mask/cigarette/handroll/J = new /obj/item/clothing/mask/cigarette/handroll(user.loc)
|
||||
J.chem_volume = src.reagents.total_volume
|
||||
src.reagents.trans_to(J, J.chem_volume)
|
||||
qdel(W)
|
||||
user.put_in_active_hand(J)
|
||||
to_chat(user, "\blue You roll the [src] into a rolling paper.")
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "\red You can't roll a smokable from the [src].")
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_new(src, newloc)
|
||||
seed.prepare_result(src)
|
||||
transform *= TransformUsingVariable(seed.potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency!
|
||||
add_juice()
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attack(var/mob/living/carbon/M, var/mob/user, var/def_zone)
|
||||
if(awakening)
|
||||
to_chat(user, "<span class='warning'>The [src] is twitching and shaking, preventing you from eating it.</span>")
|
||||
return
|
||||
if(user == M)
|
||||
return ..()
|
||||
|
||||
if(user.a_intent == I_HARM)
|
||||
|
||||
// This is being copypasted here because reagent_containers (WHY DOES FOOD DESCEND FROM THAT) overrides it completely.
|
||||
// TODO: refactor all food paths to be less horrible and difficult to work with in this respect. ~Z
|
||||
if(!istype(M)) return 0
|
||||
|
||||
if(!def_zone)
|
||||
def_zone = check_zone(user.zone_sel.selecting)
|
||||
|
||||
user.lastattacked = M
|
||||
M.lastattacker = user
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
|
||||
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [key_name(user)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
|
||||
msg_admin_attack("[key_name_admin(user)] attacked [key_name_admin(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/hit = H.attacked_by(src, user, def_zone)
|
||||
if(hit && hitsound)
|
||||
playsound(loc, hitsound, 50, 1, -1)
|
||||
//return hit
|
||||
else
|
||||
if(attack_verb.len)
|
||||
user.visible_message("<span class='danger'>[M] has been [pick(attack_verb)] with [src] by [user]!</span>")
|
||||
else
|
||||
user.visible_message("<span class='danger'>[M] has been attacked with [src] by [user]!</span>")
|
||||
|
||||
if(hitsound)
|
||||
playsound(loc, hitsound, 50, 1, -1)
|
||||
switch(damtype)
|
||||
if("brute")
|
||||
M.take_organ_damage(force)
|
||||
if(prob(33))
|
||||
var/turf/simulated/location = get_turf(M)
|
||||
if(istype(location)) location.add_blood_floor(M)
|
||||
if("fire")
|
||||
M.take_organ_damage(0, force)
|
||||
M.updatehealth()
|
||||
|
||||
if(seed && seed.get_trait(TRAIT_CARNIVOROUS))
|
||||
seed.do_thorns(M, src, def_zone)
|
||||
|
||||
if(ishuman(M) && seed && seed.get_trait(TRAIT_STINGS))
|
||||
if(!reagents || reagents.total_volume <= 0)
|
||||
return
|
||||
seed.do_sting(M, src, def_zone)
|
||||
reagents.remove_any(rand(1,3)) //use up some of the reagents at random
|
||||
sleep(-1)
|
||||
if(!src)
|
||||
return
|
||||
if(reagents && reagents.total_volume <= 0) //used-up fruit will be destroyed
|
||||
if(user)
|
||||
to_chat(user, "<span class='danger'>\The [src] has dried out and crumbles to dust.</span>")
|
||||
//user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
else if(prob(35)) //fruit that still has reagents has a chance of breaking each time it stings on hit
|
||||
if(user)
|
||||
to_chat(user, "<span class='danger'>\The [src] has fallen to bits.</span>")
|
||||
//user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
|
||||
add_fingerprint(user)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/add_juice()
|
||||
if(reagents)
|
||||
if(bitesize_mod)
|
||||
bitesize = 1 + round(reagents.total_volume / bitesize_mod)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attack_self(mob/user as mob)
|
||||
|
||||
if(!seed)
|
||||
return
|
||||
|
||||
if(istype(user.loc,/turf/space))
|
||||
return
|
||||
|
||||
if(user.a_intent == I_HARM)
|
||||
user.visible_message("<span class='danger'>\The [user] squashes \the [src]!</span>")
|
||||
seed.thrown_at(src,user)
|
||||
sleep(-1)
|
||||
if(src) qdel(src)
|
||||
return
|
||||
|
||||
if(user.a_intent == I_DISARM && seed.get_trait(TRAIT_SPREAD) > 0) //Using disarm so we can tell if you want to plant or convert non-final plants
|
||||
to_chat(user, "<span class='notice'>You plant the [src.name].</span>")
|
||||
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
|
||||
new /obj/effect/plant(get_turf(user), src.seed)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
if(!seed.final_form) //This isn't even my final form! (sorry, it had to be done)
|
||||
switch(seed.kitchen_tag)
|
||||
if("comfrey")
|
||||
var/obj/item/stack/medical/bruise_pack/comfrey/poultice = new /obj/item/stack/medical/bruise_pack/comfrey(user.loc)
|
||||
poultice.heal_brute = potency
|
||||
to_chat(user, "<span class='notice'>You mash the leaves into a poultice.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
if("aloe")
|
||||
var/obj/item/stack/medical/ointment/aloe/poultice = new /obj/item/stack/medical/ointment/aloe(user.loc)
|
||||
poultice.heal_burn = potency
|
||||
to_chat(user, "<span class='notice'>You mash the petals into a poultice.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
if("grass")
|
||||
user.show_message("<span class='notice'>You make a grass tile out of \the [src]!</span>", 1)
|
||||
for(var/i=0,i<2,i++)
|
||||
var/obj/item/stack/tile/grass/G = new (user.loc)
|
||||
G.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
for(var/obj/item/stack/tile/grass/NG in user.loc)
|
||||
if(G==NG)
|
||||
continue
|
||||
if(NG.amount>=NG.max_amount)
|
||||
continue
|
||||
NG.attackby(G, user)
|
||||
to_chat(user, "You add the newly-formed grass to the stack. It now contains [G.amount] tiles.")
|
||||
qdel(src)
|
||||
return
|
||||
if("sunflower")
|
||||
var/obj/item/weapon/grown/sunflower/SF = new /obj/item/weapon/grown/sunflower(user.loc)
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(SF)
|
||||
qdel(src)
|
||||
return
|
||||
if("novaflower")
|
||||
var/obj/item/weapon/grown/novaflower/NF = new /obj/item/weapon/grown/novaflower(user.loc)
|
||||
if(prob(10))
|
||||
user.say("PRAISE THE SUN!")
|
||||
else
|
||||
to_chat(user, "PRAISE THE SUN!")
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(NF)
|
||||
qdel(src)
|
||||
return
|
||||
if("nettle")
|
||||
var/obj/item/weapon/grown/nettle/nettle = new /obj/item/weapon/grown/nettle(user.loc)
|
||||
nettle.force = round((5 + potency / 5), 1)
|
||||
to_chat(user, "You straighten up the plant.")
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(nettle)
|
||||
qdel(src)
|
||||
return
|
||||
if("deathnettle")
|
||||
var/obj/item/weapon/grown/nettle/death/DN = new /obj/item/weapon/grown/nettle/death(user.loc)
|
||||
DN.force = round((5 + potency / 2.5), 1)
|
||||
to_chat(user, "You straighten up the plant.")
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(DN)
|
||||
qdel(src)
|
||||
return
|
||||
if("killertomato")
|
||||
if(awakening || istype(user.loc,/turf/space))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin to awaken the Killer Tomato...</span>")
|
||||
awakening = 1
|
||||
|
||||
spawn(30)
|
||||
if(!qdeleted(src))
|
||||
var/mob/living/simple_animal/hostile/killertomato/K = new /mob/living/simple_animal/hostile/killertomato(get_turf(src.loc))
|
||||
var/endurance_value = seed.get_trait(TRAIT_ENDURANCE)
|
||||
K.maxHealth += round(endurance_value / 3)
|
||||
K.melee_damage_lower += round(potency / 10)
|
||||
K.melee_damage_upper += round(potency / 10)
|
||||
var/production_value = seed.get_trait(TRAIT_PRODUCTION)
|
||||
K.move_to_delay -= round(production_value / 50)
|
||||
K.health = K.maxHealth
|
||||
K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>")
|
||||
if(user)
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
if("cashpod")
|
||||
to_chat(user, "You crack open the cash pod...")
|
||||
var/value = round(seed.get_trait(TRAIT_POTENCY))
|
||||
user.unEquip(src)
|
||||
switch(value)
|
||||
if(0)
|
||||
to_chat(user, "It's empty! What a waste...")
|
||||
if(1 to 10)
|
||||
to_chat(user, "It has a space dollar inside. Woo.")
|
||||
new /obj/item/weapon/spacecash(get_turf(user))
|
||||
if(11 to 20)
|
||||
to_chat(user, "It has 10 space dollars inside!")
|
||||
new /obj/item/weapon/spacecash/c10(get_turf(user))
|
||||
if(21 to 30)
|
||||
to_chat(user, "It has 20 space dollars inside! Cool!")
|
||||
new /obj/item/weapon/spacecash/c20(get_turf(user))
|
||||
if(31 to 40)
|
||||
to_chat(user, "It has 50 space dollars inside! Nice!")
|
||||
new /obj/item/weapon/spacecash/c50(get_turf(user))
|
||||
if(41 to 50)
|
||||
to_chat(user, "It has 100 space dollars inside! Sweet!")
|
||||
new /obj/item/weapon/spacecash/c100(get_turf(user))
|
||||
if(51 to 60)
|
||||
to_chat(user, "It has 200 space dollars inside! Awesome!")
|
||||
new /obj/item/weapon/spacecash/c200(get_turf(user))
|
||||
if(61 to 80)
|
||||
to_chat(user, "It has 500 space dollars inside! CHA-CHING!")
|
||||
new /obj/item/weapon/spacecash/c500(get_turf(user))
|
||||
else
|
||||
to_chat(user, "It has 1000 space dollars inside! JACKPOT!")
|
||||
new /obj/item/weapon/spacecash/c1000(get_turf(user))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pickup(mob/user)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/examine(user)
|
||||
..()
|
||||
if(!seed)
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
if(T.examine_line)
|
||||
to_chat(user, T.examine_line)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(obj/item/O, mob/user, params)
|
||||
..()
|
||||
if (istype(O, /obj/item/device/plant_analyzer))
|
||||
var/msg = "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>.\n"
|
||||
if(seed)
|
||||
msg += seed.get_analyzer_text()
|
||||
msg += "\n- Nutritional value: [reagents.get_reagent_amount("nutriment")]\n"
|
||||
msg += "- Other substances: [reagents.total_volume-reagents.get_reagent_amount("nutriment")]\n"
|
||||
msg += "*---------*</span>"
|
||||
|
||||
var/list/scannable_reagents = list("charcoal" = "Anti-Toxin", "morphine" = "Morphine", "amatoxin" = "Amatoxins",
|
||||
"toxin" = "Toxins", "mushroomhallucinogen" = "Mushroom Hallucinogen", "condensedcapsaicin" = "Condensed Capsaicin",
|
||||
"capsaicin" = "Capsaicin", "frostoil" = "Frost Oil", "gold" = "Mineral Content", "glycerol" = "Glycerol",
|
||||
"radium" = "Highly Radioactive Material", "uranium" = "Radioactive Material")
|
||||
var/reag_txt = ""
|
||||
if(seed)
|
||||
for(var/reagent_id in scannable_reagents)
|
||||
if(reagent_id in seed.reagents_add)
|
||||
var/amt = reagents.get_reagent_amount(reagent_id)
|
||||
reag_txt += "\n<span class='info'>- [scannable_reagents[reagent_id]]: [amt*100/reagents.maximum_volume]%</span>"
|
||||
|
||||
if(reag_txt)
|
||||
msg += reag_txt
|
||||
msg += "<br><span class='info'>*---------*</span>"
|
||||
to_chat(user, msg)
|
||||
else
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_attackby(src, O, user)
|
||||
|
||||
|
||||
// Various gene procs
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attack_self(mob/user)
|
||||
if(seed && seed.get_gene(/datum/plant_gene/trait/squash))
|
||||
squash(user)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
|
||||
if(!..()) //was it caught by a mob?
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_throw_impact(src, hit_atom)
|
||||
if(seed.get_gene(/datum/plant_gene/trait/squash))
|
||||
squash(hit_atom)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/squash(atom/target)
|
||||
var/turf/T = get_turf(target)
|
||||
if(ispath(splat_type, /obj/effect/decal/cleanable/plant_smudge))
|
||||
if(filling_color)
|
||||
var/obj/O = new splat_type(T)
|
||||
O.color = filling_color
|
||||
O.name = "[name] smudge"
|
||||
else if(splat_type)
|
||||
new splat_type(T)
|
||||
|
||||
if(trash)
|
||||
generate_trash(T)
|
||||
|
||||
visible_message("<span class='warning'>[src] has been squashed.</span>","<span class='italics'>You hear a smack.</span>")
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/trait in seed.genes)
|
||||
trait.on_squash(src, target)
|
||||
|
||||
for(var/A in T)
|
||||
reagents.reaction(A)
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/On_Consume()
|
||||
if(iscarbon(usr))
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_consume(src, usr)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/Crossed(atom/movable/AM)
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_cross(src, AM)
|
||||
..()
|
||||
|
||||
|
||||
// Glow gene procs
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/generate_trash(atom/location)
|
||||
if(trash && ispath(trash, /obj/item/weapon/grown))
|
||||
. = new trash(location, seed)
|
||||
trash = null
|
||||
return
|
||||
if(seed.get_trait(TRAIT_STINGS))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(istype(H) && H.gloves)
|
||||
return
|
||||
if(!reagents || reagents.total_volume <= 0)
|
||||
return
|
||||
reagents.remove_any(rand(1,3)) //Todo, make it actually remove the reagents the seed uses.
|
||||
seed.do_thorns(H,src)
|
||||
seed.do_sting(H,src,pick("r_hand","l_hand"))
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/On_Consume(mob/M, mob/user)
|
||||
if(seed && seed.get_trait(TRAIT_BATTERY_RECHARGE))
|
||||
if(!reagents.total_volume)
|
||||
var/batteries_recharged = 0
|
||||
for(var/obj/item/weapon/stock_parts/cell/C in user.GetAllContents())
|
||||
var/newcharge = (potency*0.01)*C.maxcharge
|
||||
if(C.charge < newcharge)
|
||||
C.charge = newcharge
|
||||
if(isobj(C.loc))
|
||||
var/obj/O = C.loc
|
||||
O.update_icon() //update power meters and such
|
||||
batteries_recharged = 1
|
||||
if(batteries_recharged)
|
||||
to_chat(user, "<span class='notice'>Battery has recovered.</span>")
|
||||
..()
|
||||
// For item-containing growns such as eggy or gatfruit
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/attack_self(mob/user)
|
||||
user.unEquip(src)
|
||||
if(trash)
|
||||
var/obj/item/T = generate_trash()
|
||||
user.put_in_hands(T)
|
||||
to_chat(user, "<span class='notice'>You open [src]\'s shell, revealing \a [T].</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// Ambrosia - base type
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia
|
||||
seed = /obj/item/seeds/ambrosia
|
||||
name = "ambrosia branch"
|
||||
desc = "This is a plant."
|
||||
icon_state = "ambrosiavulgaris"
|
||||
slot_flags = SLOT_HEAD
|
||||
filling_color = "#008000"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Ambrosia Vulgaris
|
||||
/obj/item/seeds/ambrosia
|
||||
name = "pack of ambrosia vulgaris seeds"
|
||||
desc = "These seeds grow into common ambrosia, a plant grown by and from medicine."
|
||||
icon_state = "seed-ambrosiavulgaris"
|
||||
species = "ambrosiavulgaris"
|
||||
plantname = "Ambrosia Vulgaris"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/vulgaris
|
||||
lifespan = 60
|
||||
endurance = 25
|
||||
yield = 6
|
||||
potency = 5
|
||||
icon_dead = "ambrosia-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/ambrosia/deus)
|
||||
reagents_add = list("space_drugs" = 0.15, "bicaridine" = 0.1, "kelotane" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05, "toxin" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/vulgaris
|
||||
seed = /obj/item/seeds/ambrosia
|
||||
name = "ambrosia vulgaris branch"
|
||||
desc = "This is a plant containing various healing chemicals."
|
||||
origin_tech = "biotech=2"
|
||||
|
||||
// Ambrosia Deus
|
||||
/obj/item/seeds/ambrosia/deus
|
||||
name = "pack of ambrosia deus seeds"
|
||||
desc = "These seeds grow into ambrosia deus. Could it be the food of the gods..?"
|
||||
icon_state = "seed-ambrosiadeus"
|
||||
species = "ambrosiadeus"
|
||||
plantname = "Ambrosia Deus"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus
|
||||
mutatelist = list(/obj/item/seeds/ambrosia/gaia)
|
||||
reagents_add = list("omnizine" = 0.15, "synaptizine" = 0.15, "space_drugs" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05)
|
||||
rarity = 40
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus
|
||||
seed = /obj/item/seeds/ambrosia/deus
|
||||
name = "ambrosia deus branch"
|
||||
desc = "Eating this makes you feel immortal!"
|
||||
icon_state = "ambrosiadeus"
|
||||
filling_color = "#008B8B"
|
||||
origin_tech = "biotech=4;materials=3"
|
||||
|
||||
//Ambrosia Gaia
|
||||
/obj/item/seeds/ambrosia/gaia
|
||||
name = "pack of ambrosia gaia seeds"
|
||||
desc = "These seeds grow into ambrosia gaia, filled with infinite potential."
|
||||
icon_state = "seed-ambrosia_gaia"
|
||||
species = "ambrosia_gaia"
|
||||
plantname = "Ambrosia Gaia"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/gaia
|
||||
mutatelist = list()
|
||||
reagents_add = list("earthsblood" = 0.05, "nutriment" = 0.06, "vitamin" = 0.05)
|
||||
rarity = 30 //These are some pretty good plants right here
|
||||
genes = list()
|
||||
weed_rate = 4
|
||||
weed_chance = 100
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/gaia
|
||||
name = "ambrosia gaia branch"
|
||||
desc = "Eating this <i>makes</i> you immortal."
|
||||
icon_state = "ambrosia_gaia"
|
||||
filling_color = rgb(255, 175, 0)
|
||||
origin_tech = "biotech=6;materials=5"
|
||||
light_range = 3
|
||||
seed = /obj/item/seeds/ambrosia/gaia
|
||||
@@ -0,0 +1,57 @@
|
||||
// Apple
|
||||
/obj/item/seeds/apple
|
||||
name = "pack of apple seeds"
|
||||
desc = "These seeds grow into apple trees."
|
||||
icon_state = "seed-apple"
|
||||
species = "apple"
|
||||
plantname = "Apple Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/apple
|
||||
lifespan = 55
|
||||
endurance = 35
|
||||
yield = 5
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "apple-grow"
|
||||
icon_dead = "apple-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/apple/gold)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
|
||||
seed = /obj/item/seeds/apple
|
||||
name = "apple"
|
||||
desc = "It's a little piece of Eden."
|
||||
icon_state = "apple"
|
||||
filling_color = "#FF4500"
|
||||
bitesize = 100 // Always eat the apple in one bite
|
||||
|
||||
// Posioned Apple
|
||||
/obj/item/seeds/apple/poisoned
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/apple/poisoned
|
||||
mutatelist = list()
|
||||
reagents_add = list("zombiepowder" = 0.5, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 50 // Source of cyanide, and hard (almost impossible) to obtain normally.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/apple/poisoned
|
||||
seed = /obj/item/seeds/apple/poisoned
|
||||
|
||||
// Gold Apple
|
||||
/obj/item/seeds/apple/gold
|
||||
name = "pack of golden apple seeds"
|
||||
desc = "These seeds grow into golden apple trees. Good thing there are no firebirds in space."
|
||||
icon_state = "seed-goldapple"
|
||||
species = "goldapple"
|
||||
plantname = "Golden Apple Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/apple/gold
|
||||
maturation = 10
|
||||
production = 10
|
||||
mutatelist = list()
|
||||
reagents_add = list("gold" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 40 // Alchemy!
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/apple/gold
|
||||
seed = /obj/item/seeds/apple/gold
|
||||
name = "golden apple"
|
||||
desc = "Emblazoned upon the apple is the word 'Kallisti'."
|
||||
icon_state = "goldapple"
|
||||
filling_color = "#FFD700"
|
||||
origin_tech = "biotech=4;materials=5"
|
||||
@@ -0,0 +1,121 @@
|
||||
// Banana
|
||||
/obj/item/seeds/banana
|
||||
name = "pack of banana seeds"
|
||||
desc = "They're seeds that grow into banana trees. When grown, keep away from clown."
|
||||
icon_state = "seed-banana"
|
||||
species = "banana"
|
||||
plantname = "Banana Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana
|
||||
lifespan = 50
|
||||
endurance = 30
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_dead = "banana-dead"
|
||||
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace)
|
||||
reagents_add = list("banana" = 0.1, "potassium" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
|
||||
seed = /obj/item/seeds/banana
|
||||
name = "banana"
|
||||
desc = "It's an excellent prop for a clown."
|
||||
icon_state = "banana"
|
||||
item_state = "banana"
|
||||
trash = /obj/item/weapon/grown/bananapeel
|
||||
filling_color = "#FFFF00"
|
||||
bitesize = 5
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is aiming [src] at [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1, -1)
|
||||
sleep(25)
|
||||
if(!user)
|
||||
return (OXYLOSS)
|
||||
user.say("BANG!")
|
||||
sleep(25)
|
||||
if(!user)
|
||||
return (OXYLOSS)
|
||||
user.visible_message("<B>[user]</B> laughs so hard they begin to suffocate!")
|
||||
return (OXYLOSS)
|
||||
|
||||
/obj/item/weapon/grown/bananapeel
|
||||
seed = /obj/item/seeds/banana
|
||||
name = "banana peel"
|
||||
desc = "A peel from a banana."
|
||||
icon_state = "banana_peel"
|
||||
item_state = "banana_peel"
|
||||
w_class = 1
|
||||
throwforce = 0
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
|
||||
/obj/item/weapon/grown/bananapeel/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is deliberately slipping on [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, 'sound/misc/slip.ogg', 50, 1, -1)
|
||||
return (BRUTELOSS)
|
||||
|
||||
|
||||
// Mimana - invisible sprites are totally a feature!
|
||||
/obj/item/seeds/banana/mime
|
||||
name = "pack of mimana seeds"
|
||||
desc = "They're seeds that grow into mimana trees. When grown, keep away from mime."
|
||||
icon_state = "seed-mimana"
|
||||
species = "mimana"
|
||||
plantname = "Mimana Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana/mime
|
||||
growthstages = 4
|
||||
mutatelist = list()
|
||||
reagents_add = list("nothing" = 0.1, "mutetoxin" = 0.1, "nutriment" = 0.02)
|
||||
rarity = 15
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/mime
|
||||
seed = /obj/item/seeds/banana/mime
|
||||
name = "mimana"
|
||||
desc = "It's an excellent prop for a mime."
|
||||
icon_state = "mimana"
|
||||
trash = /obj/item/weapon/grown/bananapeel/mimanapeel
|
||||
filling_color = "#FFFFEE"
|
||||
|
||||
/obj/item/weapon/grown/bananapeel/mimanapeel
|
||||
seed = /obj/item/seeds/banana/mime
|
||||
name = "mimana peel"
|
||||
desc = "A mimana peel."
|
||||
icon_state = "mimana_peel"
|
||||
|
||||
// Bluespace Banana
|
||||
/obj/item/seeds/banana/bluespace
|
||||
name = "pack of bluespace banana seeds"
|
||||
desc = "They're seeds that grow into bluespace banana trees. When grown, keep away from bluespace clown."
|
||||
icon_state = "seed-banana-blue"
|
||||
species = "bluespacebanana"
|
||||
icon_grow = "banana-grow"
|
||||
plantname = "Bluespace Banana Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana/bluespace
|
||||
mutatelist = list()
|
||||
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/teleport, /datum/plant_gene/trait/repeated_harvest)
|
||||
reagents_add = list("singulo" = 0.2, "banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
|
||||
rarity = 30
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/bluespace
|
||||
seed = /obj/item/seeds/banana/bluespace
|
||||
name = "bluespace banana"
|
||||
icon_state = "banana_blue"
|
||||
trash = /obj/item/weapon/grown/bananapeel/bluespace
|
||||
filling_color = "#0000FF"
|
||||
origin_tech = "biotech=3;bluespace=5"
|
||||
|
||||
/obj/item/weapon/grown/bananapeel/bluespace
|
||||
seed = /obj/item/seeds/banana/bluespace
|
||||
name = "bluespace banana peel"
|
||||
desc = "A peel from a bluespace banana."
|
||||
icon_state = "banana_peel_blue"
|
||||
|
||||
// Other
|
||||
/obj/item/weapon/grown/bananapeel/specialpeel //used by /obj/item/clothing/shoes/clown_shoes/banana_shoes
|
||||
name = "synthesized banana peel"
|
||||
desc = "A synthetic banana peel."
|
||||
|
||||
/obj/item/weapon/grown/bananapeel/specialpeel/Crossed(AM)
|
||||
if(iscarbon(AM))
|
||||
var/mob/living/carbon/carbon = AM
|
||||
if(carbon.slip(2, 2, src, FALSE))
|
||||
qdel(src)
|
||||
@@ -0,0 +1,48 @@
|
||||
// Soybeans
|
||||
/obj/item/seeds/soya
|
||||
name = "pack of soybean seeds"
|
||||
desc = "These seeds grow into soybean plants."
|
||||
icon_state = "seed-soybean"
|
||||
species = "soybean"
|
||||
plantname = "Soybean Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
|
||||
maturation = 4
|
||||
production = 4
|
||||
potency = 15
|
||||
growthstages = 4
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_grow = "soybean-grow"
|
||||
icon_dead = "soybean-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/soya/koi)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
|
||||
seed = /obj/item/seeds/soya
|
||||
name = "soybeans"
|
||||
desc = "It's pretty bland, but oh the possibilities..."
|
||||
gender = PLURAL
|
||||
icon_state = "soybeans"
|
||||
filling_color = "#F0E68C"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Koibean
|
||||
/obj/item/seeds/soya/koi
|
||||
name = "pack of koibean seeds"
|
||||
desc = "These seeds grow into koibean plants."
|
||||
icon_state = "seed-koibean"
|
||||
species = "koibean"
|
||||
plantname = "Koibean Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/koibeans
|
||||
potency = 10
|
||||
mutatelist = list()
|
||||
reagents_add = list("carpotoxin" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/koibeans
|
||||
seed = /obj/item/seeds/soya/koi
|
||||
name = "koibean"
|
||||
desc = "Something about these seems fishy."
|
||||
icon_state = "koibeans"
|
||||
filling_color = "#F0E68C"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,187 @@
|
||||
// Berries
|
||||
/obj/item/seeds/berry
|
||||
name = "pack of berry seeds"
|
||||
desc = "These seeds grow into berry bushes."
|
||||
icon_state = "seed-berry"
|
||||
species = "berry"
|
||||
plantname = "Berry Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/berries
|
||||
lifespan = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 2
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "berry-grow" // Uses one growth icons set for all the subtypes
|
||||
icon_dead = "berry-dead" // Same for the dead icon
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/berry/glow, /obj/item/seeds/berry/poison)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries
|
||||
seed = /obj/item/seeds/berry
|
||||
name = "bunch of berries"
|
||||
desc = "Nutritious!"
|
||||
icon_state = "berrypile"
|
||||
gender = PLURAL
|
||||
filling_color = "#FF00FF"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Poison Berries
|
||||
/obj/item/seeds/berry/poison
|
||||
name = "pack of poison-berry seeds"
|
||||
desc = "These seeds grow into poison-berry bushes."
|
||||
icon_state = "seed-poisonberry"
|
||||
species = "poisonberry"
|
||||
plantname = "Poison-Berry Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison
|
||||
mutatelist = list(/obj/item/seeds/berry/death)
|
||||
reagents_add = list("cyanide" = 0.15, "tirizene" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 10 // Mildly poisonous berries are common in reality
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison
|
||||
seed = /obj/item/seeds/berry/poison
|
||||
name = "bunch of poison-berries"
|
||||
desc = "Taste so good, you could die!"
|
||||
icon_state = "poisonberrypile"
|
||||
filling_color = "#C71585"
|
||||
|
||||
// Death Berries
|
||||
/obj/item/seeds/berry/death
|
||||
name = "pack of death-berry seeds"
|
||||
desc = "These seeds grow into death berries."
|
||||
icon_state = "seed-deathberry"
|
||||
species = "deathberry"
|
||||
plantname = "Death Berry Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/berries/death
|
||||
lifespan = 30
|
||||
potency = 50
|
||||
mutatelist = list()
|
||||
reagents_add = list("coniine" = 0.08, "tirizene" = 0.1, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 30
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/death
|
||||
seed = /obj/item/seeds/berry/death
|
||||
name = "bunch of death-berries"
|
||||
desc = "Taste so good, you could die!"
|
||||
icon_state = "deathberrypile"
|
||||
filling_color = "#708090"
|
||||
|
||||
// Glow Berries
|
||||
/obj/item/seeds/berry/glow
|
||||
name = "pack of glow-berry seeds"
|
||||
desc = "These seeds grow into glow-berry bushes."
|
||||
icon_state = "seed-glowberry"
|
||||
species = "glowberry"
|
||||
plantname = "Glow-Berry Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow
|
||||
lifespan = 30
|
||||
endurance = 25
|
||||
mutatelist = list()
|
||||
genes = list(/datum/plant_gene/trait/glow/berry , /datum/plant_gene/trait/noreact, /datum/plant_gene/trait/repeated_harvest)
|
||||
reagents_add = list("uranium" = 0.25, "iodine" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow
|
||||
seed = /obj/item/seeds/berry/glow
|
||||
name = "bunch of glow-berries"
|
||||
desc = "Nutritious!"
|
||||
icon_state = "glowberrypile"
|
||||
filling_color = "#7CFC00"
|
||||
origin_tech = "plasmatech=6"
|
||||
|
||||
// Cherries
|
||||
/obj/item/seeds/cherry
|
||||
name = "pack of cherry pits"
|
||||
desc = "Careful not to crack a tooth on one... That'd be the pits."
|
||||
icon_state = "seed-cherry"
|
||||
species = "cherry"
|
||||
plantname = "Cherry Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cherries
|
||||
lifespan = 35
|
||||
endurance = 35
|
||||
maturation = 5
|
||||
production = 5
|
||||
growthstages = 5
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "cherry-grow"
|
||||
icon_dead = "cherry-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/cherry/blue)
|
||||
reagents_add = list("nutriment" = 0.07, "sugar" = 0.07)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries
|
||||
seed = /obj/item/seeds/cherry
|
||||
name = "cherries"
|
||||
desc = "Great for toppings!"
|
||||
icon_state = "cherry"
|
||||
gender = PLURAL
|
||||
filling_color = "#FF0000"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Blue Cherries
|
||||
/obj/item/seeds/cherry/blue
|
||||
name = "pack of blue cherry pits"
|
||||
desc = "The blue kind of cherries"
|
||||
icon_state = "seed-bluecherry"
|
||||
species = "bluecherry"
|
||||
plantname = "Blue Cherry Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/bluecherries
|
||||
mutatelist = list()
|
||||
reagents_add = list("nutriment" = 0.07, "sugar" = 0.07)
|
||||
rarity = 10
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/bluecherries
|
||||
seed = /obj/item/seeds/cherry/blue
|
||||
name = "blue cherries"
|
||||
desc = "They're cherries that are blue."
|
||||
icon_state = "bluecherry"
|
||||
filling_color = "#6495ED"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Grapes
|
||||
/obj/item/seeds/grape
|
||||
name = "pack of grape seeds"
|
||||
desc = "These seeds grow into grape vines."
|
||||
icon_state = "seed-grapes"
|
||||
species = "grape"
|
||||
plantname = "Grape Vine"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/grapes
|
||||
lifespan = 50
|
||||
endurance = 25
|
||||
maturation = 3
|
||||
production = 5
|
||||
yield = 4
|
||||
growthstages = 2
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "grape-grow"
|
||||
icon_dead = "grape-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/grape/green)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes
|
||||
seed = /obj/item/seeds/grape
|
||||
name = "bunch of grapes"
|
||||
desc = "Nutritious!"
|
||||
icon_state = "grapes"
|
||||
dried_type = /obj/item/weapon/reagent_containers/food/snacks/no_raisin
|
||||
filling_color = "#FF1493"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Green Grapes
|
||||
/obj/item/seeds/grape/green
|
||||
name = "pack of green grape seeds"
|
||||
desc = "These seeds grow into green-grape vines."
|
||||
icon_state = "seed-greengrapes"
|
||||
species = "greengrape"
|
||||
plantname = "Green-Grape Vine"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/grapes/green
|
||||
reagents_add = list("kelotane" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
|
||||
// No rarity: technically it's a beneficial mutant, but it's not exactly "new"...
|
||||
mutatelist = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes/green
|
||||
seed = /obj/item/seeds/grape/green
|
||||
name = "bunch of green grapes"
|
||||
icon_state = "greengrapes"
|
||||
filling_color = "#7FFF00"
|
||||
@@ -0,0 +1,118 @@
|
||||
// Cannabis
|
||||
/obj/item/seeds/cannabis
|
||||
name = "pack of cannabis seeds"
|
||||
desc = "Taxable."
|
||||
icon_state = "seed-cannabis"
|
||||
species = "cannabis"
|
||||
plantname = "Cannabis Plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cannabis
|
||||
maturation = 8
|
||||
potency = 20
|
||||
growthstages = 1
|
||||
growing_icon = 'icons/goonstation/objects/hydroponics.dmi'
|
||||
icon_grow = "cannabis-grow" // Uses one growth icons set for all the subtypes
|
||||
icon_dead = "cannabis-dead" // Same for the dead icon
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/cannabis/rainbow,
|
||||
/obj/item/seeds/cannabis/death,
|
||||
/obj/item/seeds/cannabis/white,
|
||||
/obj/item/seeds/cannabis/ultimate)
|
||||
reagents_add = list("space_drugs" = 0.15, "lipolicide" = 0.35) // gives u the munchies
|
||||
|
||||
|
||||
/obj/item/seeds/cannabis/rainbow
|
||||
name = "pack of rainbow weed seeds"
|
||||
desc = "These seeds grow into rainbow weed. Groovy."
|
||||
icon_state = "seed-megacannabis"
|
||||
species = "megacannabis"
|
||||
plantname = "Rainbow Weed"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/rainbow
|
||||
mutatelist = list()
|
||||
reagents_add = list("mindbreaker" = 0.15, "lipolicide" = 0.35)
|
||||
rarity = 40
|
||||
|
||||
/obj/item/seeds/cannabis/death
|
||||
name = "pack of deathweed seeds"
|
||||
desc = "These seeds grow into deathweed. Not groovy."
|
||||
icon_state = "seed-blackcannabis"
|
||||
species = "blackcannabis"
|
||||
plantname = "Deathweed"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/death
|
||||
mutatelist = list()
|
||||
reagents_add = list("cyanide" = 0.35, "space_drugs" = 0.15, "lipolicide" = 0.15)
|
||||
rarity = 40
|
||||
|
||||
/obj/item/seeds/cannabis/white
|
||||
name = "pack of lifeweed seeds"
|
||||
desc = "I will give unto him that is munchies of the fountain of the cravings of life, freely."
|
||||
icon_state = "seed-whitecannabis"
|
||||
species = "whitecannabis"
|
||||
plantname = "Lifeweed"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/white
|
||||
mutatelist = list()
|
||||
reagents_add = list("omnizine" = 0.35, "space_drugs" = 0.15, "lipolicide" = 0.15)
|
||||
rarity = 40
|
||||
|
||||
|
||||
/obj/item/seeds/cannabis/ultimate
|
||||
name = "pack of omega weed seeds"
|
||||
desc = "These seeds grow into omega weed."
|
||||
icon_state = "seed-ocannabis"
|
||||
species = "ocannabis"
|
||||
plantname = "Omega Weed"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/ultimate
|
||||
mutatelist = list()
|
||||
reagents_add = list("space_drugs" = 0.3,
|
||||
"mindbreaker" = 0.3,
|
||||
"mercury" = 0.15,
|
||||
"lithium" = 0.15,
|
||||
"atropine" = 0.15,
|
||||
"haloperidol" = 0.15,
|
||||
"methamphetamine" = 0.15,
|
||||
"capsaicin" = 0.15,
|
||||
"barbers_aid" = 0.15,
|
||||
"bath_salts" = 0.15,
|
||||
"itching_powder" = 0.15,
|
||||
"crank" = 0.15,
|
||||
"krokodil" = 0.15,
|
||||
"histamine" = 0.15,
|
||||
"lipolicide" = 0.15)
|
||||
rarity = 69
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cannabis
|
||||
seed = /obj/item/seeds/cannabis
|
||||
icon = 'icons/goonstation/objects/hydroponics.dmi'
|
||||
name = "cannabis leaf"
|
||||
desc = "Recently legalized in most galaxies."
|
||||
icon_state = "cannabis"
|
||||
filling_color = "#00FF00"
|
||||
bitesize_mod = 2
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/rainbow
|
||||
seed = /obj/item/seeds/cannabis/rainbow
|
||||
name = "rainbow cannabis leaf"
|
||||
desc = "Is it supposed to be glowing like that...?"
|
||||
icon_state = "megacannabis"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/death
|
||||
seed = /obj/item/seeds/cannabis/death
|
||||
name = "death cannabis leaf"
|
||||
desc = "Looks a bit dark. Oh well."
|
||||
icon_state = "blackcannabis"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/white
|
||||
seed = /obj/item/seeds/cannabis/white
|
||||
name = "white cannabis leaf"
|
||||
desc = "It feels smooth and nice to the touch."
|
||||
icon_state = "whitecannabis"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cannabis/ultimate
|
||||
seed = /obj/item/seeds/cannabis/ultimate
|
||||
name = "omega cannibas leaf"
|
||||
desc = "You feel dizzy looking at it. What the fuck?"
|
||||
icon_state = "ocannabis"
|
||||
volume = 420
|
||||
@@ -0,0 +1,90 @@
|
||||
// Wheat
|
||||
/obj/item/seeds/wheat
|
||||
name = "pack of wheat seeds"
|
||||
desc = "These may, or may not, grow into wheat."
|
||||
icon_state = "seed-wheat"
|
||||
species = "wheat"
|
||||
plantname = "Wheat Stalks"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat
|
||||
production = 1
|
||||
yield = 4
|
||||
potency = 15
|
||||
icon_dead = "wheat-dead"
|
||||
mutatelist = list(/obj/item/seeds/wheat/oat, /obj/item/seeds/wheat/meat)
|
||||
reagents_add = list("nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat
|
||||
seed = /obj/item/seeds/wheat
|
||||
name = "wheat"
|
||||
desc = "Sigh... wheat... a-grain?"
|
||||
gender = PLURAL
|
||||
icon_state = "wheat"
|
||||
filling_color = "#F0E68C"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Oat
|
||||
/obj/item/seeds/wheat/oat
|
||||
name = "pack of oat seeds"
|
||||
desc = "These may, or may not, grow into oat."
|
||||
icon_state = "seed-oat"
|
||||
species = "oat"
|
||||
plantname = "Oat Stalks"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/oat
|
||||
mutatelist = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/oat
|
||||
seed = /obj/item/seeds/wheat/oat
|
||||
name = "oat"
|
||||
desc = "Eat oats, do squats."
|
||||
gender = PLURAL
|
||||
icon_state = "oat"
|
||||
filling_color = "#556B2F"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Rice
|
||||
/obj/item/seeds/wheat/rice
|
||||
name = "pack of rice seeds"
|
||||
desc = "These may, or may not, grow into rice."
|
||||
icon_state = "seed-rice"
|
||||
species = "rice"
|
||||
plantname = "Rice Stalks"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/rice
|
||||
mutatelist = list()
|
||||
growthstages = 3
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/rice
|
||||
seed = /obj/item/seeds/wheat/rice
|
||||
name = "rice"
|
||||
desc = "Rice to meet you."
|
||||
gender = PLURAL
|
||||
icon_state = "rice"
|
||||
filling_color = "#FAFAD2"
|
||||
bitesize_mod = 2
|
||||
|
||||
//Meatwheat - grows into synthetic meat
|
||||
/obj/item/seeds/wheat/meat
|
||||
name = "pack of meatwheat seeds"
|
||||
desc = "If you ever wanted to drive a vegetarian to insanity, here's how."
|
||||
icon_state = "seed-meatwheat"
|
||||
species = "meatwheat"
|
||||
plantname = "Meatwheat"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/meatwheat
|
||||
mutatelist = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/meatwheat
|
||||
name = "meatwheat"
|
||||
desc = "Some blood-drenched wheat stalks. You can crush them into what passes for meat if you squint hard enough."
|
||||
icon_state = "meatwheat"
|
||||
gender = PLURAL
|
||||
filling_color = rgb(150, 0, 0)
|
||||
bitesize_mod = 2
|
||||
seed = /obj/item/seeds/wheat/meat
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/meatwheat/attack_self(mob/living/user)
|
||||
user.visible_message("<span class='notice'>[user] crushes [src] into meat.</span>", "<span class='notice'>You crush [src] into something that resembles meat.</span>")
|
||||
playsound(user, 'sound/effects/blobattack.ogg', 50, 1)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/meat/slab/meatwheat/M = new(get_turf(user))
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
user.put_in_hands(M)
|
||||
return 1
|
||||
@@ -0,0 +1,95 @@
|
||||
// Chili
|
||||
/obj/item/seeds/chili
|
||||
name = "pack of chili seeds"
|
||||
desc = "These seeds grow into chili plants. HOT! HOT! HOT!"
|
||||
icon_state = "seed-chili"
|
||||
species = "chili"
|
||||
plantname = "Chili Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/chili
|
||||
lifespan = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 4
|
||||
potency = 20
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_grow = "chili-grow" // Uses one growth icons set for all the subtypes
|
||||
icon_dead = "chili-dead" // Same for the dead icon
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/chili/ice, /obj/item/seeds/chili/ghost)
|
||||
reagents_add = list("capsaicin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/chili
|
||||
seed = /obj/item/seeds/chili
|
||||
name = "chili"
|
||||
desc = "It's spicy! Wait... IT'S BURNING ME!!"
|
||||
icon_state = "chilipepper"
|
||||
filling_color = "#FF0000"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Ice Chili
|
||||
/obj/item/seeds/chili/ice
|
||||
name = "pack of ice pepper seeds"
|
||||
desc = "These seeds grow into ice pepper plants."
|
||||
icon_state = "seed-icepepper"
|
||||
species = "chiliice"
|
||||
plantname = "Ice Pepper Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/icepepper
|
||||
lifespan = 25
|
||||
maturation = 4
|
||||
production = 4
|
||||
rarity = 20
|
||||
mutatelist = list()
|
||||
reagents_add = list("frostoil" = 0.25, "vitamin" = 0.02, "nutriment" = 0.02)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper
|
||||
seed = /obj/item/seeds/chili/ice
|
||||
name = "ice pepper"
|
||||
desc = "It's a mutant strain of chili"
|
||||
icon_state = "icepepper"
|
||||
filling_color = "#0000CD"
|
||||
bitesize_mod = 2
|
||||
origin_tech = "biotech=4"
|
||||
|
||||
// Ghost Chili
|
||||
/obj/item/seeds/chili/ghost
|
||||
name = "pack of ghost chili seeds"
|
||||
desc = "These seeds grow into a chili said to be the hottest in the galaxy."
|
||||
icon_state = "seed-chilighost"
|
||||
species = "chilighost"
|
||||
plantname = "Ghost Chili Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili
|
||||
endurance = 10
|
||||
maturation = 10
|
||||
production = 10
|
||||
yield = 3
|
||||
rarity = 20
|
||||
mutatelist = list()
|
||||
reagents_add = list("condensedcapsaicin" = 0.3, "capsaicin" = 0.55, "nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili
|
||||
seed = /obj/item/seeds/chili/ghost
|
||||
name = "ghost chili"
|
||||
desc = "It seems to be vibrating gently."
|
||||
icon_state = "ghostchilipepper"
|
||||
var/mob/held_mob
|
||||
filling_color = "#F8F8FF"
|
||||
bitesize_mod = 4
|
||||
origin_tech = "biotech=4;magnets=5"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/attack_hand(mob/user)
|
||||
..()
|
||||
if(ismob(loc))
|
||||
held_mob = loc
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/process()
|
||||
if(held_mob && loc == held_mob)
|
||||
if(held_mob.is_holding(src))
|
||||
if(hasvar(held_mob,"gloves") && held_mob:gloves)
|
||||
return
|
||||
held_mob.bodytemperature += 15 * TEMPERATURE_DAMAGE_COEFFICIENT
|
||||
if(prob(10))
|
||||
to_chat(held_mob, "<span class='warning'>Your hand holding [src] burns!</span>")
|
||||
else
|
||||
held_mob = null
|
||||
..()
|
||||
@@ -0,0 +1,155 @@
|
||||
// Citrus - base type
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus
|
||||
seed = /obj/item/seeds/lime
|
||||
name = "citrus"
|
||||
desc = "It's so sour, your face will twist."
|
||||
icon_state = "lime"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Lime
|
||||
/obj/item/seeds/lime
|
||||
name = "pack of lime seeds"
|
||||
desc = "These are very sour seeds."
|
||||
icon_state = "seed-lime"
|
||||
species = "lime"
|
||||
plantname = "Lime Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lime
|
||||
lifespan = 55
|
||||
endurance = 50
|
||||
yield = 4
|
||||
potency = 15
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/orange)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lime
|
||||
seed = /obj/item/seeds/lime
|
||||
name = "lime"
|
||||
desc = "It's so sour, your face will twist."
|
||||
icon_state = "lime"
|
||||
filling_color = "#00FF00"
|
||||
|
||||
// Orange
|
||||
/obj/item/seeds/orange
|
||||
name = "pack of orange seeds"
|
||||
desc = "Sour seeds."
|
||||
icon_state = "seed-orange"
|
||||
species = "orange"
|
||||
plantname = "Orange Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange
|
||||
lifespan = 60
|
||||
endurance = 50
|
||||
yield = 5
|
||||
potency = 20
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "lime-grow"
|
||||
icon_dead = "lime-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/lime)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange
|
||||
seed = /obj/item/seeds/orange
|
||||
name = "orange"
|
||||
desc = "It's an tangy fruit."
|
||||
icon_state = "orange"
|
||||
filling_color = "#FFA500"
|
||||
|
||||
// Lemon
|
||||
/obj/item/seeds/lemon
|
||||
name = "pack of lemon seeds"
|
||||
desc = "These are sour seeds."
|
||||
icon_state = "seed-lemon"
|
||||
species = "lemon"
|
||||
plantname = "Lemon Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lemon
|
||||
lifespan = 55
|
||||
endurance = 45
|
||||
yield = 4
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "lime-grow"
|
||||
icon_dead = "lime-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/firelemon)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lemon
|
||||
seed = /obj/item/seeds/lemon
|
||||
name = "lemon"
|
||||
desc = "When life gives you lemons, make lemonade."
|
||||
icon_state = "lemon"
|
||||
filling_color = "#FFD700"
|
||||
|
||||
// Combustible lemon
|
||||
/obj/item/seeds/firelemon //combustible lemon is too long so firelemon
|
||||
name = "pack of combustible lemon seeds"
|
||||
desc = "When life gives you lemons, don't make lemonade. Make life take the lemons back! Get mad! I don't want your damn lemons!"
|
||||
icon_state = "seed-firelemon"
|
||||
species = "firelemon"
|
||||
plantname = "Combustible Lemon Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/firelemon
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "lime-grow"
|
||||
icon_dead = "lime-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
lifespan = 55
|
||||
endurance = 45
|
||||
yield = 4
|
||||
reagents_add = list("nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon
|
||||
seed = /obj/item/seeds/firelemon
|
||||
name = "Combustible Lemon"
|
||||
desc = "Made for burning houses down."
|
||||
icon_state = "firelemon"
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon/attack_self(mob/living/user)
|
||||
var/area/A = get_area(user)
|
||||
user.visible_message("<span class='warning'>[user] primes the [src]!</span>", "<span class='userdanger'>You prime the [src]!</span>")
|
||||
var/message = "[ADMIN_LOOKUPFLW(user)] primed a combustible lemon for detonation at [A] [ADMIN_COORDJMP(user)]"
|
||||
bombers += message
|
||||
message_admins(message)
|
||||
log_game("[key_name(user)] primed a combustible lemon for detonation at [A] [COORD(user)].")
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.throw_mode_on()
|
||||
icon_state = "firelemon_active"
|
||||
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
addtimer(src, "prime", rand(10, 60))
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon/burn()
|
||||
prime()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon/proc/update_mob()
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.unEquip(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon/ex_act(severity)
|
||||
qdel(src) //Ensuring that it's deleted by its own explosion
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/firelemon/proc/prime()
|
||||
switch(seed.potency) //Combustible lemons are alot like IEDs, lots of flame, very little bang.
|
||||
if(0 to 30)
|
||||
update_mob()
|
||||
explosion(loc,-1,-1,2, flame_range = 1)
|
||||
qdel(src)
|
||||
if(31 to 50)
|
||||
update_mob()
|
||||
explosion(loc,-1,-1,2, flame_range = 2)
|
||||
qdel(src)
|
||||
if(51 to 70)
|
||||
update_mob()
|
||||
explosion(loc,-1,-1,2, flame_range = 3)
|
||||
qdel(src)
|
||||
if(71 to 90)
|
||||
update_mob()
|
||||
explosion(loc,-1,-1,2, flame_range = 4)
|
||||
qdel(src)
|
||||
else
|
||||
update_mob()
|
||||
explosion(loc,-1,-1,2, flame_range = 5)
|
||||
qdel(src)
|
||||
@@ -0,0 +1,46 @@
|
||||
// Cocoa Pod
|
||||
/obj/item/seeds/cocoapod
|
||||
name = "pack of cocoa pod seeds"
|
||||
desc = "These seeds grow into cacao trees. They look fattening." //SIC: cocoa is the seeds. The trees are spelled cacao.
|
||||
icon_state = "seed-cocoapod"
|
||||
species = "cocoapod"
|
||||
plantname = "Cocao Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
|
||||
lifespan = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 2
|
||||
growthstages = 5
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "cocoapod-grow"
|
||||
icon_dead = "cocoapod-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/cocoapod/vanillapod)
|
||||
reagents_add = list("cocoa" = 0.25, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
|
||||
seed = /obj/item/seeds/cocoapod
|
||||
name = "cocoa pod"
|
||||
desc = "Fattening... Mmmmm... chucklate."
|
||||
icon_state = "cocoapod"
|
||||
filling_color = "#FFD700"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Vanilla Pod
|
||||
/obj/item/seeds/cocoapod/vanillapod
|
||||
name = "pack of vanilla pod seeds"
|
||||
desc = "These seeds grow into vanilla trees. They look fattening."
|
||||
icon_state = "seed-vanillapod"
|
||||
species = "vanillapod"
|
||||
plantname = "Vanilla Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/vanillapod
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list()
|
||||
reagents_add = list("vanilla" = 0.25, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/vanillapod
|
||||
seed = /obj/item/seeds/cocoapod/vanillapod
|
||||
name = "vanilla pod"
|
||||
desc = "Fattening... Mmmmm... vanilla."
|
||||
icon_state = "vanillapod"
|
||||
filling_color = "#FFD700"
|
||||
@@ -0,0 +1,84 @@
|
||||
// Corn
|
||||
/obj/item/seeds/corn
|
||||
name = "pack of corn seeds"
|
||||
desc = "I don't mean to sound corny..."
|
||||
icon_state = "seed-corn"
|
||||
species = "corn"
|
||||
plantname = "Corn Stalks"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/corn
|
||||
maturation = 8
|
||||
potency = 20
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_grow = "corn-grow" // Uses one growth icons set for all the subtypes
|
||||
icon_dead = "corn-dead" // Same for the dead icon
|
||||
mutatelist = list(/obj/item/seeds/corn/snapcorn)
|
||||
reagents_add = list("cornoil" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
|
||||
seed = /obj/item/seeds/corn
|
||||
name = "ear of corn"
|
||||
desc = "Needs some butter!"
|
||||
icon_state = "corn"
|
||||
cooked_type = /obj/item/weapon/reagent_containers/food/snacks/popcorn
|
||||
filling_color = "#FFFF00"
|
||||
trash = /obj/item/weapon/grown/corncob
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/grown/corncob
|
||||
name = "corn cob"
|
||||
desc = "A reminder of meals gone by."
|
||||
icon_state = "corncob"
|
||||
item_state = "corncob"
|
||||
w_class = 1
|
||||
throwforce = 0
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
|
||||
/obj/item/weapon/grown/corncob/attackby(obj/item/weapon/grown/W, mob/user, params)
|
||||
if(W.is_sharp())
|
||||
to_chat(user, "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>")
|
||||
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Snapcorn
|
||||
/obj/item/seeds/corn/snapcorn
|
||||
name = "pack of snapcorn seeds"
|
||||
desc = "Oh snap!"
|
||||
icon_state = "seed-snapcorn"
|
||||
species = "snapcorn"
|
||||
plantname = "Snapcorn Stalks"
|
||||
product = /obj/item/weapon/grown/snapcorn
|
||||
mutatelist = list()
|
||||
rarity = 10
|
||||
|
||||
/obj/item/weapon/grown/snapcorn
|
||||
seed = /obj/item/seeds/corn/snapcorn
|
||||
name = "snap corn"
|
||||
desc = "A cob with snap pops"
|
||||
icon_state = "snapcorn"
|
||||
item_state = "corncob"
|
||||
w_class = 1
|
||||
throwforce = 0
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
var/snap_pops = 1
|
||||
|
||||
/obj/item/weapon/grown/snapcorn/add_juice()
|
||||
..()
|
||||
snap_pops = max(round(seed.potency/8), 1)
|
||||
|
||||
/obj/item/weapon/grown/snapcorn/attack_self(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>You pick a snap pop from the cob.</span>")
|
||||
var/obj/item/toy/snappop/S = new /obj/item/toy/snappop(user.loc)
|
||||
if(ishuman(user))
|
||||
user.put_in_hands(S)
|
||||
snap_pops -= 1
|
||||
if(!snap_pops)
|
||||
new /obj/item/weapon/grown/corncob(user.loc)
|
||||
qdel(src)
|
||||
@@ -0,0 +1,44 @@
|
||||
// Eggplant
|
||||
/obj/item/seeds/eggplant
|
||||
name = "pack of eggplant seeds"
|
||||
desc = "These seeds grow to produce berries that look nothing like eggs."
|
||||
icon_state = "seed-eggplant"
|
||||
species = "eggplant"
|
||||
plantname = "Eggplants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
|
||||
yield = 2
|
||||
potency = 20
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_grow = "eggplant-grow"
|
||||
icon_dead = "eggplant-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/eggplant/eggy)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
|
||||
seed = /obj/item/seeds/eggplant
|
||||
name = "eggplant"
|
||||
desc = "Maybe there's a chicken inside?"
|
||||
icon_state = "eggplant"
|
||||
filling_color = "#800080"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Egg-Plant
|
||||
/obj/item/seeds/eggplant/eggy
|
||||
desc = "These seeds grow to produce berries that look a lot like eggs."
|
||||
icon_state = "seed-eggy"
|
||||
species = "eggy"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy
|
||||
lifespan = 75
|
||||
production = 12
|
||||
mutatelist = list()
|
||||
reagents_add = list("nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy
|
||||
seed = /obj/item/seeds/eggplant/eggy
|
||||
name = "Egg-plant"
|
||||
desc = "There MUST be a chicken inside."
|
||||
icon_state = "eggyplant"
|
||||
trash = /obj/item/weapon/reagent_containers/food/snacks/egg
|
||||
filling_color = "#F8F8FF"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,202 @@
|
||||
// Poppy
|
||||
/obj/item/seeds/poppy
|
||||
name = "pack of poppy seeds"
|
||||
desc = "These seeds grow into poppies."
|
||||
icon_state = "seed-poppy"
|
||||
species = "poppy"
|
||||
plantname = "Poppy Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/poppy
|
||||
endurance = 10
|
||||
maturation = 8
|
||||
yield = 6
|
||||
potency = 20
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
|
||||
icon_grow = "poppy-grow"
|
||||
icon_dead = "poppy-dead"
|
||||
mutatelist = list(/obj/item/seeds/poppy/geranium, /obj/item/seeds/poppy/lily)
|
||||
reagents_add = list("bicaridine" = 0.2, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy
|
||||
seed = /obj/item/seeds/poppy
|
||||
name = "poppy"
|
||||
desc = "Long-used as a symbol of rest, peace, and death."
|
||||
icon_state = "poppy"
|
||||
slot_flags = SLOT_HEAD
|
||||
filling_color = "#FF6347"
|
||||
bitesize_mod = 3
|
||||
|
||||
// Lily
|
||||
/obj/item/seeds/poppy/lily
|
||||
name = "pack of lily seeds"
|
||||
desc = "These seeds grow into lilies."
|
||||
icon_state = "seed-lily"
|
||||
species = "lily"
|
||||
plantname = "Lily Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/poppy/lily
|
||||
mutatelist = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy/lily
|
||||
seed = /obj/item/seeds/poppy/lily
|
||||
name = "lily"
|
||||
desc = "A beautiful orange flower"
|
||||
icon_state = "lily"
|
||||
filling_color = "#FFA500"
|
||||
|
||||
// Geranium
|
||||
/obj/item/seeds/poppy/geranium
|
||||
name = "pack of geranium seeds"
|
||||
desc = "These seeds grow into geranium."
|
||||
icon_state = "seed-geranium"
|
||||
species = "geranium"
|
||||
plantname = "Geranium Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/poppy/geranium
|
||||
mutatelist = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy/geranium
|
||||
seed = /obj/item/seeds/poppy/geranium
|
||||
name = "geranium"
|
||||
desc = "A beautiful blue flower"
|
||||
icon_state = "geranium"
|
||||
filling_color = "#008B8B"
|
||||
|
||||
|
||||
// Harebell
|
||||
/obj/item/seeds/harebell
|
||||
name = "pack of harebell seeds"
|
||||
desc = "These seeds grow into pretty little flowers."
|
||||
icon_state = "seed-harebell"
|
||||
species = "harebell"
|
||||
plantname = "Harebells"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/harebell
|
||||
lifespan = 100
|
||||
endurance = 20
|
||||
maturation = 7
|
||||
production = 1
|
||||
yield = 2
|
||||
potency = 30
|
||||
growthstages = 4
|
||||
genes = list(/datum/plant_gene/trait/plant_type/weed_hardy)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
|
||||
reagents_add = list("nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/harebell
|
||||
seed = /obj/item/seeds/harebell
|
||||
name = "harebell"
|
||||
desc = "\"I'll sweeten thy sad grave: thou shalt not lack the flower that's like thy face, pale primrose, nor the azured hare-bell, like thy veins; no, nor the leaf of eglantine, whom not to slander, out-sweeten'd not thy breath.\""
|
||||
icon_state = "harebell"
|
||||
slot_flags = SLOT_HEAD
|
||||
filling_color = "#E6E6FA"
|
||||
bitesize_mod = 3
|
||||
|
||||
|
||||
// Sunflower
|
||||
/obj/item/seeds/sunflower
|
||||
name = "pack of sunflower seeds"
|
||||
desc = "These seeds grow into sunflowers."
|
||||
icon_state = "seed-sunflower"
|
||||
species = "sunflower"
|
||||
plantname = "Sunflowers"
|
||||
product = /obj/item/weapon/grown/sunflower
|
||||
endurance = 20
|
||||
production = 2
|
||||
yield = 2
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
|
||||
icon_grow = "sunflower-grow"
|
||||
icon_dead = "sunflower-dead"
|
||||
mutatelist = list(/obj/item/seeds/sunflower/moonflower, /obj/item/seeds/sunflower/novaflower)
|
||||
reagents_add = list("cornoil" = 0.08, "nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/grown/sunflower // FLOWER POWER!
|
||||
seed = /obj/item/seeds/sunflower
|
||||
name = "sunflower"
|
||||
desc = "It's beautiful! A certain person might beat you to death if you trample these."
|
||||
icon_state = "sunflower"
|
||||
damtype = "fire"
|
||||
force = 0
|
||||
slot_flags = SLOT_HEAD
|
||||
throwforce = 0
|
||||
w_class = 1
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
|
||||
/obj/item/weapon/grown/sunflower/attack(mob/M, mob/user)
|
||||
to_chat(M, "<font color='green'><b> [user] smacks you with a sunflower!</font><font color='yellow'><b>FLOWER POWER<b></font>")
|
||||
to_chat(user, "<font color='green'>Your sunflower's </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'>strikes [M]</font>")
|
||||
|
||||
// Moonflower
|
||||
/obj/item/seeds/sunflower/moonflower
|
||||
name = "pack of moonflower seeds"
|
||||
desc = "These seeds grow into moonflowers."
|
||||
icon_state = "seed-moonflower"
|
||||
species = "moonflower"
|
||||
plantname = "Moonflowers"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
|
||||
mutatelist = list()
|
||||
reagents_add = list("moonshine" = 0.2, "vitamin" = 0.02, "nutriment" = 0.02)
|
||||
rarity = 15
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
|
||||
seed = /obj/item/seeds/sunflower/moonflower
|
||||
name = "moonflower"
|
||||
desc = "Store in a location at least 50 yards away from werewolves."
|
||||
icon_state = "moonflower"
|
||||
slot_flags = SLOT_HEAD
|
||||
filling_color = "#E6E6FA"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Novaflower
|
||||
/obj/item/seeds/sunflower/novaflower
|
||||
name = "pack of novaflower seeds"
|
||||
desc = "These seeds grow into novaflowers."
|
||||
icon_state = "seed-novaflower"
|
||||
species = "novaflower"
|
||||
plantname = "Novaflowers"
|
||||
product = /obj/item/weapon/grown/novaflower
|
||||
mutatelist = list()
|
||||
reagents_add = list("condensedcapsaicin" = 0.25, "capsaicin" = 0.3, "nutriment" = 0)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/grown/novaflower
|
||||
seed = /obj/item/seeds/sunflower/novaflower
|
||||
name = "novaflower"
|
||||
desc = "These beautiful flowers have a crisp smokey scent, like a summer bonfire."
|
||||
icon_state = "novaflower"
|
||||
damtype = "fire"
|
||||
force = 0
|
||||
slot_flags = SLOT_HEAD
|
||||
throwforce = 0
|
||||
w_class = 1
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
attack_verb = list("roasted", "scorched", "burned")
|
||||
|
||||
/obj/item/weapon/grown/novaflower/add_juice()
|
||||
..()
|
||||
force = round((5 + seed.potency / 5), 1)
|
||||
|
||||
/obj/item/weapon/grown/novaflower/attack(mob/living/carbon/M, mob/user)
|
||||
if(!..())
|
||||
return
|
||||
if(isliving(M))
|
||||
to_chat(M, "<span class='danger'>You are lit on fire from the intense heat of the [name]!</span>")
|
||||
M.adjust_fire_stacks(seed.potency / 20)
|
||||
if(M.IgniteMob())
|
||||
message_admins("[key_name_admin(user)] set [key_name_admin(M)] on fire")
|
||||
log_game("[key_name(user)] set [key_name(M)] on fire")
|
||||
|
||||
/obj/item/weapon/grown/novaflower/afterattack(atom/A as mob|obj, mob/user,proximity)
|
||||
if(!proximity) return
|
||||
if(force > 0)
|
||||
force -= rand(1, (force / 3) + 1)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>All the petals have fallen off the [name] from violent whacking!</span>")
|
||||
usr.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/grown/novaflower/pickup(mob/living/carbon/human/user)
|
||||
..()
|
||||
if(!user.gloves)
|
||||
to_chat(user, "<span class='danger'>The [name] burns your bare hand!</span>")
|
||||
user.adjustFireLoss(rand(1, 5))
|
||||
@@ -0,0 +1,69 @@
|
||||
// Grass
|
||||
/obj/item/seeds/grass
|
||||
name = "pack of grass seeds"
|
||||
desc = "These seeds grow into grass. Yummy!"
|
||||
icon_state = "seed-grass"
|
||||
species = "grass"
|
||||
plantname = "Grass"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/grass
|
||||
lifespan = 40
|
||||
endurance = 40
|
||||
maturation = 2
|
||||
production = 5
|
||||
yield = 5
|
||||
growthstages = 2
|
||||
icon_grow = "grass-grow"
|
||||
icon_dead = "grass-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/grass/carpet)
|
||||
reagents_add = list("nutriment" = 0.02, "hydrogen" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grass
|
||||
seed = /obj/item/seeds/grass
|
||||
name = "grass"
|
||||
desc = "Green and lush."
|
||||
icon_state = "grassclump"
|
||||
filling_color = "#32CD32"
|
||||
bitesize_mod = 2
|
||||
var/stacktype = /obj/item/stack/tile/grass
|
||||
var/tile_coefficient = 0.02 // 1/50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grass/attack_self(mob/user)
|
||||
to_chat(user, "<span class='notice'>You prepare the astroturf.</span>")
|
||||
var/grassAmt = 1 + round(seed.potency * tile_coefficient) // The grass we're holding
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/grass/G in user.loc) // The grass on the floor
|
||||
if(G.type != type)
|
||||
continue
|
||||
grassAmt += 1 + round(G.seed.potency * tile_coefficient)
|
||||
qdel(G)
|
||||
var/obj/item/stack/tile/GT = new stacktype(user.loc)
|
||||
while(grassAmt > GT.max_amount)
|
||||
GT.amount = GT.max_amount
|
||||
grassAmt -= GT.max_amount
|
||||
GT = new stacktype(user.loc)
|
||||
GT.amount = grassAmt
|
||||
for(var/obj/item/stack/tile/T in user.loc)
|
||||
if((T.type == stacktype) && (T.amount < T.max_amount))
|
||||
GT.merge(T)
|
||||
if(GT.amount <= 0)
|
||||
break
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// Carpet
|
||||
/obj/item/seeds/grass/carpet
|
||||
name = "pack of carpet seeds"
|
||||
desc = "These seeds grow into stylish carpet samples."
|
||||
icon_state = "seed-carpet"
|
||||
species = "carpet"
|
||||
plantname = "Carpet"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/grass/carpet
|
||||
mutatelist = list()
|
||||
rarity = 10
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grass/carpet
|
||||
seed = /obj/item/seeds/grass/carpet
|
||||
name = "carpet"
|
||||
desc = "The textile industry's dark secret."
|
||||
icon_state = "carpetclump"
|
||||
stacktype = /obj/item/stack/tile/carpet
|
||||
@@ -0,0 +1,96 @@
|
||||
// A very special plant, deserving it's own file.
|
||||
|
||||
/obj/item/seeds/kudzu
|
||||
name = "pack of kudzu seeds"
|
||||
desc = "These seeds grow into a weed that grows incredibly fast."
|
||||
icon_state = "seed-kudzu"
|
||||
species = "kudzu"
|
||||
plantname = "Kudzu"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/kudzupod
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy)
|
||||
lifespan = 20
|
||||
endurance = 10
|
||||
yield = 4
|
||||
growthstages = 4
|
||||
rarity = 30
|
||||
var/list/mutations = list()
|
||||
reagents_add = list("charcoal" = 0.04, "nutriment" = 0.02)
|
||||
|
||||
/obj/item/seeds/kudzu/Copy()
|
||||
var/obj/item/seeds/kudzu/S = ..()
|
||||
S.mutations = mutations.Copy()
|
||||
return S
|
||||
|
||||
/obj/item/seeds/kudzu/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] swallows the pack of kudzu seeds! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
plant(user)
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/seeds/kudzu/proc/plant(mob/user)
|
||||
if(istype(user.loc, /turf/space))
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("Kudzu planted by [key_name_admin(user)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) at ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>(JMP)</a>)",0,1)
|
||||
investigate_log("was planted by [key_name(user)] at ([T.x],[T.y],[T.z])","kudzu")
|
||||
new /obj/effect/spacevine_controller(user.loc, mutations, potency, production)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/seeds/kudzu/attack_self(mob/user)
|
||||
plant(user)
|
||||
to_chat(user, "<span class='notice'>You plant the kudzu. You monster.</span>")
|
||||
|
||||
/obj/item/seeds/kudzu/get_analyzer_text()
|
||||
var/text = ..()
|
||||
var/text_string = ""
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
text_string += "[(text_string == "") ? "" : ", "][SM.name]"
|
||||
text += "\n- Plant Mutations: [(text_string == "") ? "None" : text_string]"
|
||||
return text
|
||||
|
||||
/obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/S)
|
||||
var/list/temp_mut_list = list()
|
||||
|
||||
if(S.has_reagent("sterilizine", 5))
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
if(SM.quality == NEGATIVE)
|
||||
temp_mut_list += SM
|
||||
if(prob(20))
|
||||
mutations.Remove(pick(temp_mut_list))
|
||||
temp_mut_list.Cut()
|
||||
|
||||
if(S.has_reagent("welding_fuel", 5))
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
if(SM.quality == POSITIVE)
|
||||
temp_mut_list += SM
|
||||
if(prob(20))
|
||||
mutations.Remove(pick(temp_mut_list))
|
||||
temp_mut_list.Cut()
|
||||
|
||||
if(S.has_reagent("phenol", 5))
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
if(SM.quality == MINOR_NEGATIVE)
|
||||
temp_mut_list += SM
|
||||
if(prob(20))
|
||||
mutations.Remove(pick(temp_mut_list))
|
||||
temp_mut_list.Cut()
|
||||
|
||||
if(S.has_reagent("blood", 15))
|
||||
production = Clamp(production + rand(15, -5),1,10)
|
||||
|
||||
if(S.has_reagent("amatoxin", 5))
|
||||
production = Clamp(production + rand(5, -15),1,10)
|
||||
|
||||
if(S.has_reagent("plasma", 5))
|
||||
potency = Clamp(potency + rand(5, -15),0,100)
|
||||
|
||||
if(S.has_reagent("holywater", 10))
|
||||
potency = Clamp(potency + rand(15, -5),0,100)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/kudzupod
|
||||
seed = /obj/item/seeds/kudzu
|
||||
name = "kudzu pod"
|
||||
desc = "<I>Pueraria Virallis</I>: An invasive species with vines that rapidly creep and wrap around whatever they contact."
|
||||
icon_state = "kudzupod"
|
||||
filling_color = "#6B8E23"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,47 @@
|
||||
// Watermelon
|
||||
/obj/item/seeds/watermelon
|
||||
name = "pack of watermelon seeds"
|
||||
desc = "These seeds grow into watermelon plants."
|
||||
icon_state = "seed-watermelon"
|
||||
species = "watermelon"
|
||||
plantname = "Watermelon Vines"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
|
||||
lifespan = 50
|
||||
endurance = 40
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_dead = "watermelon-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/watermelon/holy)
|
||||
reagents_add = list("water" = 0.2, "vitamin" = 0.04, "nutriment" = 0.2)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
|
||||
seed = /obj/item/seeds/watermelon
|
||||
name = "watermelon"
|
||||
desc = "It's full of watery goodness."
|
||||
icon_state = "watermelon"
|
||||
slice_path = /obj/item/weapon/reagent_containers/food/snacks/watermelonslice
|
||||
slices_num = 5
|
||||
dried_type = null
|
||||
w_class = 3
|
||||
filling_color = "#008000"
|
||||
bitesize_mod = 3
|
||||
|
||||
// Holymelon
|
||||
/obj/item/seeds/watermelon/holy
|
||||
name = "pack of holymelon seeds"
|
||||
desc = "These seeds grow into holymelon plants."
|
||||
icon_state = "seed-holymelon"
|
||||
species = "holymelon"
|
||||
plantname = "Holy Melon Vines"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/holymelon
|
||||
mutatelist = list()
|
||||
reagents_add = list("holywater" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/holymelon
|
||||
seed = /obj/item/seeds/watermelon/holy
|
||||
name = "holymelon"
|
||||
desc = "The water within this melon has been blessed by some deity that's particularly fond of watermelon."
|
||||
icon_state = "holymelon"
|
||||
filling_color = "#FFD700"
|
||||
dried_type = null
|
||||
@@ -0,0 +1,141 @@
|
||||
// Weeds
|
||||
/obj/item/seeds/weeds
|
||||
name = "pack of weed seeds"
|
||||
desc = "Yo mang, want some weeds?"
|
||||
icon_state = "seed"
|
||||
species = "weeds"
|
||||
plantname = "Starthistle"
|
||||
lifespan = 100
|
||||
endurance = 50 // damm pesky weeds
|
||||
maturation = 5
|
||||
production = 1
|
||||
yield = -1
|
||||
potency = -1
|
||||
growthstages = 4
|
||||
genes = list(/datum/plant_gene/trait/plant_type/weed_hardy)
|
||||
|
||||
|
||||
// Cabbage
|
||||
/obj/item/seeds/cabbage
|
||||
name = "pack of cabbage seeds"
|
||||
desc = "These seeds grow into cabbages."
|
||||
icon_state = "seed-cabbage"
|
||||
species = "cabbage"
|
||||
plantname = "Cabbages"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cabbage
|
||||
lifespan = 50
|
||||
endurance = 25
|
||||
maturation = 3
|
||||
production = 5
|
||||
yield = 4
|
||||
growthstages = 1
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/replicapod)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage
|
||||
seed = /obj/item/seeds/cabbage
|
||||
name = "cabbage"
|
||||
desc = "Ewwwwwwwwww. Cabbage."
|
||||
icon_state = "cabbage"
|
||||
filling_color = "#90EE90"
|
||||
bitesize_mod = 2
|
||||
|
||||
|
||||
// Sugarcane
|
||||
/obj/item/seeds/sugarcane
|
||||
name = "pack of sugarcane seeds"
|
||||
desc = "These seeds grow into sugarcane."
|
||||
icon_state = "seed-sugarcane"
|
||||
species = "sugarcane"
|
||||
plantname = "Sugarcane"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
lifespan = 60
|
||||
endurance = 50
|
||||
maturation = 3
|
||||
yield = 4
|
||||
growthstages = 3
|
||||
reagents_add = list("sugar" = 0.25)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane
|
||||
seed = /obj/item/seeds/sugarcane
|
||||
name = "sugarcane"
|
||||
desc = "Sickly sweet."
|
||||
icon_state = "sugarcane"
|
||||
filling_color = "#FFD700"
|
||||
bitesize_mod = 2
|
||||
|
||||
|
||||
// Gatfruit
|
||||
/obj/item/seeds/gatfruit
|
||||
name = "pack of gatfruit seeds"
|
||||
desc = "These seeds grow into .357 revolvers."
|
||||
icon_state = "seed-gatfruit"
|
||||
species = "gatfruit"
|
||||
plantname = "Gatfruit Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/shell/gatfruit
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
lifespan = 20
|
||||
endurance = 20
|
||||
maturation = 40
|
||||
production = 10
|
||||
yield = 2
|
||||
potency = 60
|
||||
growthstages = 2
|
||||
rarity = 60 // Obtainable only with xenobio+superluck.
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
reagents_add = list("sulfur" = 0.1, "carbon" = 0.1, "nitrogen" = 0.07, "potassium" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/gatfruit
|
||||
seed = /obj/item/seeds/gatfruit
|
||||
name = "gatfruit"
|
||||
desc = "It smells like burning."
|
||||
icon_state = "gatfruit"
|
||||
origin_tech = "combat=6"
|
||||
trash = /obj/item/weapon/gun/projectile/revolver
|
||||
bitesize_mod = 2
|
||||
|
||||
//Cherry Bombs
|
||||
/obj/item/seeds/cherry/bomb
|
||||
name = "pack of cherry bomb pits"
|
||||
desc = "They give you vibes of dread and frustration."
|
||||
icon_state = "seed-cherry_bomb"
|
||||
species = "cherry_bomb"
|
||||
plantname = "Cherry Bomb Tree"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb
|
||||
mutatelist = list()
|
||||
reagents_add = list("nutriment" = 0.1, "sugar" = 0.1, "blackpowder" = 0.7)
|
||||
rarity = 60 //See above
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb
|
||||
name = "cherry bombs"
|
||||
desc = "You think you can hear the hissing of a tiny fuse."
|
||||
icon_state = "cherry_bomb"
|
||||
filling_color = rgb(20, 20, 20)
|
||||
seed = /obj/item/seeds/cherry/bomb
|
||||
bitesize_mod = 2
|
||||
volume = 125 //Gives enough room for the black powder at max potency
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/attack_self(mob/living/user)
|
||||
var/area/A = get_area(user)
|
||||
user.visible_message("<span class='warning'>[user] plucks the stem from [src]!</span>", "<span class='userdanger'>You pluck the stem from [src], which begins to hiss loudly!</span>")
|
||||
message_admins("[user] ([user.key ? user.key : "no key"]) primed a cherry bomb for detonation at [A] ([user.x], [user.y], [user.z]) <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>(JMP)</a>")
|
||||
log_game("[user] ([user.key ? user.key : "no key"]) primed a cherry bomb for detonation at [A] ([user.x],[user.y],[user.z]).")
|
||||
prime()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/deconstruct(disassembled = TRUE)
|
||||
if(!disassembled)
|
||||
prime()
|
||||
if(!qdeleted(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/ex_act(severity)
|
||||
qdel(src) //Ensuring that it's deleted by its own explosion. Also prevents mass chain reaction with piles of cherry bombs
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/proc/prime()
|
||||
icon_state = "cherry_bomb_lit"
|
||||
playsound(src, 'sound/goonstation/misc/fuse.ogg', seed.potency, 0)
|
||||
reagents.chem_temp = 1000 //Sets off the black powder
|
||||
reagents.handle_reactions()
|
||||
@@ -0,0 +1,270 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom
|
||||
name = "mushroom"
|
||||
bitesize_mod = 2
|
||||
|
||||
|
||||
// Reishi
|
||||
/obj/item/seeds/reishi
|
||||
name = "pack of reishi mycelium"
|
||||
desc = "This mycelium grows into something medicinal and relaxing."
|
||||
icon_state = "mycelium-reishi"
|
||||
species = "reishi"
|
||||
plantname = "Reishi"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi
|
||||
lifespan = 35
|
||||
endurance = 35
|
||||
maturation = 10
|
||||
production = 5
|
||||
yield = 4
|
||||
potency = 15
|
||||
growthstages = 4
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
reagents_add = list("morphine" = 0.35, "charcoal" = 0.35, "nutriment" = 0)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi
|
||||
seed = /obj/item/seeds/reishi
|
||||
name = "reishi"
|
||||
desc = "<I>Ganoderma lucidum</I>: A special fungus known for its medicinal and stress relieving properties."
|
||||
icon_state = "reishi"
|
||||
filling_color = "#FF4500"
|
||||
|
||||
|
||||
// Fly Amanita
|
||||
/obj/item/seeds/amanita
|
||||
name = "pack of fly amanita mycelium"
|
||||
desc = "This mycelium grows into something horrible."
|
||||
icon_state = "mycelium-amanita"
|
||||
species = "amanita"
|
||||
plantname = "Fly Amanitas"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
|
||||
lifespan = 50
|
||||
endurance = 35
|
||||
maturation = 10
|
||||
production = 5
|
||||
yield = 4
|
||||
growthstages = 3
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
mutatelist = list(/obj/item/seeds/angel)
|
||||
reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.35, "nutriment" = 0, "growthserum" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
|
||||
seed = /obj/item/seeds/amanita
|
||||
name = "fly amanita"
|
||||
desc = "<I>Amanita Muscaria</I>: Learn poisonous mushrooms by heart. Only pick mushrooms you know."
|
||||
icon_state = "amanita"
|
||||
filling_color = "#FF0000"
|
||||
|
||||
|
||||
// Destroying Angel
|
||||
/obj/item/seeds/angel
|
||||
name = "pack of destroying angel mycelium"
|
||||
desc = "This mycelium grows into something devastating."
|
||||
icon_state = "mycelium-angel"
|
||||
species = "angel"
|
||||
plantname = "Destroying Angels"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel
|
||||
lifespan = 50
|
||||
endurance = 35
|
||||
maturation = 12
|
||||
production = 5
|
||||
yield = 2
|
||||
potency = 35
|
||||
growthstages = 3
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.1, "nutriment" = 0, "amanitin" = 0.2)
|
||||
rarity = 30
|
||||
origin_tech = "biotech=5"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel
|
||||
seed = /obj/item/seeds/angel
|
||||
name = "destroying angel"
|
||||
desc = "<I>Amanita Virosa</I>: Deadly poisonous basidiomycete fungus filled with alpha amatoxins."
|
||||
icon_state = "angel"
|
||||
filling_color = "#C0C0C0"
|
||||
|
||||
|
||||
// Liberty Cap
|
||||
/obj/item/seeds/liberty
|
||||
name = "pack of liberty-cap mycelium"
|
||||
desc = "This mycelium grows into liberty-cap mushrooms."
|
||||
icon_state = "mycelium-liberty"
|
||||
species = "liberty"
|
||||
plantname = "Liberty-Caps"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
|
||||
maturation = 7
|
||||
production = 1
|
||||
yield = 5
|
||||
potency = 15
|
||||
growthstages = 3
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
reagents_add = list("mushroomhallucinogen" = 0.25, "nutriment" = 0.02)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
|
||||
seed = /obj/item/seeds/liberty
|
||||
name = "liberty-cap"
|
||||
desc = "<I>Psilocybe Semilanceata</I>: Liberate yourself!"
|
||||
icon_state = "libertycap"
|
||||
filling_color = "#DAA520"
|
||||
|
||||
|
||||
// Plump Helmet
|
||||
/obj/item/seeds/plump
|
||||
name = "pack of plump-helmet mycelium"
|
||||
desc = "This mycelium grows into helmets... maybe."
|
||||
icon_state = "mycelium-plump"
|
||||
species = "plump"
|
||||
plantname = "Plump-Helmet Mushrooms"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet
|
||||
maturation = 8
|
||||
production = 1
|
||||
yield = 4
|
||||
potency = 15
|
||||
growthstages = 3
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
mutatelist = list(/obj/item/seeds/plump/walkingmushroom)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet
|
||||
seed = /obj/item/seeds/plump
|
||||
name = "plump-helmet"
|
||||
desc = "<I>Plumus Hellmus</I>: Plump, soft and s-so inviting~"
|
||||
icon_state = "plumphelmet"
|
||||
filling_color = "#9370DB"
|
||||
|
||||
|
||||
// Walking Mushroom
|
||||
/obj/item/seeds/plump/walkingmushroom
|
||||
name = "pack of walking mushroom mycelium"
|
||||
desc = "This mycelium will grow into huge stuff!"
|
||||
icon_state = "mycelium-walkingmushroom"
|
||||
species = "walkingmushroom"
|
||||
plantname = "Walking Mushrooms"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom
|
||||
lifespan = 30
|
||||
endurance = 30
|
||||
maturation = 5
|
||||
yield = 1
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
mutatelist = list()
|
||||
reagents_add = list("vitamin" = 0.05, "nutriment" = 0.15)
|
||||
rarity = 30
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom
|
||||
seed = /obj/item/seeds/plump/walkingmushroom
|
||||
name = "walking mushroom"
|
||||
desc = "<I>Plumus Locomotus</I>: The beginning of the great walk."
|
||||
icon_state = "walkingmushroom"
|
||||
filling_color = "#9370DB"
|
||||
origin_tech = "biotech=4;programming=5"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user)
|
||||
if(isspaceturf(user.loc))
|
||||
return
|
||||
var/mob/living/simple_animal/hostile/mushroom/M = new /mob/living/simple_animal/hostile/mushroom(user.loc)
|
||||
M.maxHealth += round(seed.endurance / 4)
|
||||
M.melee_damage_lower += round(seed.potency / 20)
|
||||
M.melee_damage_upper += round(seed.potency / 20)
|
||||
M.move_to_delay -= round(seed.production / 50)
|
||||
M.health = M.maxHealth
|
||||
qdel(src)
|
||||
to_chat(user, "<span class='notice'>You plant the walking mushroom.</span>")
|
||||
|
||||
|
||||
// Chanterelle
|
||||
/obj/item/seeds/chanter
|
||||
name = "pack of chanterelle mycelium"
|
||||
desc = "This mycelium grows into chanterelle mushrooms."
|
||||
icon_state = "mycelium-chanter"
|
||||
species = "chanter"
|
||||
plantname = "Chanterelle Mushrooms"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle
|
||||
lifespan = 35
|
||||
endurance = 20
|
||||
maturation = 7
|
||||
production = 1
|
||||
yield = 5
|
||||
potency = 15
|
||||
growthstages = 3
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
reagents_add = list("nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle
|
||||
seed = /obj/item/seeds/chanter
|
||||
name = "chanterelle cluster"
|
||||
desc = "<I>Cantharellus Cibarius</I>: These jolly yellow little shrooms sure look tasty!"
|
||||
icon_state = "chanterelle"
|
||||
filling_color = "#FFA500"
|
||||
|
||||
|
||||
// Glowshroom
|
||||
/obj/item/seeds/glowshroom
|
||||
name = "pack of glowshroom mycelium"
|
||||
desc = "This mycelium -glows- into mushrooms!"
|
||||
icon_state = "mycelium-glowshroom"
|
||||
species = "glowshroom"
|
||||
plantname = "Glowshrooms"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
|
||||
lifespan = 120 //ten times that is the delay
|
||||
endurance = 30
|
||||
maturation = 15
|
||||
production = 1
|
||||
yield = 3 //-> spread
|
||||
potency = 30 //-> brightness
|
||||
growthstages = 4
|
||||
rarity = 20
|
||||
genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
mutatelist = list(/obj/item/seeds/glowshroom/glowcap)
|
||||
reagents_add = list("radium" = 0.1, "phosphorus" = 0.1, "nutriment" = 0.04)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
|
||||
seed = /obj/item/seeds/glowshroom
|
||||
name = "glowshroom cluster"
|
||||
desc = "<I>Mycena Bregprox</I>: This species of mushroom glows in the dark."
|
||||
icon_state = "glowshroom"
|
||||
filling_color = "#00FA9A"
|
||||
var/effect_path = /obj/structure/glowshroom
|
||||
origin_tech = "biotech=4;plasmatech=6"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user)
|
||||
if(isspaceturf(user.loc))
|
||||
return
|
||||
var/obj/structure/glowshroom/planted = new effect_path(user.loc)
|
||||
planted.delay = planted.delay - seed.production * 100 //So the delay goes DOWN with better stats instead of up. :I
|
||||
planted.obj_integrity = seed.endurance
|
||||
planted.max_integrity = seed.endurance
|
||||
planted.yield = seed.yield
|
||||
planted.potency = seed.potency
|
||||
to_chat(user, "<span class='notice'>You plant [src].</span>")
|
||||
qdel(src)
|
||||
|
||||
|
||||
// Glowcap
|
||||
/obj/item/seeds/glowshroom/glowcap
|
||||
name = "pack of glowcap mycelium"
|
||||
desc = "This mycelium -powers- into mushrooms!"
|
||||
icon_state = "mycelium-glowcap"
|
||||
species = "glowcap"
|
||||
icon_grow = "glowshroom-grow"
|
||||
icon_dead = "glowshroom-dead"
|
||||
plantname = "Glowcaps"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap
|
||||
genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/cell_charge, /datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
mutatelist = list()
|
||||
reagents_add = list("teslium" = 0.1, "nutriment" = 0.04)
|
||||
rarity = 30
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap
|
||||
seed = /obj/item/seeds/glowshroom/glowcap
|
||||
name = "glowcap cluster"
|
||||
desc = "<I>Mycena Ruthenia</I>: This species of mushroom glows in the dark, but aren't bioluminescent. They're warm to the touch..."
|
||||
icon_state = "glowcap"
|
||||
filling_color = "#00FA9A"
|
||||
effect_path = /obj/structure/glowshroom/glowcap
|
||||
origin_tech = "biotech=4;powerstorage=6;plasmatech=4"
|
||||
@@ -0,0 +1,111 @@
|
||||
/obj/item/seeds/nettle
|
||||
name = "pack of nettle seeds"
|
||||
desc = "These seeds grow into nettles."
|
||||
icon_state = "seed-nettle"
|
||||
species = "nettle"
|
||||
plantname = "Nettles"
|
||||
product = /obj/item/weapon/grown/nettle/basic
|
||||
lifespan = 30
|
||||
endurance = 40 // tuff like a toiger
|
||||
yield = 4
|
||||
growthstages = 5
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy)
|
||||
mutatelist = list(/obj/item/seeds/nettle/death)
|
||||
reagents_add = list("sacid" = 0.5)
|
||||
|
||||
/obj/item/seeds/nettle/death
|
||||
name = "pack of death-nettle seeds"
|
||||
desc = "These seeds grow into death-nettles."
|
||||
icon_state = "seed-deathnettle"
|
||||
species = "deathnettle"
|
||||
plantname = "Death Nettles"
|
||||
product = /obj/item/weapon/grown/nettle/death
|
||||
endurance = 25
|
||||
maturation = 8
|
||||
yield = 2
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy, /datum/plant_gene/trait/stinging)
|
||||
mutatelist = list()
|
||||
reagents_add = list("facid" = 0.5, "sacid" = 0.5)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/grown/nettle //abstract type
|
||||
name = "nettle"
|
||||
desc = "It's probably <B>not</B> wise to touch it with bare hands..."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "nettle"
|
||||
damtype = "fire"
|
||||
force = 15
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
throwforce = 5
|
||||
w_class = 1
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
origin_tech = "combat=3"
|
||||
attack_verb = list("stung")
|
||||
|
||||
/obj/item/weapon/grown/nettle/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is eating some of [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (BRUTELOSS|TOXLOSS)
|
||||
|
||||
/obj/item/weapon/grown/nettle/pickup(mob/living/user)
|
||||
..()
|
||||
if(!iscarbon(user))
|
||||
return 0
|
||||
var/mob/living/carbon/C = user
|
||||
if(C.gloves)
|
||||
return 0
|
||||
var/hit_zone = (C.held_index_to_dir(C.active_hand_index) == "l" ? "l_":"r_") + "arm"
|
||||
var/obj/item/bodypart/affecting = C.get_bodypart(hit_zone)
|
||||
if(affecting)
|
||||
if(affecting.receive_damage(0, force))
|
||||
C.update_damage_overlays()
|
||||
to_chat(C, "<span class='userdanger'>The nettle burns your bare hand!</span>")
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user,proximity)
|
||||
if(!proximity) return
|
||||
if(force > 0)
|
||||
force -= rand(1, (force / 3) + 1) // When you whack someone with it, leaves fall off
|
||||
else
|
||||
to_chat(usr, "All the leaves have fallen off the nettle from violent whacking.")
|
||||
usr.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/grown/nettle/basic
|
||||
seed = /obj/item/seeds/nettle
|
||||
|
||||
/obj/item/weapon/grown/nettle/basic/add_juice()
|
||||
..()
|
||||
force = round((5 + seed.potency / 5), 1)
|
||||
|
||||
/obj/item/weapon/grown/nettle/death
|
||||
seed = /obj/item/seeds/nettle/death
|
||||
name = "deathnettle"
|
||||
desc = "The <span class='danger'>glowing</span> nettle incites <span class='boldannounce'>rage</span> in you just from looking at it!"
|
||||
icon_state = "deathnettle"
|
||||
force = 30
|
||||
throwforce = 15
|
||||
origin_tech = "combat=5"
|
||||
|
||||
/obj/item/weapon/grown/nettle/death/add_juice()
|
||||
..()
|
||||
force = round((5 + seed.potency / 2.5), 1)
|
||||
|
||||
/obj/item/weapon/grown/nettle/death/pickup(mob/living/carbon/user)
|
||||
if(..())
|
||||
if(prob(50))
|
||||
user.Paralyse(5)
|
||||
to_chat(user, "<span class='userdanger'>You are stunned by the Deathnettle when you try picking it up!</span>")
|
||||
|
||||
/obj/item/weapon/grown/nettle/death/attack(mob/living/carbon/M, mob/user)
|
||||
if(!..())
|
||||
return
|
||||
if(isliving(M))
|
||||
to_chat(M, "<span class='danger'>You are stunned by the powerful acid of the Deathnettle!</span>")
|
||||
add_logs(user, M, "attacked", src)
|
||||
|
||||
M.adjust_blurriness(force/7)
|
||||
if(prob(20))
|
||||
M.Paralyse(force / 6)
|
||||
M.Weaken(force / 15)
|
||||
M.drop_item()
|
||||
@@ -0,0 +1,65 @@
|
||||
// Potato
|
||||
/obj/item/seeds/potato
|
||||
name = "pack of potato seeds"
|
||||
desc = "Boil 'em! Mash 'em! Stick 'em in a stew!"
|
||||
icon_state = "seed-potato"
|
||||
species = "potato"
|
||||
plantname = "Potato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/potato
|
||||
lifespan = 30
|
||||
maturation = 10
|
||||
production = 1
|
||||
yield = 4
|
||||
growthstages = 4
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_grow = "potato-grow"
|
||||
icon_dead = "potato-dead"
|
||||
genes = list(/datum/plant_gene/trait/battery)
|
||||
mutatelist = list(/obj/item/seeds/potato/sweet)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato
|
||||
seed = /obj/item/seeds/potato
|
||||
name = "potato"
|
||||
desc = "Boil 'em! Mash 'em! Stick 'em in a stew!"
|
||||
icon_state = "potato"
|
||||
filling_color = "#E9967A"
|
||||
bitesize = 100
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/wedges
|
||||
name = "potato wedges"
|
||||
desc = "Slices of neatly cut potato."
|
||||
icon_state = "potato_wedges"
|
||||
filling_color = "#E9967A"
|
||||
bitesize = 100
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.is_sharp())
|
||||
to_chat(user, "<span class='notice'>You cut the potato into wedges with [W].</span>")
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/potato/wedges/Wedges = new /obj/item/weapon/reagent_containers/food/snacks/grown/potato/wedges
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(Wedges)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
// Sweet Potato
|
||||
/obj/item/seeds/potato/sweet
|
||||
name = "pack of sweet potato seeds"
|
||||
desc = "These seeds grow into sweet potato plants."
|
||||
icon_state = "seed-sweetpotato"
|
||||
species = "sweetpotato"
|
||||
plantname = "Sweet Potato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/potato/sweet
|
||||
mutatelist = list()
|
||||
reagents_add = list("vitamin" = 0.1, "sugar" = 0.1, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/sweet
|
||||
seed = /obj/item/seeds/potato/sweet
|
||||
name = "sweet potato"
|
||||
desc = "It's sweet."
|
||||
icon_state = "sweetpotato"
|
||||
@@ -0,0 +1,54 @@
|
||||
// Pumpkin
|
||||
/obj/item/seeds/pumpkin
|
||||
name = "pack of pumpkin seeds"
|
||||
desc = "These seeds grow into pumpkin vines."
|
||||
icon_state = "seed-pumpkin"
|
||||
species = "pumpkin"
|
||||
plantname = "Pumpkin Vines"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin
|
||||
lifespan = 50
|
||||
endurance = 40
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "pumpkin-grow"
|
||||
icon_dead = "pumpkin-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/pumpkin/blumpkin)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin
|
||||
seed = /obj/item/seeds/pumpkin
|
||||
name = "pumpkin"
|
||||
desc = "It's large and scary."
|
||||
icon_state = "pumpkin"
|
||||
filling_color = "#FFA500"
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(W.is_sharp())
|
||||
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
|
||||
new /obj/item/clothing/head/hardhat/pumpkinhead(user.loc)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Blumpkin
|
||||
/obj/item/seeds/pumpkin/blumpkin
|
||||
name = "pack of blumpkin seeds"
|
||||
desc = "These seeds grow into blumpkin vines."
|
||||
icon_state = "seed-blumpkin"
|
||||
species = "blumpkin"
|
||||
plantname = "Blumpkin Vines"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin
|
||||
mutatelist = list()
|
||||
reagents_add = list("ammonia" = 0.2, "chlorine" = 0.1, "nutriment" = 0.2)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin
|
||||
seed = /obj/item/seeds/pumpkin/blumpkin
|
||||
name = "blumpkin"
|
||||
desc = "The pumpkin's toxic sibling."
|
||||
icon_state = "blumpkin"
|
||||
filling_color = "#87CEFA"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,29 @@
|
||||
//Random seeds; stats, traits, and plant type are randomized for each seed.
|
||||
|
||||
/obj/item/seeds/random
|
||||
name = "pack of strange seeds"
|
||||
desc = "Mysterious seeds as strange as their name implies. Spooky"
|
||||
icon_state = "seed-x"
|
||||
species = "?????"
|
||||
plantname = "strange plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/random
|
||||
icon_grow = "xpod-grow"
|
||||
icon_dead = "xpod-dead"
|
||||
icon_harvest = "xpod-harvest"
|
||||
growthstages = 4
|
||||
|
||||
/obj/item/seeds/random/New()
|
||||
randomize_stats()
|
||||
..()
|
||||
if(prob(60))
|
||||
add_random_reagents()
|
||||
if(prob(50))
|
||||
add_random_traits()
|
||||
add_random_plant_type(35)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/random
|
||||
seed = /obj/item/seeds/random
|
||||
name = "strange plant"
|
||||
desc = "What could this even be?"
|
||||
icon_state = "crunchy"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,114 @@
|
||||
// A very special plant, deserving it's own file.
|
||||
|
||||
/obj/item/seeds/replicapod
|
||||
name = "pack of replica pod seeds"
|
||||
desc = "These seeds grow into replica pods. They say these are used to harvest humans."
|
||||
icon_state = "seed-replicapod"
|
||||
species = "replicapod"
|
||||
plantname = "Replica Pod"
|
||||
product = /mob/living/carbon/human //verrry special -- Urist
|
||||
lifespan = 50
|
||||
endurance = 8
|
||||
maturation = 10
|
||||
production = 1
|
||||
yield = 1 //seeds if there isn't a dna inside
|
||||
potency = 30
|
||||
var/ckey = null
|
||||
var/realName = null
|
||||
var/datum/mind/mind = null
|
||||
var/blood_gender = null
|
||||
var/blood_type = null
|
||||
var/list/features = null
|
||||
var/factions = null
|
||||
var/contains_sample = 0
|
||||
|
||||
/obj/item/seeds/replicapod/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(istype(W,/obj/item/weapon/reagent_containers/syringe))
|
||||
if(!contains_sample)
|
||||
for(var/datum/reagent/blood/bloodSample in W.reagents.reagent_list)
|
||||
if(bloodSample.data["mind"] && bloodSample.data["cloneable"] == 1)
|
||||
mind = bloodSample.data["mind"]
|
||||
ckey = bloodSample.data["ckey"]
|
||||
realName = bloodSample.data["real_name"]
|
||||
blood_gender = bloodSample.data["gender"]
|
||||
blood_type = bloodSample.data["blood_type"]
|
||||
features = bloodSample.data["features"]
|
||||
factions = bloodSample.data["factions"]
|
||||
W.reagents.clear_reagents()
|
||||
user << "<span class='notice'>You inject the contents of the syringe into the seeds.</span>"
|
||||
contains_sample = 1
|
||||
else
|
||||
user << "<span class='warning'>The seeds reject the sample!</span>"
|
||||
else
|
||||
user << "<span class='warning'>The seeds already contain a genetic sample!</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/seeds/replicapod/get_analyzer_text()
|
||||
var/text = ..()
|
||||
if(contains_sample)
|
||||
text += "\n It contains a blood sample!"
|
||||
return text
|
||||
|
||||
|
||||
/obj/item/seeds/replicapod/harvest(mob/user = usr) //now that one is fun -- Urist
|
||||
var/obj/machinery/hydroponics/parent = loc
|
||||
var/make_podman = 0
|
||||
var/ckey_holder = null
|
||||
if(config.revival_pod_plants)
|
||||
if(ckey)
|
||||
for(var/mob/M in player_list)
|
||||
if(isobserver(M))
|
||||
var/mob/dead/observer/O = M
|
||||
if(O.ckey == ckey && O.can_reenter_corpse)
|
||||
make_podman = 1
|
||||
break
|
||||
else
|
||||
if(M.ckey == ckey && M.stat == DEAD && !M.suiciding)
|
||||
make_podman = 1
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
make_podman = !L.hellbound
|
||||
break
|
||||
else //If the player has ghosted from his corpse before blood was drawn, his ckey is no longer attached to the mob, so we need to match up the cloned player through the mind key
|
||||
for(var/mob/M in player_list)
|
||||
if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == 2 && !M.suiciding)
|
||||
if(isobserver(M))
|
||||
var/mob/dead/observer/O = M
|
||||
if(!O.can_reenter_corpse)
|
||||
break
|
||||
make_podman = 1
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
make_podman = !L.hellbound
|
||||
ckey_holder = M.ckey
|
||||
break
|
||||
|
||||
if(make_podman) //all conditions met!
|
||||
var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc)
|
||||
if(realName)
|
||||
podman.real_name = realName
|
||||
else
|
||||
podman.real_name = "Pod Person [rand(0,999)]"
|
||||
mind.transfer_to(podman)
|
||||
if(ckey)
|
||||
podman.ckey = ckey
|
||||
else
|
||||
podman.ckey = ckey_holder
|
||||
podman.gender = blood_gender
|
||||
podman.faction |= factions
|
||||
if(!features["mcolor"])
|
||||
features["mcolor"] = "#59CE00"
|
||||
podman.hardset_dna(null,null,podman.real_name,blood_type,/datum/species/pod,features)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman
|
||||
podman.set_cloned_appearance()
|
||||
|
||||
else //else, one packet of seeds. maybe two
|
||||
var/seed_count = 1
|
||||
if(prob(getYield() * 20))
|
||||
seed_count++
|
||||
var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
|
||||
for(var/i=0,i<seed_count,i++)
|
||||
var/obj/item/seeds/replicapod/harvestseeds = src.Copy()
|
||||
harvestseeds.forceMove(output_loc)
|
||||
|
||||
parent.update_tray()
|
||||
@@ -0,0 +1,101 @@
|
||||
// Carrot
|
||||
/obj/item/seeds/carrot
|
||||
name = "pack of carrot seeds"
|
||||
desc = "These seeds grow into carrots."
|
||||
icon_state = "seed-carrot"
|
||||
species = "carrot"
|
||||
plantname = "Carrots"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/carrot
|
||||
maturation = 10
|
||||
production = 1
|
||||
yield = 5
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
mutatelist = list(/obj/item/seeds/carrot/parsnip)
|
||||
reagents_add = list("oculine" = 0.25, "vitamin" = 0.04, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot
|
||||
seed = /obj/item/seeds/carrot
|
||||
name = "carrot"
|
||||
desc = "It's good for the eyes!"
|
||||
icon_state = "carrot"
|
||||
filling_color = "#FFA500"
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot/attackby(obj/item/I, mob/user, params)
|
||||
if(I.is_sharp())
|
||||
to_chat(user, "<span class='notice'>You sharpen the carrot into a shiv with [I].</span>")
|
||||
var/obj/item/weapon/kitchen/knife/carrotshiv/Shiv = new /obj/item/weapon/kitchen/knife/carrotshiv
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(Shiv)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Parsnip
|
||||
/obj/item/seeds/carrot/parsnip
|
||||
name = "pack of parsnip seeds"
|
||||
desc = "These seeds grow into parsnips."
|
||||
icon_state = "seed-parsnip"
|
||||
species = "parsnip"
|
||||
plantname = "Parsnip"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/parsnip
|
||||
icon_dead = "carrot-dead"
|
||||
mutatelist = list()
|
||||
reagents_add = list("vitamin" = 0.05, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/parsnip
|
||||
seed = /obj/item/seeds/carrot/parsnip
|
||||
name = "parsnip"
|
||||
desc = "Closely related to carrots."
|
||||
icon_state = "parsnip"
|
||||
bitesize_mod = 2
|
||||
|
||||
|
||||
// White-Beet
|
||||
/obj/item/seeds/whitebeet
|
||||
name = "pack of white-beet seeds"
|
||||
desc = "These seeds grow into sugary beet producing plants."
|
||||
icon_state = "seed-whitebeet"
|
||||
species = "whitebeet"
|
||||
plantname = "White-Beet Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet
|
||||
lifespan = 60
|
||||
endurance = 50
|
||||
yield = 6
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_dead = "whitebeet-dead"
|
||||
mutatelist = list(/obj/item/seeds/redbeet)
|
||||
reagents_add = list("vitamin" = 0.04, "sugar" = 0.2, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet
|
||||
seed = /obj/item/seeds/whitebeet
|
||||
name = "white-beet"
|
||||
desc = "You can't beat white-beet."
|
||||
icon_state = "whitebeet"
|
||||
filling_color = "#F4A460"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Red Beet
|
||||
/obj/item/seeds/redbeet
|
||||
name = "pack of redbeet seeds"
|
||||
desc = "These seeds grow into red beet producing plants."
|
||||
icon_state = "seed-redbeet"
|
||||
species = "redbeet"
|
||||
plantname = "Red-Beet Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/redbeet
|
||||
lifespan = 60
|
||||
endurance = 50
|
||||
yield = 6
|
||||
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
|
||||
icon_dead = "whitebeet-dead"
|
||||
genes = list(/datum/plant_gene/trait/maxchem)
|
||||
reagents_add = list("vitamin" = 0.05, "nutriment" = 0.05)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/redbeet
|
||||
seed = /obj/item/seeds/redbeet
|
||||
name = "red beet"
|
||||
desc = "You can't beat red beet."
|
||||
icon_state = "redbeet"
|
||||
bitesize_mod = 2
|
||||
@@ -0,0 +1,87 @@
|
||||
// Tea
|
||||
/obj/item/seeds/tea
|
||||
name = "pack of tea aspera seeds"
|
||||
desc = "These seeds grow into tea plants."
|
||||
icon_state = "seed-teaaspera"
|
||||
species = "teaaspera"
|
||||
plantname = "Tea Aspera Plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tea
|
||||
lifespan = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 5
|
||||
growthstages = 5
|
||||
icon_dead = "tea-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/tea/astra)
|
||||
reagents_add = list("vitamin" = 0.04, "teapowder" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea
|
||||
seed = /obj/item/seeds/tea
|
||||
name = "Tea Aspera tips"
|
||||
desc = "These aromatic tips of the tea plant can be dried to make tea."
|
||||
icon_state = "tea_aspera_leaves"
|
||||
filling_color = "#008000"
|
||||
|
||||
// Tea Astra
|
||||
/obj/item/seeds/tea/astra
|
||||
name = "pack of tea astra seeds"
|
||||
icon_state = "seed-teaastra"
|
||||
species = "teaastra"
|
||||
plantname = "Tea Astra Plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tea/astra
|
||||
mutatelist = list()
|
||||
reagents_add = list("synaptizine" = 0.1, "vitamin" = 0.04, "teapowder" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea/astra
|
||||
seed = /obj/item/seeds/tea/astra
|
||||
name = "Tea Astra tips"
|
||||
icon_state = "tea_astra_leaves"
|
||||
filling_color = "#4582B4"
|
||||
|
||||
|
||||
// Coffee
|
||||
/obj/item/seeds/coffee
|
||||
name = "pack of coffee arabica seeds"
|
||||
desc = "These seeds grow into coffee arabica bushes."
|
||||
icon_state = "seed-coffeea"
|
||||
species = "coffeea"
|
||||
plantname = "Coffee Arabica Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/coffee
|
||||
lifespan = 30
|
||||
endurance = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 5
|
||||
growthstages = 5
|
||||
icon_dead = "coffee-dead"
|
||||
genes = list(/datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/coffee/robusta)
|
||||
reagents_add = list("vitamin" = 0.04, "coffeepowder" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee
|
||||
seed = /obj/item/seeds/coffee
|
||||
name = "coffee arabica beans"
|
||||
desc = "Dry them out to make coffee."
|
||||
icon_state = "coffee_arabica"
|
||||
filling_color = "#DC143C"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Coffee Robusta
|
||||
/obj/item/seeds/coffee/robusta
|
||||
name = "pack of coffee robusta seeds"
|
||||
desc = "These seeds grow into coffee robusta bushes."
|
||||
icon_state = "seed-coffeer"
|
||||
species = "coffeer"
|
||||
plantname = "Coffee Robusta Bush"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/coffee/robusta
|
||||
mutatelist = list()
|
||||
reagents_add = list("ephedrine" = 0.1, "vitamin" = 0.04, "coffeepowder" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee/robusta
|
||||
seed = /obj/item/seeds/coffee/robusta
|
||||
name = "coffee robusta beans"
|
||||
desc = "Increases robustness by 37 percent!"
|
||||
icon_state = "coffee_robusta"
|
||||
@@ -0,0 +1,41 @@
|
||||
// Tobacco
|
||||
/obj/item/seeds/tobacco
|
||||
name = "pack of tobacco seeds"
|
||||
desc = "These seeds grow into tobacco plants."
|
||||
icon_state = "seed-tobacco"
|
||||
species = "tobacco"
|
||||
plantname = "Tobacco Plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tobacco
|
||||
lifespan = 20
|
||||
maturation = 5
|
||||
production = 5
|
||||
yield = 10
|
||||
growthstages = 3
|
||||
icon_dead = "tobacco-dead"
|
||||
mutatelist = list(/obj/item/seeds/tobacco/space)
|
||||
reagents_add = list("nicotine" = 0.03, "nutriment" = 0.03)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco
|
||||
seed = /obj/item/seeds/tobacco
|
||||
name = "tobacco leaves"
|
||||
desc = "Dry them out to make some smokes."
|
||||
icon_state = "tobacco_leaves"
|
||||
filling_color = "#008000"
|
||||
|
||||
// Space Tobacco
|
||||
/obj/item/seeds/tobacco/space
|
||||
name = "pack of space tobacco seeds"
|
||||
desc = "These seeds grow into space tobacco plants."
|
||||
icon_state = "seed-stobacco"
|
||||
species = "stobacco"
|
||||
plantname = "Space Tobacco Plant"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tobacco/space
|
||||
mutatelist = list()
|
||||
reagents_add = list("salbutamol" = 0.05, "nicotine" = 0.08, "nutriment" = 0.03)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco/space
|
||||
seed = /obj/item/seeds/tobacco/space
|
||||
name = "space tobacco leaves"
|
||||
desc = "Dry them out to make some space-smokes."
|
||||
icon_state = "stobacco_leaves"
|
||||
@@ -0,0 +1,143 @@
|
||||
// Tomato
|
||||
/obj/item/seeds/tomato
|
||||
name = "pack of tomato seeds"
|
||||
desc = "These seeds grow into tomato plants."
|
||||
icon_state = "seed-tomato"
|
||||
species = "tomato"
|
||||
plantname = "Tomato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tomato
|
||||
maturation = 8
|
||||
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
|
||||
icon_grow = "tomato-grow"
|
||||
icon_dead = "tomato-dead"
|
||||
genes = list(/datum/plant_gene/trait/squash, /datum/plant_gene/trait/repeated_harvest)
|
||||
mutatelist = list(/obj/item/seeds/tomato/blue, /obj/item/seeds/tomato/blood, /obj/item/seeds/tomato/killer)
|
||||
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato
|
||||
seed = /obj/item/seeds/tomato
|
||||
name = "tomato"
|
||||
desc = "I say to-mah-to, you say tom-mae-to."
|
||||
icon_state = "tomato"
|
||||
splat_type = /obj/effect/decal/cleanable/tomato_smudge
|
||||
filling_color = "#FF6347"
|
||||
bitesize_mod = 2
|
||||
|
||||
// Blood Tomato
|
||||
/obj/item/seeds/tomato/blood
|
||||
name = "pack of blood-tomato seeds"
|
||||
desc = "These seeds grow into blood-tomato plants."
|
||||
icon_state = "seed-bloodtomato"
|
||||
species = "bloodtomato"
|
||||
plantname = "Blood-Tomato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blood
|
||||
mutatelist = list()
|
||||
reagents_add = list("blood" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blood
|
||||
seed = /obj/item/seeds/tomato/blood
|
||||
name = "blood-tomato"
|
||||
desc = "So bloody...so...very...bloody....AHHHH!!!!"
|
||||
icon_state = "bloodtomato"
|
||||
splat_type = /obj/effect/gibspawner/generic
|
||||
filling_color = "#FF0000"
|
||||
origin_tech = "biotech=5"
|
||||
|
||||
|
||||
// Blue Tomato
|
||||
/obj/item/seeds/tomato/blue
|
||||
name = "pack of blue-tomato seeds"
|
||||
desc = "These seeds grow into blue-tomato plants."
|
||||
icon_state = "seed-bluetomato"
|
||||
species = "bluetomato"
|
||||
plantname = "Blue-Tomato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blue
|
||||
yield = 2
|
||||
icon_grow = "bluetomato-grow"
|
||||
mutatelist = list(/obj/item/seeds/tomato/blue/bluespace)
|
||||
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest)
|
||||
reagents_add = list("lube" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 20
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blue
|
||||
seed = /obj/item/seeds/tomato/blue
|
||||
name = "blue-tomato"
|
||||
desc = "I say blue-mah-to, you say blue-mae-to."
|
||||
icon_state = "bluetomato"
|
||||
splat_type = /obj/effect/decal/cleanable/blood/oil
|
||||
filling_color = "#0000FF"
|
||||
|
||||
|
||||
// Bluespace Tomato
|
||||
/obj/item/seeds/tomato/blue/bluespace
|
||||
name = "pack of bluespace tomato seeds"
|
||||
desc = "These seeds grow into bluespace tomato plants."
|
||||
icon_state = "seed-bluespacetomato"
|
||||
species = "bluespacetomato"
|
||||
plantname = "Bluespace Tomato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blue/bluespace
|
||||
yield = 2
|
||||
mutatelist = list()
|
||||
genes = list(/datum/plant_gene/trait/squash, /datum/plant_gene/trait/slip, /datum/plant_gene/trait/teleport, /datum/plant_gene/trait/repeated_harvest)
|
||||
reagents_add = list("lube" = 0.2, "singulo" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
|
||||
rarity = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blue/bluespace
|
||||
seed = /obj/item/seeds/tomato/blue/bluespace
|
||||
name = "bluespace tomato"
|
||||
desc = "So lubricated, you might slip through space-time."
|
||||
icon_state = "bluespacetomato"
|
||||
origin_tech = "biotech=4;bluespace=5"
|
||||
|
||||
|
||||
// Killer Tomato
|
||||
/obj/item/seeds/tomato/killer
|
||||
name = "pack of killer-tomato seeds"
|
||||
desc = "These seeds grow into killer-tomato plants."
|
||||
icon_state = "seed-killertomato"
|
||||
species = "killertomato"
|
||||
plantname = "Killer-Tomato Plants"
|
||||
product = /obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer
|
||||
yield = 2
|
||||
genes = list(/datum/plant_gene/trait/squash)
|
||||
growthstages = 2
|
||||
icon_grow = "killertomato-grow"
|
||||
icon_harvest = "killertomato-harvest"
|
||||
icon_dead = "killertomato-dead"
|
||||
mutatelist = list()
|
||||
rarity = 30
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer
|
||||
seed = /obj/item/seeds/tomato/killer
|
||||
name = "killer-tomato"
|
||||
desc = "I say to-mah-to, you say tom-mae-to... OH GOD IT'S EATING MY LEGS!!"
|
||||
icon_state = "killertomato"
|
||||
var/awakening = 0
|
||||
filling_color = "#FF0000"
|
||||
origin_tech = "biotech=4;combat=5"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer/attack(mob/M, mob/user, def_zone)
|
||||
if(awakening)
|
||||
to_chat(user, "<span class='warning'>The tomato is twitching and shaking, preventing you from eating it.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer/attack_self(mob/user)
|
||||
if(awakening || isspaceturf(user.loc))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin to awaken the Killer Tomato...</span>")
|
||||
awakening = 1
|
||||
|
||||
spawn(30)
|
||||
if(!qdeleted(src))
|
||||
var/mob/living/simple_animal/hostile/killertomato/K = new /mob/living/simple_animal/hostile/killertomato(get_turf(loc))
|
||||
K.maxHealth += round(seed.endurance / 3)
|
||||
K.melee_damage_lower += round(seed.potency / 10)
|
||||
K.melee_damage_upper += round(seed.potency / 10)
|
||||
K.move_to_delay -= round(seed.production / 50)
|
||||
K.health = K.maxHealth
|
||||
K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>")
|
||||
if(user)
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
@@ -0,0 +1,190 @@
|
||||
/obj/item/seeds/tower
|
||||
name = "pack of tower-cap mycelium"
|
||||
desc = "This mycelium grows into tower-cap mushrooms."
|
||||
icon_state = "mycelium-tower"
|
||||
species = "towercap"
|
||||
plantname = "Tower Caps"
|
||||
product = /obj/item/weapon/grown/log
|
||||
lifespan = 80
|
||||
endurance = 50
|
||||
maturation = 15
|
||||
production = 1
|
||||
yield = 5
|
||||
potency = 50
|
||||
growthstages = 3
|
||||
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
icon_dead = "towercap-dead"
|
||||
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
|
||||
mutatelist = list(/obj/item/seeds/tower/steel)
|
||||
|
||||
/obj/item/seeds/tower/steel
|
||||
name = "pack of steel-cap mycelium"
|
||||
desc = "This mycelium grows into steel logs."
|
||||
icon_state = "mycelium-steelcap"
|
||||
species = "steelcap"
|
||||
plantname = "Steel Caps"
|
||||
product = /obj/item/weapon/grown/log/steel
|
||||
mutatelist = list()
|
||||
rarity = 20
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/grown/log
|
||||
seed = /obj/item/seeds/tower
|
||||
name = "tower-cap log"
|
||||
desc = "It's better than bad, it's good!"
|
||||
icon_state = "logs"
|
||||
force = 5
|
||||
throwforce = 5
|
||||
w_class = 3
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
origin_tech = "materials=1"
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
|
||||
var/plank_type = /obj/item/stack/sheet/wood
|
||||
var/plank_name = "wooden planks"
|
||||
var/list/accepted = list(/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/vulgaris,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat)
|
||||
|
||||
|
||||
/obj/item/weapon/grown/log/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.sharpness)
|
||||
user.show_message("<span class='notice'>You make [plank_name] out of \the [src]!</span>", 1)
|
||||
var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(seed.potency / 25))
|
||||
var/old_plank_amount = plank.amount
|
||||
for(var/obj/item/stack/ST in user.loc)
|
||||
if(ST != plank && istype(ST, plank_type) && ST.amount < ST.max_amount)
|
||||
ST.attackby(plank, user) //we try to transfer all old unfinished stacks to the new stack we created.
|
||||
if(plank.amount > old_plank_amount)
|
||||
to_chat(user, "<span class='notice'>You add the newly-formed [plank_name] to the stack. It now contains [plank.amount] [plank_name].</span>")
|
||||
qdel(src)
|
||||
|
||||
if(is_type_in_list(W,accepted))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/leaf = W
|
||||
if(leaf.dry)
|
||||
user.show_message("<span class='notice'>You wrap \the [W] around the log, turning it into a torch!</span>")
|
||||
var/obj/item/device/flashlight/flare/torch/T = new /obj/item/device/flashlight/flare/torch(user.loc)
|
||||
usr.unEquip(W)
|
||||
usr.put_in_active_hand(T)
|
||||
qdel(leaf)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
to_chat(usr, "<span class ='warning'>You must dry this first!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/grown/log/tree
|
||||
seed = null
|
||||
name = "wood log"
|
||||
desc = "TIMMMMM-BERRRRRRRRRRR!"
|
||||
|
||||
/obj/item/weapon/grown/log/steel
|
||||
seed = /obj/item/seeds/tower/steel
|
||||
name = "steel-cap log"
|
||||
desc = "It's made of metal."
|
||||
icon_state = "steellogs"
|
||||
accepted = list()
|
||||
plank_type = /obj/item/stack/rods
|
||||
plank_name = "rods"
|
||||
|
||||
|
||||
/////////BONFIRES//////////
|
||||
|
||||
/obj/structure/bonfire
|
||||
name = "bonfire"
|
||||
desc = "For grilling, broiling, charring, smoking, heating, roasting, toasting, simmering, searing, melting, and occasionally burning things."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "bonfire"
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
buckle_lying = 0
|
||||
var/burning = 0
|
||||
var/fire_stack_strength = 5
|
||||
|
||||
/obj/structure/bonfire/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/stack/rods) && !can_buckle)
|
||||
var/obj/item/stack/rods/R = W
|
||||
R.use(1)
|
||||
can_buckle = 1
|
||||
buckle_requires_restraints = 1
|
||||
to_chat(user, "<span class='italics'>You add a rod to [src].")
|
||||
var/image/U = image(icon='icons/obj/hydroponics/equipment.dmi',icon_state="bonfire_rod",pixel_y=16)
|
||||
underlays += U
|
||||
if(is_hot(W))
|
||||
StartBurning()
|
||||
|
||||
|
||||
/obj/structure/bonfire/attack_hand(mob/user)
|
||||
if(burning)
|
||||
to_chat(user, "<span class='warning'>You need to extinguish [src] before removing the logs!")
|
||||
return
|
||||
if(!has_buckled_mobs() && do_after(user, 50, target = src))
|
||||
for(var/I in 1 to 5)
|
||||
var/obj/item/weapon/grown/log/L = new /obj/item/weapon/grown/log(loc)
|
||||
L.pixel_x += rand(1,4)
|
||||
L.pixel_y += rand(1,4)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/bonfire/proc/CheckOxygen()
|
||||
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
|
||||
if(G.oxygen < 16)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/bonfire/proc/StartBurning()
|
||||
if(!burning && CheckOxygen())
|
||||
icon_state = "bonfire_on_fire"
|
||||
burning = 1
|
||||
set_light(6)
|
||||
Burn()
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/structure/bonfire/fire_act(exposed_temperature, exposed_volume)
|
||||
StartBurning()
|
||||
|
||||
/obj/structure/bonfire/Crossed(atom/movable/AM)
|
||||
if(burning)
|
||||
Burn()
|
||||
|
||||
/obj/structure/bonfire/proc/Burn()
|
||||
var/turf/current_location = get_turf(src)
|
||||
current_location.hotspot_expose(1000,500,1)
|
||||
for(var/A in current_location)
|
||||
if(A == src)
|
||||
continue
|
||||
if(isobj(A))
|
||||
var/obj/O = A
|
||||
O.fire_act(1000, 500)
|
||||
else if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
L.adjust_fire_stacks(fire_stack_strength)
|
||||
L.IgniteMob()
|
||||
|
||||
/obj/structure/bonfire/process()
|
||||
if(!CheckOxygen())
|
||||
extinguish()
|
||||
return
|
||||
Burn()
|
||||
|
||||
/obj/structure/bonfire/extinguish()
|
||||
if(burning)
|
||||
icon_state = "bonfire"
|
||||
burning = 0
|
||||
set_light(0)
|
||||
processing_objects.Remove(src)
|
||||
|
||||
/obj/structure/bonfire/buckle_mob(mob/living/M, force = 0)
|
||||
if(..())
|
||||
M.pixel_y += 13
|
||||
|
||||
/obj/structure/bonfire/unbuckle_mob(mob/living/buckled_mob, force=0)
|
||||
if(..())
|
||||
buckled_mob.pixel_y -= 13
|
||||
@@ -1,181 +0,0 @@
|
||||
// **********************
|
||||
// Other harvested materials from plants (that are not food)
|
||||
// **********************
|
||||
|
||||
/obj/item/weapon/grown // Grown weapons
|
||||
name = "grown_weapon"
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
var/plantname
|
||||
var/potency = 1
|
||||
burn_state = FLAMMABLE
|
||||
|
||||
/obj/item/weapon/grown/New(newloc,planttype)
|
||||
|
||||
..()
|
||||
|
||||
create_reagents(50)
|
||||
|
||||
//Handle some post-spawn var stuff.
|
||||
if(planttype)
|
||||
plantname = planttype
|
||||
var/datum/seed/S = plant_controller.seeds[plantname]
|
||||
if(!S || !S.chems)
|
||||
return
|
||||
|
||||
potency = S.get_trait(TRAIT_POTENCY)
|
||||
|
||||
for(var/rid in S.chems)
|
||||
var/list/reagent_data = S.chems[rid]
|
||||
var/rtotal = reagent_data[1]
|
||||
if(reagent_data.len > 1 && potency > 0)
|
||||
rtotal += round(potency/reagent_data[2])
|
||||
reagents.add_reagent(rid,max(1,rtotal))
|
||||
|
||||
/obj/item/weapon/grown/nettle //abstract type
|
||||
name = "nettle"
|
||||
desc = "It's probably <B>not</B> wise to touch it with bare hands..."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "nettle"
|
||||
damtype = "fire"
|
||||
force = 15
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
throwforce = 5
|
||||
w_class = 1
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
origin_tech = "combat=1"
|
||||
attack_verb = list("stung")
|
||||
|
||||
/obj/item/weapon/grown/nettle/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is eating some of the [src.name]! It looks like \he's trying to commit suicide.</span>")
|
||||
return (BRUTELOSS|TOXLOSS)
|
||||
|
||||
/obj/item/weapon/grown/nettle/pickup(mob/living/user)
|
||||
if(!iscarbon(user))
|
||||
return 0
|
||||
var/mob/living/carbon/C = user
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(H.gloves)
|
||||
return 0
|
||||
var/organ = ((user.hand ? "l_":"r_") + "arm")
|
||||
var/obj/item/organ/external/affecting = H.get_organ(organ)
|
||||
if(affecting.take_damage(0,force))
|
||||
user.UpdateDamageIcon()
|
||||
else
|
||||
C.take_organ_damage(0,force)
|
||||
to_chat(C, "<span class='userdanger'>The nettle burns your bare hand!</span>")
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user,proximity)
|
||||
if(!proximity) return
|
||||
if(force > 0)
|
||||
force -= rand(1, (force / 3) + 1) // When you whack someone with it, leaves fall off
|
||||
else
|
||||
to_chat(usr, "All the leaves have fallen off the nettle from violent whacking.")
|
||||
usr.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/item/weapon/grown/nettle/death
|
||||
name = "deathnettle"
|
||||
desc = "The <span class='danger'>glowing</span> nettle incites <span class='boldannounce'>rage</span> in you just from looking at it!"
|
||||
icon_state = "deathnettle"
|
||||
force = 30
|
||||
throwforce = 15
|
||||
origin_tech = "combat=3"
|
||||
|
||||
/obj/item/weapon/grown/nettle/death/pickup(mob/living/carbon/user)
|
||||
if(..())
|
||||
if(prob(50))
|
||||
user.Paralyse(5)
|
||||
to_chat(user, "<span class='userdanger'>You are stunned by the Deathnettle when you try picking it up!</span>")
|
||||
|
||||
/obj/item/weapon/grown/nettle/death/afterattack(mob/living/carbon/M, mob/user)
|
||||
if(istype(M, /mob/living))
|
||||
to_chat(M, "<span class='danger'>You are stunned by the powerful acid of the Deathnettle!</span>")
|
||||
add_logs(user, M, "attacked", src)
|
||||
|
||||
M.AdjustEyeBlurry(force/7)
|
||||
if(prob(20))
|
||||
M.Paralyse(force / 6)
|
||||
M.Weaken(force / 15)
|
||||
M.drop_item()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/corncob
|
||||
name = "corn cob"
|
||||
desc = "A reminder of meals gone by."
|
||||
icon = 'icons/obj/trash.dmi'
|
||||
icon_state = "corncob"
|
||||
item_state = "corncob"
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/knife))
|
||||
to_chat(user, "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>")
|
||||
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/bananapeel
|
||||
name = "banana peel"
|
||||
desc = "A peel from a banana."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "banana_peel"
|
||||
item_state = "banana_peel"
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
|
||||
// Sunflower
|
||||
|
||||
/obj/item/weapon/grown/sunflower
|
||||
name = "sunflower"
|
||||
desc = "A large, fresh-grown sunflower. How cheery!"
|
||||
icon = 'icons/obj/harvest.dmi'
|
||||
icon_state = "sunflower"
|
||||
item_state = "sunflower"
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob)
|
||||
to_chat(M, "<font color='green'><b> [user] smacks you with a [name]!</font><font color='yellow'><b>FLOWER POWER<b></font>")
|
||||
to_chat(user, "<font color='green'> Your [name]'s </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'> strikes [M]</font>")
|
||||
|
||||
|
||||
// Novaflower
|
||||
|
||||
/obj/item/weapon/grown/novaflower
|
||||
name = "novaflower"
|
||||
desc = "A large, fresh-grown novaflower. It seems to radiate heat."
|
||||
icon = 'icons/obj/harvest.dmi'
|
||||
icon_state = "novaflower"
|
||||
item_state = "sunflower"
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/weapon/grown/novaflower/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
to_chat(M, "<font color='green'>[user] smacks you with a [name]!</font><font color='yellow'><b>FLOWER POWER</b></font>")
|
||||
to_chat(user, "<font color='green'> Your [name]'s </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'> strikes [M]</font>")
|
||||
if(istype(M, /mob/living))
|
||||
to_chat(M, "<span class='danger'>You are lit on fire from the intense heat of the [name]!</span>")
|
||||
M.adjust_fire_stacks(potency / 20)
|
||||
if(M.IgniteMob())
|
||||
message_admins("[key_name_admin(user)] set [key_name_admin(M)] on fire")
|
||||
log_game("[key_name(user)] set [key_name(M)] on fire")
|
||||
|
||||
/obj/item/weapon/grown/novaflower/pickup(mob/living/carbon/human/user as mob)
|
||||
if(!user.gloves)
|
||||
to_chat(user, "<span class='warning'>The [name] burns your bare hand!</span>")
|
||||
user.adjustFireLoss(rand(1,5))
|
||||
@@ -1,55 +0,0 @@
|
||||
// Predefined types for placing on the map.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
|
||||
plantname = "libertycap"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
|
||||
plantname = "ambrosia"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato
|
||||
plantname = "potato"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato
|
||||
plantname = "tomato"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer
|
||||
plantname = "killertomato"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot
|
||||
plantname = "carrot"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries
|
||||
plantname = "berries"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
|
||||
plantname = "banana"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/chili
|
||||
plantname = "chili"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon
|
||||
plantname = "lemon"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries
|
||||
plantname = "cherry"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/orange
|
||||
plantname = "orange"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
|
||||
plantname = "corn"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
|
||||
plantname = "amanita"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus
|
||||
plantname = "ambrosiadeus"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/aloe
|
||||
plantname = "aloe"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/comfrey
|
||||
plantname = "comfrey"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/glowcap
|
||||
plantname = "glowcap"
|
||||
@@ -0,0 +1,64 @@
|
||||
// **********************
|
||||
// Other harvested materials from plants (that are not food)
|
||||
// **********************
|
||||
|
||||
/obj/item/weapon/grown // Grown weapons
|
||||
name = "grown_weapon"
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
burn_state = FLAMMABLE
|
||||
var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item.
|
||||
|
||||
/obj/item/weapon/grown/New(newloc, var/obj/item/seeds/new_seed = null)
|
||||
..()
|
||||
create_reagents(50)
|
||||
|
||||
if(new_seed)
|
||||
seed = new_seed.Copy()
|
||||
else if(ispath(seed))
|
||||
// This is for adminspawn or map-placed growns. They get the default stats of their seed type.
|
||||
seed = new seed()
|
||||
seed.adjust_potency(50-seed.potency)
|
||||
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_new(src, newloc)
|
||||
|
||||
if(istype(src, seed.product)) // no adding reagents if it is just a trash item
|
||||
seed.prepare_result(src)
|
||||
transform *= TransformUsingVariable(seed.potency, 100, 0.5)
|
||||
add_juice()
|
||||
|
||||
|
||||
/obj/item/weapon/grown/attackby(obj/item/O, mob/user, params)
|
||||
..()
|
||||
if (istype(O, /obj/item/device/plant_analyzer))
|
||||
var/msg = "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>\n"
|
||||
if(seed)
|
||||
msg += seed.get_analyzer_text()
|
||||
msg += "</span>"
|
||||
to_chat(usr, msg)
|
||||
return
|
||||
|
||||
/obj/item/weapon/grown/proc/add_juice()
|
||||
if(reagents)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/weapon/grown/Crossed(atom/movable/AM)
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_cross(src, AM)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/grown/throw_impact(atom/hit_atom)
|
||||
if(!..()) //was it caught by a mob?
|
||||
if(seed)
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_throw_impact(src, hit_atom)
|
||||
|
||||
/obj/item/weapon/grown/microwave_act(obj/machine/microwave/M)
|
||||
return
|
||||
@@ -1,124 +0,0 @@
|
||||
|
||||
/obj/item/weapon/plantspray
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
item_state = "spray"
|
||||
flags = OPENCONTAINER | NOBLUDGEON
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 4
|
||||
w_class = 2
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
var/toxicity = 4
|
||||
var/pest_kill_str = 0
|
||||
var/weed_kill_str = 0
|
||||
|
||||
/obj/item/weapon/plantspray/weeds // -- Skie
|
||||
|
||||
name = "weed-spray"
|
||||
desc = "It's a toxic mixture, in spray form, to kill small weeds."
|
||||
icon_state = "weedspray"
|
||||
weed_kill_str = 6
|
||||
|
||||
/obj/item/weapon/plantspray/pests
|
||||
name = "pest-spray"
|
||||
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
|
||||
icon_state = "pestspray"
|
||||
pest_kill_str = 6
|
||||
|
||||
/obj/item/weapon/plantspray/pests/old
|
||||
name = "bottle of pestkiller"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
|
||||
/obj/item/weapon/plantspray/pests/old/carbaryl
|
||||
name = "bottle of carbaryl"
|
||||
toxicity = 4
|
||||
pest_kill_str = 2
|
||||
|
||||
/obj/item/weapon/plantspray/pests/old/lindane
|
||||
name = "bottle of lindane"
|
||||
icon_state = "bottle18"
|
||||
toxicity = 6
|
||||
pest_kill_str = 4
|
||||
|
||||
/obj/item/weapon/plantspray/pests/old/phosmet
|
||||
name = "bottle of phosmet"
|
||||
icon_state = "bottle15"
|
||||
toxicity = 8
|
||||
pest_kill_str = 7
|
||||
|
||||
|
||||
// *************************************
|
||||
// Weedkiller defines for hydroponics
|
||||
// *************************************
|
||||
|
||||
/obj/item/weedkiller
|
||||
name = "bottle of weedkiller"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
flags = OPENCONTAINER | NOBLUDGEON
|
||||
var/toxicity = 0
|
||||
var/weed_kill_str = 0
|
||||
|
||||
/obj/item/weedkiller/triclopyr
|
||||
name = "bottle of glyphosate"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
toxicity = 4
|
||||
weed_kill_str = 2
|
||||
|
||||
/obj/item/weedkiller/lindane
|
||||
name = "bottle of triclopyr"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle18"
|
||||
toxicity = 6
|
||||
weed_kill_str = 4
|
||||
|
||||
/obj/item/weedkiller/D24
|
||||
name = "bottle of 2,4-D"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle15"
|
||||
toxicity = 8
|
||||
weed_kill_str = 7
|
||||
|
||||
// *************************************
|
||||
// Nutrient defines for hydroponics
|
||||
// *************************************
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fertilizer
|
||||
name = "fertilizer bottle"
|
||||
desc = "A small glass bottle. Can hold up to 10 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "round_bottle"
|
||||
flags = OPENCONTAINER
|
||||
possible_transfer_amounts = null
|
||||
w_class = 2
|
||||
|
||||
var/fertilizer //Reagent contained, if any.
|
||||
|
||||
//Like a shot glass!
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 10
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fertilizer/New()
|
||||
..()
|
||||
|
||||
src.pixel_x = rand(-5.0, 5)
|
||||
src.pixel_y = rand(-5.0, 5)
|
||||
|
||||
if(fertilizer)
|
||||
reagents.add_reagent(fertilizer,10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fertilizer/ez
|
||||
name = "bottle of E-Z-Nutrient"
|
||||
icon_state = "round_bottle"
|
||||
fertilizer = "eznutrient"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fertilizer/l4z
|
||||
name = "bottle of Left 4 Zed"
|
||||
icon_state = "round_bottle"
|
||||
fertilizer = "left4zed"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fertilizer/rh
|
||||
name = "bottle of Robust Harvest"
|
||||
icon_state = "round_bottle"
|
||||
fertilizer = "robustharvest"
|
||||
@@ -0,0 +1,206 @@
|
||||
// Plant analyzer
|
||||
/obj/item/device/plant_analyzer
|
||||
name = "plant analyzer"
|
||||
desc = "A scanner used to evaluate a plant's various areas of growth."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hydro"
|
||||
item_state = "analyzer"
|
||||
w_class = 1
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "magnets=2;biotech=2"
|
||||
materials = list(MAT_METAL=30, MAT_GLASS=20)
|
||||
|
||||
// *************************************
|
||||
// Hydroponics Tools
|
||||
// *************************************
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/weedspray // -- Skie
|
||||
desc = "It's a toxic mixture, in spray form, to kill small weeds."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
name = "weed spray"
|
||||
icon_state = "weedspray"
|
||||
item_state = "spray"
|
||||
volume = 100
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 0
|
||||
w_class = 2
|
||||
throw_speed = 3
|
||||
throw_range = 10
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/weedspray/New()
|
||||
..()
|
||||
reagents.add_reagent("weedkiller", 100)
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/weedspray/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (TOXLOSS)
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/pestspray // -- Skie
|
||||
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
name = "pest spray"
|
||||
icon_state = "pestspray"
|
||||
item_state = "plantbgone"
|
||||
volume = 100
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 0
|
||||
w_class = 2
|
||||
throw_speed = 3
|
||||
throw_range = 10
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/pestspray/New()
|
||||
..()
|
||||
reagents.add_reagent("pestkiller", 100)
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/pestspray/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (TOXLOSS)
|
||||
|
||||
/obj/item/weapon/cultivator
|
||||
name = "cultivator"
|
||||
desc = "It's used for removing weeds or scratching your back."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "cultivator"
|
||||
item_state = "cultivator"
|
||||
origin_tech = "engineering=2;biotech=2"
|
||||
flags = CONDUCT
|
||||
force = 5
|
||||
throwforce = 7
|
||||
w_class = 2
|
||||
materials = list(MAT_METAL=50)
|
||||
attack_verb = list("slashed", "sliced", "cut", "clawed")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
/obj/item/weapon/hatchet
|
||||
name = "hatchet"
|
||||
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "hatchet"
|
||||
flags = CONDUCT
|
||||
force = 12
|
||||
w_class = 1
|
||||
throwforce = 15
|
||||
throw_speed = 3
|
||||
throw_range = 4
|
||||
materials = list(MAT_METAL = 15000)
|
||||
origin_tech = "materials=2;combat=2"
|
||||
attack_verb = list("chopped", "torn", "cut")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharp = 1
|
||||
edge = 1
|
||||
|
||||
/obj/item/weapon/hatchet/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is chopping at [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/scythe
|
||||
icon_state = "scythe0"
|
||||
name = "scythe"
|
||||
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
|
||||
force = 13
|
||||
throwforce = 5
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
w_class = 4
|
||||
flags = CONDUCT
|
||||
armour_penetration = 20
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "materials=3;combat=2"
|
||||
attack_verb = list("chopped", "sliced", "cut", "reaped")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
/obj/item/weapon/scythe/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is beheading [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
var/obj/item/bodypart/BP = C.get_bodypart("head")
|
||||
if(BP)
|
||||
BP.drop_limb()
|
||||
playsound(loc,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1)
|
||||
return (BRUTELOSS)
|
||||
|
||||
// *************************************
|
||||
// Nutrient defines for hydroponics
|
||||
// *************************************
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient
|
||||
name = "bottle of nutrient"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
volume = 50
|
||||
w_class = 1
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(1,2,5,10,15,25,50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/New()
|
||||
..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/ez
|
||||
name = "bottle of E-Z-Nutrient"
|
||||
desc = "Contains a fertilizer that causes mild mutations with each harvest."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/ez/New()
|
||||
..()
|
||||
reagents.add_reagent("eznutriment", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/l4z
|
||||
name = "bottle of Left 4 Zed"
|
||||
desc = "Contains a fertilizer that limits plant yields to no more than one and causes significant mutations in plants."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle18"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/l4z/New()
|
||||
..()
|
||||
reagents.add_reagent("left4zednutriment", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/rh
|
||||
name = "bottle of Robust Harvest"
|
||||
desc = "Contains a fertilizer that increases the yield of a plant by 30% while causing no mutations."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle15"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/rh/New()
|
||||
..()
|
||||
reagents.add_reagent("robustharvestnutriment", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/nutrient/empty
|
||||
name = "bottle"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/killer
|
||||
name = "bottle"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
volume = 50
|
||||
w_class = 1
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(1,2,5,10,15,25,50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/killer/weedkiller
|
||||
name = "bottle of weed killer"
|
||||
desc = "Contains a herbicide."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle19"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/killer/weedkiller/New()
|
||||
..()
|
||||
reagents.add_reagent("weedkiller", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/killer/pestkiller
|
||||
name = "bottle of pest spray"
|
||||
desc = "Contains a pesticide."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle20"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/killer/pestkiller/New()
|
||||
..()
|
||||
reagents.add_reagent("pestkiller", 50)
|
||||
@@ -0,0 +1,951 @@
|
||||
/obj/machinery/hydroponics
|
||||
name = "hydroponics tray"
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "hydrotray"
|
||||
density = 1
|
||||
anchored = 1
|
||||
pixel_y = 8
|
||||
var/waterlevel = 100 //The amount of water in the tray (max 100)
|
||||
var/maxwater = 100 //The maximum amount of water in the tray
|
||||
var/nutrilevel = 10 //The amount of nutrient in the tray (max 10)
|
||||
var/maxnutri = 10 //The maximum nutrient of water in the tray
|
||||
var/pestlevel = 0 //The amount of pests in the tray (max 10)
|
||||
var/weedlevel = 0 //The amount of weeds in the tray (max 10)
|
||||
var/yieldmod = 1 //Nutriment's effect on yield
|
||||
var/mutmod = 1 //Nutriment's effect on mutations
|
||||
var/toxic = 0 //Toxicity in the tray?
|
||||
var/age = 0 //Current age
|
||||
var/dead = 0 //Is it dead?
|
||||
var/plant_health //Its health
|
||||
var/lastproduce = 0 //Last time it was harvested
|
||||
var/lastcycle = 0 //Used for timing of cycles.
|
||||
var/cycledelay = 200 //About 10 seconds / cycle
|
||||
var/harvest = 0 //Ready to harvest?
|
||||
var/obj/item/seeds/myseed = null //The currently planted seed
|
||||
var/rating = 1
|
||||
var/unwrenchable = 1
|
||||
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
|
||||
var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses
|
||||
var/self_sustaining = FALSE //If the tray generates nutrients and water on its own
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/constructable
|
||||
name = "hydroponics tray"
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
|
||||
/obj/machinery/hydroponics/constructable/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/hydroponics/constructable/RefreshParts()
|
||||
var/tmp_capacity = 0
|
||||
for (var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
tmp_capacity += M.rating
|
||||
for (var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
rating = M.rating
|
||||
maxwater = tmp_capacity * 50 // Up to 300
|
||||
maxnutri = tmp_capacity * 5 // Up to 30
|
||||
waterlevel = maxwater
|
||||
nutrilevel = 3
|
||||
|
||||
/obj/machinery/hydroponics/Destroy()
|
||||
if(myseed)
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/hydroponics/constructable/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "hydrotray3", "hydrotray3", I))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
if(default_pry_open(I))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, I))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(using_irrigation)
|
||||
to_chat(user, "<span class='warning'>Disconnect the hoses first!</span>")
|
||||
else if(default_deconstruction_crowbar(I, 1))
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/hydroponics/proc/FindConnected()
|
||||
var/list/connected = list()
|
||||
var/list/processing_atoms = list(src)
|
||||
|
||||
while(processing_atoms.len)
|
||||
var/atom/a = processing_atoms[1]
|
||||
for(var/step_dir in cardinal)
|
||||
var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir)
|
||||
// Soil plots aren't dense
|
||||
if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms))
|
||||
processing_atoms += h
|
||||
|
||||
processing_atoms -= a
|
||||
connected += a
|
||||
|
||||
return connected
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(!myseed)
|
||||
return ..()
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mutate()
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
return myseed.bullet_act(Proj)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/hydroponics/process()
|
||||
var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time
|
||||
|
||||
if(myseed && (myseed.loc != src))
|
||||
myseed.loc = src
|
||||
|
||||
if(self_sustaining)
|
||||
adjustNutri(1)
|
||||
adjustWater(rand(3,5))
|
||||
adjustWeeds(-2)
|
||||
adjustPests(-2)
|
||||
adjustToxic(-2)
|
||||
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
if(myseed && !dead)
|
||||
// Advance age
|
||||
age++
|
||||
if(age < myseed.maturation)
|
||||
lastproduce = age
|
||||
|
||||
needs_update = 1
|
||||
|
||||
//Nutrients//////////////////////////////////////////////////////////////
|
||||
// Nutrients deplete slowly
|
||||
if(prob(50))
|
||||
adjustNutri(-1 / rating)
|
||||
|
||||
// Lack of nutrients hurts non-weeds
|
||||
if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
|
||||
adjustHealth(-rand(1,3))
|
||||
|
||||
//Photosynthesis/////////////////////////////////////////////////////////
|
||||
// Lack of light hurts non-mushrooms
|
||||
if(isturf(loc))
|
||||
var/turf/currentTurf = loc
|
||||
var/lightAmt = currentTurf.get_lumcount() * 10
|
||||
if(myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
|
||||
if(lightAmt < 2)
|
||||
adjustHealth(-1 / rating)
|
||||
else // Non-mushroom
|
||||
if(lightAmt < 4)
|
||||
adjustHealth(-2 / rating)
|
||||
|
||||
//Water//////////////////////////////////////////////////////////////////
|
||||
// Drink random amount of water
|
||||
adjustWater(-rand(1,6) / rating)
|
||||
|
||||
// If the plant is dry, it loses health pretty fast, unless mushroom
|
||||
if(waterlevel <= 10 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
|
||||
adjustHealth(-rand(0,1) / rating)
|
||||
if(waterlevel <= 0)
|
||||
adjustHealth(-rand(0,2) / rating)
|
||||
|
||||
// Sufficient water level and nutrient level = plant healthy but also spawns weeds
|
||||
else if(waterlevel > 10 && nutrilevel > 0)
|
||||
adjustHealth(rand(1,2) / rating)
|
||||
if(myseed && prob(myseed.weed_chance))
|
||||
adjustWeeds(myseed.weed_rate)
|
||||
else if(prob(5)) //5 percent chance the weed population will increase
|
||||
adjustWeeds(1 / rating)
|
||||
|
||||
//Toxins/////////////////////////////////////////////////////////////////
|
||||
|
||||
// Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly
|
||||
if(toxic >= 40 && toxic < 80)
|
||||
adjustHealth(-1 / rating)
|
||||
adjustToxic(-rand(1,10) / rating)
|
||||
else if(toxic >= 80) // I don't think it ever gets here tbh unless above is commented out
|
||||
adjustHealth(-3)
|
||||
adjustToxic(-rand(1,10) / rating)
|
||||
|
||||
//Pests & Weeds//////////////////////////////////////////////////////////
|
||||
|
||||
else if(pestlevel >= 5)
|
||||
adjustHealth(-1 / rating)
|
||||
|
||||
// If it's a weed, it doesn't stunt the growth
|
||||
if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
|
||||
adjustHealth(-1 / rating)
|
||||
|
||||
//Health & Age///////////////////////////////////////////////////////////
|
||||
|
||||
// Plant dies if plant_health <= 0
|
||||
if(plant_health <= 0)
|
||||
plantdies()
|
||||
adjustWeeds(1 / rating) // Weeds flourish
|
||||
|
||||
// If the plant is too old, lose health fast
|
||||
if(age > myseed.lifespan)
|
||||
adjustHealth(-rand(1,5) / rating)
|
||||
|
||||
// Harvest code
|
||||
if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead))
|
||||
nutrimentMutation()
|
||||
if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested
|
||||
harvest = 1
|
||||
else
|
||||
lastproduce = age
|
||||
if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase
|
||||
adjustPests(1 / rating)
|
||||
else
|
||||
if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10%
|
||||
adjustWeeds(1 / rating)
|
||||
|
||||
// Weeeeeeeeeeeeeeedddssss
|
||||
if(weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot.
|
||||
if(myseed)
|
||||
if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) // If a normal plant
|
||||
weedinvasion()
|
||||
else
|
||||
weedinvasion() // Weed invasion into empty tray
|
||||
needs_update = 1
|
||||
if (needs_update)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/hydroponics/proc/nutrimentMutation()
|
||||
if (mutmod == 0)
|
||||
return
|
||||
if (mutmod == 1)
|
||||
if(prob(80)) //80%
|
||||
mutate()
|
||||
else if(prob(75)) //15%
|
||||
hardmutate()
|
||||
return
|
||||
if (mutmod == 2)
|
||||
if(prob(50)) //50%
|
||||
mutate()
|
||||
else if(prob(50)) //25%
|
||||
hardmutate()
|
||||
else if(prob(50)) //12.5%
|
||||
mutatespecie()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/hydroponics/update_icon()
|
||||
//Refreshes the icon and sets the luminosity
|
||||
overlays.Cut()
|
||||
|
||||
if(self_sustaining)
|
||||
if(istype(src, /obj/machinery/hydroponics/soil))
|
||||
color = rgb(255, 175, 0)
|
||||
else
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "gaia_blessing")
|
||||
set_light(3)
|
||||
|
||||
update_icon_hoses()
|
||||
|
||||
if(myseed)
|
||||
update_icon_plant()
|
||||
update_icon_lights()
|
||||
|
||||
if(!self_sustaining)
|
||||
if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow))
|
||||
var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow)
|
||||
set_light(G.get_lum(myseed))
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/hydroponics/proc/update_icon_hoses()
|
||||
var/n = 0
|
||||
for(var/Dir in cardinal)
|
||||
var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
|
||||
if(t && t.using_irrigation && using_irrigation)
|
||||
n += Dir
|
||||
|
||||
icon_state = "hoses-[n]"
|
||||
|
||||
/obj/machinery/hydroponics/proc/update_icon_plant()
|
||||
var/image/I
|
||||
if(dead)
|
||||
I = image(icon = myseed.growing_icon, icon_state = myseed.icon_dead)
|
||||
else if(harvest)
|
||||
if(!myseed.icon_harvest)
|
||||
I = image(icon = myseed.growing_icon, icon_state = "[myseed.icon_grow][myseed.growthstages]")
|
||||
else
|
||||
I = image(icon = myseed.growing_icon, icon_state = myseed.icon_harvest)
|
||||
else
|
||||
var/t_growthstate = min(round((age / myseed.maturation) * myseed.growthstages), myseed.growthstages)
|
||||
I = image(icon = myseed.growing_icon, icon_state = "[myseed.icon_grow][t_growthstate]")
|
||||
I.layer = OBJ_LAYER + 0.01
|
||||
overlays += I
|
||||
|
||||
/obj/machinery/hydroponics/proc/update_icon_lights()
|
||||
if(waterlevel <= 10)
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowwater3")
|
||||
if(nutrilevel <= 2)
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lownutri3")
|
||||
if(plant_health <= (myseed.endurance / 2))
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowhealth3")
|
||||
if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40)
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_alert3")
|
||||
if(harvest)
|
||||
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_harvest3")
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/examine(user)
|
||||
..()
|
||||
if(myseed)
|
||||
to_chat(user, "<span class='info'>It has <span class='name'>[myseed.plantname]</span> planted.</span>")
|
||||
if (dead)
|
||||
to_chat(user, "<span class='warning'>It's dead!</span>")
|
||||
else if (harvest)
|
||||
to_chat(user, "<span class='info'>It's ready to harvest.</span>")
|
||||
else if (plant_health <= (myseed.endurance / 2))
|
||||
to_chat(user, "<span class='warning'>It looks unhealthy.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>[src] is empty.</span>")
|
||||
|
||||
if(!self_sustaining)
|
||||
to_chat(user, "<span class='info'>Water: [waterlevel]/[maxwater]</span>")
|
||||
to_chat(user, "<span class='info'>Nutrient: [nutrilevel]/[maxnutri]</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>It doesn't require any water or nutrients.</span>")
|
||||
|
||||
if(weedlevel >= 5)
|
||||
to_chat(user, "<span class='warning'>[src] is filled with weeds!</span>")
|
||||
if(pestlevel >= 5)
|
||||
to_chat(user, "<span class='warning'>[src] is filled with tiny worms!</span>")
|
||||
to_chat(user, "") // Empty line for readability.
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens.
|
||||
dead = 0
|
||||
var/oldPlantName
|
||||
if(myseed) // In case there's nothing in the tray beforehand
|
||||
oldPlantName = myseed.plantname
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
else
|
||||
oldPlantName = "empty tray"
|
||||
switch(rand(1,18)) // randomly pick predominative weed
|
||||
if(16 to 18)
|
||||
myseed = new /obj/item/seeds/reishi(src)
|
||||
if(14 to 15)
|
||||
myseed = new /obj/item/seeds/nettle(src)
|
||||
if(12 to 13)
|
||||
myseed = new /obj/item/seeds/harebell(src)
|
||||
if(10 to 11)
|
||||
myseed = new /obj/item/seeds/amanita(src)
|
||||
if(8 to 9)
|
||||
myseed = new /obj/item/seeds/chanter(src)
|
||||
if(6 to 7)
|
||||
myseed = new /obj/item/seeds/tower(src)
|
||||
if(4 to 5)
|
||||
myseed = new /obj/item/seeds/plump(src)
|
||||
else
|
||||
myseed = new /obj/item/seeds/weeds(src)
|
||||
age = 0
|
||||
plant_health = myseed.endurance
|
||||
lastcycle = world.time
|
||||
harvest = 0
|
||||
weedlevel = 0 // Reset
|
||||
pestlevel = 0 // Reset
|
||||
update_icon()
|
||||
visible_message("<span class='warning'>The [oldPlantName] is overtaken by some [myseed.plantname]!</span>")
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed
|
||||
if(!myseed)
|
||||
return
|
||||
myseed.mutate(lifemut, endmut, productmut, yieldmut, potmut, wrmut, wcmut, traitmut)
|
||||
|
||||
/obj/machinery/hydroponics/proc/hardmutate()
|
||||
mutate(4, 10, 2, 4, 50, 4, 10, 3)
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant!
|
||||
if(!myseed || dead)
|
||||
return
|
||||
|
||||
var/oldPlantName = myseed.plantname
|
||||
if(myseed.mutatelist.len > 0)
|
||||
var/mutantseed = pick(myseed.mutatelist)
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
myseed = new mutantseed
|
||||
else
|
||||
return
|
||||
|
||||
hardmutate()
|
||||
age = 0
|
||||
plant_health = myseed.endurance
|
||||
lastcycle = world.time
|
||||
harvest = 0
|
||||
weedlevel = 0 // Reset
|
||||
|
||||
sleep(5) // Wait a while
|
||||
update_icon()
|
||||
visible_message("<span class='warning'>[oldPlantName] suddenly mutates into [myseed.plantname]!</span>")
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
|
||||
if( weedlevel > 5 )
|
||||
if(myseed)
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu)
|
||||
myseed = new newWeed
|
||||
dead = 0
|
||||
hardmutate()
|
||||
age = 0
|
||||
plant_health = myseed.endurance
|
||||
lastcycle = world.time
|
||||
harvest = 0
|
||||
weedlevel = 0 // Reset
|
||||
|
||||
sleep(5) // Wait a while
|
||||
update_icon()
|
||||
visible_message("<span class='warning'>The mutated weeds in [src] spawn some [myseed.plantname]!</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>The few weeds in [src] seem to react, but only for a moment...</span>")
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier
|
||||
plant_health = 0
|
||||
harvest = 0
|
||||
pestlevel = 0 // Pests die
|
||||
if(!dead)
|
||||
update_icon()
|
||||
dead = 1
|
||||
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutatepest(mob/user)
|
||||
if(pestlevel > 5)
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] caused spiderling pests to spawn in a hydro tray")
|
||||
log_game("[key_name(user)] caused spiderling pests to spawn in a hydro tray")
|
||||
visible_message("<span class='warning'>The pests seem to behave oddly...</span>")
|
||||
for(var/i in 1 to 3)
|
||||
var/obj/effect/spider/spiderling/S = new(get_turf(src))
|
||||
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The pests seem to behave oddly, but quickly settle down...</span>")
|
||||
|
||||
/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user)
|
||||
if(myseed)
|
||||
myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines
|
||||
|
||||
// Requires 5 mutagen to possibly change species.// Poor man's mutagen.
|
||||
if(S.has_reagent("mutagen", 5) || S.has_reagent("radium", 10) || S.has_reagent("uranium", 10))
|
||||
switch(rand(100))
|
||||
if(91 to 100)
|
||||
adjustHealth(-10)
|
||||
to_chat(user, "<span class='warning'>The plant shrivels and burns.</span>")
|
||||
if(81 to 90)
|
||||
mutatespecie()
|
||||
if(66 to 80)
|
||||
hardmutate()
|
||||
if(41 to 65)
|
||||
mutate()
|
||||
if(21 to 41)
|
||||
to_chat(user, "<span class='notice'>The plants don't seem to react...</span>")
|
||||
if(11 to 20)
|
||||
mutateweed()
|
||||
if(1 to 10)
|
||||
mutatepest(user)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Nothing happens...</span>")
|
||||
|
||||
// 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen
|
||||
else if(S.has_reagent("mutagen", 2) || S.has_reagent("radium", 5) || S.has_reagent("uranium", 5))
|
||||
hardmutate()
|
||||
else if(S.has_reagent("mutagen", 1) || S.has_reagent("radium", 2) || S.has_reagent("uranium", 2))
|
||||
mutate()
|
||||
|
||||
// After handling the mutating, we now handle the damage from adding crude radioactives...
|
||||
if(S.has_reagent("uranium", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("uranium") * 1))
|
||||
adjustToxic(round(S.get_reagent_amount("uranium") * 2))
|
||||
if(S.has_reagent("radium", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("radium") * 1))
|
||||
adjustToxic(round(S.get_reagent_amount("radium") * 3)) // Radium is harsher (OOC: also easier to produce)
|
||||
|
||||
// Nutriments
|
||||
if(S.has_reagent("eznutriment", 1))
|
||||
yieldmod = 1
|
||||
mutmod = 1
|
||||
adjustNutri(round(S.get_reagent_amount("eznutriment") * 1))
|
||||
|
||||
if(S.has_reagent("left4zednutriment", 1))
|
||||
yieldmod = 0
|
||||
mutmod = 2
|
||||
adjustNutri(round(S.get_reagent_amount("left4zednutriment") * 1))
|
||||
|
||||
if(S.has_reagent("robustharvestnutriment", 1))
|
||||
yieldmod = 1.3
|
||||
mutmod = 0
|
||||
adjustNutri(round(S.get_reagent_amount("robustharvestnutriment") *1 ))
|
||||
|
||||
// Antitoxin binds shit pretty well. So the tox goes significantly down
|
||||
if(S.has_reagent("charcoal", 1))
|
||||
adjustToxic(-round(S.get_reagent_amount("charcoal") * 2))
|
||||
|
||||
// NIGGA, YOU JUST WENT ON FULL RETARD.
|
||||
if(S.has_reagent("toxin", 1))
|
||||
adjustToxic(round(S.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.has_reagent("milk", 1))
|
||||
adjustNutri(round(S.get_reagent_amount("milk") * 0.1))
|
||||
adjustWater(round(S.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.has_reagent("beer", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("beer") * 0.05))
|
||||
adjustNutri(round(S.get_reagent_amount("beer") * 0.25))
|
||||
adjustWater(round(S.get_reagent_amount("beer") * 0.7))
|
||||
|
||||
// You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial
|
||||
if(S.has_reagent("fluorine", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("fluorine") * 2))
|
||||
adjustToxic(round(S.get_reagent_amount("flourine") * 2.5))
|
||||
adjustWater(-round(S.get_reagent_amount("flourine") * 0.5))
|
||||
adjustWeeds(-rand(1,4))
|
||||
|
||||
// You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial
|
||||
if(S.has_reagent("chlorine", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("chlorine") * 1))
|
||||
adjustToxic(round(S.get_reagent_amount("chlorine") * 1.5))
|
||||
adjustWater(-round(S.get_reagent_amount("chlorine") * 0.5))
|
||||
adjustWeeds(-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.has_reagent("phosphorus", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("phosphorus") * 0.75))
|
||||
adjustNutri(round(S.get_reagent_amount("phosphorus") * 0.1))
|
||||
adjustWater(-round(S.get_reagent_amount("phosphorus") * 0.5))
|
||||
adjustWeeds(-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.has_reagent("sugar", 1))
|
||||
adjustWeeds(rand(1,2))
|
||||
adjustPests(rand(1,2))
|
||||
adjustNutri(round(S.get_reagent_amount("sugar") * 0.1))
|
||||
|
||||
// It is water!
|
||||
if(S.has_reagent("water", 1))
|
||||
adjustWater(round(S.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.has_reagent("holywater", 1))
|
||||
adjustWater(round(S.get_reagent_amount("holywater") * 1))
|
||||
adjustHealth(round(S.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.has_reagent("sodawater", 1))
|
||||
adjustWater(round(S.get_reagent_amount("sodawater") * 1))
|
||||
adjustHealth(round(S.get_reagent_amount("sodawater") * 0.1))
|
||||
adjustNutri(round(S.get_reagent_amount("sodawater") * 0.1))
|
||||
|
||||
// Man, you guys are retards
|
||||
if(S.has_reagent("sacid", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("sacid") * 1))
|
||||
adjustToxic(round(S.get_reagent_amount("sacid") * 1.5))
|
||||
adjustWeeds(-rand(1,2))
|
||||
|
||||
// SERIOUSLY
|
||||
if(S.has_reagent("facid", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("facid") * 2))
|
||||
adjustToxic(round(S.get_reagent_amount("facid") * 3))
|
||||
adjustWeeds(-rand(1,4))
|
||||
|
||||
// Plant-B-Gone is just as bad
|
||||
if(S.has_reagent("plantbgone", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("plantbgone") * 5))
|
||||
adjustToxic(round(S.get_reagent_amount("plantbgone") * 6))
|
||||
adjustWeeds(-rand(4,8))
|
||||
|
||||
// why, just why
|
||||
if(S.has_reagent("napalm", 1))
|
||||
adjustHealth(-round(S.get_reagent_amount("napalm") * 6))
|
||||
adjustToxic(round(S.get_reagent_amount("napalm") * 7))
|
||||
adjustWeeds(-rand(5,9))
|
||||
|
||||
//Weed Spray
|
||||
if(S.has_reagent("weedkiller", 1))
|
||||
adjustToxic(round(S.get_reagent_amount("weedkiller") * 0.5))
|
||||
//old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts
|
||||
adjustWeeds(-rand(1,2))
|
||||
|
||||
//Pest Spray
|
||||
if(S.has_reagent("pestkiller", 1))
|
||||
adjustToxic(round(S.get_reagent_amount("pestkiller") * 0.5))
|
||||
adjustPests(-rand(1,2))
|
||||
|
||||
// Healing
|
||||
if(S.has_reagent("cryoxadone", 1))
|
||||
adjustHealth(round(S.get_reagent_amount("cryoxadone") * 3))
|
||||
adjustToxic(-round(S.get_reagent_amount("cryoxadone") * 3))
|
||||
|
||||
// Ammonia is bad ass.
|
||||
if(S.has_reagent("ammonia", 1))
|
||||
adjustHealth(round(S.get_reagent_amount("ammonia") * 0.5))
|
||||
adjustNutri(round(S.get_reagent_amount("ammonia") * 1))
|
||||
if(myseed)
|
||||
myseed.adjust_yield(round(S.get_reagent_amount("ammonia") * 0.01))
|
||||
|
||||
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
|
||||
if(S.has_reagent("saltpetre", 1))
|
||||
var/salt = S.get_reagent_amount("saltpetre")
|
||||
adjustHealth(round(salt * 0.25))
|
||||
if (myseed)
|
||||
myseed.adjust_production(-round(salt/100)-prob(salt%100))
|
||||
myseed.adjust_potency(round(salt*0.50))
|
||||
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
|
||||
if(S.has_reagent("ash", 1))
|
||||
adjustHealth(round(S.get_reagent_amount("ash") * 0.25))
|
||||
adjustNutri(round(S.get_reagent_amount("ash") * 0.5))
|
||||
adjustWeeds(-1)
|
||||
|
||||
// This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant.
|
||||
if(S.has_reagent("diethylamine", 1))
|
||||
adjustHealth(round(S.get_reagent_amount("diethylamine") * 1))
|
||||
adjustNutri(round(S.get_reagent_amount("diethylamine") * 2))
|
||||
if(myseed)
|
||||
myseed.adjust_yield(round(S.get_reagent_amount("diethylamine") * 0.02))
|
||||
adjustPests(-rand(1,2))
|
||||
|
||||
// Compost, effectively
|
||||
if(S.has_reagent("nutriment", 1))
|
||||
adjustHealth(round(S.get_reagent_amount("nutriment") * 0.5))
|
||||
adjustNutri(round(S.get_reagent_amount("nutriment") * 1))
|
||||
|
||||
// Compost for EVERYTHING
|
||||
if(S.has_reagent("virusfood", 1))
|
||||
adjustNutri(round(S.get_reagent_amount("virusfood") * 0.5))
|
||||
adjustHealth(-round(S.get_reagent_amount("virusfood") * 0.5))
|
||||
|
||||
// FEED ME
|
||||
if(S.has_reagent("blood", 1))
|
||||
adjustNutri(round(S.get_reagent_amount("blood") * 1))
|
||||
adjustPests(rand(2,4))
|
||||
|
||||
// FEED ME SEYMOUR
|
||||
if(S.has_reagent("strangereagent", 1))
|
||||
spawnplant()
|
||||
|
||||
// The best stuff there is. For testing/debugging.
|
||||
if(S.has_reagent("adminordrazine", 1))
|
||||
adjustWater(round(S.get_reagent_amount("adminordrazine") * 1))
|
||||
adjustHealth(round(S.get_reagent_amount("adminordrazine") * 1))
|
||||
adjustNutri(round(S.get_reagent_amount("adminordrazine") * 1))
|
||||
adjustPests(-rand(1,5))
|
||||
adjustWeeds(-rand(1,5))
|
||||
if(S.has_reagent("adminordrazine", 5))
|
||||
switch(rand(100))
|
||||
if(66 to 100)
|
||||
mutatespecie()
|
||||
if(33 to 65)
|
||||
mutateweed()
|
||||
if(1 to 32)
|
||||
mutatepest(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Nothing happens...</span>")
|
||||
|
||||
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params)
|
||||
//Called when mob user "attacks" it with object O
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/gaia)) //Checked early on so it doesn't have to deal with composting checks
|
||||
if(self_sustaining)
|
||||
to_chat(user, "<span class='warning'>This [name] is already self-sustaining!</span>")
|
||||
return
|
||||
if(myseed || weedlevel)
|
||||
to_chat(user, "<span class='warning'>[src] needs to be clear of plants and weeds!</span>")
|
||||
return
|
||||
if(alert(user, "This will make [src] self-sustaining but consume [O] forever. Are you sure?", "[name]", "I'm Sure", "Abort") == "Abort" || !user)
|
||||
return
|
||||
if(!O || qdeleted(O))
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
if(self_sustaining)
|
||||
to_chat(user, "<span class='warning'>This [name] is already self-sustaining!</span>")
|
||||
return
|
||||
if(myseed || weedlevel)
|
||||
to_chat(user, "<span class='warning'>[src] needs to be clear of plants and weeds!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] gently pulls open the soil for [O] and places it inside.</span>", "<span class='notice'>You tenderly root [O] into [src].</span>")
|
||||
user.drop_item()
|
||||
qdel(O)
|
||||
visible_message("<span class='boldnotice'>[src] begins to glow with a beautiful light!</span>")
|
||||
self_sustaining = TRUE
|
||||
update_icon()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers) ) // Syringe stuff (and other reagent containers now too)
|
||||
var/obj/item/weapon/reagent_containers/reagent_source = O
|
||||
|
||||
if(istype(reagent_source, /obj/item/weapon/reagent_containers/syringe))
|
||||
var/obj/item/weapon/reagent_containers/syringe/syr = reagent_source
|
||||
if(syr.mode != 1)
|
||||
to_chat(user, "<span class='warning'>You can't get any extract out of this plant.</span>") //That. Gives me an idea...
|
||||
return
|
||||
|
||||
if(!reagent_source.reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>[reagent_source] is empty.</span>")
|
||||
return 1
|
||||
|
||||
var/list/trays = list(src)//makes the list just this in cases of syringes and compost etc
|
||||
var/target = myseed ? myseed.plantname : src
|
||||
var/visi_msg = ""
|
||||
var/irrigate = 0 //How am I supposed to irrigate pill contents?
|
||||
|
||||
if(istype(reagent_source, /obj/item/weapon/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/weapon/reagent_containers/food/pill))
|
||||
visi_msg="[user] composts [reagent_source], spreading it through [target]"
|
||||
else
|
||||
if(istype(reagent_source, /obj/item/weapon/reagent_containers/syringe/))
|
||||
var/obj/item/weapon/reagent_containers/syringe/syr = reagent_source
|
||||
visi_msg="[user] injects [target] with [syr]"
|
||||
if(syr.reagents.total_volume <= syr.amount_per_transfer_from_this)
|
||||
syr.mode = 0
|
||||
else if(istype(reagent_source, /obj/item/weapon/reagent_containers/spray/))
|
||||
visi_msg="[user] sprays [target] with [reagent_source]"
|
||||
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
|
||||
irrigate = 1
|
||||
else if(reagent_source.amount_per_transfer_from_this) // Droppers, cans, beakers, what have you.
|
||||
visi_msg="[user] uses [reagent_source] on [target]"
|
||||
irrigate = 1
|
||||
// Beakers, bottles, buckets, etc. Can't use is_open_container though.
|
||||
if(istype(reagent_source, /obj/item/weapon/reagent_containers/glass/))
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
|
||||
if(irrigate && reagent_source.amount_per_transfer_from_this > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation)
|
||||
trays = FindConnected()
|
||||
if (trays.len > 1)
|
||||
visi_msg += ", setting off the irrigation system"
|
||||
|
||||
if(visi_msg)
|
||||
visible_message("<span class='notice'>[visi_msg].</span>")
|
||||
|
||||
var/split = round(reagent_source.amount_per_transfer_from_this/trays.len)
|
||||
|
||||
for(var/obj/machinery/hydroponics/H in trays)
|
||||
//cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener
|
||||
|
||||
var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment...
|
||||
S.my_atom = H
|
||||
|
||||
reagent_source.reagents.trans_to(S,split)
|
||||
if(istype(reagent_source, /obj/item/weapon/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/weapon/reagent_containers/food/pill))
|
||||
qdel(reagent_source)
|
||||
|
||||
H.applyChemicals(S, user)
|
||||
|
||||
S.clear_reagents()
|
||||
qdel(S)
|
||||
H.update_icon()
|
||||
if(reagent_source) // If the source wasn't composted and destroyed
|
||||
reagent_source.update_icon()
|
||||
return 1
|
||||
|
||||
else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample))
|
||||
if(!myseed)
|
||||
if(istype(O, /obj/item/seeds/kudzu))
|
||||
investigate_log("had Kudzu planted in it by [user.ckey]([user]) at ([x],[y],[z])","kudzu")
|
||||
user.unEquip(O)
|
||||
to_chat(user, "<span class='notice'>You plant [O].</span>")
|
||||
dead = 0
|
||||
myseed = O
|
||||
age = 1
|
||||
plant_health = myseed.endurance
|
||||
lastcycle = world.time
|
||||
O.forceMove(src)
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] already has seeds in it!</span>")
|
||||
|
||||
else if(istype(O, /obj/item/device/plant_analyzer))
|
||||
if(myseed)
|
||||
to_chat(user, "*** <B>[myseed.plantname]</B> ***") //Carn: now reports the plants growing, not the seeds.
|
||||
to_chat(user, "- Plant Age: <span class='notice'>[age]</span>")
|
||||
var/list/text_string = myseed.get_analyzer_text()
|
||||
if(text_string)
|
||||
to_chat(user, text_string)
|
||||
else
|
||||
to_chat(user, "<B>No plant found.</B>")
|
||||
to_chat(user, "- Weed level: <span class='notice'>[weedlevel] / 10</span>")
|
||||
to_chat(user, "- Pest level: <span class='notice'>[pestlevel] / 10</span>")
|
||||
to_chat(user, "- Toxicity level: <span class='notice'>[toxic] / 100</span>")
|
||||
to_chat(user, "- Water level: <span class='notice'>[waterlevel] / [maxwater]</span>")
|
||||
to_chat(user, "- Nutrition level: <span class='notice'>[nutrilevel] / [maxnutri]</span>")
|
||||
to_chat(user, "")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/cultivator))
|
||||
if(weedlevel > 0)
|
||||
user.visible_message("[user] uproots the weeds.", "<span class='notice'>You remove the weeds from [src].</span>")
|
||||
weedlevel = 0
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This plot is completely devoid of weeds! It doesn't need uprooting.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
attack_hand(user)
|
||||
var/obj/item/weapon/storage/bag/plants/S = O
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
|
||||
if(!S.can_be_inserted(G))
|
||||
return
|
||||
S.handle_item_insertion(G, 1)
|
||||
|
||||
else if(istype(O, /obj/item/weapon/wrench) && unwrenchable)
|
||||
if(using_irrigation)
|
||||
to_chat(user, "<span class='warning'>Disconnect the hoses first!</span>")
|
||||
return
|
||||
|
||||
if(!anchored && !isinspace())
|
||||
user.visible_message("[user] begins to wrench [src] into place.", "<span class='notice'>You begin to wrench [src] in place...</span>")
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if (do_after(user, 20, target = src))
|
||||
if(anchored)
|
||||
return
|
||||
anchored = 1
|
||||
user.visible_message("[user] wrenches [src] into place.", \
|
||||
"<span class='notice'>You wrench [src] in place.</span>")
|
||||
else if(anchored)
|
||||
user.visible_message("[user] begins to unwrench [src].", \
|
||||
"<span class='notice'>You begin to unwrench [src]...</span>")
|
||||
playsound(loc, O.usesound, 50, 1)
|
||||
if (do_after(user, 20*O.toolspeed, target = src))
|
||||
if(!anchored)
|
||||
return
|
||||
anchored = 0
|
||||
user.visible_message("[user] unwrenches [src].", \
|
||||
"<span class='notice'>You unwrench [src].</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/wirecutters) && unwrenchable)
|
||||
using_irrigation = !using_irrigation
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
|
||||
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
|
||||
for(var/obj/machinery/hydroponics/h in range(1,src))
|
||||
h.update_icon()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/shovel/spade) && unwrenchable)
|
||||
if(!myseed && !weedlevel)
|
||||
to_chat(user, "<span class='warning'>[src] doesn't have any plants or weeds!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] starts digging out [src]'s plants...</span>", "<span class='notice'>You start digging out [src]'s plants...</span>")
|
||||
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1)
|
||||
if(!do_after(user, 50, target = src) || (!myseed && !weedlevel))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] digs out the plants in [src]!</span>", "<span class='notice'>You dig out all of [src]'s plants!</span>")
|
||||
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1)
|
||||
if(myseed) //Could be that they're just using it as a de-weeder
|
||||
age = 0
|
||||
plant_health = 0
|
||||
if(harvest)
|
||||
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
|
||||
update_icon()
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/hydroponics/attack_hand(mob/user)
|
||||
if(issilicon(user)) //How does AI know what plant is?
|
||||
return
|
||||
if(harvest)
|
||||
myseed.harvest(user)
|
||||
else if(dead)
|
||||
dead = 0
|
||||
to_chat(user, "<span class='notice'>You remove the dead plant from [src].</span>")
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
update_icon()
|
||||
else
|
||||
examine(user)
|
||||
|
||||
/obj/machinery/hydroponics/proc/update_tray(mob/user = usr)
|
||||
harvest = 0
|
||||
lastproduce = age
|
||||
if(istype(myseed,/obj/item/seeds/replicapod))
|
||||
to_chat(user, "<span class='notice'>You harvest from the [myseed.plantname].</span>")
|
||||
else if(myseed.getYield() <= 0)
|
||||
to_chat(user, "<span class='warning'>You fail to harvest anything useful!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
|
||||
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
dead = 0
|
||||
update_icon()
|
||||
|
||||
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
|
||||
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
|
||||
nutrilevel = Clamp(nutrilevel + adjustamt, 0, maxnutri)
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
|
||||
waterlevel = Clamp(waterlevel + adjustamt, 0, maxwater)
|
||||
|
||||
if(adjustamt>0)
|
||||
adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustHealth(adjustamt)
|
||||
if(myseed && !dead)
|
||||
plant_health = Clamp(plant_health + adjustamt, 0, myseed.endurance)
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustToxic(adjustamt)
|
||||
toxic = Clamp(toxic + adjustamt, 0, 100)
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustPests(adjustamt)
|
||||
pestlevel = Clamp(pestlevel + adjustamt, 0, 10)
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt)
|
||||
weedlevel = Clamp(weedlevel + adjustamt, 0, 10)
|
||||
|
||||
/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood
|
||||
var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato)
|
||||
var/chosen = pick(livingplants)
|
||||
var/mob/living/simple_animal/hostile/C = new chosen
|
||||
C.faction = list("plants")
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/obj/machinery/hydroponics/soil //Not actually hydroponics at all! Honk!
|
||||
name = "soil"
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "soil"
|
||||
density = 0
|
||||
use_power = 0
|
||||
unwrenchable = 0
|
||||
|
||||
/obj/machinery/hydroponics/soil/update_icon_hoses()
|
||||
return // Has no hoses
|
||||
|
||||
/obj/machinery/hydroponics/soil/update_icon_lights()
|
||||
return // Has no lights
|
||||
|
||||
/obj/machinery/hydroponics/soil/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/shovel) && !istype(O, /obj/item/weapon/shovel/spade)) //Doesn't include spades because of uprooting plants
|
||||
to_chat(user, "<span class='notice'>You clear up [src]!</span>")
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
@@ -0,0 +1,406 @@
|
||||
/datum/plant_gene
|
||||
var/name
|
||||
|
||||
/datum/plant_gene/proc/get_name() // Used for manipulator display and gene disk name.
|
||||
return name
|
||||
|
||||
/datum/plant_gene/proc/can_add(obj/item/seeds/S)
|
||||
return !istype(S, /obj/item/seeds/sample) // Samples can't accept new genes
|
||||
|
||||
/datum/plant_gene/proc/Copy()
|
||||
return new type
|
||||
|
||||
|
||||
|
||||
|
||||
// Core plant genes store 5 main variables: lifespan, endurance, production, yield, potency
|
||||
/datum/plant_gene/core
|
||||
var/value
|
||||
|
||||
/datum/plant_gene/core/get_name()
|
||||
return "[name] [value]"
|
||||
|
||||
/datum/plant_gene/core/proc/apply_stat(obj/item/seeds/S)
|
||||
return
|
||||
|
||||
/datum/plant_gene/core/New(var/i = null)
|
||||
..()
|
||||
if(!isnull(i))
|
||||
value = i
|
||||
|
||||
/datum/plant_gene/core/Copy()
|
||||
var/datum/plant_gene/core/C = ..()
|
||||
C.value = value
|
||||
return C
|
||||
|
||||
/datum/plant_gene/core/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
return S.get_gene(type)
|
||||
|
||||
/datum/plant_gene/core/lifespan
|
||||
name = "Lifespan"
|
||||
value = 25
|
||||
|
||||
/datum/plant_gene/core/lifespan/apply_stat(obj/item/seeds/S)
|
||||
S.lifespan = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/endurance
|
||||
name = "Endurance"
|
||||
value = 15
|
||||
|
||||
/datum/plant_gene/core/endurance/apply_stat(obj/item/seeds/S)
|
||||
S.endurance = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/production
|
||||
name = "Production Speed"
|
||||
value = 6
|
||||
|
||||
/datum/plant_gene/core/production/apply_stat(obj/item/seeds/S)
|
||||
S.production = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/yield
|
||||
name = "Yield"
|
||||
value = 3
|
||||
|
||||
/datum/plant_gene/core/yield/apply_stat(obj/item/seeds/S)
|
||||
S.yield = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/potency
|
||||
name = "Potency"
|
||||
value = 10
|
||||
|
||||
/datum/plant_gene/core/potency/apply_stat(obj/item/seeds/S)
|
||||
S.potency = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/weed_rate
|
||||
name = "Weed Growth Rate"
|
||||
value = 1
|
||||
|
||||
/datum/plant_gene/core/weed_rate/apply_stat(obj/item/seeds/S)
|
||||
S.weed_rate = value
|
||||
|
||||
|
||||
/datum/plant_gene/core/weed_chance
|
||||
name = "Weed Vulnerability"
|
||||
value = 5
|
||||
|
||||
/datum/plant_gene/core/weed_chance/apply_stat(obj/item/seeds/S)
|
||||
S.weed_chance = value
|
||||
|
||||
|
||||
// Reagent genes store reagent ID and reagent ratio. Amount of reagent in the plant = 1 + (potency * rate)
|
||||
/datum/plant_gene/reagent
|
||||
name = "Nutriment"
|
||||
var/reagent_id = "nutriment"
|
||||
var/rate = 0.04
|
||||
|
||||
/datum/plant_gene/reagent/get_name()
|
||||
return "[name] production [rate*100]%"
|
||||
|
||||
/datum/plant_gene/reagent/proc/set_reagent(reag_id)
|
||||
reagent_id = reag_id
|
||||
name = "UNKNOWN"
|
||||
|
||||
var/datum/reagent/R = chemical_reagents_list[reag_id]
|
||||
if(R && R.id == reagent_id)
|
||||
name = R.name
|
||||
|
||||
/datum/plant_gene/reagent/New(reag_id = null, reag_rate = 0)
|
||||
..()
|
||||
if(reag_id && reag_rate)
|
||||
set_reagent(reag_id)
|
||||
rate = reag_rate
|
||||
|
||||
/datum/plant_gene/reagent/Copy()
|
||||
var/datum/plant_gene/reagent/G = ..()
|
||||
G.name = name
|
||||
G.reagent_id = reagent_id
|
||||
G.rate = rate
|
||||
return G
|
||||
|
||||
/datum/plant_gene/reagent/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
for(var/datum/plant_gene/reagent/R in S.genes)
|
||||
if(R.reagent_id == reagent_id)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
// Various traits affecting the product. Each must be somehow useful.
|
||||
/datum/plant_gene/trait
|
||||
var/rate = 0.05
|
||||
var/examine_line = ""
|
||||
var/list/origin_tech = null
|
||||
var/trait_id // must be set and equal for any two traits of the same type
|
||||
|
||||
/datum/plant_gene/trait/Copy()
|
||||
var/datum/plant_gene/trait/G = ..()
|
||||
G.rate = rate
|
||||
return G
|
||||
|
||||
/datum/plant_gene/trait/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
for(var/datum/plant_gene/trait/R in S.genes)
|
||||
if(trait_id && R.trait_id == trait_id)
|
||||
return FALSE
|
||||
if(type == R.type)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/plant_gene/trait/proc/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc)
|
||||
if(!origin_tech) // This ugly code segment adds RnD tech levels to resulting plants.
|
||||
return
|
||||
|
||||
if(G.origin_tech)
|
||||
var/list/tech = params2list(G.origin_tech)
|
||||
for(var/t in origin_tech)
|
||||
if(t in tech)
|
||||
tech[t] = max(text2num(tech[t]), origin_tech[t])
|
||||
else
|
||||
tech[t] = origin_tech[t]
|
||||
G.origin_tech = list2params(tech)
|
||||
else
|
||||
G.origin_tech = list2params(origin_tech)
|
||||
|
||||
/datum/plant_gene/trait/proc/on_consume(obj/item/weapon/reagent_containers/food/snacks/grown/G, mob/living/carbon/target)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/proc/on_cross(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/proc/on_slip(obj/item/weapon/reagent_containers/food/snacks/grown/G, mob/living/carbon/target)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/proc/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/proc/on_attackby(obj/item/weapon/reagent_containers/food/snacks/grown/G, obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/proc/on_throw_impact(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
return
|
||||
|
||||
/datum/plant_gene/trait/squash
|
||||
// Allows the plant to be squashed when thrown or slipped on, leaving a colored mess and trash type item behind.
|
||||
// Also splashes everything in target turf with reagents and applies other trait effects (teleporting, etc) to the target by on_squash.
|
||||
// For code, see grown.dm
|
||||
name = "Liquid Contents"
|
||||
examine_line = "<span class='info'>It has a lot of liquid contents inside.</span>"
|
||||
origin_tech = list("biotech" = 5)
|
||||
|
||||
/datum/plant_gene/trait/slip
|
||||
// Makes plant slippery, unless it has a grown-type trash. Then the trash gets slippery.
|
||||
// Applies other trait effects (teleporting, etc) to the target by on_slip.
|
||||
name = "Slippery Skin"
|
||||
rate = 0.1
|
||||
examine_line = "<span class='info'>It has a very slippery skin.</span>"
|
||||
|
||||
/datum/plant_gene/trait/slip/on_cross(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
if(iscarbon(target))
|
||||
var/obj/item/seeds/seed = G.seed
|
||||
var/mob/living/carbon/M = target
|
||||
|
||||
var/stun_len = seed.potency * rate * 0.8
|
||||
if(istype(G) && ispath(G.trash, /obj/item/weapon/grown))
|
||||
return
|
||||
|
||||
if(!istype(G, /obj/item/weapon/grown/bananapeel) && (!G.reagents || !G.reagents.has_reagent("lube")))
|
||||
stun_len /= 3
|
||||
|
||||
var/stun = min(stun_len, 7)
|
||||
var/weaken = min(stun_len, 7)
|
||||
|
||||
if(M.slip(stun, weaken, G))
|
||||
for(var/datum/plant_gene/trait/T in seed.genes)
|
||||
T.on_slip(G, M)
|
||||
|
||||
/datum/plant_gene/trait/cell_charge
|
||||
// Cell recharging trait. Charges all mob's power cells to (potency*rate)% mark when eaten.
|
||||
// Generates sparks on squash.
|
||||
// Small (potency*rate*5) chance to shock squish or slip target for (potency*rate*5) damage.
|
||||
// Multiplies max charge by (rate*1000) when used in potato power cells.
|
||||
name = "Electrical Activity"
|
||||
rate = 0.2
|
||||
origin_tech = list("powerstorage" = 5)
|
||||
|
||||
/datum/plant_gene/trait/cell_charge/on_slip(obj/item/weapon/reagent_containers/food/snacks/grown/G, mob/living/carbon/C)
|
||||
var/power = G.seed.potency*rate
|
||||
if(prob(power))
|
||||
C.electrocute_act(round(power), G, 1, 1)
|
||||
|
||||
/datum/plant_gene/trait/cell_charge/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
var/power = G.seed.potency*rate
|
||||
if(prob(power))
|
||||
C.electrocute_act(round(power), G, 1, 1)
|
||||
|
||||
/datum/plant_gene/trait/cell_charge/on_consume(obj/item/weapon/reagent_containers/food/snacks/grown/G, mob/living/carbon/target)
|
||||
if(!G.reagents.total_volume)
|
||||
var/batteries_recharged = 0
|
||||
for(var/obj/item/weapon/stock_parts/cell/C in target.GetAllContents())
|
||||
var/newcharge = min(G.seed.potency*0.01*C.maxcharge, C.maxcharge)
|
||||
if(C.charge < newcharge)
|
||||
C.charge = newcharge
|
||||
if(isobj(C.loc))
|
||||
var/obj/O = C.loc
|
||||
O.update_icon() //update power meters and such
|
||||
C.update_icon()
|
||||
batteries_recharged = 1
|
||||
if(batteries_recharged)
|
||||
to_chat(target, "<span class='notice'>Your batteries are recharged!</span>")
|
||||
|
||||
|
||||
|
||||
/datum/plant_gene/trait/glow
|
||||
// Makes plant glow. Makes plant in tray glow too.
|
||||
// Adds potency*rate luminosity to products.
|
||||
name = "Bioluminescence"
|
||||
rate = 0.1
|
||||
examine_line = "<span class='info'>It emits a soft glow.</span>"
|
||||
trait_id = "glow"
|
||||
|
||||
/datum/plant_gene/trait/glow/proc/get_lum(obj/item/seeds/S)
|
||||
return round(S.potency*rate)
|
||||
|
||||
/datum/plant_gene/trait/glow/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc)
|
||||
..()
|
||||
G.set_light(get_lum(G.seed))
|
||||
|
||||
/datum/plant_gene/trait/glow/berry
|
||||
name = "Strong Bioluminescence"
|
||||
rate = 0.2
|
||||
|
||||
|
||||
/datum/plant_gene/trait/teleport
|
||||
// Makes plant teleport people when squashed or slipped on.
|
||||
// Teleport radius is calculated as max(round(potency*rate), 1)
|
||||
name = "Bluespace Activity"
|
||||
rate = 0.1
|
||||
origin_tech = list("bluespace" = 5)
|
||||
|
||||
/datum/plant_gene/trait/teleport/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
if(isliving(target))
|
||||
var/teleport_radius = max(round(G.seed.potency / 10), 1)
|
||||
var/turf/T = get_turf(target)
|
||||
new /obj/effect/decal/cleanable/molten_object(T) //Leave a pile of goo behind for dramatic effect...
|
||||
do_teleport(target, T, teleport_radius)
|
||||
|
||||
/datum/plant_gene/trait/teleport/on_slip(obj/item/weapon/reagent_containers/food/snacks/grown/G, mob/living/carbon/C)
|
||||
var/teleport_radius = max(round(G.seed.potency / 10), 1)
|
||||
var/turf/T = get_turf(C)
|
||||
to_chat(C, "<span class='warning'>You slip through spacetime!</span>")
|
||||
do_teleport(C, T, teleport_radius)
|
||||
if(prob(50))
|
||||
do_teleport(G, T, teleport_radius)
|
||||
else
|
||||
new /obj/effect/decal/cleanable/molten_object(T) //Leave a pile of goo behind for dramatic effect...
|
||||
qdel(G)
|
||||
|
||||
|
||||
/datum/plant_gene/trait/noreact
|
||||
// Makes plant reagents not react until squashed.
|
||||
name = "Separated Chemicals"
|
||||
|
||||
/datum/plant_gene/trait/noreact/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc)
|
||||
..()
|
||||
G.reagents.set_reacting(FALSE)
|
||||
|
||||
/datum/plant_gene/trait/noreact/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
G.reagents.set_reacting(TRUE)
|
||||
G.reagents.handle_reactions()
|
||||
|
||||
|
||||
/datum/plant_gene/trait/maxchem
|
||||
// 2x to max reagents volume.
|
||||
name = "Densified Chemicals"
|
||||
rate = 2
|
||||
|
||||
/datum/plant_gene/trait/maxchem/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc)
|
||||
..()
|
||||
G.reagents.maximum_volume *= rate
|
||||
|
||||
/datum/plant_gene/trait/repeated_harvest
|
||||
name = "Perennial Growth"
|
||||
|
||||
/datum/plant_gene/trait/repeated_harvest/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(istype(S, /obj/item/seeds/replicapod))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/plant_gene/trait/battery
|
||||
name = "Capacitive Cell Production"
|
||||
|
||||
/datum/plant_gene/trait/battery/on_attackby(obj/item/weapon/reagent_containers/food/snacks/grown/G, obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = I
|
||||
if(C.use(5))
|
||||
to_chat(user, "<span class='notice'>You add some cable to [G] and slide it inside the battery encasing.</span>")
|
||||
var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(user.loc)
|
||||
pocell.icon_state = G.icon_state
|
||||
pocell.maxcharge = G.seed.potency * 20
|
||||
|
||||
// The secret of potato supercells!
|
||||
var/datum/plant_gene/trait/cell_charge/CG = G.seed.get_gene(/datum/plant_gene/trait/cell_charge)
|
||||
if(CG) // 10x charge for deafult cell charge gene - 20 000 with 100 potency.
|
||||
pocell.maxcharge *= CG.rate*1000
|
||||
pocell.charge = pocell.maxcharge
|
||||
pocell.name = "[G] battery"
|
||||
pocell.desc = "A rechargable plant based power cell. This one has a power rating of [pocell.maxcharge], and you should not swallow it."
|
||||
|
||||
if(G.reagents.has_reagent("plasma", 2))
|
||||
pocell.rigged = 1
|
||||
|
||||
qdel(G)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need five lengths of cable to make a [G] battery!</span>")
|
||||
|
||||
|
||||
/datum/plant_gene/trait/stinging
|
||||
name = "Hypodermic Prickles"
|
||||
|
||||
/datum/plant_gene/trait/stinging/on_throw_impact(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
if(isliving(target) && G.reagents && G.reagents.total_volume)
|
||||
var/mob/living/L = target
|
||||
if(L.reagents && L.can_inject(null, 0))
|
||||
var/injecting_amount = max(1, G.seed.potency*0.2) // Minimum of 1, max of 20
|
||||
var/fraction = min(injecting_amount/G.reagents.total_volume, 1)
|
||||
G.reagents.reaction(L, INGEST, fraction)
|
||||
G.reagents.trans_to(L, injecting_amount)
|
||||
to_chat(target, "<span class='danger'>You are pricked by [G]!</span>")
|
||||
|
||||
/datum/plant_gene/trait/smoke
|
||||
name = "gaseous decomposition"
|
||||
|
||||
/datum/plant_gene/trait/smoke/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
|
||||
var/datum/effect/system/chem_smoke_spread/S = new
|
||||
var/splat_location = get_turf(target)
|
||||
var/smoke_amount = round(sqrt(G.seed.potency * 0.1), 1) //FOX CHANGE THIS FORMULA FOR PARA.
|
||||
S.attach(splat_location)
|
||||
S.set_up(G.reagents, smoke_amount, splat_location, 0)
|
||||
S.start()
|
||||
G.reagents.clear_reagents()
|
||||
|
||||
/datum/plant_gene/trait/plant_type // Parent type
|
||||
name = "you shouldn't see this"
|
||||
trait_id = "plant_type"
|
||||
|
||||
/datum/plant_gene/trait/plant_type/weed_hardy
|
||||
name = "Weed Adaptation"
|
||||
|
||||
/datum/plant_gene/trait/plant_type/fungal_metabolism
|
||||
name = "Fungal Vitality"
|
||||
|
||||
/datum/plant_gene/trait/plant_type/alien_properties
|
||||
name ="?????"
|
||||
@@ -0,0 +1,44 @@
|
||||
var/list/chem_t1_reagents = list(
|
||||
"hydrogen", "oxygen", "silicon",
|
||||
"phosphorus", "sulfur", "carbon",
|
||||
"nitrogen", "water"
|
||||
)
|
||||
|
||||
var/list/chem_t2_reagents = list(
|
||||
"lithium", "copper", "mercury",
|
||||
"sodium", "iodine", "bromine"
|
||||
) // "sugar", "sacid" removed because they are already in roundstart plants
|
||||
|
||||
var/list/chem_t3_reagents = list(
|
||||
"ethanol", "chlorine", "potassium",
|
||||
"aluminium", "radium", "fluorine",
|
||||
"iron", "welding_fuel", "silver",
|
||||
"stable_plasma"
|
||||
)
|
||||
|
||||
var/list/chem_t4_reagents = list(
|
||||
"oil", "ash", "acetone",
|
||||
"saltpetre", "ammonia", "diethylamine"
|
||||
)
|
||||
|
||||
/obj/item/seeds/sample
|
||||
name = "plant sample"
|
||||
icon_state = "sample-empty"
|
||||
potency = -1
|
||||
yield = -1
|
||||
var/sample_color = "#FFFFFF"
|
||||
|
||||
/obj/item/seeds/sample/New()
|
||||
..()
|
||||
if(sample_color)
|
||||
var/image/I = image(icon, icon_state = "sample-filling")
|
||||
I.color = sample_color
|
||||
overlays += I
|
||||
|
||||
/obj/item/seeds/sample/get_analyzer_text()
|
||||
return " The DNA of this sample is damaged beyond recovery, it can't support life on it's own.\n*---------*"
|
||||
|
||||
/obj/item/seeds/sample/alienweed
|
||||
name = "alien weed sample"
|
||||
icon_state = "alienweed"
|
||||
sample_color = null
|
||||
@@ -1,839 +0,0 @@
|
||||
/datum/plantgene
|
||||
var/genetype // Label used when applying trait.
|
||||
var/list/values // Values to copy into the target seed datum.
|
||||
|
||||
/datum/seed
|
||||
//Tracking.
|
||||
var/uid // Unique identifier.
|
||||
var/name // Index for global list.
|
||||
var/seed_name // Plant name for seed packet.
|
||||
var/seed_noun = "seeds" // Descriptor for packet.
|
||||
var/display_name // Prettier name.
|
||||
var/base_name // Unchanging name for use with modified versions
|
||||
var/roundstart // If set, seed will not display variety number.
|
||||
var/mysterious // Only used for the random seed packets.
|
||||
var/can_self_harvest = 0 // Mostly used for living mobs.
|
||||
var/growth_stages = 0 // Number of stages the plant passes through before it is mature.
|
||||
var/list/traits = list() // Initialized in New()
|
||||
var/list/mutants // Possible predefined mutant varieties, if any.
|
||||
var/list/chems // Chemicals that plant produces in products/injects into victim.
|
||||
var/list/consume_gasses // The plant will absorb these gasses during its life.
|
||||
var/list/exude_gasses // The plant will exude these gasses during its life.
|
||||
var/kitchen_tag // Used by the reagent grinder.
|
||||
var/trash_type // Garbage item produced when eaten.
|
||||
var/splat_type = /obj/effect/decal/cleanable/fruit_smudge // Graffiti decal.
|
||||
var/preset_product
|
||||
var/final_form = 1
|
||||
var/last_diverge_type = -1 // Used to check if we need to change our name prefix when we are mutated/modified/enhanced
|
||||
var/modular_icon = 0 // Dictates if the product uses a modular sprite. 0 = preset, 1 = modular
|
||||
var/preset_icon = "undef" // Name of the iconstate in icon/obj/harvest.dmi to use for preset sprite
|
||||
// Make sure to set this to the correct icon if not using a modular sprite
|
||||
|
||||
/datum/seed/New()
|
||||
base_name = seed_name
|
||||
set_trait(TRAIT_IMMUTABLE, 0) // If set, plant will never mutate. If -1, plant is highly mutable.
|
||||
set_trait(TRAIT_HARVEST_REPEAT, 0) // If 1, this plant will fruit repeatedly.
|
||||
set_trait(TRAIT_PRODUCES_POWER, 0) // Can be used to make a battery.
|
||||
set_trait(TRAIT_JUICY, 0) // When thrown, causes a splatter decal.
|
||||
set_trait(TRAIT_EXPLOSIVE, 0) // When thrown, acts as a grenade.
|
||||
set_trait(TRAIT_CARNIVOROUS, 0) // 0 = none, 1 = eat pests in tray, 2 = eat living things (when a vine).
|
||||
set_trait(TRAIT_PARASITE, 0) // 0 = no, 1 = gain health from weed level.
|
||||
set_trait(TRAIT_STINGS, 0) // Can cause damage/inject reagents when thrown or handled.
|
||||
set_trait(TRAIT_YIELD, 0) // Amount of product.
|
||||
set_trait(TRAIT_SPREAD, 0) // 0 limits plant to tray, 1 = creepers, 2 = vines.
|
||||
set_trait(TRAIT_MATURATION, 0) // Time taken before the plant is mature.
|
||||
set_trait(TRAIT_PRODUCTION, 0) // Time before harvesting can be undertaken again.
|
||||
set_trait(TRAIT_TELEPORTING, 0) // Uses the bluespace tomato effect.
|
||||
set_trait(TRAIT_BATTERY_RECHARGE, 0) // Used for glowcaps; recharges batteries on a user.
|
||||
set_trait(TRAIT_BIOLUM, 0) // Plant is bioluminescent.
|
||||
set_trait(TRAIT_ALTER_TEMP, 0) // If set, the plant will periodically alter local temp by this amount.
|
||||
set_trait(TRAIT_PRODUCT_ICON, 0) // Icon to use for fruit coming from this plant.
|
||||
set_trait(TRAIT_PLANT_ICON, 0) // Icon to use for the plant growing in the tray.
|
||||
set_trait(TRAIT_PRODUCT_COLOUR, 0) // Colour to apply to product icon.
|
||||
set_trait(TRAIT_BIOLUM_COLOUR, 0) // The colour of the plant's radiance.
|
||||
set_trait(TRAIT_RARITY, 0) // How rare the plant is. Used for giving points to cargo when shipping off to Centcom.
|
||||
set_trait(TRAIT_POTENCY, 1) // General purpose plant strength value.
|
||||
set_trait(TRAIT_REQUIRES_NUTRIENTS, 1) // The plant can starve.
|
||||
set_trait(TRAIT_REQUIRES_WATER, 1) // The plant can become dehydrated.
|
||||
set_trait(TRAIT_WATER_CONSUMPTION, 3) // Plant drinks this much per tick.
|
||||
set_trait(TRAIT_LIGHT_TOLERANCE, 5) // Departure from ideal that is survivable.
|
||||
set_trait(TRAIT_TOXINS_TOLERANCE, 5) // Resistance to poison.
|
||||
set_trait(TRAIT_PEST_TOLERANCE, 5) // Threshold for pests to impact health.
|
||||
set_trait(TRAIT_WEED_TOLERANCE, 5) // Threshold for weeds to impact health.
|
||||
set_trait(TRAIT_IDEAL_LIGHT, 8) // Preferred light level in luminosity.
|
||||
set_trait(TRAIT_HEAT_TOLERANCE, 20) // Departure from ideal that is survivable.
|
||||
set_trait(TRAIT_LOWKPA_TOLERANCE, 25) // Low pressure capacity.
|
||||
set_trait(TRAIT_ENDURANCE, 100) // Maximum plant HP when growing.
|
||||
set_trait(TRAIT_HIGHKPA_TOLERANCE, 200) // High pressure capacity.
|
||||
set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin.
|
||||
set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick.
|
||||
set_trait(TRAIT_PLANT_COLOUR, "#46B543") // Colour of the plant icon.
|
||||
|
||||
spawn(5)
|
||||
sleep(-1)
|
||||
update_growth_stages()
|
||||
|
||||
/datum/seed/proc/get_trait(var/trait)
|
||||
return traits["[trait]"]
|
||||
|
||||
/datum/seed/proc/set_trait(var/trait,var/nval,var/ubound,var/lbound, var/degrade)
|
||||
if(!isnull(degrade)) nval *= degrade
|
||||
if(!isnull(ubound)) nval = min(nval,ubound)
|
||||
if(!isnull(lbound)) nval = max(nval,lbound)
|
||||
traits["[trait]"] = nval
|
||||
|
||||
/datum/seed/proc/create_spores(var/turf/T, var/obj/item/thrown)
|
||||
if(!T)
|
||||
return
|
||||
if(!istype(T))
|
||||
T = get_turf(T)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
R.my_atom = thrown
|
||||
if(chems.len)
|
||||
for(var/rid in chems)
|
||||
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/3))
|
||||
R.add_reagent(rid,injecting)
|
||||
|
||||
var/datum/effect/system/chem_smoke_spread/S = new()
|
||||
S.attach(T)
|
||||
S.set_up(R, round(get_trait(TRAIT_POTENCY)/4), 0, T)
|
||||
S.start()
|
||||
|
||||
// Does brute damage to a target.
|
||||
/datum/seed/proc/do_thorns(var/mob/living/carbon/human/target, var/obj/item/fruit, var/target_limb)
|
||||
|
||||
if(!get_trait(TRAIT_CARNIVOROUS))
|
||||
return
|
||||
|
||||
if(!istype(target))
|
||||
if(istype(target, /mob/living/simple_animal/mouse) || istype(target, /mob/living/simple_animal/lizard))
|
||||
new /obj/effect/decal/cleanable/blood/splatter(get_turf(target))
|
||||
qdel(target)
|
||||
return
|
||||
|
||||
|
||||
if(!target_limb) target_limb = pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin")
|
||||
var/obj/item/organ/external/affecting = target.get_organ(target_limb)
|
||||
var/damage = 0
|
||||
|
||||
if(get_trait(TRAIT_CARNIVOROUS))
|
||||
if(get_trait(TRAIT_CARNIVOROUS) == 2)
|
||||
if(affecting)
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns pierce your [affecting.name] greedily!</span>")
|
||||
else
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns pierce your flesh greedily!</span>")
|
||||
damage = get_trait(TRAIT_POTENCY)/2
|
||||
else
|
||||
if(affecting)
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns dig deeply into your [affecting.name]!</span>")
|
||||
else
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns dig deeply into your flesh!</span>")
|
||||
damage = get_trait(TRAIT_POTENCY)/5
|
||||
else
|
||||
return
|
||||
|
||||
if(affecting)
|
||||
affecting.take_damage(damage, 0)
|
||||
affecting.add_autopsy_data("Thorns",damage)
|
||||
else
|
||||
target.adjustBruteLoss(damage)
|
||||
target.UpdateDamageIcon()
|
||||
target.updatehealth()
|
||||
|
||||
// Adds reagents to a target.
|
||||
/datum/seed/proc/do_sting(var/mob/living/carbon/human/target, var/obj/item/fruit, var/target_limb)
|
||||
if(!get_trait(TRAIT_STINGS))
|
||||
return
|
||||
if(!istype(target))
|
||||
return
|
||||
if(!target_limb) //if we weren't given a target_limb, pick a random one to try stinging
|
||||
target_limb = pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin")
|
||||
if(chems && chems.len)
|
||||
|
||||
if(!target.can_inject(target, 0, target_limb)) //if a syringe can't get through, neither can the sting
|
||||
return
|
||||
|
||||
var/protection_needed
|
||||
switch(target_limb)
|
||||
if("head")
|
||||
protection_needed = HEAD | HEADCOVERSMOUTH | HEADCOVERSEYES
|
||||
if("chest")
|
||||
protection_needed = UPPER_TORSO
|
||||
if("groin")
|
||||
protection_needed = LOWER_TORSO
|
||||
if("l_arm","r_arm")
|
||||
protection_needed = ARMS
|
||||
if("l_hand","r_hand")
|
||||
protection_needed = HANDS
|
||||
if("l_leg","r_leg")
|
||||
protection_needed = LEGS
|
||||
if("l_foot","r_foot")
|
||||
protection_needed = FEET
|
||||
|
||||
for(var/obj/item/clothing/clothes in target)
|
||||
|
||||
if(target.l_hand == clothes|| target.r_hand == clothes)
|
||||
continue
|
||||
protection_needed &= ~(clothes.body_parts_covered)
|
||||
if((clothes.slot_flags & SLOT_HEAD) || (clothes.slot_flags & SLOT_MASK))
|
||||
if(clothes.flags & HEADCOVERSEYES)
|
||||
protection_needed &= ~(HEADCOVERSEYES)
|
||||
if(clothes.flags & HEADCOVERSMOUTH)
|
||||
protection_needed &= ~(HEADCOVERSMOUTH)
|
||||
if(!protection_needed) //already got the needed protection, save some time and skip the rest of the loop
|
||||
break
|
||||
|
||||
if(!protection_needed) //properly protected, good job!
|
||||
return
|
||||
|
||||
to_chat(target, "<span class='danger'>You are stung by \the [fruit]!</span>")
|
||||
for(var/rid in chems)
|
||||
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/5))
|
||||
target.reagents.add_reagent(rid,injecting)
|
||||
|
||||
//Splatter a turf.
|
||||
/datum/seed/proc/splatter(var/turf/T,var/obj/item/thrown)
|
||||
if(splat_type)
|
||||
var/obj/effect/plant/splat = new splat_type(T, src)
|
||||
if(!istype(splat)) // Plants handle their own stuff.
|
||||
splat.name = "[thrown.name] [pick("smear","smudge","splatter")]"
|
||||
var/clr
|
||||
if(get_trait(TRAIT_BIOLUM))
|
||||
if(get_trait(TRAIT_BIOLUM_COLOUR))
|
||||
clr = get_trait(TRAIT_BIOLUM_COLOUR)
|
||||
splat.set_light(get_trait(TRAIT_BIOLUM), l_color = clr)
|
||||
if(get_trait(TRAIT_PRODUCT_COLOUR))
|
||||
splat.color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
|
||||
if(chems)
|
||||
for(var/mob/living/M in T.contents)
|
||||
if(!M.reagents)
|
||||
continue
|
||||
for(var/chem in chems)
|
||||
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/3))
|
||||
M.reagents.add_reagent(chem,injecting)
|
||||
|
||||
//Applies an effect to a target atom.
|
||||
/datum/seed/proc/thrown_at(var/obj/item/thrown,var/atom/target, var/force_explode)
|
||||
|
||||
var/splatted
|
||||
var/turf/origin_turf = get_turf(target)
|
||||
|
||||
if(force_explode || get_trait(TRAIT_EXPLOSIVE))
|
||||
|
||||
create_spores(origin_turf, thrown)
|
||||
|
||||
var/flood_dist = min(10,max(1,get_trait(TRAIT_POTENCY)/15))
|
||||
var/list/open_turfs = list()
|
||||
var/list/closed_turfs = list()
|
||||
var/list/valid_turfs = list()
|
||||
open_turfs |= origin_turf
|
||||
|
||||
// Flood fill to get affected turfs.
|
||||
while(open_turfs.len)
|
||||
var/turf/T = pick(open_turfs)
|
||||
open_turfs -= T
|
||||
closed_turfs |= T
|
||||
valid_turfs |= T
|
||||
|
||||
for(var/dir in alldirs)
|
||||
var/turf/neighbor = get_step(T,dir)
|
||||
if(!neighbor || (neighbor in closed_turfs) || (neighbor in open_turfs))
|
||||
continue
|
||||
if(neighbor.density || get_dist(neighbor,origin_turf) > flood_dist || istype(neighbor,/turf/space))
|
||||
closed_turfs |= neighbor
|
||||
continue
|
||||
// Check for windows.
|
||||
var/no_los
|
||||
var/turf/last_turf = origin_turf
|
||||
for(var/turf/target_turf in getline(origin_turf,neighbor))
|
||||
if(!last_turf.Enter(thrown,target_turf) || target_turf.density)
|
||||
no_los = 1
|
||||
break
|
||||
last_turf = target_turf
|
||||
if(!no_los && !origin_turf.Enter(thrown, neighbor))
|
||||
no_los = 1
|
||||
if(no_los)
|
||||
closed_turfs |= neighbor
|
||||
continue
|
||||
open_turfs |= neighbor
|
||||
|
||||
for(var/turf/T in valid_turfs)
|
||||
for(var/mob/living/M in T.contents)
|
||||
apply_special_effect(M)
|
||||
splatter(T,thrown)
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
|
||||
qdel(thrown)
|
||||
return
|
||||
|
||||
if(istype(target,/mob/living))
|
||||
splatted = apply_special_effect(target,thrown)
|
||||
else if(istype(target,/turf))
|
||||
splatted = 1
|
||||
for(var/mob/living/M in target.contents)
|
||||
apply_special_effect(M)
|
||||
|
||||
if(get_trait(TRAIT_JUICY) && splatted)
|
||||
splatter(origin_turf,thrown)
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] splatters against [target]!</span>")
|
||||
qdel(thrown)
|
||||
|
||||
/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/obj/item/weapon/tank/holding, var/check_only)
|
||||
|
||||
var/health_change = 0
|
||||
|
||||
if(!environment) //Someone called this without passing an environment. Punish their plant.
|
||||
return -100
|
||||
|
||||
// Process it.
|
||||
var/pressure
|
||||
if(holding) //Check if we are running from an internal source (portable tank)
|
||||
//Use the tank's distribution pressure or it's internal pressure (whichever is lower) for pressure checks
|
||||
pressure = min(environment.return_pressure(), holding.distribute_pressure)
|
||||
else //Not using an internal source
|
||||
pressure = environment.return_pressure()
|
||||
if(pressure < get_trait(TRAIT_LOWKPA_TOLERANCE)|| pressure > get_trait(TRAIT_HIGHKPA_TOLERANCE))
|
||||
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
if(abs(environment.temperature - get_trait(TRAIT_IDEAL_HEAT)) > get_trait(TRAIT_HEAT_TOLERANCE))
|
||||
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Handle gas consumption.
|
||||
if(consume_gasses && consume_gasses.len)
|
||||
var/missing_gas = 0
|
||||
for(var/gas in consume_gasses)
|
||||
if(environment && environment.vars[gas] && environment.vars[gas] >= consume_gasses[gas])
|
||||
if(!check_only)
|
||||
environment = adjust_gas(environment, gas,-consume_gasses[gas])
|
||||
else
|
||||
missing_gas++
|
||||
|
||||
if(missing_gas > 0)
|
||||
health_change += missing_gas * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Handle gas production.
|
||||
if(exude_gasses && exude_gasses.len && !check_only)
|
||||
for(var/gas in exude_gasses)
|
||||
environment = adjust_gas(environment, gas, max(1,round((exude_gasses[gas]*(get_trait(TRAIT_POTENCY)/5))/exude_gasses.len)))
|
||||
|
||||
//Handle heat adjustment
|
||||
if(get_trait(TRAIT_ALTER_TEMP))
|
||||
environment.temperature += get_trait(TRAIT_ALTER_TEMP)
|
||||
if(environment.temperature < 0) //Make sure we didn't drop below absolute zero
|
||||
environment.temperature = 0 //Set temperature back to zero if we did
|
||||
|
||||
// Handle light requirements.
|
||||
if(!light_supplied)
|
||||
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in current_turf
|
||||
if(L)
|
||||
light_supplied = L.get_clamped_lum()*10
|
||||
else
|
||||
light_supplied = 5
|
||||
|
||||
if(light_supplied)
|
||||
if(abs(light_supplied - get_trait(TRAIT_IDEAL_LIGHT)) > get_trait(TRAIT_LIGHT_TOLERANCE))
|
||||
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
return health_change
|
||||
|
||||
//Screw it, making a new proc for this for the sake of readability or something. --FalseIncarnate
|
||||
/datum/seed/proc/adjust_gas(var/datum/gas_mixture/environment, var/gas, var/amount = 0)
|
||||
if(!environment || !gas) //no gas_mixture or gas defined to adjust
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()
|
||||
var/datum/gas_mixture/temp_holding
|
||||
if(transfer_moles <= 0) //Check if the transfer_moles is an unacceptable value for the remove proc
|
||||
//The environment is empty (or somehow has negative moles), create a new gas_mixture for temp_holding
|
||||
temp_holding = new /datum/gas_mixture()
|
||||
temp_holding.temperature = T20C
|
||||
else
|
||||
//The environment is acceptable, transfer it's contents into temp_holding
|
||||
temp_holding = environment.remove(transfer_moles)
|
||||
|
||||
if(!temp_holding) return //Just in case temp_holding has somehow avoided being set
|
||||
|
||||
switch(gas)
|
||||
if("oxygen")
|
||||
temp_holding.oxygen += amount
|
||||
if("nitrogen")
|
||||
temp_holding.nitrogen += amount
|
||||
if("carbon_dioxide")
|
||||
temp_holding.carbon_dioxide += amount
|
||||
if("toxins")
|
||||
temp_holding.toxins += amount
|
||||
|
||||
return environment.merge(temp_holding)
|
||||
|
||||
/datum/seed/proc/apply_special_effect(var/mob/living/target,var/obj/item/thrown)
|
||||
|
||||
var/impact = 1
|
||||
do_sting(target,thrown)
|
||||
do_thorns(target,thrown)
|
||||
|
||||
// Bluespace tomato code copied over from grown.dm.
|
||||
if(get_trait(TRAIT_TELEPORTING))
|
||||
if(!is_teleport_allowed(target.z))
|
||||
return 1
|
||||
|
||||
//Plant potency determines radius of teleport.
|
||||
var/outer_teleport_radius = get_trait(TRAIT_POTENCY)/5
|
||||
var/inner_teleport_radius = get_trait(TRAIT_POTENCY)/15
|
||||
|
||||
var/list/turfs = list()
|
||||
if(inner_teleport_radius > 0)
|
||||
for(var/turf/T in orange(target,outer_teleport_radius))
|
||||
if(get_dist(target,T) >= inner_teleport_radius)
|
||||
turfs |= T
|
||||
|
||||
if(turfs.len)
|
||||
// Moves the mob, causes sparks.
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(3, 1, get_turf(target))
|
||||
s.start()
|
||||
var/turf/picked = get_turf(pick(turfs)) // Just in case...
|
||||
new/obj/effect/decal/cleanable/molten_item(get_turf(target)) // Leave a pile of goo behind for dramatic effect...
|
||||
target.loc = picked // And teleport them to the chosen location.
|
||||
|
||||
impact = 1
|
||||
|
||||
return impact
|
||||
|
||||
//Creates a random seed. MAKE SURE THE LINE HAS DIVERGED BEFORE THIS IS CALLED.
|
||||
/datum/seed/proc/randomize()
|
||||
|
||||
roundstart = 0
|
||||
// TODO: Better name generator
|
||||
seed_name = "cultivar #[uid]"
|
||||
display_name = "strange plants" // TODO: name generator.
|
||||
base_name = seed_name
|
||||
mysterious = 1
|
||||
seed_noun = pick("spores","nodes","cuttings","seeds")
|
||||
modular_icon = 1
|
||||
|
||||
set_trait(TRAIT_POTENCY,rand(5,30),200,0)
|
||||
set_trait(TRAIT_PRODUCT_ICON,pick(plant_controller.plant_product_sprites))
|
||||
set_trait(TRAIT_PLANT_ICON,pick(plant_controller.plant_sprites))
|
||||
set_trait(TRAIT_PLANT_COLOUR,"#[get_random_colour(0,75,190)]")
|
||||
set_trait(TRAIT_PRODUCT_COLOUR,"#[get_random_colour(0,75,190)]")
|
||||
update_growth_stages()
|
||||
|
||||
if(prob(20))
|
||||
set_trait(TRAIT_HARVEST_REPEAT,1)
|
||||
|
||||
if(prob(15))
|
||||
if(prob(15))
|
||||
set_trait(TRAIT_JUICY,2)
|
||||
else
|
||||
set_trait(TRAIT_JUICY,1)
|
||||
|
||||
if(prob(5))
|
||||
set_trait(TRAIT_STINGS,1)
|
||||
|
||||
if(prob(5))
|
||||
set_trait(TRAIT_PRODUCES_POWER,1)
|
||||
|
||||
if(prob(1))
|
||||
set_trait(TRAIT_EXPLOSIVE,1)
|
||||
else if(prob(1))
|
||||
set_trait(TRAIT_TELEPORTING,1)
|
||||
|
||||
if(prob(5))
|
||||
consume_gasses = list()
|
||||
var/gas = pick("oxygen","nitrogen","toxins","carbon_dioxide")
|
||||
consume_gasses[gas] = rand(3,9)
|
||||
|
||||
if(prob(5))
|
||||
exude_gasses = list()
|
||||
var/gas = pick("oxygen","nitrogen","toxins","carbon_dioxide")
|
||||
exude_gasses[gas] = rand(3,9)
|
||||
|
||||
chems = list()
|
||||
if(prob(80))
|
||||
var/nutrient_type = rand(1,7)
|
||||
switch(nutrient_type)
|
||||
if(1)
|
||||
chems["plantmatter"] = list(rand(1,10),rand(10,20))
|
||||
if(2)
|
||||
chems["nutriment"] = list(rand(1,10),rand(10,20))
|
||||
if(3)
|
||||
chems["protein"] = list(rand(1,10),rand(10,20))
|
||||
if(4)
|
||||
chems["plantmatter"] = list(rand(1,5),rand(10,20))
|
||||
chems["nutriment"] = list(rand(1,5),rand(10,20))
|
||||
if(5)
|
||||
chems["plantmatter"] = list(rand(1,5),rand(10,20))
|
||||
chems["protein"] = list(rand(1,5),rand(10,20))
|
||||
if(6)
|
||||
chems["protein"] = list(rand(1,5),rand(10,20))
|
||||
chems["nutriment"] = list(rand(1,5),rand(10,20))
|
||||
if(7)
|
||||
chems["plantmatter"] = list(rand(1,3),rand(10,20))
|
||||
chems["nutriment"] = list(rand(1,4),rand(10,20))
|
||||
chems["protein"] = list(rand(1,3),rand(10,20))
|
||||
|
||||
var/additional_chems = rand(0,5)
|
||||
|
||||
if(additional_chems)
|
||||
for(var/x=1;x<=additional_chems;x++)
|
||||
var/new_chem = get_random_chemical(1)
|
||||
if(chems.Find(new_chem))
|
||||
chems[new_chem] = list(rand(2,20),rand(5,15)) //DOUBLE UP
|
||||
else
|
||||
chems[new_chem] = list(rand(1,10),rand(10,20))
|
||||
|
||||
if(prob(90))
|
||||
set_trait(TRAIT_REQUIRES_NUTRIENTS,1)
|
||||
set_trait(TRAIT_NUTRIENT_CONSUMPTION,rand(25)/25)
|
||||
else
|
||||
set_trait(TRAIT_REQUIRES_NUTRIENTS,0)
|
||||
|
||||
if(prob(90))
|
||||
set_trait(TRAIT_REQUIRES_WATER,1)
|
||||
set_trait(TRAIT_WATER_CONSUMPTION,rand(10))
|
||||
else
|
||||
set_trait(TRAIT_REQUIRES_WATER,0)
|
||||
|
||||
set_trait(TRAIT_IDEAL_HEAT, rand(100,400))
|
||||
set_trait(TRAIT_HEAT_TOLERANCE, rand(10,30))
|
||||
set_trait(TRAIT_IDEAL_LIGHT, rand(2,10))
|
||||
set_trait(TRAIT_LIGHT_TOLERANCE, rand(2,7))
|
||||
set_trait(TRAIT_TOXINS_TOLERANCE, rand(2,7))
|
||||
set_trait(TRAIT_PEST_TOLERANCE, rand(2,7))
|
||||
set_trait(TRAIT_WEED_TOLERANCE, rand(2,7))
|
||||
set_trait(TRAIT_LOWKPA_TOLERANCE, rand(10,50))
|
||||
set_trait(TRAIT_HIGHKPA_TOLERANCE,rand(100,300))
|
||||
|
||||
if(prob(5))
|
||||
set_trait(TRAIT_ALTER_TEMP,rand(-5,5))
|
||||
|
||||
if(prob(1))
|
||||
set_trait(TRAIT_IMMUTABLE,-1)
|
||||
|
||||
var/carnivore_prob = rand(100)
|
||||
if(carnivore_prob < 5)
|
||||
set_trait(TRAIT_CARNIVOROUS,2)
|
||||
else if(carnivore_prob < 10)
|
||||
set_trait(TRAIT_CARNIVOROUS,1)
|
||||
|
||||
if(prob(10))
|
||||
set_trait(TRAIT_PARASITE,1)
|
||||
|
||||
var/vine_prob = rand(100)
|
||||
if(vine_prob < 5)
|
||||
set_trait(TRAIT_SPREAD,2)
|
||||
else if(vine_prob < 10)
|
||||
set_trait(TRAIT_SPREAD,1)
|
||||
|
||||
if(prob(5))
|
||||
set_trait(TRAIT_BIOLUM,1)
|
||||
set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]")
|
||||
|
||||
set_trait(TRAIT_ENDURANCE,rand(60,100))
|
||||
set_trait(TRAIT_YIELD,rand(3,15))
|
||||
set_trait(TRAIT_MATURATION,rand(5,15))
|
||||
set_trait(TRAIT_PRODUCTION,get_trait(TRAIT_MATURATION)+rand(2,5))
|
||||
|
||||
//Returns a key corresponding to an entry in the global seed list.
|
||||
/datum/seed/proc/get_mutant_variant()
|
||||
if(!mutants || !mutants.len || get_trait(TRAIT_IMMUTABLE) > 0) return 0
|
||||
return pick(mutants)
|
||||
|
||||
//Mutates the plant overall (randomly).
|
||||
/datum/seed/proc/mutate(var/degree,var/turf/source_turf)
|
||||
|
||||
if(!degree || get_trait(TRAIT_IMMUTABLE) > 0) return
|
||||
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name] quivers!</span>")
|
||||
|
||||
//This looks like shit, but it's a lot easier to read/change this way.
|
||||
var/total_mutations = rand(1,1+degree)
|
||||
for(var/i = 0;i<total_mutations;i++)
|
||||
switch(rand(0,11))
|
||||
if(0) //Plant cancer!
|
||||
set_trait(TRAIT_ENDURANCE,get_trait(TRAIT_ENDURANCE)-rand(10,20),null,0)
|
||||
source_turf.visible_message("<span class='danger'>\The [display_name] withers rapidly!</span>")
|
||||
if(1)
|
||||
set_trait(TRAIT_NUTRIENT_CONSUMPTION,get_trait(TRAIT_NUTRIENT_CONSUMPTION)+rand(-(degree*0.1),(degree*0.1)),5,0)
|
||||
set_trait(TRAIT_WATER_CONSUMPTION, get_trait(TRAIT_WATER_CONSUMPTION) +rand(-degree,degree),50,0)
|
||||
set_trait(TRAIT_JUICY, !get_trait(TRAIT_JUICY))
|
||||
set_trait(TRAIT_STINGS, !get_trait(TRAIT_STINGS))
|
||||
if(2)
|
||||
set_trait(TRAIT_IDEAL_HEAT, get_trait(TRAIT_IDEAL_HEAT) + (rand(-5,5)*degree),800,70)
|
||||
set_trait(TRAIT_HEAT_TOLERANCE, get_trait(TRAIT_HEAT_TOLERANCE) + (rand(-5,5)*degree),800,70)
|
||||
set_trait(TRAIT_LOWKPA_TOLERANCE, get_trait(TRAIT_LOWKPA_TOLERANCE)+ (rand(-5,5)*degree),80,0)
|
||||
set_trait(TRAIT_HIGHKPA_TOLERANCE, get_trait(TRAIT_HIGHKPA_TOLERANCE)+(rand(-5,5)*degree),500,110)
|
||||
set_trait(TRAIT_EXPLOSIVE,1)
|
||||
if(3)
|
||||
set_trait(TRAIT_IDEAL_LIGHT, get_trait(TRAIT_IDEAL_LIGHT)+(rand(-1,1)*degree),30,0)
|
||||
set_trait(TRAIT_LIGHT_TOLERANCE, get_trait(TRAIT_LIGHT_TOLERANCE)+(rand(-2,2)*degree),10,0)
|
||||
if(4)
|
||||
set_trait(TRAIT_TOXINS_TOLERANCE, get_trait(TRAIT_TOXINS_TOLERANCE)+(rand(-2,2)*degree),10,0)
|
||||
if(5)
|
||||
set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0)
|
||||
if(prob(degree*5))
|
||||
set_trait(TRAIT_CARNIVOROUS, get_trait(TRAIT_CARNIVOROUS)+rand(-degree,degree),2, 0)
|
||||
if(get_trait(TRAIT_CARNIVOROUS))
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name] shudders hungrily.</span>")
|
||||
if(6)
|
||||
set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0)
|
||||
if(prob(degree*5))
|
||||
set_trait(TRAIT_PARASITE,!get_trait(TRAIT_PARASITE))
|
||||
if(7)
|
||||
if(get_trait(TRAIT_YIELD) != -1)
|
||||
set_trait(TRAIT_YIELD, get_trait(TRAIT_YIELD)+(rand(-2,2)*degree),10,0)
|
||||
if(8)
|
||||
set_trait(TRAIT_ENDURANCE, get_trait(TRAIT_ENDURANCE)+(rand(-5,5)*degree),100,10)
|
||||
set_trait(TRAIT_PRODUCTION, get_trait(TRAIT_PRODUCTION)+(rand(-1,1)*degree),10, 1)
|
||||
set_trait(TRAIT_POTENCY, get_trait(TRAIT_POTENCY)+(rand(-20,20)*degree),200, 0)
|
||||
if(prob(degree*5))
|
||||
set_trait(TRAIT_SPREAD, get_trait(TRAIT_SPREAD)+rand(-1,1),2, 0)
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name] spasms visibly, shifting in the tray.</span>")
|
||||
if(9)
|
||||
set_trait(TRAIT_MATURATION, get_trait(TRAIT_MATURATION)+(rand(-1,1)*degree),30, 0)
|
||||
if(prob(degree*5))
|
||||
set_trait(TRAIT_HARVEST_REPEAT, !get_trait(TRAIT_HARVEST_REPEAT))
|
||||
if(10)
|
||||
if(prob(degree*2))
|
||||
set_trait(TRAIT_BIOLUM, !get_trait(TRAIT_BIOLUM))
|
||||
if(get_trait(TRAIT_BIOLUM))
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name] begins to glow!</span>")
|
||||
if(prob(degree*2))
|
||||
set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]")
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name]'s glow </span><font color='[get_trait(TRAIT_BIOLUM_COLOUR)]'>changes colour</font>!")
|
||||
else
|
||||
source_turf.visible_message("<span class='notice'>\The [display_name]'s glow dims...</span>")
|
||||
if(11)
|
||||
set_trait(TRAIT_TELEPORTING,1)
|
||||
|
||||
return
|
||||
|
||||
//Mutates a specific trait/set of traits.
|
||||
/datum/seed/proc/apply_gene(var/datum/plantgene/gene)
|
||||
|
||||
if(!gene || !gene.values || get_trait(TRAIT_IMMUTABLE) > 0) return
|
||||
|
||||
// Splicing products has some detrimental effects on yield and lifespan.
|
||||
// We handle this before we do the rest of the looping, as normal traits don't really include lists.
|
||||
switch(gene.genetype)
|
||||
if(GENE_BIOCHEMISTRY)
|
||||
for(var/trait in list(TRAIT_YIELD, TRAIT_ENDURANCE))
|
||||
if(get_trait(trait) > 0) set_trait(trait,get_trait(trait),null,1,0.85)
|
||||
|
||||
if(!chems) chems = list()
|
||||
|
||||
var/list/gene_value = gene.values["[TRAIT_CHEMS]"]
|
||||
for(var/rid in gene_value)
|
||||
|
||||
var/list/gene_chem = gene_value[rid]
|
||||
|
||||
if(!chems[rid])
|
||||
chems[rid] = gene_chem.Copy()
|
||||
continue
|
||||
|
||||
// Normally a length 2 list - but sometimes, it's length 1 - poisonberries, etc.
|
||||
// This means the reagent does not scale with potency.
|
||||
// Index 1 is the base value, index 2 is the potency per u of reagent
|
||||
var/list/rgnt_list = chems[rid]
|
||||
rgnt_list.len = max(gene_chem.len, rgnt_list.len)
|
||||
|
||||
for(var/i=1;i<=gene_chem.len;i++)
|
||||
|
||||
if(isnull(gene_chem[i])) gene_chem[i] = 0
|
||||
|
||||
if(rgnt_list[i])
|
||||
rgnt_list[i] = max(1,round((gene_chem[i] + rgnt_list[i])/2))
|
||||
else
|
||||
rgnt_list[i] = gene_chem[i]
|
||||
|
||||
var/list/new_gasses = gene.values["[TRAIT_EXUDE_GASSES]"]
|
||||
if(islist(new_gasses))
|
||||
if(!exude_gasses) exude_gasses = list()
|
||||
exude_gasses |= new_gasses
|
||||
for(var/gas in exude_gasses)
|
||||
exude_gasses[gas] = max(1,round(exude_gasses[gas]*0.8))
|
||||
|
||||
gene.values["[TRAIT_EXUDE_GASSES]"] = null
|
||||
gene.values["[TRAIT_CHEMS]"] = null
|
||||
|
||||
if(GENE_DIET)
|
||||
var/list/new_gasses = gene.values["[TRAIT_CONSUME_GASSES]"]
|
||||
consume_gasses |= new_gasses
|
||||
gene.values["[TRAIT_CONSUME_GASSES]"] = null
|
||||
if(GENE_METABOLISM)
|
||||
preset_product = gene.values["alt_product"]
|
||||
gene.values["alt_product"] = null
|
||||
|
||||
for(var/trait in gene.values)
|
||||
set_trait(trait,gene.values["[trait]"])
|
||||
|
||||
update_growth_stages()
|
||||
|
||||
//Returns a list of the desired trait values.
|
||||
/datum/seed/proc/get_gene(var/genetype)
|
||||
|
||||
if(!genetype) return 0
|
||||
|
||||
var/list/traits_to_copy
|
||||
var/datum/plantgene/P = new()
|
||||
P.genetype = genetype
|
||||
P.values = list()
|
||||
|
||||
switch(genetype)
|
||||
if(GENE_BIOCHEMISTRY)
|
||||
P.values["[TRAIT_CHEMS]"] = chems
|
||||
P.values["[TRAIT_EXUDE_GASSES]"] = exude_gasses
|
||||
traits_to_copy = list(TRAIT_POTENCY)
|
||||
if(GENE_OUTPUT)
|
||||
traits_to_copy = list(TRAIT_PRODUCES_POWER,TRAIT_BIOLUM,TRAIT_BATTERY_RECHARGE)
|
||||
if(GENE_ATMOSPHERE)
|
||||
traits_to_copy = list(TRAIT_HEAT_TOLERANCE,TRAIT_LOWKPA_TOLERANCE,TRAIT_HIGHKPA_TOLERANCE)
|
||||
if(GENE_HARDINESS)
|
||||
traits_to_copy = list(TRAIT_TOXINS_TOLERANCE,TRAIT_PEST_TOLERANCE,TRAIT_WEED_TOLERANCE,TRAIT_ENDURANCE)
|
||||
if(GENE_METABOLISM)
|
||||
P.values["alt_product"] = preset_product
|
||||
traits_to_copy = list(TRAIT_REQUIRES_NUTRIENTS,TRAIT_REQUIRES_WATER,TRAIT_ALTER_TEMP)
|
||||
if(GENE_VIGOUR)
|
||||
traits_to_copy = list(TRAIT_PRODUCTION,TRAIT_MATURATION,TRAIT_YIELD,TRAIT_SPREAD)
|
||||
if(GENE_DIET)
|
||||
P.values["[TRAIT_CONSUME_GASSES]"] = consume_gasses
|
||||
traits_to_copy = list(TRAIT_CARNIVOROUS,TRAIT_PARASITE,TRAIT_NUTRIENT_CONSUMPTION,TRAIT_WATER_CONSUMPTION)
|
||||
if(GENE_ENVIRONMENT)
|
||||
traits_to_copy = list(TRAIT_IDEAL_HEAT,TRAIT_IDEAL_LIGHT,TRAIT_LIGHT_TOLERANCE)
|
||||
if(GENE_PIGMENT)
|
||||
traits_to_copy = list(TRAIT_PLANT_COLOUR,TRAIT_PRODUCT_COLOUR,TRAIT_BIOLUM_COLOUR)
|
||||
if(GENE_STRUCTURE)
|
||||
traits_to_copy = list(TRAIT_PLANT_ICON,TRAIT_PRODUCT_ICON,TRAIT_HARVEST_REPEAT)
|
||||
if(GENE_FRUIT)
|
||||
traits_to_copy = list(TRAIT_STINGS,TRAIT_EXPLOSIVE,TRAIT_JUICY)
|
||||
if(GENE_SPECIAL)
|
||||
traits_to_copy = list(TRAIT_TELEPORTING)
|
||||
|
||||
for(var/trait in traits_to_copy)
|
||||
P.values["[trait]"] = get_trait(trait)
|
||||
return (P ? P : 0)
|
||||
|
||||
//Place the plant products at the feet of the user.
|
||||
/datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample,var/force_amount)
|
||||
|
||||
if(!user)
|
||||
return
|
||||
|
||||
if(!force_amount && get_trait(TRAIT_YIELD) == 0 && !harvest_sample)
|
||||
if(istype(user))
|
||||
to_chat(user, "<span class='danger'>You fail to harvest anything useful.</span>")
|
||||
else
|
||||
if(istype(user))
|
||||
to_chat(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 plant_controller.seeds))
|
||||
uid = plant_controller.seeds.len + 1
|
||||
name = "[uid]"
|
||||
plant_controller.seeds[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 = 0
|
||||
if(!isnull(force_amount))
|
||||
total_yield = force_amount
|
||||
else
|
||||
if(get_trait(TRAIT_YIELD) > -1)
|
||||
if(isnull(yield_mod) || yield_mod < 1)
|
||||
yield_mod = 0
|
||||
total_yield = get_trait(TRAIT_YIELD)
|
||||
else
|
||||
total_yield = get_trait(TRAIT_YIELD) + rand(yield_mod)
|
||||
total_yield = max(1,total_yield)
|
||||
|
||||
currently_querying = list()
|
||||
for(var/i = 0;i<total_yield;i++)
|
||||
var/obj/item/product
|
||||
if(preset_product)
|
||||
product = new preset_product(get_turf(user),name)
|
||||
else
|
||||
product = new /obj/item/weapon/reagent_containers/food/snacks/grown(get_turf(user),name)
|
||||
if(get_trait(TRAIT_PRODUCT_COLOUR))
|
||||
if(modular_icon == 1)
|
||||
product.color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
if(istype(product,/obj/item/weapon/reagent_containers/food))
|
||||
var/obj/item/weapon/reagent_containers/food/food = product
|
||||
food.filling_color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
|
||||
if(mysterious)
|
||||
product.name += "?"
|
||||
product.desc += " On second thought, something about this one looks strange."
|
||||
|
||||
if(get_trait(TRAIT_BIOLUM))
|
||||
var/clr
|
||||
if(get_trait(TRAIT_BIOLUM_COLOUR))
|
||||
clr = get_trait(TRAIT_BIOLUM_COLOUR)
|
||||
product.set_light(get_trait(TRAIT_BIOLUM), l_color = clr)
|
||||
|
||||
//Handle spawning in living, mobile products (like dionaea).
|
||||
if(istype(product,/mob/living))
|
||||
product.visible_message("<span class='notice'>The pod disgorges [product]!</span>")
|
||||
handle_living_product(product)
|
||||
|
||||
// When the seed in this machine mutates/is modified, the tray seed value
|
||||
// is set to a new datum copied from the original. This datum won't actually
|
||||
// be put into the global datum list until the product is harvested, though.
|
||||
/datum/seed/proc/diverge(var/modified = 0)
|
||||
|
||||
if(get_trait(TRAIT_IMMUTABLE) > 0) return
|
||||
|
||||
//Set up some basic information.
|
||||
var/datum/seed/new_seed = new
|
||||
new_seed.name = "new line"
|
||||
new_seed.uid = 0
|
||||
new_seed.roundstart = 0
|
||||
new_seed.can_self_harvest = can_self_harvest
|
||||
new_seed.kitchen_tag = kitchen_tag
|
||||
new_seed.trash_type = trash_type
|
||||
new_seed.preset_product = preset_product
|
||||
new_seed.final_form = final_form
|
||||
//Copy over everything else.
|
||||
if(mutants) new_seed.mutants = mutants.Copy()
|
||||
if(chems) new_seed.chems = chems.Copy()
|
||||
if(consume_gasses) new_seed.consume_gasses = consume_gasses.Copy()
|
||||
if(exude_gasses) new_seed.exude_gasses = exude_gasses.Copy()
|
||||
new_seed.modular_icon = modular_icon
|
||||
new_seed.preset_icon = preset_icon
|
||||
|
||||
new_seed.base_name = base_name
|
||||
new_seed.update_name_prefixes(modified)
|
||||
|
||||
new_seed.seed_noun = seed_noun
|
||||
new_seed.traits = traits.Copy()
|
||||
new_seed.update_growth_stages()
|
||||
return new_seed
|
||||
|
||||
/datum/seed/proc/update_growth_stages()
|
||||
if(get_trait(TRAIT_PLANT_ICON))
|
||||
growth_stages = plant_controller.plant_sprites[get_trait(TRAIT_PLANT_ICON)]
|
||||
else
|
||||
growth_stages = 0
|
||||
|
||||
/datum/seed/proc/update_name_prefixes(var/modified = 0)
|
||||
if(last_diverge_type == modified)
|
||||
//We already match the new prefix, so we're not going to bother
|
||||
return
|
||||
//Since we don't match, set the last_diverge type to the modified value, then handle the new prefix
|
||||
last_diverge_type = modified
|
||||
switch(modified)
|
||||
if(0) //Mutant (default)
|
||||
seed_name = "mutant [base_name]"
|
||||
display_name = "mutant [base_name]"
|
||||
if(1) //Modified
|
||||
seed_name = "modified [base_name]"
|
||||
display_name = "modified [base_name]"
|
||||
if(2) //Enhanced
|
||||
seed_name = "enhanced [base_name]"
|
||||
display_name = "enhanced [base_name]"
|
||||
@@ -1,153 +0,0 @@
|
||||
// Attempts to offload processing for the spreading plants from the MC.
|
||||
// Processes vines/spreading plants.
|
||||
|
||||
#define PLANTS_PER_TICK 500 // Cap on number of plant segments processed.
|
||||
#define PLANT_TICK_TIME 75 // Number of ticks between the plant processor cycling.
|
||||
|
||||
// Debug for testing seed genes (less useful now that the obfuscation is gone, but still might be useful for the future.
|
||||
/client/proc/show_plant_genes()
|
||||
set category = "Debug"
|
||||
set name = "Show Plant Genes"
|
||||
set desc = "Prints the round's plant gene tags."
|
||||
|
||||
if(!holder) return
|
||||
|
||||
if(!plant_controller || !plant_controller.gene_tag_list)
|
||||
to_chat(usr, "Gene tags not set.")
|
||||
return
|
||||
|
||||
for(var/gene_tag in plant_controller.gene_tag_list)
|
||||
to_chat(usr, "[gene_tag]")
|
||||
|
||||
var/global/datum/controller/plants/plant_controller // Set in New().
|
||||
|
||||
/datum/controller/plants
|
||||
|
||||
var/plants_per_tick = PLANTS_PER_TICK
|
||||
var/plant_tick_time = PLANT_TICK_TIME
|
||||
var/list/product_descs = list() // Stores generated fruit descs.
|
||||
var/list/plant_queue = list() // All queued plants.
|
||||
var/list/seeds = list() // All seed data stored here.
|
||||
var/list/gene_tag_list = list() // List of gene tags for xenobotany fun
|
||||
var/list/plant_icon_cache = list() // Stores images of growth, fruits and seeds.
|
||||
var/list/plant_sprites = list() // List of all harvested product sprites.
|
||||
var/list/plant_product_sprites = list() // List of all growth sprites plus number of growth stages.
|
||||
//var/processing = 0 // Off/on.
|
||||
|
||||
/datum/controller/plants/New()
|
||||
if(plant_controller && plant_controller != src)
|
||||
log_debug("Rebuilding plant controller.")
|
||||
qdel(plant_controller)
|
||||
plant_controller = src
|
||||
setup()
|
||||
process()
|
||||
|
||||
/datum/controller/plants/Destroy()
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL_NOW
|
||||
|
||||
// Predefined/roundstart varieties use a string key to make it
|
||||
// easier to grab the new variety when mutating. Post-roundstart
|
||||
// and mutant varieties use their uid converted to a string instead.
|
||||
// Looks like shit but it's sort of necessary.
|
||||
/datum/controller/plants/proc/setup()
|
||||
|
||||
// Build the icon lists.
|
||||
for(var/icostate in icon_states('icons/obj/hydroponics_growing.dmi'))
|
||||
var/split = findtext(icostate,"-")
|
||||
if(!split)
|
||||
// invalid icon_state
|
||||
continue
|
||||
|
||||
var/ikey = copytext(icostate,(split+1))
|
||||
if(ikey == "dead")
|
||||
// don't count dead icons
|
||||
continue
|
||||
ikey = text2num(ikey)
|
||||
var/base = copytext(icostate,1,split)
|
||||
|
||||
if(!(plant_sprites[base]) || (plant_sprites[base]<ikey))
|
||||
plant_sprites[base] = ikey
|
||||
|
||||
for(var/icostate in icon_states('icons/obj/hydroponics_products.dmi'))
|
||||
var/split = findtext(icostate,"-")
|
||||
if(split)
|
||||
plant_product_sprites |= copytext(icostate,1,split)
|
||||
|
||||
// Populate the global seed datum list.
|
||||
for(var/type in subtypesof(/datum/seed))
|
||||
var/datum/seed/S = new type
|
||||
seeds[S.name] = S
|
||||
S.uid = "[seeds.len]"
|
||||
S.roundstart = 1
|
||||
|
||||
// Make sure any seed packets that were mapped in are updated
|
||||
// correctly (since the seed datums did not exist a tick ago).
|
||||
for(var/obj/item/seeds/S in world)
|
||||
S.update_seed()
|
||||
|
||||
//Might as well mask the gene types while we're at it.
|
||||
var/list/plant_traits = ALL_GENES
|
||||
while(plant_traits && plant_traits.len)
|
||||
var/gene_tag = pick(plant_traits)
|
||||
plant_traits -= gene_tag
|
||||
gene_tag_list.Add(gene_tag)
|
||||
|
||||
// Proc for creating a random seed type.
|
||||
/datum/controller/plants/proc/create_random_seed(var/survive_on_station)
|
||||
var/datum/seed/seed = new()
|
||||
seed.uid = plant_controller.seeds.len + 1
|
||||
seed.name = "[seed.uid]"
|
||||
seed.randomize()
|
||||
seeds[seed.name] = seed
|
||||
|
||||
if(survive_on_station)
|
||||
if(seed.consume_gasses)
|
||||
seed.consume_gasses["plasma"] = null
|
||||
seed.consume_gasses["carbon_dioxide"] = null
|
||||
if(seed.chems && !isnull(seed.chems["pacid"]))
|
||||
seed.chems -= "pacid" // Eating through the hull will make these plants completely inviable, albeit very dangerous.
|
||||
seed.set_trait(TRAIT_IDEAL_HEAT,293)
|
||||
seed.set_trait(TRAIT_HEAT_TOLERANCE,20)
|
||||
seed.set_trait(TRAIT_IDEAL_LIGHT,8)
|
||||
seed.set_trait(TRAIT_LIGHT_TOLERANCE,5)
|
||||
seed.set_trait(TRAIT_LOWKPA_TOLERANCE,25)
|
||||
seed.set_trait(TRAIT_HIGHKPA_TOLERANCE,200)
|
||||
return seed
|
||||
|
||||
/datum/controller/plants/proc/process()
|
||||
processing = 1
|
||||
spawn(0)
|
||||
set background = 1
|
||||
var/processed = 0
|
||||
while(1)
|
||||
if(!processing)
|
||||
sleep(plant_tick_time)
|
||||
else
|
||||
processed = 0
|
||||
if(plant_queue.len)
|
||||
var/target_to_process = min(plant_queue.len,plants_per_tick)
|
||||
for(var/x=0;x<target_to_process;x++)
|
||||
if(!plant_queue.len)
|
||||
break
|
||||
var/obj/effect/plant/plant = pick(plant_queue)
|
||||
plant_queue -= plant
|
||||
if(!istype(plant) || !isnull(plant.gcDestroyed))
|
||||
continue
|
||||
plant.process()
|
||||
processed++
|
||||
sleep(1) // Stagger processing out so previous tick can resolve (overlapping plant segments etc)
|
||||
sleep(max(1,(plant_tick_time-processed)))
|
||||
|
||||
/datum/controller/plants/proc/add_plant(var/obj/effect/plant/plant)
|
||||
plant_queue |= plant
|
||||
|
||||
/datum/controller/plants/proc/remove_plant(var/obj/effect/plant/plant)
|
||||
plant_queue -= plant
|
||||
|
||||
/client/proc/list_plant_sprites()
|
||||
if(!plant_controller || !plant_controller.plant_sprites || !plant_controller.plant_sprites.len)
|
||||
to_chat(world, "Cannot list plant sprites, plant controller or plant sprites list may not be initialized.")
|
||||
|
||||
for(var/base in plant_controller.plant_sprites)
|
||||
to_chat(world, "[base] : [plant_controller.plant_sprites[base]] growth states")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,205 @@
|
||||
/proc/seedify(obj/item/O, t_max, obj/machinery/seed_extractor/extractor, mob/living/user)
|
||||
var/t_amount = 0
|
||||
if(t_max == -1)
|
||||
if(extractor)
|
||||
t_max = rand(1,4) * extractor.seed_multiplier
|
||||
else
|
||||
t_max = rand(1,4)
|
||||
|
||||
var/seedloc = O.loc
|
||||
if(extractor)
|
||||
seedloc = extractor.loc
|
||||
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
|
||||
if(F.seed)
|
||||
if(user && !user.drop_item()) //couldn't drop the item
|
||||
return
|
||||
while(t_amount < t_max)
|
||||
var/obj/item/seeds/t_prod = F.seed.Copy()
|
||||
t_prod.loc = seedloc
|
||||
t_amount++
|
||||
qdel(O)
|
||||
return 1
|
||||
|
||||
else if(istype(O, /obj/item/weapon/grown))
|
||||
var/obj/item/weapon/grown/F = O
|
||||
if(F.seed)
|
||||
if(user && !user.drop_item())
|
||||
return
|
||||
while(t_amount < t_max)
|
||||
var/obj/item/seeds/t_prod = F.seed.Copy()
|
||||
t_prod.loc = seedloc
|
||||
t_amount++
|
||||
qdel(O)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/seed_extractor
|
||||
name = "seed extractor"
|
||||
desc = "Extracts and bags seeds from produce."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "sextractor"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/piles = list()
|
||||
var/max_seeds = 1000
|
||||
var/seed_multiplier = 1
|
||||
|
||||
/obj/machinery/seed_extractor/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/seed_extractor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/seed_extractor/RefreshParts()
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
max_seeds = 1000 * B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
seed_multiplier = M.rating
|
||||
|
||||
/obj/machinery/seed_extractor/attackby(obj/item/O, mob/user, params)
|
||||
|
||||
if(default_deconstruction_screwdriver(user, "sextractor_open", "sextractor", O))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(default_pry_open(O))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, O))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
|
||||
if (istype(O,/obj/item/weapon/storage/bag/plants))
|
||||
var/obj/item/weapon/storage/P = O
|
||||
var/loaded = 0
|
||||
for(var/obj/item/seeds/G in P.contents)
|
||||
if(contents.len >= max_seeds)
|
||||
break
|
||||
++loaded
|
||||
add_seed(G)
|
||||
if (loaded)
|
||||
to_chat(user, "<span class='notice'>You put the seeds from \the [O.name] into [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no seeds in \the [O.name].</span>")
|
||||
return
|
||||
|
||||
else if(seedify(O,-1, src, user))
|
||||
to_chat(user, "<span class='notice'>You extract some seeds.</span>")
|
||||
return
|
||||
else if (istype(O,/obj/item/seeds))
|
||||
if(add_seed(O))
|
||||
to_chat(user, "<span class='notice'>You add [O] to [name].</span>")
|
||||
updateUsrDialog()
|
||||
return
|
||||
else if(user.a_intent != I_HARM)
|
||||
to_chat(user, "<span class='warning'>You can't extract any seeds from \the [O.name]!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/datum/seed_pile
|
||||
var/name = ""
|
||||
var/lifespan = 0 //Saved stats
|
||||
var/endurance = 0
|
||||
var/maturation = 0
|
||||
var/production = 0
|
||||
var/yield = 0
|
||||
var/potency = 0
|
||||
var/amount = 0
|
||||
|
||||
/datum/seed_pile/New(var/name, var/life, var/endur, var/matur, var/prod, var/yie, var/poten, var/am = 1)
|
||||
name = name
|
||||
lifespan = life
|
||||
endurance = endur
|
||||
maturation = matur
|
||||
production = prod
|
||||
yield = yie
|
||||
potency = poten
|
||||
amount = am
|
||||
|
||||
/obj/machinery/seed_extractor/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/seed_extractor/interact(mob/user)
|
||||
if (stat)
|
||||
return 0
|
||||
|
||||
var/dat = "<b>Stored seeds:</b><br>"
|
||||
|
||||
if (contents.len == 0)
|
||||
dat += "<font color='red'>No seeds</font>"
|
||||
else
|
||||
dat += "<table cellpadding='3' style='text-align:center;'><tr><td>Name</td><td>Lifespan</td><td>Endurance</td><td>Maturation</td><td>Production</td><td>Yield</td><td>Potency</td><td>Stock</td></tr>"
|
||||
for (var/datum/seed_pile/O in piles)
|
||||
dat += "<tr><td>[O.name]</td><td>[O.lifespan]</td><td>[O.endurance]</td><td>[O.maturation]</td>"
|
||||
dat += "<td>[O.production]</td><td>[O.yield]</td><td>[O.potency]</td><td>"
|
||||
dat += "<a href='byond://?src=\ref[src];name=[O.name];li=[O.lifespan];en=[O.endurance];ma=[O.maturation];pr=[O.production];yi=[O.yield];pot=[O.potency]'>Vend</a> ([O.amount] left)</td></tr>"
|
||||
dat += "</table>"
|
||||
var/datum/browser/popup = new(user, "seed_ext", name, 700, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/seed_extractor/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
|
||||
href_list["li"] = text2num(href_list["li"])
|
||||
href_list["en"] = text2num(href_list["en"])
|
||||
href_list["ma"] = text2num(href_list["ma"])
|
||||
href_list["pr"] = text2num(href_list["pr"])
|
||||
href_list["yi"] = text2num(href_list["yi"])
|
||||
href_list["pot"] = text2num(href_list["pot"])
|
||||
|
||||
for (var/datum/seed_pile/N in piles)//Find the pile we need to reduce...
|
||||
if (href_list["name"] == N.name && href_list["li"] == N.lifespan && href_list["en"] == N.endurance && href_list["ma"] == N.maturation && href_list["pr"] == N.production && href_list["yi"] == N.yield && href_list["pot"] == N.potency)
|
||||
if(N.amount <= 0)
|
||||
return
|
||||
N.amount = max(N.amount - 1, 0)
|
||||
if (N.amount <= 0)
|
||||
piles -= N
|
||||
qdel(N)
|
||||
break
|
||||
|
||||
for (var/obj/T in contents)//Now we find the seed we need to vend
|
||||
var/obj/item/seeds/O = T
|
||||
if (O.plantname == href_list["name"] && O.lifespan == href_list["li"] && O.endurance == href_list["en"] && O.maturation == href_list["ma"] && O.production == href_list["pr"] && O.yield == href_list["yi"] && O.potency == href_list["pot"])
|
||||
O.loc = loc
|
||||
break
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/seed_extractor/proc/add_seed(obj/item/seeds/O)
|
||||
if(contents.len >= 999)
|
||||
to_chat(usr, "<span class='notice'>\The [src] is full.</span>")
|
||||
return 0
|
||||
|
||||
if(istype(O.loc,/mob))
|
||||
var/mob/M = O.loc
|
||||
if(!M.drop_item())
|
||||
return 0
|
||||
else if(istype(O.loc,/obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = O.loc
|
||||
S.remove_from_storage(O,src)
|
||||
|
||||
O.loc = src
|
||||
. = 1
|
||||
for (var/datum/seed_pile/N in piles)
|
||||
if (O.plantname == N.name && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency)
|
||||
++N.amount
|
||||
return
|
||||
|
||||
piles += new /datum/seed_pile(O.plantname, O.lifespan, O.endurance, O.maturation, O.production, O.yield, O.potency)
|
||||
return
|
||||
@@ -1,377 +0,0 @@
|
||||
/obj/item/weapon/disk/botany
|
||||
name = "flora data disk"
|
||||
desc = "A small disk used for carrying data on plant genetics."
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "disk"
|
||||
w_class = 1
|
||||
|
||||
var/list/genes = list()
|
||||
var/genesource = "unknown"
|
||||
|
||||
/obj/item/weapon/disk/botany/New()
|
||||
..()
|
||||
pixel_x = rand(-5,5)
|
||||
pixel_y = rand(-5,5)
|
||||
|
||||
/obj/item/weapon/disk/botany/attack_self(var/mob/user as mob)
|
||||
if(genes.len)
|
||||
var/choice = alert(user, "Are you sure you want to wipe the disk?", "Xenobotany Data", "No", "Yes")
|
||||
if(src && user && genes && choice && choice == "Yes" && user.Adjacent(get_turf(src)))
|
||||
to_chat(user, "You wipe the disk data.")
|
||||
name = initial(name)
|
||||
desc = initial(name)
|
||||
genes = list()
|
||||
genesource = "unknown"
|
||||
|
||||
/obj/item/weapon/storage/box/botanydisk
|
||||
name = "flora disk box"
|
||||
desc = "A box of flora data disks, apparently."
|
||||
|
||||
/obj/item/weapon/storage/box/botanydisk/New()
|
||||
..()
|
||||
for(var/i = 0;i<7;i++)
|
||||
new /obj/item/weapon/disk/botany(src)
|
||||
|
||||
/obj/machinery/botany
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
|
||||
var/obj/item/seeds/seed // Currently loaded seed packet.
|
||||
var/obj/item/weapon/disk/botany/loaded_disk //Currently loaded data disk.
|
||||
|
||||
var/open = 0
|
||||
var/active = 0
|
||||
var/action_time = 5
|
||||
var/last_action = 0
|
||||
var/eject_disk = 0
|
||||
var/failed_task = 0
|
||||
var/disk_needs_genes = 0
|
||||
|
||||
/obj/machinery/botany/process()
|
||||
|
||||
..()
|
||||
if(!active) return
|
||||
|
||||
if(world.time > last_action + action_time)
|
||||
finished_task()
|
||||
|
||||
/obj/machinery/botany/attack_ai(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/botany/attack_hand(mob/user as mob)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/botany/proc/finished_task()
|
||||
active = 0
|
||||
if(failed_task)
|
||||
failed_task = 0
|
||||
visible_message("[bicon(src)] [src] pings unhappily, flashing a red warning light.")
|
||||
else
|
||||
visible_message("[bicon(src)] [src] pings happily.")
|
||||
|
||||
if(eject_disk)
|
||||
eject_disk = 0
|
||||
if(loaded_disk)
|
||||
loaded_disk.loc = get_turf(src)
|
||||
visible_message("[bicon(src)] [src] beeps and spits out [loaded_disk].")
|
||||
loaded_disk = null
|
||||
|
||||
/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/seeds))
|
||||
if(seed)
|
||||
to_chat(user, "There is already a seed loaded.")
|
||||
return
|
||||
var/obj/item/seeds/S =W
|
||||
if(S.seed && S.seed.get_trait(TRAIT_IMMUTABLE) > 0)
|
||||
to_chat(user, "That seed is not compatible with our genetics technology.")
|
||||
else
|
||||
user.drop_item(W)
|
||||
W.loc = src
|
||||
seed = W
|
||||
to_chat(user, "You load [W] into [src].")
|
||||
return
|
||||
|
||||
if(istype(W,/obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the maintenance panel.</span>")
|
||||
return
|
||||
|
||||
if(open)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
dismantle()
|
||||
return
|
||||
|
||||
if(istype(W,/obj/item/weapon/disk/botany))
|
||||
if(loaded_disk)
|
||||
to_chat(user, "There is already a data disk loaded.")
|
||||
return
|
||||
else
|
||||
var/obj/item/weapon/disk/botany/B = W
|
||||
|
||||
if(B.genes && B.genes.len)
|
||||
if(!disk_needs_genes)
|
||||
to_chat(user, "That disk already has gene data loaded.")
|
||||
return
|
||||
else
|
||||
if(disk_needs_genes)
|
||||
to_chat(user, "That disk does not have any gene data loaded.")
|
||||
return
|
||||
|
||||
user.drop_item(W)
|
||||
W.loc = src
|
||||
loaded_disk = W
|
||||
to_chat(user, "You load [W] into [src].")
|
||||
|
||||
return
|
||||
..()
|
||||
|
||||
// Allows for a trait to be extracted from a seed packet, destroying that seed.
|
||||
/obj/machinery/botany/extractor
|
||||
name = "lysis-isolation centrifuge"
|
||||
icon_state = "traitcopier"
|
||||
|
||||
var/datum/seed/genetics // Currently scanned seed genetic structure.
|
||||
var/degradation = 0 // Increments with each scan, stops allowing gene mods after a certain point.
|
||||
|
||||
var/degrade_lower = 20
|
||||
var/degrade_upper = 60
|
||||
|
||||
/obj/machinery/botany/extractor/New()
|
||||
..()
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/botany_extractor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/botany/extractor/RefreshParts()
|
||||
var/tier = 1
|
||||
for(var/obj/item/weapon/stock_parts/scanning_module/S in component_parts)
|
||||
tier = S.rating
|
||||
degrade_lower = 25 - (tier * 5) //Tier 1: 20, Tier 4: 5
|
||||
degrade_upper = 70 - (tier * 10) //Tier 1: 60, Tier 4: 30
|
||||
|
||||
/obj/machinery/botany/extractor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!user)
|
||||
return
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/botany/extractor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
|
||||
var/list/geneMasks[0]
|
||||
for(var/gene_tag in plant_controller.gene_tag_list)
|
||||
geneMasks.Add(gene_tag)
|
||||
data["geneMasks"] = geneMasks
|
||||
|
||||
data["activity"] = active
|
||||
data["degradation"] = degradation
|
||||
|
||||
if(loaded_disk)
|
||||
data["disk"] = 1
|
||||
else
|
||||
data["disk"] = 0
|
||||
|
||||
if(seed)
|
||||
data["loaded"] = "[seed.name]"
|
||||
else
|
||||
data["loaded"] = 0
|
||||
|
||||
if(genetics)
|
||||
data["hasGenetics"] = 1
|
||||
data["sourceName"] = genetics.display_name
|
||||
if(!genetics.roundstart)
|
||||
data["sourceName"] += " (variety #[genetics.uid])"
|
||||
else
|
||||
data["hasGenetics"] = 0
|
||||
data["sourceName"] = 0
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/botany/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["eject_packet"])
|
||||
if(!seed) return
|
||||
seed.loc = get_turf(src)
|
||||
|
||||
if(seed.seed.name == "new line" || isnull(plant_controller.seeds[seed.seed.name]))
|
||||
seed.seed.uid = plant_controller.seeds.len + 1
|
||||
seed.seed.name = "[seed.seed.uid]"
|
||||
plant_controller.seeds[seed.seed.name] = seed.seed
|
||||
|
||||
seed.update_seed()
|
||||
visible_message("[bicon(src)] [src] beeps and spits out [seed].")
|
||||
|
||||
seed = null
|
||||
|
||||
if(href_list["eject_disk"])
|
||||
if(!loaded_disk) return
|
||||
loaded_disk.loc = get_turf(src)
|
||||
visible_message("[bicon(src)] [src] beeps and spits out [loaded_disk].")
|
||||
loaded_disk = null
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
/obj/machinery/botany/extractor/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if(href_list["scan_genome"])
|
||||
|
||||
if(!seed) return
|
||||
|
||||
last_action = world.time
|
||||
active = 1
|
||||
|
||||
if(seed && seed.seed)
|
||||
genetics = seed.seed
|
||||
degradation = 0
|
||||
|
||||
qdel(seed)
|
||||
seed = null
|
||||
|
||||
if(href_list["get_gene"])
|
||||
|
||||
if(!genetics || !loaded_disk) return
|
||||
|
||||
last_action = world.time
|
||||
active = 1
|
||||
|
||||
var/datum/plantgene/P = genetics.get_gene(href_list["get_gene"])
|
||||
if(!P) return
|
||||
loaded_disk.genes += P
|
||||
|
||||
loaded_disk.genesource = "[genetics.display_name]"
|
||||
if(!genetics.roundstart)
|
||||
loaded_disk.genesource += " (variety #[genetics.uid])"
|
||||
|
||||
loaded_disk.name += " ([href_list["get_gene"]], #[genetics.uid])"
|
||||
loaded_disk.desc += " The label reads \'[href_list["get_gene"]] gene, sampled from [genetics.display_name]\'."
|
||||
eject_disk = 1
|
||||
|
||||
degradation += rand(degrade_lower, degrade_upper)
|
||||
if(degradation >= 100)
|
||||
failed_task = 1
|
||||
genetics = null
|
||||
degradation = 0
|
||||
|
||||
if(href_list["clear_buffer"])
|
||||
if(!genetics) return
|
||||
genetics = null
|
||||
degradation = 0
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
// Fires an extracted trait into another packet of seeds with a chance
|
||||
// of destroying it based on the size/complexity of the plasmid.
|
||||
/obj/machinery/botany/editor
|
||||
name = "bioballistic delivery system"
|
||||
icon_state = "traitgun"
|
||||
disk_needs_genes = 1
|
||||
|
||||
var/degrade_lower = 5
|
||||
var/degrade_upper = 10
|
||||
|
||||
/obj/machinery/botany/editor/New()
|
||||
..()
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/botany_editor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/botany/editor/RefreshParts()
|
||||
var/tier = 1
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
tier = M.rating
|
||||
degrade_lower = 6 - tier //Tier 1: 5, Tier 4: 1
|
||||
degrade_upper = 11 - tier //Tier 1: 10, Tier 4: 6
|
||||
|
||||
/obj/machinery/botany/editor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!user)
|
||||
return
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/botany/editor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
|
||||
data["activity"] = active
|
||||
|
||||
if(seed)
|
||||
data["degradation"] = seed.modified
|
||||
else
|
||||
data["degradation"] = 0
|
||||
|
||||
if(loaded_disk && loaded_disk.genes.len)
|
||||
data["disk"] = 1
|
||||
data["sourceName"] = loaded_disk.genesource
|
||||
data["locus"] = ""
|
||||
|
||||
for(var/datum/plantgene/P in loaded_disk.genes)
|
||||
if(data["locus"] != "") data["locus"] += ", "
|
||||
data["locus"] += "[plant_controller.gene_tag_list[P.genetype]]"
|
||||
|
||||
else
|
||||
data["disk"] = 0
|
||||
data["sourceName"] = 0
|
||||
data["locus"] = 0
|
||||
|
||||
if(seed)
|
||||
data["loaded"] = "[seed.name]"
|
||||
else
|
||||
data["loaded"] = 0
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/botany/editor/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["apply_gene"])
|
||||
if(!loaded_disk || !seed) return
|
||||
|
||||
last_action = world.time
|
||||
active = 1
|
||||
|
||||
if(!isnull(plant_controller.seeds[seed.seed.name]))
|
||||
seed.seed = seed.seed.diverge(1)
|
||||
seed.seed_type = seed.seed.name
|
||||
seed.update_seed()
|
||||
|
||||
if(prob(seed.modified))
|
||||
failed_task = 1
|
||||
seed.modified = 101
|
||||
|
||||
for(var/datum/plantgene/gene in loaded_disk.genes)
|
||||
seed.seed.apply_gene(gene)
|
||||
seed.modified += rand(degrade_lower, degrade_upper)
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
@@ -1,5 +0,0 @@
|
||||
/datum/seed
|
||||
var/list/currently_querying // Used to avoid asking the same ghost repeatedly.
|
||||
|
||||
// The following procs are used to grab players for mobs produced by a seed (mostly for dionaea).
|
||||
/datum/seed/proc/handle_living_product(var/mob/living/host)
|
||||
@@ -1,315 +0,0 @@
|
||||
var/global/list/plant_seed_sprites = list()
|
||||
|
||||
//Seed packet object/procs.
|
||||
/obj/item/seeds
|
||||
name = "packet of seeds"
|
||||
icon = 'icons/obj/seeds.dmi'
|
||||
icon_state = "blank"
|
||||
w_class = 2
|
||||
burn_state = FLAMMABLE
|
||||
var/seed_type
|
||||
var/datum/seed/seed
|
||||
var/modified = 0
|
||||
|
||||
/obj/item/seeds/New()
|
||||
while(!plant_controller)
|
||||
sleep(30)
|
||||
update_seed()
|
||||
..()
|
||||
|
||||
//Grabs the appropriate seed datum from the global list.
|
||||
/obj/item/seeds/proc/update_seed()
|
||||
if(!seed && seed_type && !isnull(plant_controller.seeds) && plant_controller.seeds[seed_type])
|
||||
seed = plant_controller.seeds[seed_type]
|
||||
update_appearance()
|
||||
|
||||
//Updates strings and icon appropriately based on seed datum.
|
||||
/obj/item/seeds/proc/update_appearance()
|
||||
if(!seed) return
|
||||
|
||||
// Update icon.
|
||||
overlays.Cut()
|
||||
var/is_seeds = ((seed.seed_noun in list("seeds","pits","nodes")) ? 1 : 0)
|
||||
var/image/seed_mask
|
||||
var/seed_base_key = "base-[is_seeds ? seed.get_trait(TRAIT_PLANT_COLOUR) : "spores"]"
|
||||
if(plant_seed_sprites[seed_base_key])
|
||||
seed_mask = plant_seed_sprites[seed_base_key]
|
||||
else
|
||||
seed_mask = image('icons/obj/seeds.dmi',"[is_seeds ? "seed" : "spore"]-mask")
|
||||
if(is_seeds) // Spore glass bits aren't coloured.
|
||||
seed_mask.color = seed.get_trait(TRAIT_PLANT_COLOUR)
|
||||
plant_seed_sprites[seed_base_key] = seed_mask
|
||||
|
||||
var/image/seed_overlay
|
||||
var/seed_overlay_key = "[seed.get_trait(TRAIT_PRODUCT_ICON)]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"
|
||||
if(plant_seed_sprites[seed_overlay_key])
|
||||
seed_overlay = plant_seed_sprites[seed_overlay_key]
|
||||
else
|
||||
seed_overlay = image('icons/obj/seeds.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]")
|
||||
seed_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
plant_seed_sprites[seed_overlay_key] = seed_overlay
|
||||
|
||||
overlays |= seed_mask
|
||||
overlays |= seed_overlay
|
||||
|
||||
if(is_seeds)
|
||||
src.name = "packet of [seed.seed_name] [seed.seed_noun]"
|
||||
src.desc = "It has a picture of [seed.display_name] on the front."
|
||||
else
|
||||
src.name = "sample of [seed.seed_name] [seed.seed_noun]"
|
||||
src.desc = "It's labelled as coming from [seed.display_name]."
|
||||
|
||||
/obj/item/seeds/examine(mob/user)
|
||||
..(user)
|
||||
if(seed && !seed.roundstart)
|
||||
to_chat(user, "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/random
|
||||
seed_type = null
|
||||
|
||||
/obj/item/seeds/random/New()
|
||||
seed = plant_controller.create_random_seed()
|
||||
seed_type = seed.name
|
||||
update_seed()
|
||||
|
||||
/obj/item/seeds/replicapod
|
||||
seed_type = "diona"
|
||||
|
||||
/obj/item/seeds/chiliseed
|
||||
seed_type = "chili"
|
||||
|
||||
/obj/item/seeds/plastiseed
|
||||
seed_type = "plastic"
|
||||
|
||||
/obj/item/seeds/grapeseed
|
||||
seed_type = "grapes"
|
||||
|
||||
/obj/item/seeds/greengrapeseed
|
||||
seed_type = "greengrapes"
|
||||
|
||||
/obj/item/seeds/peanutseed
|
||||
seed_type = "peanut"
|
||||
|
||||
/obj/item/seeds/cabbageseed
|
||||
seed_type = "cabbage"
|
||||
|
||||
/obj/item/seeds/comfreyseed
|
||||
seed_type = "comfrey"
|
||||
|
||||
/obj/item/seeds/aloeseed
|
||||
seed_type = "aloe"
|
||||
|
||||
/obj/item/seeds/berryseed
|
||||
seed_type = "berries"
|
||||
|
||||
/obj/item/seeds/glowberryseed
|
||||
seed_type = "glowberries"
|
||||
|
||||
/obj/item/seeds/bananaseed
|
||||
seed_type = "banana"
|
||||
|
||||
/obj/item/seeds/eggplantseed
|
||||
seed_type = "eggplant"
|
||||
|
||||
/obj/item/seeds/bloodtomatoseed
|
||||
seed_type = "bloodtomato"
|
||||
|
||||
/obj/item/seeds/tomatoseed
|
||||
seed_type = "tomato"
|
||||
|
||||
/obj/item/seeds/killertomatoseed
|
||||
seed_type = "killertomato"
|
||||
|
||||
/obj/item/seeds/bluetomatoseed
|
||||
seed_type = "bluetomato"
|
||||
|
||||
/obj/item/seeds/bluespacetomatoseed
|
||||
seed_type = "bluespacetomato"
|
||||
|
||||
/obj/item/seeds/cornseed
|
||||
seed_type = "corn"
|
||||
|
||||
/obj/item/seeds/poppyseed
|
||||
seed_type = "poppies"
|
||||
|
||||
/obj/item/seeds/potatoseed
|
||||
seed_type = "potato"
|
||||
|
||||
/obj/item/seeds/icepepperseed
|
||||
seed_type = "icechili"
|
||||
|
||||
/obj/item/seeds/soyaseed
|
||||
seed_type = "soybean"
|
||||
|
||||
/obj/item/seeds/wheatseed
|
||||
seed_type = "wheat"
|
||||
|
||||
/obj/item/seeds/riceseed
|
||||
seed_type = "rice"
|
||||
|
||||
/obj/item/seeds/carrotseed
|
||||
seed_type = "carrot"
|
||||
|
||||
/obj/item/seeds/reishimycelium
|
||||
seed_type = "reishi"
|
||||
|
||||
/obj/item/seeds/amanitamycelium
|
||||
seed_type = "amanita"
|
||||
|
||||
/obj/item/seeds/angelmycelium
|
||||
seed_type = "destroyingangel"
|
||||
|
||||
/obj/item/seeds/libertymycelium
|
||||
seed_type = "libertycap"
|
||||
|
||||
/obj/item/seeds/chantermycelium
|
||||
seed_type = "mushrooms"
|
||||
|
||||
/obj/item/seeds/towermycelium
|
||||
seed_type = "towercap"
|
||||
|
||||
/obj/item/seeds/glowshroom
|
||||
seed_type = "glowshroom"
|
||||
|
||||
/obj/item/seeds/glowcap
|
||||
seed_type = "glowcap"
|
||||
|
||||
/obj/item/seeds/plumpmycelium
|
||||
seed_type = "plumphelmet"
|
||||
|
||||
/obj/item/seeds/walkingmushroommycelium
|
||||
seed_type = "walkingmushroom"
|
||||
|
||||
/obj/item/seeds/nettleseed
|
||||
seed_type = "nettle"
|
||||
|
||||
/obj/item/seeds/deathnettleseed
|
||||
seed_type = "deathnettle"
|
||||
|
||||
/obj/item/seeds/weeds
|
||||
seed_type = "weeds"
|
||||
|
||||
/obj/item/seeds/harebell
|
||||
seed_type = "harebells"
|
||||
|
||||
/obj/item/seeds/sunflowerseed
|
||||
seed_type = "sunflowers"
|
||||
|
||||
/obj/item/seeds/brownmold
|
||||
seed_type = "mold"
|
||||
|
||||
/obj/item/seeds/appleseed
|
||||
seed_type = "apple"
|
||||
|
||||
/obj/item/seeds/poisonedappleseed
|
||||
seed_type = "poisonapple"
|
||||
|
||||
/obj/item/seeds/goldappleseed
|
||||
seed_type = "goldapple"
|
||||
|
||||
/obj/item/seeds/ambrosiavulgarisseed
|
||||
seed_type = "ambrosia"
|
||||
|
||||
/obj/item/seeds/ambrosiadeusseed
|
||||
seed_type = "ambrosiadeus"
|
||||
|
||||
/obj/item/seeds/ambrosiavulgarisseed/cruciatus
|
||||
seed_type = "ambrosia"
|
||||
|
||||
/obj/item/seeds/whitebeetseed
|
||||
seed_type = "whitebeet"
|
||||
|
||||
/obj/item/seeds/sugarcaneseed
|
||||
seed_type = "sugarcane"
|
||||
|
||||
/obj/item/seeds/watermelonseed
|
||||
seed_type = "watermelon"
|
||||
|
||||
/obj/item/seeds/pumpkinseed
|
||||
seed_type = "pumpkin"
|
||||
|
||||
/obj/item/seeds/limeseed
|
||||
seed_type = "lime"
|
||||
|
||||
/obj/item/seeds/lemonseed
|
||||
seed_type = "lemon"
|
||||
|
||||
/obj/item/seeds/orangeseed
|
||||
seed_type = "orange"
|
||||
|
||||
/obj/item/seeds/poisonberryseed
|
||||
seed_type = "poisonberries"
|
||||
|
||||
/obj/item/seeds/deathberryseed
|
||||
seed_type = "deathberries"
|
||||
|
||||
/obj/item/seeds/grassseed
|
||||
seed_type = "grass"
|
||||
|
||||
/obj/item/seeds/cocoapodseed
|
||||
seed_type = "cocoa"
|
||||
|
||||
/obj/item/seeds/cherryseed
|
||||
seed_type = "cherry"
|
||||
|
||||
/obj/item/seeds/tobaccoseed
|
||||
seed_type = "tobacco"
|
||||
|
||||
/obj/item/seeds/kudzuseed
|
||||
seed_type = "kudzu"
|
||||
|
||||
/obj/item/seeds/jurlmah
|
||||
seed_type = "jurlmah"
|
||||
|
||||
/obj/item/seeds/amauri
|
||||
seed_type = "amauri"
|
||||
|
||||
/obj/item/seeds/gelthi
|
||||
seed_type = "gelthi"
|
||||
|
||||
/obj/item/seeds/vale
|
||||
seed_type = "vale"
|
||||
|
||||
/obj/item/seeds/surik
|
||||
seed_type = "surik"
|
||||
|
||||
/obj/item/seeds/telriis
|
||||
seed_type = "telriis"
|
||||
|
||||
/obj/item/seeds/thaadra
|
||||
seed_type = "thaadra"
|
||||
|
||||
/obj/item/seeds/clown
|
||||
seed_type = "clown"
|
||||
|
||||
/obj/item/seeds/test
|
||||
seed_type = "test"
|
||||
|
||||
/obj/item/seeds/test2
|
||||
seed_type = "test2"
|
||||
|
||||
/obj/item/seeds/stobaccoseed
|
||||
seed_type = "stobacco"
|
||||
|
||||
/obj/item/seeds/teaasperaseed
|
||||
seed_type = "teaaspera"
|
||||
|
||||
/obj/item/seeds/teaastraseed
|
||||
seed_type = "teaastra"
|
||||
|
||||
/obj/item/seeds/coffeeaseed
|
||||
seed_type = "coffeea"
|
||||
|
||||
/obj/item/seeds/coffeerseed
|
||||
seed_type = "coffeer"
|
||||
|
||||
/obj/item/seeds/cash
|
||||
seed_type = "cashtree"
|
||||
@@ -1,245 +0,0 @@
|
||||
/datum/seed_pile
|
||||
var/name
|
||||
var/amount
|
||||
var/datum/seed/seed_type // Keeps track of what our seed is
|
||||
var/list/obj/item/seeds/seeds = list() // Tracks actual objects contained in the pile
|
||||
var/ID
|
||||
|
||||
/datum/seed_pile/New(var/obj/item/seeds/O, var/ID)
|
||||
name = O.name
|
||||
amount = 1
|
||||
seed_type = O.seed
|
||||
seeds += O
|
||||
src.ID = ID
|
||||
|
||||
/datum/seed_pile/proc/matches(var/obj/item/seeds/O)
|
||||
if(O.seed == seed_type)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/seed_storage
|
||||
name = "Seed storage"
|
||||
desc = "It stores, sorts, and dispenses seeds."
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "seeds"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 100
|
||||
|
||||
var/initialized = 0 // Map-placed ones break if seeds are loaded right at the start of the round, so we do it on the first interaction
|
||||
var/list/datum/seed_pile/piles = list()
|
||||
var/list/starting_seeds = list()
|
||||
var/list/scanner = list() // What properties we can view
|
||||
|
||||
/obj/machinery/seed_storage/random // This is mostly for testing, but I guess admins could spawn it
|
||||
name = "Random seed storage"
|
||||
scanner = list("stats", "produce", "soil", "temperature", "light")
|
||||
starting_seeds = list(/obj/item/seeds/random = 50)
|
||||
|
||||
/obj/machinery/seed_storage/garden
|
||||
name = "Garden seed storage"
|
||||
scanner = list("stats")
|
||||
starting_seeds = list(/obj/item/seeds/appleseed = 3, /obj/item/seeds/bananaseed = 3, /obj/item/seeds/berryseed = 3, /obj/item/seeds/cabbageseed = 3, /obj/item/seeds/carrotseed = 3, /obj/item/seeds/chantermycelium = 3, /obj/item/seeds/cherryseed = 3, /obj/item/seeds/chiliseed = 3, /obj/item/seeds/cocoapodseed = 3, /obj/item/seeds/cornseed = 3, /obj/item/seeds/eggplantseed = 3, /obj/item/seeds/grapeseed = 3, /obj/item/seeds/grassseed = 3, /obj/item/seeds/replicapod = 3, /obj/item/seeds/lemonseed = 3, /obj/item/seeds/limeseed = 3, /obj/item/seeds/aloeseed = 2, /obj/item/seeds/orangeseed = 3, /obj/item/seeds/peanutseed = 3, /obj/item/seeds/plumpmycelium = 3, /obj/item/seeds/poppyseed = 3, /obj/item/seeds/potatoseed = 3, /obj/item/seeds/pumpkinseed = 3, /obj/item/seeds/riceseed = 3, /obj/item/seeds/soyaseed = 3, /obj/item/seeds/sugarcaneseed = 3, /obj/item/seeds/sunflowerseed = 3, /obj/item/seeds/comfreyseed = 2, /obj/item/seeds/tobaccoseed = 3, /obj/item/seeds/tomatoseed = 3, /obj/item/seeds/towermycelium = 3, /obj/item/seeds/watermelonseed = 3, /obj/item/seeds/wheatseed = 3, /obj/item/seeds/whitebeetseed = 3)
|
||||
|
||||
/obj/machinery/seed_storage/xenobotany
|
||||
name = "Xenobotany seed storage"
|
||||
scanner = list("stats", "produce", "soil", "temperature", "light")
|
||||
starting_seeds = list(/obj/item/seeds/ambrosiavulgarisseed = 3, /obj/item/seeds/appleseed = 3, /obj/item/seeds/amanitamycelium = 2, /obj/item/seeds/bananaseed = 3, /obj/item/seeds/berryseed = 3, /obj/item/seeds/cabbageseed = 3, /obj/item/seeds/carrotseed = 3, /obj/item/seeds/chantermycelium = 3, /obj/item/seeds/cherryseed = 3, /obj/item/seeds/chiliseed = 3, /obj/item/seeds/cocoapodseed = 3, /obj/item/seeds/cornseed = 3, /obj/item/seeds/replicapod = 3, /obj/item/seeds/eggplantseed = 3, /obj/item/seeds/glowshroom = 2, /obj/item/seeds/grapeseed = 3, /obj/item/seeds/grassseed = 3, /obj/item/seeds/lemonseed = 3, /obj/item/seeds/libertymycelium = 2, /obj/item/seeds/limeseed = 3, /obj/item/seeds/aloeseed = 2, /obj/item/seeds/nettleseed = 2, /obj/item/seeds/orangeseed = 3, /obj/item/seeds/peanutseed = 3, /obj/item/seeds/plastiseed = 3, /obj/item/seeds/plumpmycelium = 3, /obj/item/seeds/poppyseed = 3, /obj/item/seeds/potatoseed = 3, /obj/item/seeds/pumpkinseed = 3, /obj/item/seeds/reishimycelium = 2, /obj/item/seeds/riceseed = 3, /obj/item/seeds/soyaseed = 3, /obj/item/seeds/sugarcaneseed = 3, /obj/item/seeds/sunflowerseed = 3, /obj/item/seeds/comfreyseed = 2, /obj/item/seeds/tobaccoseed = 3, /obj/item/seeds/tomatoseed = 3, /obj/item/seeds/towermycelium = 3, /obj/item/seeds/watermelonseed = 3, /obj/item/seeds/wheatseed = 3, /obj/item/seeds/whitebeetseed = 3)
|
||||
|
||||
/obj/machinery/seed_storage/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/seed_storage/interact(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!initialized)
|
||||
for(var/typepath in starting_seeds)
|
||||
var/amount = starting_seeds[typepath]
|
||||
if(isnull(amount)) amount = 1
|
||||
|
||||
for(var/i = 1 to amount)
|
||||
var/O = new typepath
|
||||
add(O)
|
||||
initialized = 1
|
||||
|
||||
var/dat = "<center><h1>Seed storage contents</h1></center>"
|
||||
if(piles.len == 0)
|
||||
dat += "<font color='red'>No seeds</font>"
|
||||
else
|
||||
dat += "<table style='text-align:center;border-style:solid;border-width:1px;padding:4px'><tr><td>Name</td>"
|
||||
dat += "<td>Variety</td>"
|
||||
if("stats" in scanner)
|
||||
dat += "<td>E</td><td>Y</td><td>M</td><td>Pr</td><td>Pt</td><td>Harvest</td>"
|
||||
if("temperature" in scanner)
|
||||
dat += "<td>Temp</td>"
|
||||
if("light" in scanner)
|
||||
dat += "<td>Light</td>"
|
||||
if("soil" in scanner)
|
||||
dat += "<td>Nutri</td><td>Water</td>"
|
||||
dat += "<td>Notes</td><td>Amount</td><td></td></tr>"
|
||||
for(var/datum/seed_pile/S in piles)
|
||||
var/datum/seed/seed = S.seed_type
|
||||
if(!seed)
|
||||
continue
|
||||
dat += "<tr>"
|
||||
dat += "<td>[seed.seed_name]</td>"
|
||||
dat += "<td>#[seed.uid]</td>"
|
||||
if("stats" in scanner)
|
||||
dat += "<td>[seed.get_trait(TRAIT_ENDURANCE)]</td><td>[seed.get_trait(TRAIT_YIELD)]</td><td>[seed.get_trait(TRAIT_MATURATION)]</td><td>[seed.get_trait(TRAIT_PRODUCTION)]</td><td>[seed.get_trait(TRAIT_POTENCY)]</td>"
|
||||
if(seed.get_trait(TRAIT_HARVEST_REPEAT))
|
||||
dat += "<td>Multiple</td>"
|
||||
else
|
||||
dat += "<td>Single</td>"
|
||||
if("temperature" in scanner)
|
||||
dat += "<td>[seed.get_trait(TRAIT_IDEAL_HEAT)] K</td>"
|
||||
if("light" in scanner)
|
||||
dat += "<td>[seed.get_trait(TRAIT_IDEAL_LIGHT)] L</td>"
|
||||
if("soil" in scanner)
|
||||
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
|
||||
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
|
||||
dat += "<td>Low</td>"
|
||||
else if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) > 0.2)
|
||||
dat += "<td>High</td>"
|
||||
else
|
||||
dat += "<td>Norm</td>"
|
||||
else
|
||||
dat += "<td>No</td>"
|
||||
if(seed.get_trait(TRAIT_REQUIRES_WATER))
|
||||
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) < 1)
|
||||
dat += "<td>Low</td>"
|
||||
else if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 5)
|
||||
dat += "<td>High</td>"
|
||||
else
|
||||
dat += "<td>Norm</td>"
|
||||
else
|
||||
dat += "<td>No</td>"
|
||||
|
||||
dat += "<td>"
|
||||
switch(seed.get_trait(TRAIT_CARNIVOROUS))
|
||||
if(1)
|
||||
dat += "CARN "
|
||||
if(2)
|
||||
dat += "<font color='red'>CARN </font>"
|
||||
switch(seed.get_trait(TRAIT_SPREAD))
|
||||
if(1)
|
||||
dat += "VINE "
|
||||
if(2)
|
||||
dat += "<font color='red'>VINE </font>"
|
||||
if("pressure" in scanner)
|
||||
if(seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
|
||||
dat += "LP "
|
||||
if(seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
|
||||
dat += "HP "
|
||||
if("temperature" in scanner)
|
||||
if(seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
|
||||
dat += "TEMRES "
|
||||
else if(seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
|
||||
dat += "TEMSEN "
|
||||
if("light" in scanner)
|
||||
if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
|
||||
dat += "LIGRES "
|
||||
else if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
|
||||
dat += "LIGSEN "
|
||||
if(seed.get_trait(TRAIT_TOXINS_TOLERANCE) < 3)
|
||||
dat += "TOXSEN "
|
||||
else if(seed.get_trait(TRAIT_TOXINS_TOLERANCE) > 6)
|
||||
dat += "TOXRES "
|
||||
if(seed.get_trait(TRAIT_PEST_TOLERANCE) < 3)
|
||||
dat += "PESTSEN "
|
||||
else if(seed.get_trait(TRAIT_PEST_TOLERANCE) > 6)
|
||||
dat += "PESTRES "
|
||||
if(seed.get_trait(TRAIT_WEED_TOLERANCE) < 3)
|
||||
dat += "WEEDSEN "
|
||||
else if(seed.get_trait(TRAIT_WEED_TOLERANCE) > 6)
|
||||
dat += "WEEDRES "
|
||||
if(seed.get_trait(TRAIT_PARASITE))
|
||||
dat += "PAR "
|
||||
if("temperature" in scanner)
|
||||
if(seed.get_trait(TRAIT_ALTER_TEMP) > 0)
|
||||
dat += "TEMP+ "
|
||||
if(seed.get_trait(TRAIT_ALTER_TEMP) < 0)
|
||||
dat += "TEMP- "
|
||||
if(seed.get_trait(TRAIT_BIOLUM))
|
||||
dat += "LUM "
|
||||
dat += "</td>"
|
||||
dat += "<td>[S.amount]</td>"
|
||||
dat += "<td><a href='byond://?src=[UID()];task=vend;id=[S.ID]'>Vend</a> <a href='byond://?src=[UID()];task=purge;id=[S.ID]'>Purge</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
|
||||
user << browse(dat, "window=seedstorage")
|
||||
onclose(user, "seedstorage")
|
||||
|
||||
/obj/machinery/seed_storage/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
var/task = href_list["task"]
|
||||
var/ID = text2num(href_list["id"])
|
||||
|
||||
for(var/datum/seed_pile/N in piles)
|
||||
if(N.ID == ID)
|
||||
if(task == "vend")
|
||||
var/obj/O = pick(N.seeds)
|
||||
if(O)
|
||||
--N.amount
|
||||
N.seeds -= O
|
||||
if(N.amount <= 0 || N.seeds.len <= 0)
|
||||
piles -= N
|
||||
qdel(N)
|
||||
O.loc = src.loc
|
||||
else
|
||||
piles -= N
|
||||
qdel(N)
|
||||
else if(task == "purge")
|
||||
for(var/obj/O in N.seeds)
|
||||
qdel(O)
|
||||
piles -= N
|
||||
qdel(N)
|
||||
break
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/seed_storage/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/seeds))
|
||||
add(O)
|
||||
user.visible_message("[user] puts \the [O.name] into \the [src].", "You put \the [O] into \the [src].")
|
||||
return
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/obj/item/weapon/storage/P = O
|
||||
var/loaded = 0
|
||||
for(var/obj/item/seeds/G in P.contents)
|
||||
++loaded
|
||||
add(G)
|
||||
if(loaded)
|
||||
user.visible_message("[user] puts the seeds from \the [O.name] into \the [src].", "You put the seeds from \the [O.name] into \the [src].")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no seeds in \the [O.name].</span>")
|
||||
return
|
||||
else if(istype(O, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
|
||||
|
||||
/obj/machinery/seed_storage/proc/add(var/obj/item/seeds/O as obj)
|
||||
if(istype(O.loc, /mob))
|
||||
var/mob/user = O.loc
|
||||
user.drop_item(O)
|
||||
else if(istype(O.loc,/obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = O.loc
|
||||
S.remove_from_storage(O, src)
|
||||
|
||||
O.loc = src
|
||||
var/newID = 0
|
||||
|
||||
for(var/datum/seed_pile/N in piles)
|
||||
if(N.matches(O))
|
||||
++N.amount
|
||||
N.seeds += (O)
|
||||
return
|
||||
else if(N.ID >= newID)
|
||||
newID = N.ID + 1
|
||||
|
||||
piles += new /datum/seed_pile(O, newID)
|
||||
return
|
||||
@@ -0,0 +1,380 @@
|
||||
// ********************************************************
|
||||
// Here's all the seeds (plants) that can be used in hydro
|
||||
// ********************************************************
|
||||
|
||||
/obj/item/seeds
|
||||
icon = 'icons/obj/hydroponics/seeds.dmi'
|
||||
icon_state = "seed" // Unknown plant seed - these shouldn't exist in-game.
|
||||
w_class = 1
|
||||
burn_state = FLAMMABLE
|
||||
var/plantname = "Plants" // Name of plant when planted.
|
||||
var/product // A type path. The thing that is created when the plant is harvested.
|
||||
var/species = "" // Used to update icons. Should match the name in the sprites unless all icon_* are overriden.
|
||||
|
||||
var/growing_icon = 'icons/obj/hydroponics/growing.dmi' //the file that stores the sprites of the growing plant from this seed.
|
||||
var/icon_grow // Used to override grow icon (default is "[species]-grow"). You can use one grow icon for multiple closely related plants with it.
|
||||
var/icon_dead // Used to override dead icon (default is "[species]-dead"). You can use one dead icon for multiple closely related plants with it.
|
||||
var/icon_harvest // Used to override harvest icon (default is "[species]-harvest"). If null, plant will use [icon_grow][growthstages].
|
||||
|
||||
var/lifespan = 25 // How long before the plant begins to take damage from age.
|
||||
var/endurance = 15 // Amount of health the plant has.
|
||||
var/maturation = 6 // Used to determine which sprite to switch to when growing.
|
||||
var/production = 6 // Changes the amount of time needed for a plant to become harvestable.
|
||||
var/yield = 3 // Amount of growns created per harvest. If is -1, the plant/shroom/weed is never meant to be harvested.
|
||||
var/potency = 10 // The 'power' of a plant. Generally effects the amount of reagent in a plant, also used in other ways.
|
||||
var/growthstages = 6 // Amount of growth sprites the plant has.
|
||||
var/rarity = 0 // How rare the plant is. Used for giving points to cargo when shipping off to Centcom.
|
||||
var/list/mutatelist = list() // The type of plants that this plant can mutate into.
|
||||
var/list/genes = list() // Plant genes are stored here, see plant_genes.dm for more info.
|
||||
var/list/reagents_add = list()
|
||||
// A list of reagents to add to product.
|
||||
// Format: "reagent_id" = potency multiplier
|
||||
// Stronger reagents must always come first to avoid being displaced by weaker ones.
|
||||
// Total amount of any reagent in plant is calculated by formula: 1 + round(potency * multiplier)
|
||||
|
||||
var/weed_rate = 1 //If the chance below passes, then this many weeds sprout during growth
|
||||
var/weed_chance = 5 //Percentage chance per tray update to grow weeds
|
||||
|
||||
/obj/item/seeds/New(loc, nogenes = 0)
|
||||
..()
|
||||
pixel_x = rand(-8, 8)
|
||||
pixel_y = rand(-8, 8)
|
||||
|
||||
if(!icon_grow)
|
||||
icon_grow = "[species]-grow"
|
||||
|
||||
if(!icon_dead)
|
||||
icon_dead = "[species]-dead"
|
||||
|
||||
if(!icon_harvest && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && yield != -1)
|
||||
icon_harvest = "[species]-harvest"
|
||||
|
||||
if(!nogenes) // not used on Copy()
|
||||
genes += new /datum/plant_gene/core/lifespan(lifespan)
|
||||
genes += new /datum/plant_gene/core/endurance(endurance)
|
||||
genes += new /datum/plant_gene/core/weed_rate(weed_rate)
|
||||
genes += new /datum/plant_gene/core/weed_chance(weed_chance)
|
||||
if(yield != -1)
|
||||
genes += new /datum/plant_gene/core/yield(yield)
|
||||
genes += new /datum/plant_gene/core/production(production)
|
||||
if(potency != -1)
|
||||
genes += new /datum/plant_gene/core/potency(potency)
|
||||
|
||||
for(var/p in genes)
|
||||
if(ispath(p))
|
||||
genes -= p
|
||||
genes += new p
|
||||
|
||||
for(var/reag_id in reagents_add)
|
||||
genes += new /datum/plant_gene/reagent(reag_id, reagents_add[reag_id])
|
||||
|
||||
/obj/item/seeds/proc/Copy()
|
||||
var/obj/item/seeds/S = new type(null, 1)
|
||||
// Copy all the stats
|
||||
S.lifespan = lifespan
|
||||
S.endurance = endurance
|
||||
S.maturation = maturation
|
||||
S.production = production
|
||||
S.yield = yield
|
||||
S.potency = potency
|
||||
S.weed_rate = weed_rate
|
||||
S.weed_chance = weed_chance
|
||||
S.genes = list()
|
||||
for(var/g in genes)
|
||||
var/datum/plant_gene/G = g
|
||||
S.genes += G.Copy()
|
||||
S.reagents_add = reagents_add.Copy() // Faster than grabbing the list from genes.
|
||||
return S
|
||||
|
||||
/obj/item/seeds/proc/get_gene(typepath)
|
||||
return (locate(typepath) in genes)
|
||||
|
||||
/obj/item/seeds/proc/reagents_from_genes()
|
||||
reagents_add = list()
|
||||
for(var/datum/plant_gene/reagent/R in genes)
|
||||
reagents_add[R.reagent_id] = R.rate
|
||||
|
||||
/obj/item/seeds/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0)
|
||||
adjust_lifespan(rand(-lifemut,lifemut))
|
||||
adjust_endurance(rand(-endmut,endmut))
|
||||
adjust_production(rand(-productmut,productmut))
|
||||
adjust_yield(rand(-yieldmut,yieldmut))
|
||||
adjust_potency(rand(-potmut,potmut))
|
||||
adjust_weed_rate(rand(-wrmut, wrmut))
|
||||
adjust_weed_chance(rand(-wcmut, wcmut))
|
||||
if(prob(traitmut))
|
||||
add_random_traits(1, 1)
|
||||
|
||||
|
||||
|
||||
/obj/item/seeds/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(istype(Proj, /obj/item/projectile/energy/florayield))
|
||||
var/rating = 1
|
||||
if(istype(loc, /obj/machinery/hydroponics))
|
||||
var/obj/machinery/hydroponics/H = loc
|
||||
rating = H.rating
|
||||
|
||||
if(yield == 0)//Oh god don't divide by zero you'll doom us all.
|
||||
adjust_yield(1 * rating)
|
||||
else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
|
||||
adjust_yield(1 * rating)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
// Harvest procs
|
||||
/obj/item/seeds/proc/getYield()
|
||||
var/return_yield = yield
|
||||
|
||||
var/obj/machinery/hydroponics/parent = loc
|
||||
if(istype(loc, /obj/machinery/hydroponics))
|
||||
if(parent.yieldmod == 0)
|
||||
return_yield = min(return_yield, 1)//1 if above zero, 0 otherwise
|
||||
else
|
||||
return_yield *= (parent.yieldmod)
|
||||
|
||||
return return_yield
|
||||
|
||||
|
||||
/obj/item/seeds/proc/harvest(mob/user = usr)
|
||||
var/obj/machinery/hydroponics/parent = loc //for ease of access
|
||||
var/t_amount = 0
|
||||
var/list/result = list()
|
||||
var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
|
||||
var/product_name
|
||||
while(t_amount < getYield())
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
|
||||
result.Add(t_prod) // User gets a consumable
|
||||
if(!t_prod)
|
||||
return
|
||||
t_amount++
|
||||
product_name = t_prod.name
|
||||
if(getYield() >= 1)
|
||||
feedback_add_details("food_harvested","[product_name]|[getYield()]")
|
||||
parent.update_tray()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
/obj/item/seeds/proc/prepare_result(var/obj/item/weapon/reagent_containers/food/snacks/grown/T)
|
||||
if(T.reagents)
|
||||
for(var/reagent_id in reagents_add)
|
||||
if(reagent_id == "blood") // Hack to make blood in plants always O-
|
||||
T.reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id], 1), list("blood_type"="O-"))
|
||||
continue
|
||||
|
||||
T.reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id]), 1)
|
||||
return 1
|
||||
|
||||
|
||||
/// Setters procs ///
|
||||
/obj/item/seeds/proc/adjust_yield(adjustamt)
|
||||
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
|
||||
yield = Clamp(yield + adjustamt, 0, 10)
|
||||
|
||||
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
|
||||
yield = 1 // Mushrooms always have a minimum yield of 1.
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield)
|
||||
if(C)
|
||||
C.value = yield
|
||||
|
||||
/obj/item/seeds/proc/adjust_lifespan(adjustamt)
|
||||
lifespan = Clamp(lifespan + adjustamt, 10, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
|
||||
if(C)
|
||||
C.value = lifespan
|
||||
|
||||
/obj/item/seeds/proc/adjust_endurance(adjustamt)
|
||||
endurance = Clamp(endurance + adjustamt, 10, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
|
||||
if(C)
|
||||
C.value = endurance
|
||||
|
||||
/obj/item/seeds/proc/adjust_production(adjustamt)
|
||||
if(yield != -1)
|
||||
production = Clamp(production + adjustamt, 1, 10)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
|
||||
if(C)
|
||||
C.value = production
|
||||
|
||||
/obj/item/seeds/proc/adjust_potency(adjustamt)
|
||||
if(potency != -1)
|
||||
potency = Clamp(potency + adjustamt, 0, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
|
||||
if(C)
|
||||
C.value = potency
|
||||
|
||||
/obj/item/seeds/proc/adjust_weed_rate(adjustamt)
|
||||
weed_rate = Clamp(weed_rate + adjustamt, 0, 10)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
|
||||
if(C)
|
||||
C.value = weed_rate
|
||||
|
||||
/obj/item/seeds/proc/adjust_weed_chance(adjustamt)
|
||||
weed_chance = Clamp(weed_chance + adjustamt, 0, 67)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
|
||||
if(C)
|
||||
C.value = weed_chance
|
||||
|
||||
//Directly setting stats
|
||||
|
||||
/obj/item/seeds/proc/set_yield(adjustamt)
|
||||
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
|
||||
yield = Clamp(adjustamt, 0, 10)
|
||||
|
||||
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
|
||||
yield = 1 // Mushrooms always have a minimum yield of 1.
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield)
|
||||
if(C)
|
||||
C.value = yield
|
||||
|
||||
/obj/item/seeds/proc/set_lifespan(adjustamt)
|
||||
lifespan = Clamp(adjustamt, 10, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
|
||||
if(C)
|
||||
C.value = lifespan
|
||||
|
||||
/obj/item/seeds/proc/set_endurance(adjustamt)
|
||||
endurance = Clamp(adjustamt, 10, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
|
||||
if(C)
|
||||
C.value = endurance
|
||||
|
||||
/obj/item/seeds/proc/set_production(adjustamt)
|
||||
if(yield != -1)
|
||||
production = Clamp(adjustamt, 2, 10)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
|
||||
if(C)
|
||||
C.value = production
|
||||
|
||||
/obj/item/seeds/proc/set_potency(adjustamt)
|
||||
if(potency != -1)
|
||||
potency = Clamp(adjustamt, 0, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
|
||||
if(C)
|
||||
C.value = potency
|
||||
|
||||
/obj/item/seeds/proc/set_weed_rate(adjustamt)
|
||||
weed_rate = Clamp(adjustamt, 0, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
|
||||
if(C)
|
||||
C.value = weed_rate
|
||||
|
||||
/obj/item/seeds/proc/set_weed_chance(adjustamt)
|
||||
weed_chance = Clamp(adjustamt, 0, 100)
|
||||
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
|
||||
if(C)
|
||||
C.value = weed_chance
|
||||
|
||||
|
||||
/obj/item/seeds/proc/get_analyzer_text() //in case seeds have something special to tell to the analyzer
|
||||
var/text = ""
|
||||
if(!get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && !get_gene(/datum/plant_gene/trait/plant_type/alien_properties))
|
||||
text += "- Plant type: Normal plant\n"
|
||||
if(get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
|
||||
text += "- Plant type: Weed. Can grow in nutrient-poor soil.\n"
|
||||
if(get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
|
||||
text += "- Plant type: Mushroom. Can grow in dry soil.\n"
|
||||
if(get_gene(/datum/plant_gene/trait/plant_type/alien_properties))
|
||||
text += "- Plant type: <span class='warning'>UNKNOWN</span> \n"
|
||||
if(potency != -1)
|
||||
text += "- Potency: [potency]\n"
|
||||
if(yield != -1)
|
||||
text += "- Yield: [yield]\n"
|
||||
text += "- Maturation speed: [maturation]\n"
|
||||
if(yield != -1)
|
||||
text += "- Production speed: [production]\n"
|
||||
text += "- Endurance: [endurance]\n"
|
||||
text += "- Lifespan: [lifespan]\n"
|
||||
text += "- Weed Growth Rate: [weed_rate]\n"
|
||||
text += "- Weed Vulnerability: [weed_chance]\n"
|
||||
if(rarity)
|
||||
text += "- Species Discovery Value: [rarity]\n"
|
||||
|
||||
text += "*---------*"
|
||||
|
||||
return text
|
||||
|
||||
/obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) //in case seeds have some special interaction with special chems
|
||||
return
|
||||
|
||||
/obj/item/seeds/attackby(obj/item/O, mob/user, params)
|
||||
if (istype(O, /obj/item/device/plant_analyzer))
|
||||
to_chat(user, "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>.</span>")
|
||||
var/text = get_analyzer_text()
|
||||
if(text)
|
||||
to_chat(user, "<span class='notice'>[text]</span>")
|
||||
|
||||
return
|
||||
..() // Fallthrough to item/attackby() so that bags can pick seeds up
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Checks plants for broken tray icons. Use Advanced Proc Call to activate.
|
||||
// Maybe some day it would be used as unit test.
|
||||
/proc/check_plants_growth_stages_icons()
|
||||
var/list/states = icon_states('icons/obj/hydroponics/growing.dmi')
|
||||
states |= icon_states('icons/obj/hydroponics/growing_fruits.dmi')
|
||||
states |= icon_states('icons/obj/hydroponics/growing_flowers.dmi')
|
||||
states |= icon_states('icons/obj/hydroponics/growing_mushrooms.dmi')
|
||||
states |= icon_states('icons/obj/hydroponics/growing_vegetables.dmi')
|
||||
var/list/paths = typesof(/obj/item/seeds) - /obj/item/seeds - typesof(/obj/item/seeds/sample)
|
||||
|
||||
for(var/seedpath in paths)
|
||||
var/obj/item/seeds/seed = new seedpath
|
||||
|
||||
for(var/i in 1 to seed.growthstages)
|
||||
if("[seed.icon_grow][i]" in states)
|
||||
continue
|
||||
to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_grow][i] icon!")
|
||||
|
||||
if(!(seed.icon_dead in states))
|
||||
to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_dead] icon!")
|
||||
|
||||
if(seed.icon_harvest) // mushrooms have no grown sprites, same for items with no product
|
||||
if(!(seed.icon_harvest in states))
|
||||
to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_harvest] icon!")
|
||||
|
||||
/obj/item/seeds/proc/randomize_stats()
|
||||
set_lifespan(rand(25, 60))
|
||||
set_endurance(rand(15, 35))
|
||||
set_production(rand(2, 10))
|
||||
set_yield(rand(1, 10))
|
||||
set_potency(rand(10, 35))
|
||||
set_weed_rate(rand(1, 10))
|
||||
set_weed_chance(rand(5, 100))
|
||||
maturation = rand(6, 12)
|
||||
|
||||
/obj/item/seeds/proc/add_random_reagents(lower = 0, upper = 2)
|
||||
var/amount_random_reagents = rand(lower, upper)
|
||||
for(var/i in 1 to amount_random_reagents)
|
||||
var/random_amount = rand(4, 15) * 0.01 // this must be multiplied by 0.01, otherwise, it will not properly associate
|
||||
var/datum/plant_gene/reagent/R = new(get_random_reagent_id(), random_amount)
|
||||
if(R.can_add(src))
|
||||
genes += R
|
||||
else
|
||||
qdel(R)
|
||||
reagents_from_genes()
|
||||
|
||||
/obj/item/seeds/proc/add_random_traits(lower = 0, upper = 2)
|
||||
var/amount_random_traits = rand(lower, upper)
|
||||
for(var/i in 1 to amount_random_traits)
|
||||
var/random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type)))
|
||||
var/datum/plant_gene/trait/T = new random_trait
|
||||
if(T.can_add(src))
|
||||
genes += T
|
||||
else
|
||||
qdel(T)
|
||||
|
||||
/obj/item/seeds/proc/add_random_plant_type(normal_plant_chance = 75)
|
||||
if(prob(normal_plant_chance))
|
||||
var/random_plant_type = pick(subtypesof(/datum/plant_gene/trait/plant_type))
|
||||
var/datum/plant_gene/trait/plant_type/P = new random_plant_type
|
||||
if(P.can_add(src))
|
||||
genes += P
|
||||
else
|
||||
qdel(P)
|
||||
@@ -1,277 +0,0 @@
|
||||
#define DEFAULT_SEED "glowshroom"
|
||||
#define VINE_GROWTH_STAGES 5
|
||||
|
||||
/proc/spacevine_infestation(var/potency_min=70, var/potency_max=100, var/maturation_min=5, var/maturation_max=15)
|
||||
spawn() //to stop the secrets panel hanging
|
||||
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
|
||||
for(var/areapath in typesof(/area/hallway))
|
||||
var/area/A = locate(areapath)
|
||||
for(var/turf/simulated/floor/F in A.contents)
|
||||
if(turf_clear(F))
|
||||
turfs += F
|
||||
|
||||
if(turfs.len) //Pick a turf to spawn at if we can
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
var/datum/seed/seed = plant_controller.create_random_seed(1)
|
||||
seed.set_trait(TRAIT_SPREAD,2) // So it will function properly as vines.
|
||||
seed.set_trait(TRAIT_POTENCY,rand(potency_min, potency_max)) // 70-100 potency will help guarantee a wide spread and powerful effects.
|
||||
seed.set_trait(TRAIT_MATURATION,rand(maturation_min, maturation_max))
|
||||
|
||||
//make vine zero start off fully matured
|
||||
var/obj/effect/plant/vine = new(T,seed)
|
||||
vine.health = vine.max_health
|
||||
vine.mature_time = 0
|
||||
vine.process()
|
||||
|
||||
message_admins("<span class='notice'>Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])</span>")
|
||||
|
||||
/obj/effect/dead_plant
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
color = DEAD_PLANT_COLOUR
|
||||
|
||||
/obj/effect/dead_plant/attack_hand()
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/dead_plant/attackby()
|
||||
..()
|
||||
for(var/obj/effect/plant/neighbor in range(1))
|
||||
neighbor.update_neighbors()
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/plant
|
||||
name = "plant"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'icons/obj/hydroponics_growing.dmi'
|
||||
icon_state = "bush4-1"
|
||||
layer = 3
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
var/health = 10
|
||||
var/max_health = 100
|
||||
var/growth_threshold = 0
|
||||
var/growth_type = 0
|
||||
var/max_growth = 0
|
||||
|
||||
var/list/neighbors = list()
|
||||
var/obj/effect/plant/parent
|
||||
var/datum/seed/seed
|
||||
var/floor = 0
|
||||
var/spread_chance = 40
|
||||
var/spread_distance = 3
|
||||
var/evolve_chance = 2
|
||||
var/mature_time
|
||||
var/last_tick = 0
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
|
||||
|
||||
var/movable = 0
|
||||
|
||||
/obj/effect/plant/Destroy()
|
||||
if(buckled_mob)
|
||||
unbuckle_mob()
|
||||
if(plant_controller)
|
||||
plant_controller.remove_plant(src)
|
||||
for(var/obj/effect/plant/neighbor in range(1,src))
|
||||
plant_controller.add_plant(neighbor)
|
||||
return ..()
|
||||
|
||||
/obj/effect/plant/single
|
||||
spread_chance = 0
|
||||
|
||||
/obj/effect/plant/New(var/newloc, var/datum/seed/newseed, var/obj/effect/plant/newparent)
|
||||
..()
|
||||
|
||||
if(!newparent)
|
||||
parent = src
|
||||
else
|
||||
parent = newparent
|
||||
|
||||
if(!plant_controller)
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
to_chat(world, "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(!istype(newseed))
|
||||
newseed = plant_controller.seeds[DEFAULT_SEED]
|
||||
seed = newseed
|
||||
if(!seed)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
name = seed.display_name
|
||||
max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2)
|
||||
if(seed.get_trait(TRAIT_SPREAD)==2)
|
||||
max_growth = VINE_GROWTH_STAGES
|
||||
growth_threshold = max_health/VINE_GROWTH_STAGES
|
||||
icon = 'icons/obj/hydroponics_vines.dmi'
|
||||
growth_type = 2 // Vines by default.
|
||||
if(seed.get_trait(TRAIT_CARNIVOROUS) == 2)
|
||||
growth_type = 1 // WOOOORMS.
|
||||
else if(!(seed.seed_noun in list("seeds","pits")))
|
||||
if(seed.seed_noun == "nodes")
|
||||
growth_type = 3 // Biomass
|
||||
else
|
||||
growth_type = 4 // Mold
|
||||
else
|
||||
max_growth = seed.growth_stages
|
||||
growth_threshold = max_health/seed.growth_stages
|
||||
|
||||
if(max_growth > 2 && prob(50))
|
||||
max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky.
|
||||
|
||||
mature_time = world.time + seed.get_trait(TRAIT_MATURATION) + 15 //prevent vines from maturing until at least a few seconds after they've been created.
|
||||
spread_chance = seed.get_trait(TRAIT_POTENCY)
|
||||
if(growth_type == 0) //These don't spread far at all (glowshroom, glowberries, brown mold)
|
||||
spread_distance = round(spread_chance*0.1)
|
||||
else if(growth_type == 2 || growth_type == 3) //Vines and biomass can go further than worms and mold
|
||||
spread_distance = round(spread_chance*0.6)
|
||||
else //Worms and mold go a moderate distance
|
||||
spread_distance = round(spread_chance*0.3)
|
||||
update_icon()
|
||||
|
||||
spawn(1) // Plants will sometimes be spawned in the turf adjacent to the one they need to end up in, for the sake of correct dir/etc being set.
|
||||
set_dir(calc_dir())
|
||||
update_icon()
|
||||
plant_controller.add_plant(src)
|
||||
// Some plants eat through plating.
|
||||
if(!isnull(seed.chems["facid"]))
|
||||
var/turf/T = get_turf(src)
|
||||
T.ex_act(prob(80) ? 3 : 2)
|
||||
|
||||
/obj/effect/plant/update_icon()
|
||||
//TODO: should really be caching this.
|
||||
refresh_icon()
|
||||
if(growth_type == 0 && !floor)
|
||||
src.transform = null
|
||||
var/matrix/M = matrix()
|
||||
// should make the plant flush against the wall it's meant to be growing from.
|
||||
M.Translate(0,-(rand(12,14)))
|
||||
switch(dir)
|
||||
if(WEST)
|
||||
M.Turn(90)
|
||||
if(NORTH)
|
||||
M.Turn(180)
|
||||
if(EAST)
|
||||
M.Turn(270)
|
||||
src.transform = M
|
||||
var/icon_colour = seed.get_trait(TRAIT_PLANT_COLOUR)
|
||||
if(icon_colour)
|
||||
color = icon_colour
|
||||
// Apply colour and light from seed datum.
|
||||
if(seed.get_trait(TRAIT_BIOLUM))
|
||||
var/clr
|
||||
if(seed.get_trait(TRAIT_BIOLUM_COLOUR))
|
||||
clr = seed.get_trait(TRAIT_BIOLUM_COLOUR)
|
||||
set_light(1+round(seed.get_trait(TRAIT_POTENCY)/20), l_color = clr)
|
||||
return
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
/obj/effect/plant/proc/refresh_icon()
|
||||
var/growth = min(max_growth,round(health/growth_threshold))
|
||||
var/at_fringe = get_dist(src,parent)
|
||||
if(spread_distance > 5)
|
||||
if(at_fringe >= (spread_distance-3))
|
||||
max_growth--
|
||||
if(at_fringe >= (spread_distance-2))
|
||||
max_growth--
|
||||
max_growth = max(1,max_growth)
|
||||
if(growth_type > 0)
|
||||
switch(growth_type)
|
||||
if(1)
|
||||
icon_state = "worms"
|
||||
if(2)
|
||||
icon_state = "vines-[growth]"
|
||||
if(3)
|
||||
icon_state = "mass-[growth]"
|
||||
if(4)
|
||||
icon_state = "mold-[growth]"
|
||||
else
|
||||
icon_state = "[seed.get_trait(TRAIT_PLANT_ICON)]-[growth]"
|
||||
|
||||
if(growth>2 && growth == max_growth)
|
||||
layer = 5
|
||||
if(seed.get_trait(TRAIT_SPREAD) == 2)
|
||||
opacity = 1
|
||||
if(!isnull(seed.chems["woodpulp"]))
|
||||
density = 1
|
||||
else
|
||||
layer = 3
|
||||
density = 0
|
||||
|
||||
/obj/effect/plant/proc/calc_dir(turf/location = loc)
|
||||
set background = 1
|
||||
var/direction = 16
|
||||
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
direction |= wallDir
|
||||
|
||||
for(var/obj/effect/plant/shroom in location)
|
||||
if(shroom == src)
|
||||
continue
|
||||
if(shroom.floor) //special
|
||||
direction &= ~16
|
||||
else
|
||||
direction &= ~shroom.dir
|
||||
|
||||
var/list/dirList = list()
|
||||
|
||||
for(var/i=1,i<=16,i <<= 1)
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
newDir = 1
|
||||
return newDir
|
||||
|
||||
floor = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/plant/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
|
||||
plant_controller.add_plant(src)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
|
||||
if(!seed)
|
||||
to_chat(user, "There is nothing to take a sample from.")
|
||||
return
|
||||
seed.harvest(user,0,1)
|
||||
health -= (rand(3,5)*10)
|
||||
else
|
||||
..()
|
||||
if(W.force)
|
||||
health -= W.force
|
||||
check_health()
|
||||
|
||||
/obj/effect/plant/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
die_off()
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
die_off()
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(5))
|
||||
die_off()
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/effect/plant/proc/check_health()
|
||||
if(health <= 0)
|
||||
die_off()
|
||||
|
||||
/obj/effect/plant/proc/is_mature()
|
||||
return (health >= (max_health/3) && world.time > mature_time)
|
||||
@@ -1,109 +0,0 @@
|
||||
#define NEIGHBOR_REFRESH_TIME 100
|
||||
|
||||
/obj/effect/plant/proc/get_cardinal_neighbors()
|
||||
var/list/cardinal_neighbors = list()
|
||||
for(var/check_dir in cardinal)
|
||||
var/turf/simulated/T = get_step(get_turf(src), check_dir)
|
||||
if(istype(T))
|
||||
cardinal_neighbors |= T
|
||||
return cardinal_neighbors
|
||||
|
||||
/obj/effect/plant/proc/update_neighbors()
|
||||
// Update our list of valid neighboring turfs.
|
||||
neighbors = list()
|
||||
for(var/turf/simulated/floor in get_cardinal_neighbors())
|
||||
if(get_dist(parent, floor) > spread_distance)
|
||||
continue
|
||||
if((locate(/obj/effect/plant) in floor.contents) || (locate(/obj/effect/dead_plant) in floor.contents) )
|
||||
continue
|
||||
if(floor.density)
|
||||
if(!isnull(seed.chems["pacid"]))
|
||||
spawn(rand(5,25)) floor.ex_act(3)
|
||||
continue
|
||||
if(!Adjacent(floor) || !floor.Enter(src))
|
||||
continue
|
||||
neighbors |= floor
|
||||
// Update all of our friends.
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/effect/plant/neighbor in range(1,src))
|
||||
neighbor.neighbors -= T
|
||||
|
||||
/obj/effect/plant/process()
|
||||
|
||||
// Something is very wrong, kill ourselves.
|
||||
if(!seed)
|
||||
die_off()
|
||||
return 0
|
||||
|
||||
/* MOVED INTO code\game\objects\effects\effect_system.dm
|
||||
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
|
||||
if(smoke.reagents.has_reagent("plantbgone"))
|
||||
die_off()
|
||||
return
|
||||
*/
|
||||
|
||||
// Handle life.
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(istype(T))
|
||||
health -= seed.handle_environment(T,T.return_air(),null,null,1)
|
||||
if(health < max_health)
|
||||
health += rand(3,5)
|
||||
refresh_icon()
|
||||
if(health > max_health)
|
||||
health = max_health
|
||||
else if(health == max_health && !plant)
|
||||
plant = new(T,seed)
|
||||
plant.dir = src.dir
|
||||
plant.transform = src.transform
|
||||
plant.age = seed.get_trait(TRAIT_MATURATION)-1
|
||||
plant.update_icon()
|
||||
if(growth_type==0) //Vines do not become invisible.
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
else
|
||||
plant.layer = layer + 0.1
|
||||
|
||||
if(buckled_mob)
|
||||
seed.do_sting(buckled_mob,src)
|
||||
if(seed.get_trait(TRAIT_CARNIVOROUS))
|
||||
seed.do_thorns(buckled_mob,src)
|
||||
|
||||
if(world.time >= last_tick+NEIGHBOR_REFRESH_TIME)
|
||||
last_tick = world.time
|
||||
update_neighbors()
|
||||
|
||||
if(is_mature() && neighbors.len && prob(spread_chance))
|
||||
//spread to 1-3 adjacent turfs depending on yield trait.
|
||||
var/max_spread = between(1, round(seed.get_trait(TRAIT_YIELD)*3/14), 3)
|
||||
|
||||
for(var/i in 1 to max_spread)
|
||||
if(prob(spread_chance))
|
||||
sleep(rand(3,5))
|
||||
if(!neighbors.len)
|
||||
break
|
||||
var/turf/target_turf = pick(neighbors)
|
||||
var/obj/effect/plant/child = new(get_turf(src),seed,parent)
|
||||
spawn(1) // This should do a little bit of animation.
|
||||
child.loc = target_turf
|
||||
child.update_icon()
|
||||
// Update neighboring squares.
|
||||
for(var/obj/effect/plant/neighbor in range(1,target_turf))
|
||||
neighbor.neighbors -= target_turf
|
||||
|
||||
// We shouldn't have spawned if the controller doesn't exist.
|
||||
check_health()
|
||||
if(neighbors.len || health != max_health)
|
||||
plant_controller.add_plant(src)
|
||||
|
||||
/obj/effect/plant/proc/die_off()
|
||||
// Kill off our plant.
|
||||
if(plant) plant.die()
|
||||
// This turf is clear now, let our buddies know.
|
||||
for(var/turf/simulated/check_turf in get_cardinal_neighbors())
|
||||
if(!istype(check_turf))
|
||||
continue
|
||||
for(var/obj/effect/plant/neighbor in check_turf.contents)
|
||||
neighbor.neighbors |= check_turf
|
||||
plant_controller.add_plant(neighbor)
|
||||
spawn(1) if(src) qdel(src)
|
||||
|
||||
#undef NEIGHBOR_REFRESH_TIME
|
||||
@@ -1,57 +0,0 @@
|
||||
/obj/effect/plant/HasProximity(var/atom/movable/AM)
|
||||
|
||||
if(!is_mature() || seed.get_trait(TRAIT_SPREAD) != 2)
|
||||
return
|
||||
|
||||
var/mob/living/M = AM
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
if(!buckled_mob && !M.buckled && !M.anchored && ((M.mob_size <= MOB_SIZE_SMALL) || prob(round(seed.get_trait(TRAIT_POTENCY)/6))))
|
||||
//wait a tick for the Entered() proc that called HasProximity() to finish (and thus the moving animation),
|
||||
//so we don't appear to teleport from two tiles away when moving into a turf adjacent to vines.
|
||||
spawn(1)
|
||||
entangle(M)
|
||||
|
||||
/obj/effect/plant/attack_hand(mob/user as mob)
|
||||
// Todo, cause damage.
|
||||
user_unbuckle_mob(user, user)
|
||||
|
||||
/obj/effect/plant/Crossed(var/mob/living/victim)
|
||||
if(!is_mature())
|
||||
return
|
||||
if(!istype(victim))
|
||||
return
|
||||
var/target_limb = pick("r_foot","l_foot","r_leg","l_leg")
|
||||
if(ishuman(victim))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
if(H.shoes && prob(50)) //shoes will reduce chances of being stuck/stung by plants, but not always avoid it
|
||||
return
|
||||
seed.do_thorns(victim,src,target_limb)
|
||||
seed.do_sting(victim,src,target_limb)
|
||||
|
||||
|
||||
/obj/effect/plant/proc/entangle(var/mob/living/victim)
|
||||
|
||||
if(buckled_mob)
|
||||
return
|
||||
|
||||
if(victim.buckled)
|
||||
return
|
||||
|
||||
//grabbing people
|
||||
if(!victim.anchored && Adjacent(victim) && victim.loc != get_turf(src))
|
||||
var/can_grab = 1
|
||||
if(istype(victim, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP))
|
||||
can_grab = 0
|
||||
if(can_grab)
|
||||
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
|
||||
victim.loc = src.loc
|
||||
|
||||
//entangling people
|
||||
if(victim.loc == src.loc)
|
||||
to_chat(victim, "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>")
|
||||
can_buckle = 1
|
||||
buckle_mob(victim)
|
||||
@@ -1,771 +0,0 @@
|
||||
/obj/machinery/portable_atmospherics/hydroponics
|
||||
name = "hydroponics tray"
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
density = 1
|
||||
anchored = 1
|
||||
flags = OPENCONTAINER
|
||||
volume = 100
|
||||
|
||||
hud_possible = list (PLANT_NUTRIENT_HUD, PLANT_WATER_HUD, PLANT_STATUS_HUD, PLANT_HEALTH_HUD, PLANT_TOXIN_HUD, PLANT_PEST_HUD, PLANT_WEED_HUD)
|
||||
|
||||
var/mechanical = 1 // Set to 0 to stop it from drawing the alert lights.
|
||||
var/base_name = "tray"
|
||||
|
||||
// Plant maintenance vars.
|
||||
var/waterlevel = 100 // Water level (max 100)
|
||||
var/maxwater = 100
|
||||
var/nutrilevel = 10 // Nutrient level (max 10)
|
||||
var/maxnutri = 10
|
||||
var/pestlevel = 0 // Pests (max 10)
|
||||
var/weedlevel = 0 // Weeds (max 10)
|
||||
|
||||
// Tray state vars.
|
||||
var/dead = 0 // Is it dead?
|
||||
var/harvest = 0 // Is it ready to harvest?
|
||||
var/age = 0 // Current plant age
|
||||
var/sampled = 0 // Have we taken a sample?
|
||||
|
||||
// Harvest/mutation mods.
|
||||
var/yield_mod = 0 // Modifier to yield
|
||||
var/mutation_mod = 0 // Modifier to mutation chance
|
||||
var/toxins = 0 // Toxicity in the tray?
|
||||
var/tray_light = 1 // Supplied lighting.
|
||||
|
||||
// Mechanical concerns.
|
||||
var/health = 0 // Plant health.
|
||||
var/lastproduce = 0 // Last time tray was harvested
|
||||
var/current_cycle = 0 // Used for tracking number of cycles for aging
|
||||
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 // Set this to bypass the cycle time check.
|
||||
var/obj/temp_chem_holder // Something to hold reagents during process_reagents()
|
||||
var/labelled
|
||||
|
||||
// Seed details/line data.
|
||||
var/datum/seed/seed = null // The currently planted seed
|
||||
|
||||
// Construction
|
||||
var/unwrenchable = 1
|
||||
|
||||
var/last_plant_ikey //This is for debugging reference, and is otherwise useless. --FalseIncarnate
|
||||
|
||||
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpolinate one plant
|
||||
|
||||
/*
|
||||
* process() can be found in \code\modules\hydroponics\tray\tray_process.dm
|
||||
* reagent handling can be found in \code\modules\hydroponics\tray\tray_reagents.dm
|
||||
* icon handling can be found in \code\modules\hydroponics\tray\tray_update_icons.dm
|
||||
*/
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/AltClick()
|
||||
if(mechanical && !usr.stat && !usr.lying && Adjacent(usr))
|
||||
close_lid(usr)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/attack_generic(var/mob/user)
|
||||
if(istype(user,/mob/living/simple_animal/diona))
|
||||
var/mob/living/simple_animal/diona/nymph = user
|
||||
|
||||
if(nymph.stat == DEAD || nymph.paralysis || nymph.weakened || nymph.stunned || nymph.restrained())
|
||||
return
|
||||
|
||||
if(weedlevel > 0)
|
||||
nymph.reagents.add_reagent("nutriment", weedlevel)
|
||||
weedlevel = 0
|
||||
plant_hud_set_weed()
|
||||
nymph.visible_message("<font color='blue'><b>[nymph]</b> begins rooting through [src], ripping out weeds and eating them noisily.</font>","<font color='blue'>You begin rooting through [src], ripping out weeds and eating them noisily.</font>")
|
||||
else if(nymph.nutrition > 100 && nutrilevel < 10)
|
||||
nymph.nutrition -= ((10-nutrilevel)*5)
|
||||
nutrilevel = 10
|
||||
plant_hud_set_nutrient()
|
||||
nymph.visible_message("<font color='blue'><b>[nymph]</b> secretes a trickle of green liquid, refilling [src].</font>","<font color='blue'>You secrete a trickle of green liquid, refilling [src].</font>")
|
||||
else
|
||||
nymph.visible_message("<font color='blue'><b>[nymph]</b> rolls around in [src] for a bit.</font>","<font color='blue'>You roll around in [src] for a bit.</font>")
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/New()
|
||||
..()
|
||||
|
||||
var/datum/atom_hud/data/hydroponic/hydro_hud = huds[DATA_HUD_HYDROPONIC]
|
||||
prepare_huds()
|
||||
hydro_hud.add_to_hud(src)
|
||||
plant_hud_set_nutrient()
|
||||
plant_hud_set_water()
|
||||
plant_hud_set_status()
|
||||
plant_hud_set_health()
|
||||
plant_hud_set_toxin()
|
||||
plant_hud_set_pest()
|
||||
plant_hud_set_weed()
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
temp_chem_holder = new()
|
||||
temp_chem_holder.create_reagents(10)
|
||||
|
||||
create_reagents(200)
|
||||
connect()
|
||||
update_icon()
|
||||
if(closed_system)
|
||||
flags &= ~OPENCONTAINER
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/RefreshParts()
|
||||
var/tmp_capacity = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
tmp_capacity += M.rating
|
||||
maxwater = tmp_capacity * 50 // Up to 300
|
||||
maxnutri = tmp_capacity * 5 // Up to 30
|
||||
//waterlevel = maxwater
|
||||
//nutrilevel = 3
|
||||
plant_hud_set_nutrient()
|
||||
plant_hud_set_water()
|
||||
|
||||
/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.get_trait(TRAIT_IMMUTABLE) > 0)
|
||||
return
|
||||
|
||||
//--FalseIncarnate
|
||||
//Override for somatoray projectiles, updated to work with new mutation rework
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mutate("F1")
|
||||
return
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
mutate("F2")
|
||||
return
|
||||
//--FalseIncarnate
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/check_health()
|
||||
if(seed && !dead && health <= 0)
|
||||
die()
|
||||
check_level_sanity()
|
||||
update_icon()
|
||||
plant_hud_set_status()
|
||||
plant_hud_set_health()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/die()
|
||||
dead = 1
|
||||
harvest = 0
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
pestlevel = 0
|
||||
plant_hud_set_status()
|
||||
plant_hud_set_health()
|
||||
plant_hud_set_weed()
|
||||
plant_hud_set_pest()
|
||||
|
||||
//Harvests the product of a plant.
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(var/mob/user)
|
||||
|
||||
//Harvest the product of the plant,
|
||||
if(!seed || !harvest)
|
||||
return
|
||||
|
||||
if(closed_system)
|
||||
if(user)
|
||||
to_chat(user, "You can't harvest from the plant while the lid is shut.")
|
||||
return
|
||||
|
||||
if(user)
|
||||
seed.harvest(user,yield_mod)
|
||||
else
|
||||
seed.harvest(get_turf(src),yield_mod)
|
||||
//Increases harvest count for round-end score
|
||||
//Currently per-plant (not per-item) harvested
|
||||
// --FalseIncarnate
|
||||
score_stuffharvested++
|
||||
|
||||
// Reset values.
|
||||
harvest = 0
|
||||
lastproduce = age
|
||||
|
||||
if(!seed.get_trait(TRAIT_HARVEST_REPEAT))
|
||||
yield_mod = 0
|
||||
seed = null
|
||||
dead = 0
|
||||
age = 0
|
||||
lastproduce = 0
|
||||
sampled = 0
|
||||
mutation_mod = 0
|
||||
|
||||
check_health()
|
||||
return
|
||||
|
||||
//Clears out a dead plant.
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/remove_dead(var/mob/user)
|
||||
if(!user || !dead) return
|
||||
|
||||
if(closed_system)
|
||||
to_chat(user, "You can't remove the dead plant while the lid is shut.")
|
||||
return
|
||||
|
||||
seed = null
|
||||
dead = 0
|
||||
|
||||
sampled = 0
|
||||
age = 0
|
||||
lastproduce = 0
|
||||
yield_mod = 0
|
||||
mutation_mod = 0
|
||||
|
||||
to_chat(user, "You remove the dead plant.")
|
||||
check_health()
|
||||
return
|
||||
|
||||
// If a weed growth is sufficient, this proc is called.
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/weed_invasion()
|
||||
|
||||
//Remove the seed if something is already planted.
|
||||
if(seed) seed = null
|
||||
seed = plant_controller.seeds[pick(list("reishi","nettles","amanita","mushrooms","plumphelmet","towercap","harebells","weeds"))]
|
||||
if(!seed) return //Weed does not exist, someone fucked up.
|
||||
|
||||
dead = 0
|
||||
age = 0
|
||||
health = seed.get_trait(TRAIT_ENDURANCE)
|
||||
lastcycle = world.time
|
||||
harvest = 0
|
||||
lastproduce = 0
|
||||
weedlevel = 0
|
||||
pestlevel = 0
|
||||
sampled = 0
|
||||
update_icon()
|
||||
plant_hud_set_weed()
|
||||
plant_hud_set_status()
|
||||
plant_hud_set_health()
|
||||
visible_message("<span class='notice'>[src] has been overtaken by [seed.display_name].</span>")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate(var/severity)
|
||||
|
||||
// No seed, no mutations.
|
||||
if(!seed)
|
||||
return
|
||||
|
||||
/*
|
||||
--FalseIncarnate
|
||||
New mutation system, now uses "Mutation Tiers" to adjust the chances of mutations
|
||||
Tier 1 has a low chance of causing a stat mutation
|
||||
Tier 2 has a higher chance of causing a stat mutation
|
||||
Tier 3 has a low chance of causing a species shift (if possible), and will ALWAYS cause a stat mutation if it does not shift species
|
||||
Tier 4 has a higher chance of causing a species shift (if possible), and will ALWAYS cause a stat mutation if it does not shift species
|
||||
Tier 4 also has a low chance to cause a SECOND stat mutation when it does not shift species
|
||||
All mutation chances are increased by the mutation_mod value. Mutation_mod is not transferred into seeds/harvests, and is reset when the plant dies
|
||||
*/
|
||||
|
||||
switch(severity)
|
||||
//Reagent Tiers
|
||||
if(1) //Tier 1
|
||||
if(prob(20+mutation_mod)) //Low chance of stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
if(2) //Tier 2
|
||||
if(prob(60+mutation_mod)) //Higher chance of stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
if(3) //Tier 3
|
||||
if(prob(20+mutation_mod)) //Low chance of species shift mutation
|
||||
if(seed.mutants. && seed.mutants.len) //Check if current seed/plant has mutant species
|
||||
mutate_species()
|
||||
else //No mutant species, mutate stats instead
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
else //Failed to shift, mutate stats instead
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
if(4) //Tier 4
|
||||
if(prob(60+mutation_mod)) //Higher chance of species shift mutation
|
||||
if(seed.mutants. && seed.mutants.len) //Check if current seed/plant has mutant species
|
||||
mutate_species()
|
||||
else //No mutant species, mutate stats instead
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
if(prob(20+mutation_mod)) //Low chance for second stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
else //Failed to shift, mutate stats instead
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
if(prob(20+mutation_mod)) //Low chance for second stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
//Floral Somatoray Tiers
|
||||
if("F1") //Random Stat Tier
|
||||
if(prob(80+mutation_mod)) //EVEN Higher chance of stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
seed.mutate(1,get_turf(src))
|
||||
return
|
||||
if("F2") //Yield Tier
|
||||
if(prob(40+mutation_mod)) //Medium chance of Yield stat mutation
|
||||
if(!isnull(plant_controller.seeds[seed.name]))
|
||||
seed = seed.diverge()
|
||||
else
|
||||
seed.update_name_prefixes()
|
||||
if(seed.get_trait(TRAIT_IMMUTABLE) <= 0 && seed.get_trait(TRAIT_YIELD) != -1) //Check if the plant can be mutated and has a yield to mutate
|
||||
seed.set_trait(TRAIT_YIELD, (seed.get_trait(TRAIT_YIELD) + rand(-2, 2))) //Randomly adjust yield
|
||||
if(seed.get_trait(TRAIT_YIELD) < 0) //If yield would drop below 0 after adjustment, set to 0 to allow further attempts
|
||||
seed.set_trait(TRAIT_YIELD, 0)
|
||||
return
|
||||
|
||||
/* code references
|
||||
// We need to make sure we're not modifying one of the global seed datums.
|
||||
// If it's not in the global list, then no products of the line have been
|
||||
// harvested yet and it's safe to assume it's restricted to this tray.
|
||||
if(!isnull(seed_types[seed.name]))
|
||||
seed = seed.diverge()
|
||||
seed.mutate(severity,get_turf(src))
|
||||
*/
|
||||
|
||||
//--FalseIncarnate
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/verb/remove_label()
|
||||
set name = "Remove Label"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(labelled)
|
||||
to_chat(usr, "You remove the label.")
|
||||
labelled = null
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, "There is no label to remove.")
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/verb/setlight()
|
||||
set name = "Set Light"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
var/new_light = input("Specify a light level.") as null|anything in list(0,1,2,3,4,5,6,7,8,9,10)
|
||||
if(new_light)
|
||||
tray_light = new_light
|
||||
to_chat(usr, "You set the tray to a light level of [tray_light] lumens.")
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/check_level_sanity()
|
||||
//Make sure various values are sane.
|
||||
if(seed)
|
||||
health = max(0,min(seed.get_trait(TRAIT_ENDURANCE),health))
|
||||
else
|
||||
health = 0
|
||||
dead = 0
|
||||
|
||||
nutrilevel = max(0,min(nutrilevel,maxnutri))
|
||||
waterlevel = max(0,min(waterlevel,maxwater))
|
||||
pestlevel = max(0,min(pestlevel,10))
|
||||
weedlevel = max(0,min(weedlevel,10))
|
||||
toxins = max(0,min(toxins,10))
|
||||
yield_mod = min(100, yield_mod)
|
||||
|
||||
plant_hud_set_nutrient()
|
||||
plant_hud_set_water()
|
||||
plant_hud_set_status()
|
||||
plant_hud_set_health()
|
||||
plant_hud_set_toxin()
|
||||
plant_hud_set_pest()
|
||||
plant_hud_set_weed()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate_species()
|
||||
|
||||
var/previous_plant = seed.display_name
|
||||
var/newseed = seed.get_mutant_variant()
|
||||
if(newseed in plant_controller.seeds)
|
||||
seed = plant_controller.seeds[newseed]
|
||||
else
|
||||
return
|
||||
|
||||
dead = 0
|
||||
//mutate(1)
|
||||
age = 0
|
||||
health = seed.get_trait(TRAIT_ENDURANCE)
|
||||
lastcycle = world.time
|
||||
lastproduce = 0
|
||||
harvest = 0
|
||||
weedlevel = 0
|
||||
|
||||
plant_hud_set_health()
|
||||
plant_hud_set_weed()
|
||||
|
||||
update_icon()
|
||||
visible_message("\red The \blue [previous_plant] \red has suddenly mutated into \blue [seed.display_name]!")
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
if(anchored==2)
|
||||
to_chat(user, "Unscrew the hoses first!")
|
||||
return
|
||||
default_deconstruction_crowbar(O, 1)
|
||||
|
||||
//--FalseIncarnate
|
||||
//Check if held item is an open container
|
||||
if(O.is_open_container())
|
||||
//Check if container is of the "glass" subtype (includes buckets, beakers, vials)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
var/obj/item/weapon/reagent_containers/glass/C = O
|
||||
//Check if container is empty
|
||||
if(!C.reagents.total_volume)
|
||||
to_chat(user, "\red [C] is empty.")
|
||||
return
|
||||
//Container not empty, transfer contents to tray
|
||||
var/trans = C.reagents.trans_to(src, C.amount_per_transfer_from_this)
|
||||
to_chat(user, "\blue You transfer [trans] units of the solution to [src].")
|
||||
|
||||
check_level_sanity()
|
||||
process_reagents()
|
||||
update_icon()
|
||||
|
||||
//Check if container is one of the plantsprays (defined in tray_reagents.dm)
|
||||
else if(istype(O, /obj/item/weapon/plantspray))
|
||||
var/obj/item/weapon/plantspray/P = O
|
||||
user.drop_item(O)
|
||||
toxins += P.toxicity
|
||||
pestlevel -= P.pest_kill_str
|
||||
weedlevel -= P.weed_kill_str
|
||||
to_chat(user, "You spray [src] with [O].")
|
||||
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
|
||||
qdel(O)
|
||||
|
||||
check_level_sanity()
|
||||
update_icon()
|
||||
|
||||
//Check if spray is weedkiller (defined in tray_reagents.dm, un-obtainable currently)
|
||||
else if(istype(O, /obj/item/weedkiller))
|
||||
var/obj/item/weedkiller/W = O
|
||||
user.drop_item(O)
|
||||
toxins += W.toxicity
|
||||
weedlevel -= W.weed_kill_str
|
||||
to_chat(user, "You spray [src] with [O].")
|
||||
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
|
||||
qdel(O)
|
||||
|
||||
check_level_sanity()
|
||||
update_icon()
|
||||
|
||||
//Check if container is any spray container
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/spray))
|
||||
var/obj/item/weapon/reagent_containers/spray/S = O
|
||||
//Check if there is a plant in the tray
|
||||
if(seed)
|
||||
if(!S.reagents.total_volume)
|
||||
to_chat(user, "\red [S] is empty.")
|
||||
return
|
||||
//Container not empty, transfer contents to tray
|
||||
S.reagents.trans_to(src, S.amount_per_transfer_from_this)
|
||||
visible_message("\red <B>\The [src] has been sprayed with \the [O][(user ? " by [user]." : ".")]")
|
||||
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
|
||||
check_level_sanity()
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "There's nothing in [src] to spray!")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/screwdriver) && unwrenchable) //THIS NEED TO BE DONE DIFFERENTLY, SOMEONE REFACTOR THE TRAY CODE ALREADY
|
||||
if(anchored)
|
||||
if(anchored == 2)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
anchored = 1
|
||||
to_chat(user, "You unscrew the [src]'s hoses.")
|
||||
panel_open = 0
|
||||
|
||||
else if(anchored == 1)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
anchored = 2
|
||||
to_chat(user, "You screw in the [src]'s hoses.")
|
||||
panel_open = 1
|
||||
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/h in range(1,src))
|
||||
spawn()
|
||||
h.update_icon()
|
||||
|
||||
if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/weapon/scalpel))
|
||||
|
||||
if(!seed)
|
||||
to_chat(user, "There is nothing to take a sample from in \the [src].")
|
||||
return
|
||||
|
||||
if(sampled)
|
||||
to_chat(user, "You have already sampled from this plant.")
|
||||
return
|
||||
|
||||
if(dead)
|
||||
to_chat(user, "The plant is dead.")
|
||||
return
|
||||
|
||||
// Create a sample.
|
||||
seed.harvest(user,yield_mod,1)
|
||||
health -= (rand(3,5)*10)
|
||||
|
||||
if(prob(30))
|
||||
sampled = 1
|
||||
|
||||
// Bookkeeping.
|
||||
check_health()
|
||||
force_update = 1
|
||||
process()
|
||||
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = O
|
||||
|
||||
if(S.mode == 1)
|
||||
if(seed)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, "There's no plant to inject.")
|
||||
return 1
|
||||
else
|
||||
if(seed)
|
||||
//Leaving this in in case we want to extract from plants later.
|
||||
to_chat(user, "You can't get any extract out of this plant.")
|
||||
else
|
||||
to_chat(user, "There's nothing to draw something from.")
|
||||
return 1
|
||||
|
||||
else if(istype(O, /obj/item/seeds))
|
||||
|
||||
if(!seed)
|
||||
|
||||
var/obj/item/seeds/S = O
|
||||
user.drop_item(O)
|
||||
|
||||
if(!S.seed)
|
||||
to_chat(user, "The packet seems to be empty. You throw it away.")
|
||||
qdel(O)
|
||||
return
|
||||
|
||||
to_chat(user, "You plant the [S.seed.seed_name] [S.seed.seed_noun].")
|
||||
seed = S.seed //Grab the seed datum.
|
||||
dead = 0
|
||||
age = 1
|
||||
lastproduce = 0
|
||||
//Snowflakey, maybe move this to the seed datum
|
||||
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
|
||||
lastcycle = world.time
|
||||
|
||||
qdel(O)
|
||||
|
||||
check_health()
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='danger'>\The [src] already has seeds in it!</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/minihoe)) // The minihoe
|
||||
|
||||
if(weedlevel > 0)
|
||||
user.visible_message("<span class='danger'>[user] starts uprooting the weeds.</span>", "<span class='danger'>You remove the weeds from the [src].</span>")
|
||||
weedlevel = 0
|
||||
update_icon()
|
||||
plant_hud_set_weed()
|
||||
else
|
||||
to_chat(user, "<span class='danger'>This plot is completely devoid of weeds. It doesn't need uprooting.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
|
||||
attack_hand(user)
|
||||
|
||||
var/obj/item/weapon/storage/bag/plants/S = O
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
|
||||
if(!S.can_be_inserted(G))
|
||||
return
|
||||
S.handle_item_insertion(G, 1)
|
||||
|
||||
else if(mechanical && istype(O, /obj/item/weapon/wrench))
|
||||
|
||||
//If there's a connector here, the portable_atmospherics setup can handle it.
|
||||
if(locate(/obj/machinery/atmospherics/unary/portables_connector) in loc)
|
||||
return ..()
|
||||
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
|
||||
|
||||
else if((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
|
||||
if(src.holding)
|
||||
to_chat(user, "\blue There is alreadu a tank loaded into the [src].")
|
||||
return
|
||||
var/obj/item/weapon/tank/T = O
|
||||
user.drop_item()
|
||||
T.loc = src
|
||||
src.holding = T
|
||||
update_icon()
|
||||
return
|
||||
else if(O && O.force && seed)
|
||||
user.visible_message("<span class='danger'>\The [seed.display_name] has been attacked by [user] with \the [O]!</span>")
|
||||
if(!dead)
|
||||
health -= O.force
|
||||
check_health()
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/attack_tk(mob/user as mob)
|
||||
if(dead)
|
||||
remove_dead(user)
|
||||
else if(harvest)
|
||||
harvest(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/attack_hand(mob/user as mob)
|
||||
|
||||
if(istype(usr,/mob/living/silicon))
|
||||
return
|
||||
|
||||
if(harvest)
|
||||
harvest(user)
|
||||
else if(dead)
|
||||
remove_dead(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/examine(mob/user)
|
||||
..(user)
|
||||
|
||||
if(!seed)
|
||||
to_chat(user, "[src] is empty.")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>[seed.display_name]</span> are growing here.</span>")
|
||||
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
|
||||
to_chat(user, "Water: [round(waterlevel,0.1)]/[maxwater]")
|
||||
to_chat(user, "Nutrient: [round(nutrilevel,0.1)]/[maxnutri]")
|
||||
|
||||
if(weedlevel >= 5)
|
||||
to_chat(user, "\The [src] is <span class='danger'>infested with weeds</span>!")
|
||||
if(pestlevel >= 5)
|
||||
to_chat(user, "\The [src] is <span class='danger'>infested with tiny worms</span>!")
|
||||
|
||||
if(dead)
|
||||
to_chat(user, "<span class='danger'>The plant is dead.</span>")
|
||||
else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
|
||||
to_chat(user, "The plant looks <span class='danger'>unhealthy</span>.")
|
||||
|
||||
if(mechanical)
|
||||
var/turf/T = loc
|
||||
var/datum/gas_mixture/environment
|
||||
|
||||
if(closed_system && (connected_port || holding))
|
||||
environment = air_contents
|
||||
|
||||
if(!environment)
|
||||
if(istype(T))
|
||||
environment = T.return_air()
|
||||
|
||||
if(!environment) //We're in a crate or nullspace, bail out.
|
||||
return
|
||||
|
||||
var/light_string
|
||||
if(closed_system && mechanical)
|
||||
light_string = "that the internal lights are set to [tray_light] lumens"
|
||||
else
|
||||
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
|
||||
var/light_available
|
||||
if(L)
|
||||
light_available = L.get_clamped_lum()*10
|
||||
else
|
||||
light_available = 5
|
||||
light_string = "a light level of [light_available] lumens"
|
||||
|
||||
to_chat(user, "The tray's sensor suite is reporting [light_string] and a temperature of [environment.temperature]K.")
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb()
|
||||
set name = "Toggle Tray Lid"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
close_lid(usr)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/close_lid(var/mob/living/user)
|
||||
if(!user || user.stat || user.restrained())
|
||||
return
|
||||
|
||||
closed_system = !closed_system
|
||||
to_chat(user, "You [closed_system ? "close" : "open"] the tray's lid.")
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/verb/eject_tank_verb()
|
||||
set name = "Eject Internal Tank"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
eject_tank(usr)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/eject_tank(var/mob/living/user)
|
||||
if(!user || user.stat || user.restrained())
|
||||
return
|
||||
|
||||
if(!holding)
|
||||
to_chat(usr, "\red There is no tank loaded into [src] to eject.")
|
||||
|
||||
if(istype(holding, /obj/item/weapon/tank))
|
||||
to_chat(usr, "\blue You eject [holding.name] from [src].")
|
||||
holding.loc = loc
|
||||
holding = null
|
||||
@@ -1,240 +0,0 @@
|
||||
//http://www.youtube.com/watch?v=-1GadTfGFvU
|
||||
//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code
|
||||
|
||||
/obj/machinery/apiary
|
||||
name = "apiary tray"
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/nutrilevel = 0
|
||||
var/yieldmod = 1
|
||||
var/mut = 1
|
||||
var/toxic = 0
|
||||
var/dead = 0
|
||||
var/health = -1
|
||||
var/maxhealth = 100
|
||||
var/lastcycle = 0
|
||||
var/cycledelay = 100
|
||||
var/harvestable_honey = 0
|
||||
var/beezeez = 0
|
||||
var/swarming = 0
|
||||
|
||||
var/bees_in_hive = 0
|
||||
var/list/owned_bee_swarms = list()
|
||||
var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics
|
||||
|
||||
//overwrite this after it's created if the apiary needs a custom machinery sprite
|
||||
/obj/machinery/apiary/New()
|
||||
..()
|
||||
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
|
||||
|
||||
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mut++
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
if(!yieldmod)
|
||||
yieldmod += 1
|
||||
// to_chat(world, "Yield increased by 1, from 0, to a total of [myseed.yield]")
|
||||
else if(prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
|
||||
yieldmod += 1
|
||||
// to_chat(world, "Yield increased by 1, to a total of [myseed.yield]")
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/queen_bee))
|
||||
if(health > 0)
|
||||
to_chat(user, "\red There is already a queen in there.")
|
||||
else
|
||||
health = 10
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
qdel(O)
|
||||
to_chat(user, "\blue You carefully insert the queen into [src], she gets busy making a hive.")
|
||||
bees_in_hive = 0
|
||||
else if(istype(O, /obj/item/beezeez))
|
||||
beezeez += 100
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
if(health > 0)
|
||||
to_chat(user, "\blue You insert [O] into [src]. A relaxed humming appears to pick up.")
|
||||
else
|
||||
to_chat(user, "\blue You insert [O] into [src]. Now it just needs some bees.")
|
||||
qdel(O)
|
||||
else if(istype(O, /obj/item/weapon/minihoe))
|
||||
if(health > 0)
|
||||
to_chat(user, "<span class='danger'>You begin to dislodge the apiary from the tray, the bees don't like that.</span>")
|
||||
angry_swarm(user)
|
||||
else
|
||||
to_chat(user, "\blue You begin to dislodge the dead apiary from the tray.")
|
||||
if(do_after(user, 50, target = src))
|
||||
new hydrotray_type(src.loc)
|
||||
new /obj/item/apiary(src.loc)
|
||||
to_chat(user, "\red You dislodge the apiary from the tray.")
|
||||
qdel(src)
|
||||
else if(istype(O, /obj/item/weapon/bee_net))
|
||||
var/obj/item/weapon/bee_net/N = O
|
||||
if(N.caught_bees > 0)
|
||||
to_chat(user, "\blue You empty the bees into the apiary.")
|
||||
bees_in_hive += N.caught_bees
|
||||
N.caught_bees = 0
|
||||
else
|
||||
to_chat(user, "\blue There are no more bees in the net.")
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
var/obj/item/weapon/reagent_containers/glass/G = O
|
||||
if(harvestable_honey > 0)
|
||||
if(health > 0)
|
||||
to_chat(user, "\red You begin to harvest the honey. The bees don't seem to like it.")
|
||||
angry_swarm(user)
|
||||
else
|
||||
to_chat(user, "\blue You begin to harvest the honey.")
|
||||
if(do_after(user,50, target = src))
|
||||
G.reagents.add_reagent("honey",harvestable_honey)
|
||||
harvestable_honey = 0
|
||||
to_chat(user, "\blue You successfully harvest the honey.")
|
||||
else
|
||||
to_chat(user, "\blue There is no honey left to harvest.")
|
||||
else
|
||||
angry_swarm(user)
|
||||
..()
|
||||
|
||||
/obj/machinery/apiary/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/apiary/process()
|
||||
|
||||
if(swarming > 0)
|
||||
swarming -= 1
|
||||
if(swarming <= 0)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
qdel(B)
|
||||
else if(bees_in_hive < 10)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
qdel(B)
|
||||
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
if(health < 0)
|
||||
return
|
||||
|
||||
//magical bee formula
|
||||
if(beezeez > 0)
|
||||
beezeez -= 1
|
||||
|
||||
nutrilevel += 2
|
||||
health += 1
|
||||
toxic = max(0, toxic - 1)
|
||||
|
||||
//handle nutrients
|
||||
nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5
|
||||
if(nutrilevel > 0)
|
||||
bees_in_hive += 1 * yieldmod
|
||||
if(health < maxhealth)
|
||||
health++
|
||||
else
|
||||
//nutrilevel is less than 1, so we're effectively subtracting here
|
||||
health += max(nutrilevel - 1, round(-health / 2))
|
||||
bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2))
|
||||
if(owned_bee_swarms.len)
|
||||
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
|
||||
//clear out some toxins
|
||||
if(toxic > 0)
|
||||
toxic -= 1
|
||||
health -= 1
|
||||
|
||||
if(health <= 0)
|
||||
return
|
||||
|
||||
//make a bit of honey
|
||||
if(harvestable_honey < 50)
|
||||
harvestable_honey += 0.5
|
||||
|
||||
//make some new bees
|
||||
if(bees_in_hive >= 10 && prob(bees_in_hive * 10))
|
||||
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
|
||||
owned_bee_swarms.Add(B)
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= 1
|
||||
|
||||
//find some plants, harvest
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
|
||||
if(H.seed && !H.dead && prob(owned_bee_swarms.len * 10))
|
||||
src.nutrilevel++
|
||||
H.nutrilevel++
|
||||
if(mut < H.mutation_mod - 1)
|
||||
mut = H.mutation_mod - 1
|
||||
else if(mut > H.mutation_mod - 1)
|
||||
H.mutation_mod = mut
|
||||
|
||||
//flowers give us pollen (nutrients)
|
||||
/* - All plants should be giving nutrients to the hive.
|
||||
if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed)
|
||||
src.nutrilevel++
|
||||
H.nutrilevel++
|
||||
*/
|
||||
//have a few beneficial effects on nearby plants
|
||||
if(prob(10))
|
||||
H.lastcycle -= 5
|
||||
if(prob(10))
|
||||
H.seed.set_trait(TRAIT_ENDURANCE,max(H.seed.get_trait(TRAIT_ENDURANCE)*1.5,H.seed.get_trait(TRAIT_ENDURANCE)+1))
|
||||
if(H.toxins && prob(10))
|
||||
H.toxins = min(0, H.toxins - 1)
|
||||
toxic++
|
||||
|
||||
/obj/machinery/apiary/proc/die()
|
||||
if(owned_bee_swarms.len)
|
||||
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
B.strength -= 1
|
||||
if(B.strength <= 0)
|
||||
qdel(B)
|
||||
else if(B.strength <= 5)
|
||||
B.icon_state = "bees[B.strength]"
|
||||
bees_in_hive = 0
|
||||
health = 0
|
||||
|
||||
/obj/machinery/apiary/proc/angry_swarm(var/mob/M)
|
||||
for(var/mob/living/simple_animal/bee/B in owned_bee_swarms)
|
||||
B.feral = 25
|
||||
B.target_mob = M
|
||||
|
||||
swarming = 25
|
||||
|
||||
while(bees_in_hive > 0)
|
||||
var/spawn_strength = bees_in_hive
|
||||
if(bees_in_hive >= 5)
|
||||
spawn_strength = 6
|
||||
|
||||
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
|
||||
B.target_mob = M
|
||||
B.strength = spawn_strength
|
||||
B.feral = 25
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= spawn_strength
|
||||
|
||||
/obj/machinery/apiary/verb/harvest_honeycomb()
|
||||
set src in oview(1)
|
||||
set name = "Harvest honeycomb"
|
||||
set category = "Object"
|
||||
|
||||
while(health > 15)
|
||||
health -= 15
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc)
|
||||
if(toxic > 0)
|
||||
H.reagents.add_reagent("toxin", toxic)
|
||||
|
||||
to_chat(usr, "\blue You harvest the honeycomb from the hive. There is a wild buzzing!")
|
||||
angry_swarm(usr)
|
||||
@@ -1,142 +0,0 @@
|
||||
/obj/machinery/portable_atmospherics/hydroponics/process()
|
||||
|
||||
/* MOVED INTO code\game\objects\effects\effect_system.dm
|
||||
// Handle nearby smoke if any.
|
||||
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
|
||||
if(smoke.reagents.total_volume)
|
||||
smoke.reagents.copy_to(src, 5)
|
||||
*/
|
||||
|
||||
//Do this even if we're not ready for a plant cycle.
|
||||
process_reagents()
|
||||
|
||||
// Update values every cycle rather than every process() tick.
|
||||
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.
|
||||
// Bonus chance if the tray is unoccupied.
|
||||
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 6 : 3))
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
plant_hud_set_weed()
|
||||
|
||||
// There's a chance for a weed explosion to happen if the weeds take over.
|
||||
// Plants that are themselves weeds (weed_tolerance > 10) are unaffected.
|
||||
if(weedlevel >= 10 && prob(10))
|
||||
if(!seed || weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
|
||||
weed_invasion()
|
||||
|
||||
// If there is no seed data (and hence nothing planted),
|
||||
// or the plant is dead, process nothing further.
|
||||
if(!seed || dead)
|
||||
if(mechanical) update_icon() //Harvesting would fail to set alert icons properly.
|
||||
return
|
||||
|
||||
// Advance plant age.
|
||||
current_cycle++
|
||||
if(current_cycle == 3)
|
||||
age += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
current_cycle = 0
|
||||
|
||||
//Highly mutable plants have a chance of mutating every tick.
|
||||
if(seed.get_trait(TRAIT_IMMUTABLE) == -1)
|
||||
var/mut_prob = rand(1,100)
|
||||
if(mut_prob <= 5) mutate(mut_prob == 1 ? 2 : 1)
|
||||
|
||||
// Maintain tray nutrient and water levels.
|
||||
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25))
|
||||
nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
|
||||
plant_hud_set_nutrient()
|
||||
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25))
|
||||
waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
|
||||
plant_hud_set_water()
|
||||
|
||||
// Make sure the plant is not starving or thirsty. Adequate
|
||||
// water and nutrients will cause a plant to become healthier.
|
||||
var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER
|
||||
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) && prob(35))
|
||||
health += (nutrilevel < 2 ? -healthmod : healthmod)
|
||||
if(seed.get_trait(TRAIT_REQUIRES_WATER) && prob(35))
|
||||
health += (waterlevel < 10 ? -healthmod : healthmod)
|
||||
|
||||
// Check that pressure, heat and light are all within bounds.
|
||||
// First, handle an open system or an unconnected closed system.
|
||||
var/turf/T = loc
|
||||
var/datum/gas_mixture/environment
|
||||
// If we're closed, take from our internal sources.
|
||||
if(closed_system && (connected_port || holding))
|
||||
if(holding)
|
||||
air_contents = holding.air_contents
|
||||
environment = air_contents
|
||||
// If atmos input is not there, grab from turf.
|
||||
if(!environment && istype(T)) environment = T.return_air()
|
||||
if(!environment) return
|
||||
|
||||
// Seed datum handles gasses, light and pressure.
|
||||
if(mechanical && closed_system)
|
||||
health -= seed.handle_environment(T,environment,tray_light, holding)
|
||||
else
|
||||
health -= seed.handle_environment(T,environment)
|
||||
|
||||
T.air_update_turf()
|
||||
|
||||
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
|
||||
if(closed_system && connected_port)
|
||||
connected_port.parent.update = 1
|
||||
|
||||
// Toxin levels beyond the plant's tolerance cause damage, but
|
||||
// toxins are sucked up each tick and slowly reduce over time.
|
||||
if(toxins > 0)
|
||||
var/toxin_uptake = max(1,round(toxins/10))
|
||||
if(toxins > seed.get_trait(TRAIT_TOXINS_TOLERANCE))
|
||||
health -= toxin_uptake
|
||||
toxins -= toxin_uptake
|
||||
plant_hud_set_toxin()
|
||||
|
||||
// Check for pests and weeds.
|
||||
// Some carnivorous plants happily eat pests.
|
||||
if(pestlevel > 0)
|
||||
if(seed.get_trait(TRAIT_CARNIVOROUS))
|
||||
health += HYDRO_SPEED_MULTIPLIER
|
||||
pestlevel -= HYDRO_SPEED_MULTIPLIER
|
||||
else if(pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
|
||||
health -= HYDRO_SPEED_MULTIPLIER
|
||||
plant_hud_set_pest()
|
||||
|
||||
// Some plants thrive and live off of weeds.
|
||||
if(weedlevel > 0)
|
||||
if(seed.get_trait(TRAIT_PARASITE))
|
||||
health += HYDRO_SPEED_MULTIPLIER
|
||||
weedlevel -= HYDRO_SPEED_MULTIPLIER
|
||||
else if(weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
|
||||
health -= HYDRO_SPEED_MULTIPLIER
|
||||
plant_hud_set_weed()
|
||||
|
||||
// Handle life and death.
|
||||
// If the plant gets too old, begin killing it each cycle
|
||||
var/lifespan = 5 * seed.get_trait(TRAIT_MATURATION)
|
||||
if(age > lifespan)
|
||||
health -= rand(5,10) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// When the plant dies, weeds thrive and pests die off.
|
||||
check_health()
|
||||
|
||||
// If enough time (in cycles, not ticks) has passed since the plant was harvested, we're ready to harvest again.
|
||||
if((age > seed.get_trait(TRAIT_MATURATION)) && \
|
||||
((age - lastproduce) > seed.get_trait(TRAIT_PRODUCTION)) && \
|
||||
(!harvest && !dead))
|
||||
harvest = 1
|
||||
lastproduce = age
|
||||
|
||||
if(prob(5)) // On each tick, there's a chance the pest population will increase
|
||||
pestlevel += 0.5 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Some seeds will self-harvest if you don't keep a lid on them.
|
||||
if(seed && seed.can_self_harvest && harvest && !closed_system && prob(5))
|
||||
harvest()
|
||||
|
||||
check_health()
|
||||
return
|
||||
@@ -1,217 +0,0 @@
|
||||
|
||||
//Process reagents being put into the tray.
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/process_reagents()
|
||||
|
||||
if(!reagents) return
|
||||
|
||||
if(reagents.total_volume <= 0)
|
||||
return
|
||||
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
|
||||
var/reagent_total = reagents.get_reagent_amount(R.id)
|
||||
|
||||
//These are here because they have checks that would clutter up the switch statement cases, and thus get handled after the switch(readability)
|
||||
var/water_value = 0
|
||||
var/health_value = 0
|
||||
var/production_stat_value = 0
|
||||
var/potency_stat_value = 0
|
||||
|
||||
|
||||
switch(R.id)
|
||||
/* EXAMPLE:
|
||||
*
|
||||
* if("example")
|
||||
* //Nutrients
|
||||
* nutrilevel += reagent_total * <nutrient value>
|
||||
*
|
||||
* //Water
|
||||
* water_value = <water value>
|
||||
*
|
||||
* //Toxins
|
||||
* toxins += reagent_total * <toxin value>
|
||||
*
|
||||
* //Weeds and Pests
|
||||
* weedlevel += reagent_total * <weed value>
|
||||
* pestlevel += reagent_total * <pest value>
|
||||
*
|
||||
* //Mutagens
|
||||
* handle_mutagens(reagent_total, <min_value>, <step_value>)
|
||||
*
|
||||
* //Modifiers
|
||||
* yield_mod += reagent_total * <yield_mod value>
|
||||
* mutation_mod += reagent_total * <mutation_mod vlaue>
|
||||
*
|
||||
* //Health
|
||||
* health_value = <health value>
|
||||
*
|
||||
* //Production Stat
|
||||
* production_stat_value = <production stat value>
|
||||
*
|
||||
* //Potency Stat
|
||||
* potency_stat_value = <potency stat value>
|
||||
*
|
||||
*/
|
||||
|
||||
if("adminordrazine")
|
||||
nutrilevel += reagent_total * 1
|
||||
water_value = 1
|
||||
weedlevel += reagent_total * -5
|
||||
pestlevel += reagent_total * -5
|
||||
yield_mod += reagent_total * 1
|
||||
mutation_mod += reagent_total * 1
|
||||
health_value = 1
|
||||
if("ammonia")
|
||||
nutrilevel += reagent_total * 1
|
||||
health_value = 0.5
|
||||
if("atrazine")
|
||||
toxins += reagent_total * 3
|
||||
weedlevel += reagent_total * -8
|
||||
mutation_mod += reagent_total * 0.2
|
||||
health_value = -2
|
||||
if("beer")
|
||||
nutrilevel += reagent_total * 0.25
|
||||
water_value = 0.7
|
||||
health_value = -0.05
|
||||
if("charcoal")
|
||||
toxins += reagent_total * -2
|
||||
if("chlorine")
|
||||
water_value = -0.5
|
||||
toxins += reagent_total * 1.5
|
||||
weedlevel += reagent_total * -3
|
||||
health_value = -1
|
||||
if("cryoxadone")
|
||||
toxins += reagent_total * -3
|
||||
if(seed && !dead)
|
||||
health += reagent_total * 3
|
||||
if("diethylamine")
|
||||
nutrilevel += reagent_total * 2
|
||||
pestlevel += reagent_total * -2
|
||||
health_value = 1
|
||||
if("eznutrient")
|
||||
nutrilevel += reagent_total * 1
|
||||
if("facid")
|
||||
toxins += reagent_total * 3
|
||||
weedlevel += reagent_total * -4
|
||||
health_value = -2
|
||||
if("fishwater")
|
||||
nutrilevel += reagent_total * 0.75
|
||||
water_value = 1
|
||||
if("fluorine")
|
||||
water_value = -0.5
|
||||
toxins = reagent_total * 2.5
|
||||
weedlevel += reagent_total * -4
|
||||
health_value = -2
|
||||
if("holywater")
|
||||
water_value = 1
|
||||
health_value = 0.1
|
||||
if("left4zed")
|
||||
nutrilevel += reagent_total * 1
|
||||
mutation_mod += reagent_total * 0.2
|
||||
if("milk")
|
||||
nutrilevel += reagent_total * 0.1
|
||||
water_value = 0.9
|
||||
if("mutagen")
|
||||
handle_mutagens(reagent_total, 1, 5)
|
||||
if("nutriment")
|
||||
nutrilevel += reagent_total * 1
|
||||
yield_mod += reagent_total * 0.15
|
||||
health_value = 0.25
|
||||
if("phosphorus")
|
||||
nutrilevel += reagent_total * 0.1
|
||||
water_value = -0.5
|
||||
weedlevel += reagent_total * -2
|
||||
health_value = -0.75
|
||||
if("plantmatter")
|
||||
nutrilevel += reagent_total * 1.25
|
||||
yield_mod += reagent_total * 0.15
|
||||
health_value = 0.25
|
||||
if("protein")
|
||||
nutrilevel += reagent_total * 1.75
|
||||
yield_mod += reagent_total * 0.15
|
||||
health_value = 0.25
|
||||
if("radium")
|
||||
toxins += reagent_total * 2
|
||||
handle_mutagens(reagent_total, 10, 10)
|
||||
mutation_mod += reagent_total * 0.2
|
||||
health_value = -1.5
|
||||
if("robustharvest")
|
||||
nutrilevel += reagent_total * 1
|
||||
yield_mod += reagent_total * 0.2
|
||||
if("sacid")
|
||||
toxins += reagent_total * 1.5
|
||||
weedlevel += reagent_total * -2
|
||||
health_value = -1
|
||||
if("saltpetre")
|
||||
health_value = 0.25
|
||||
production_stat_value = -0.02
|
||||
potency_stat_value = 0.01
|
||||
if("sodawater")
|
||||
nutrilevel += reagent_total * 0.1
|
||||
water_value = 1
|
||||
health_value = 0.1
|
||||
if("sugar")
|
||||
nutrilevel += reagent_total * 0.1
|
||||
weedlevel += reagent_total * 2
|
||||
pestlevel += reagent_total * 2
|
||||
if("toxin")
|
||||
toxins += reagent_total * 2
|
||||
if("water")
|
||||
water_value = 1
|
||||
|
||||
//END SWITCH
|
||||
|
||||
//Handle water changes
|
||||
if(water_value)
|
||||
var/water_change = 0
|
||||
water_change = reagent_total * water_value
|
||||
waterlevel += water_change
|
||||
if(water_value > 0) //adding water dilutes toxins
|
||||
toxins -= round(water_change/4)
|
||||
|
||||
//Handle health and stat changes (these require a non-dead seed to be present)
|
||||
if(seed && !dead)
|
||||
//Health
|
||||
if(health_value)
|
||||
health += reagent_total * health_value
|
||||
//Stats
|
||||
if(seed.get_trait(TRAIT_IMMUTABLE) <= 0)
|
||||
//Production
|
||||
if(production_stat_value && seed.get_trait(TRAIT_PRODUCTION) > 2)
|
||||
if(!isnull(plant_controller.seeds[seed.name])) //This is so we don't affect plants in other trays unintentionally
|
||||
seed = seed.diverge(2) //ENHANCE!
|
||||
else
|
||||
seed.update_name_prefixes(2)
|
||||
var/new_production = seed.get_trait(TRAIT_PRODUCTION) + (reagent_total * production_stat_value)
|
||||
seed.set_trait(TRAIT_PRODUCTION, max(2, new_production)) //can't drop below 2 with this method
|
||||
//Potency
|
||||
if(potency_stat_value)
|
||||
if(!isnull(plant_controller.seeds[seed.name])) //This is so we don't affect plants in other trays unintentionally
|
||||
seed = seed.diverge(2) //ENHANCE!
|
||||
else
|
||||
seed.update_name_prefixes(2)
|
||||
var/new_potency = seed.get_trait(TRAIT_POTENCY) + (reagent_total * potency_stat_value)
|
||||
seed.set_trait(TRAIT_POTENCY, max(0, min(100, new_potency))) //can't go above 100 or below 0 with this method
|
||||
|
||||
//END FOR LOOP
|
||||
|
||||
reagents.clear_reagents()
|
||||
check_health() //This calls check_level_sanity, which is why it's not called from here directly
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/handle_mutagens(var/amount, var/min_amount, var/step_amount)
|
||||
//shouldn't be getting called without having reagent values supplied
|
||||
if(!amount || !step_amount || !step_amount)
|
||||
return
|
||||
//shouldn't be getting called with negative values
|
||||
if(amount < 0 || min_amount < 0 || step_amount < 0)
|
||||
return
|
||||
|
||||
if(amount > min_amount)
|
||||
if(amount >= min_amount + (3 * step_amount))
|
||||
mutate(4)
|
||||
else if(amount >= min_amount + (2 * step_amount))
|
||||
mutate(3)
|
||||
else if(amount >= min_amount + step_amount)
|
||||
mutate(2)
|
||||
else if(amount >= min_amount)
|
||||
mutate(1)
|
||||
@@ -1,70 +0,0 @@
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil
|
||||
name = "soil"
|
||||
icon_state = "soil"
|
||||
density = 0
|
||||
use_power = 0
|
||||
mechanical = 0
|
||||
tray_light = 0
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O,/obj/item/weapon/tank))
|
||||
return
|
||||
else if(istype(O,/obj/item/weapon/crowbar))
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/New()
|
||||
..()
|
||||
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb
|
||||
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label
|
||||
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/setlight
|
||||
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/eject_tank_verb
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/CanPass()
|
||||
return 1
|
||||
|
||||
// Holder for vine plants.
|
||||
// Icons for plants are generated as overlays, so setting it to invisible wouldn't work.
|
||||
// Hence using a blank icon.
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible
|
||||
name = "plant"
|
||||
icon = 'icons/obj/seeds.dmi'
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/New(var/newloc,var/datum/seed/newseed)
|
||||
..()
|
||||
seed = newseed
|
||||
dead = 0
|
||||
age = 1
|
||||
health = seed.get_trait(TRAIT_ENDURANCE)
|
||||
lastcycle = world.time
|
||||
pixel_y = rand(-5,5)
|
||||
check_health()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
|
||||
..()
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
|
||||
..()
|
||||
if(!seed) // Repeat harvests are a thing.
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
|
||||
if(!seed)
|
||||
qdel(src)
|
||||
return
|
||||
else if(name=="plant")
|
||||
name = seed.display_name
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Destroy()
|
||||
// Check if we're masking a decal that needs to be visible again.
|
||||
for(var/obj/effect/plant/plant in get_turf(src))
|
||||
if(plant.invisibility == INVISIBILITY_MAXIMUM)
|
||||
plant.invisibility = initial(plant.invisibility)
|
||||
return ..()
|
||||
@@ -1,431 +0,0 @@
|
||||
//Analyzer, pestkillers, weedkillers, nutrients, hatchets, cutters, Rapid-Seed-Producer (RSP), corn cob.
|
||||
|
||||
/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"
|
||||
desc = "A scanner used to evaluate a plant's various areas of growth."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hydro"
|
||||
item_state = "analyzer"
|
||||
origin_tech = "magnets=1;biotech=1"
|
||||
var/form_title
|
||||
var/last_data
|
||||
var/print_cooldown = 0
|
||||
var/cooldown_length = 50 // Five seconds
|
||||
|
||||
/obj/item/device/analyzer/plant_analyzer/proc/print_report_verb()
|
||||
set name = "Print Plant Report"
|
||||
set category = "Object"
|
||||
set src = usr
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
print_report(usr)
|
||||
|
||||
/obj/item/device/analyzer/plant_analyzer/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["print"])
|
||||
print_report(usr)
|
||||
|
||||
/obj/item/device/analyzer/plant_analyzer/proc/print_report(var/mob/living/user)
|
||||
if(!last_data)
|
||||
to_chat(user, "There is no scan data to print.")
|
||||
return
|
||||
if(print_cooldown > world.time)
|
||||
to_chat(user, "<span class='warning'>The printer is still cooling down.</span>")
|
||||
return
|
||||
print_cooldown = world.time + cooldown_length
|
||||
|
||||
playsound(loc, "sound/goonstation/machines/printer_thermal.ogg", 50, 1)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
|
||||
P.name = "paper - [form_title]"
|
||||
P.info = "[last_data]"
|
||||
if(istype(user,/mob/living/carbon/human) && !(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(P)
|
||||
user.visible_message("\The [src] spits out a piece of paper.")
|
||||
return
|
||||
|
||||
/obj/item/device/analyzer/plant_analyzer/attack_self(mob/user as mob)
|
||||
print_report(user)
|
||||
return 0
|
||||
|
||||
/obj/item/device/analyzer/plant_analyzer/afterattack(obj/target, mob/user, flag)
|
||||
if(!flag) return
|
||||
|
||||
var/datum/seed/grown_seed
|
||||
var/datum/reagents/grown_reagents
|
||||
|
||||
//--FalseIncarnate
|
||||
var/IS_TRAY = 0 //used to track if the target is a hydroponics tray or soil. 1 if true, otherwise 0
|
||||
var/tray_age //age of the plant in the tray
|
||||
var/tray_weed_level //weed level of tray
|
||||
var/tray_pest_level //pest level of tray
|
||||
var/tray_toxins //toxicity of the tray
|
||||
var/tray_yield_mod //yield modifier of the tray
|
||||
var/tray_mutation_mod //mutation modifier of the tray
|
||||
//--FalseIncarnate
|
||||
|
||||
if(istype(target,/obj/structure/table))
|
||||
return ..()
|
||||
else if(istype(target,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = target
|
||||
grown_seed = plant_controller.seeds[G.plantname]
|
||||
grown_reagents = G.reagents
|
||||
|
||||
else if(istype(target,/obj/item/weapon/grown))
|
||||
|
||||
var/obj/item/weapon/grown/G = target
|
||||
grown_seed = plant_controller.seeds[G.plantname]
|
||||
grown_reagents = G.reagents
|
||||
|
||||
else if(istype(target,/obj/item/seeds))
|
||||
|
||||
var/obj/item/seeds/S = target
|
||||
grown_seed = S.seed
|
||||
|
||||
else if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
||||
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/H = target
|
||||
|
||||
//--FalseIncarnate
|
||||
//Flag the target as a tray for showing tray-specific stats
|
||||
IS_TRAY = 1
|
||||
//Save tray data to matching variables
|
||||
tray_age = H.age
|
||||
tray_weed_level = H.weedlevel
|
||||
tray_pest_level = H.pestlevel
|
||||
tray_toxins = H.toxins
|
||||
tray_yield_mod = H.yield_mod
|
||||
tray_mutation_mod = H.mutation_mod
|
||||
//--FalseIncarnate
|
||||
|
||||
grown_seed = H.seed
|
||||
grown_reagents = H.reagents
|
||||
|
||||
if(!grown_seed)
|
||||
to_chat(user, "<span class='danger'>[src] can tell you nothing about \the [target].</span>")
|
||||
return
|
||||
|
||||
form_title = "[grown_seed.seed_name] (#[grown_seed.uid])"
|
||||
var/dat = "<h3>Plant data for [form_title]</h3>"
|
||||
user.visible_message("<span class='notice'>[user] runs the scanner over \the [target].</span>")
|
||||
|
||||
dat += "<h2>General Data</h2>"
|
||||
|
||||
dat += "<table>"
|
||||
dat += "<tr><td><b>Endurance</b></td><td>[grown_seed.get_trait(TRAIT_ENDURANCE)]</td></tr>"
|
||||
dat += "<tr><td><b>Yield</b></td><td>[grown_seed.get_trait(TRAIT_YIELD)]</td></tr>"
|
||||
dat += "<tr><td><b>Maturation time</b></td><td>[grown_seed.get_trait(TRAIT_MATURATION)]</td></tr>"
|
||||
dat += "<tr><td><b>Production time</b></td><td>[grown_seed.get_trait(TRAIT_PRODUCTION)]</td></tr>"
|
||||
dat += "<tr><td><b>Potency</b></td><td>[grown_seed.get_trait(TRAIT_POTENCY)]</td></tr>"
|
||||
dat += "<tr><td><b>Species Discovery Value</b></td><td>[grown_seed.get_trait(TRAIT_RARITY)]</td></tr>"
|
||||
|
||||
//--FalseIncarnate
|
||||
//Tray-specific stats like Age and Mutation Modifier, not shown if target was not a hydroponics tray or soil
|
||||
if(IS_TRAY == 1)
|
||||
dat += "<tr><td></td></tr>"
|
||||
dat += "<tr><td><b>Age</b></td><td>[tray_age]</td></tr>"
|
||||
dat += "<tr><td><b>Weed Level</b></td><td>[tray_weed_level]</td></tr>"
|
||||
dat += "<tr><td><b>Pest Level</b></td><td>[tray_pest_level]</td></tr>"
|
||||
dat += "<tr><td><b>Toxins</b></td><td>[tray_toxins]</td></tr>"
|
||||
dat += "<tr><td><b>Yield Modifier</b></td><td>[tray_yield_mod]</td></tr>"
|
||||
dat += "<tr><td><b>Mutation Modifier</b></td><td>[tray_mutation_mod]</td></tr>"
|
||||
//--FalseIncarnate
|
||||
|
||||
dat += "</table>"
|
||||
|
||||
if(grown_reagents && grown_reagents.reagent_list && grown_reagents.reagent_list.len)
|
||||
dat += "<h2>Reagent Data</h2>"
|
||||
|
||||
dat += "<br>This sample contains: "
|
||||
for(var/datum/reagent/R in grown_reagents.reagent_list)
|
||||
dat += "<br>- [R.id], [grown_reagents.get_reagent_amount(R.id)] unit(s)"
|
||||
|
||||
dat += "<h2>Other Data</h2>"
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_HARVEST_REPEAT))
|
||||
dat += "This plant can be harvested repeatedly.<br>"
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_IMMUTABLE) == -1)
|
||||
dat += "This plant is highly mutable.<br>"
|
||||
else if(grown_seed.get_trait(TRAIT_IMMUTABLE) > 0)
|
||||
dat += "This plant does not possess genetics that are alterable.<br>"
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
|
||||
if(grown_seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
|
||||
dat += "It consumes a small amount of nutrient fluid.<br>"
|
||||
else if(grown_seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0.2)
|
||||
dat += "It requires a heavy supply of nutrient fluid.<br>"
|
||||
else
|
||||
dat += "It requires a supply of nutrient fluid.<br>"
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_REQUIRES_WATER))
|
||||
if(grown_seed.get_trait(TRAIT_WATER_CONSUMPTION) < 1)
|
||||
dat += "It requires very little water.<br>"
|
||||
else if(grown_seed.get_trait(TRAIT_WATER_CONSUMPTION) > 5)
|
||||
dat += "It requires a large amount of water.<br>"
|
||||
else
|
||||
dat += "It requires a stable supply of water.<br>"
|
||||
|
||||
if(grown_seed.mutants && grown_seed.mutants.len)
|
||||
dat += "It exhibits a high degree of potential subspecies shift.<br>"
|
||||
|
||||
dat += "It thrives in a temperature of [grown_seed.get_trait(TRAIT_IDEAL_HEAT)] Kelvin."
|
||||
|
||||
if(grown_seed.consume_gasses && grown_seed.consume_gasses.len)
|
||||
for(var/gas in grown_seed.consume_gasses)
|
||||
if(gas == "carbon_dioxide") gas = "carbon dioxide"
|
||||
if(gas == "toxins") gas = "plasma"
|
||||
dat += "<br>It requires an environment rich in [gas] gas to thrive."
|
||||
|
||||
if(grown_seed.exude_gasses && grown_seed.exude_gasses.len)
|
||||
for(var/gas in grown_seed.exude_gasses)
|
||||
if(gas == "carbon_dioxide") gas = "carbon dioxide"
|
||||
if(gas == "toxins") gas = "plasma"
|
||||
dat += "<br>It releases [gas] gas as a byproduct of it's growth."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
|
||||
dat += "<br>It is well adapted to low pressure levels."
|
||||
if(grown_seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
|
||||
dat += "<br>It is well adapted to high pressure levels."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
|
||||
dat += "<br>It is well adapted to a range of temperatures."
|
||||
else if(grown_seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
|
||||
dat += "<br>It is very sensitive to temperature shifts."
|
||||
|
||||
dat += "<br>It thrives in a light level of [grown_seed.get_trait(TRAIT_IDEAL_LIGHT)] lumen[grown_seed.get_trait(TRAIT_IDEAL_LIGHT) == 1 ? "" : "s"]."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
|
||||
dat += "<br>It is well adapted to a range of light levels."
|
||||
else if(grown_seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
|
||||
dat += "<br>It is very sensitive to light level shifts."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_TOXINS_TOLERANCE) < 3)
|
||||
dat += "<br>It is highly sensitive to toxins."
|
||||
else if(grown_seed.get_trait(TRAIT_TOXINS_TOLERANCE) > 6)
|
||||
dat += "<br>It is remarkably resistant to toxins."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_PEST_TOLERANCE) < 3)
|
||||
dat += "<br>It is highly sensitive to pests."
|
||||
else if(grown_seed.get_trait(TRAIT_PEST_TOLERANCE) > 6)
|
||||
dat += "<br>It is remarkably resistant to pests."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_WEED_TOLERANCE) < 3)
|
||||
dat += "<br>It is highly sensitive to weeds."
|
||||
else if(grown_seed.get_trait(TRAIT_WEED_TOLERANCE) > 6)
|
||||
dat += "<br>It is remarkably resistant to weeds."
|
||||
|
||||
switch(grown_seed.get_trait(TRAIT_SPREAD))
|
||||
if(1)
|
||||
dat += "<br>It is able to be planted outside of a tray."
|
||||
if(2)
|
||||
dat += "<br>It is a robust and vigorous vine that will spread rapidly."
|
||||
|
||||
switch(grown_seed.get_trait(TRAIT_CARNIVOROUS))
|
||||
if(1)
|
||||
dat += "<br>It is carniovorous and will eat tray pests for sustenance."
|
||||
if(2)
|
||||
dat += "<br>It is carnivorous and poses a significant threat to living things around it."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_PARASITE))
|
||||
dat += "<br>It is capable of parisitizing and gaining sustenance from tray weeds."
|
||||
if(grown_seed.get_trait(TRAIT_ALTER_TEMP))
|
||||
dat += "<br>It will periodically alter the local temperature by [grown_seed.get_trait(TRAIT_ALTER_TEMP)] Kelvin."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_BIOLUM))
|
||||
dat += "<br>It is [grown_seed.get_trait(TRAIT_BIOLUM_COLOUR) ? "<font color='[grown_seed.get_trait(TRAIT_BIOLUM_COLOUR)]'>bio-luminescent</font>" : "bio-luminescent"]."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_PRODUCES_POWER))
|
||||
dat += "<br>The fruit will function as a battery if prepared appropriately."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_BATTERY_RECHARGE))
|
||||
dat += "<br>The fruit hums with an odd electrical energy."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_STINGS))
|
||||
dat += "<br>The fruit is covered in stinging spines."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_JUICY) == 1)
|
||||
dat += "<br>The fruit is soft-skinned and juicy."
|
||||
else if(grown_seed.get_trait(TRAIT_JUICY) == 2)
|
||||
dat += "<br>The fruit is excessively juicy."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_EXPLOSIVE))
|
||||
dat += "<br>The fruit is internally unstable."
|
||||
|
||||
if(grown_seed.get_trait(TRAIT_TELEPORTING))
|
||||
dat += "<br>The fruit is temporal/spatially unstable."
|
||||
|
||||
if(dat)
|
||||
last_data = dat
|
||||
dat += "<br><br>\[<a href='?src=[UID()];print=1'>print report</a>\]"
|
||||
user << browse(dat,"window=plant_analyzer")
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/minihoe // -- Numbers
|
||||
name = "mini hoe"
|
||||
desc = "It's used for removing weeds or scratching your back."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "hoe"
|
||||
item_state = "hoe"
|
||||
flags = CONDUCT | NOBLUDGEON
|
||||
force = 5
|
||||
throwforce = 7
|
||||
w_class = 2
|
||||
materials = list(MAT_METAL=50)
|
||||
attack_verb = list("slashed", "sliced", "cut", "clawed")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
//Hatchets and things to kill kudzu
|
||||
/obj/item/weapon/hatchet
|
||||
name = "hatchet"
|
||||
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "hatchet"
|
||||
flags = CONDUCT
|
||||
force = 12
|
||||
sharp = 1
|
||||
edge = 1
|
||||
w_class = 2
|
||||
throwforce = 15
|
||||
throw_speed = 4
|
||||
throw_range = 4
|
||||
materials = list(MAT_METAL=15000)
|
||||
origin_tech = "materials=2;combat=1"
|
||||
attack_verb = list("chopped", "torn", "cut")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
/obj/item/weapon/hatchet/unathiknife
|
||||
name = "duelling knife"
|
||||
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "unathiknife"
|
||||
attack_verb = list("ripped", "torn", "cut")
|
||||
|
||||
/obj/item/weapon/scythe
|
||||
icon_state = "scythe0"
|
||||
name = "scythe"
|
||||
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
|
||||
force = 13
|
||||
throwforce = 5
|
||||
sharp = 1
|
||||
edge = 1
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
w_class = 4
|
||||
var/extend = 1
|
||||
flags = CONDUCT
|
||||
armour_penetration = 20
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "materials=2;combat=2"
|
||||
attack_verb = list("chopped", "sliced", "cut", "reaped")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
if(istype(A, /obj/effect/plant) && extend == 1)
|
||||
for(var/obj/effect/plant/B in orange(A,1))
|
||||
if(prob(80))
|
||||
B.die_off(1)
|
||||
qdel(A)
|
||||
|
||||
/obj/item/weapon/scythe/tele
|
||||
icon_state = "tscythe0"
|
||||
name = "telescopic scythe"
|
||||
desc = "A sharp and curved blade on a collapsable fibremetal handle, this tool is the pinnacle of covert reaping technology."
|
||||
force = 3.0
|
||||
sharp = 0
|
||||
edge = 0
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
w_class = 2
|
||||
extend = 0
|
||||
armour_penetration = 20
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "materials=3;combat=3"
|
||||
attack_verb = list("chopped", "sliced", "cut", "reaped")
|
||||
hitsound = "swing_hit"
|
||||
|
||||
/obj/item/weapon/scythe/tele/attack_self(mob/user as mob)
|
||||
extend = !extend
|
||||
if(extend)
|
||||
to_chat(user, "<span class ='warning'>With a flick of the wrist, you extend the scythe. It's reaping time!</span>")
|
||||
icon_state = "tscythe1"
|
||||
item_state = "scythe0"
|
||||
slot_flags &= ~SLOT_BELT
|
||||
w_class = 4 //doesnt fit in backpack when its on for balance
|
||||
force = 13 //normal scythe damage
|
||||
attack_verb = list("chopped", "sliced", "cut", "reaped")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
//Extend sound (blade unsheath)
|
||||
playsound(src.loc, 'sound/weapons/blade_unsheath.ogg', 50, 1) //Sound credit to Qat of Freesound.org
|
||||
else
|
||||
to_chat(user, "<span class ='notice'>You collapse the scythe, folding it for easy storage.</span>")
|
||||
icon_state = "tscythe0"
|
||||
item_state = "tscythe0" //no sprite in other words
|
||||
slot_flags |= SLOT_BELT
|
||||
w_class = 2
|
||||
force = 3 //not so robust now
|
||||
attack_verb = list("hit", "poked")
|
||||
hitsound = "swing_hit"
|
||||
//Collapse sound (blade sheath)
|
||||
playsound(src.loc, 'sound/weapons/blade_sheath.ogg', 50, 1) //Sound credit to Q.K. of Freesound.org
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.update_inv_l_hand()
|
||||
H.update_inv_r_hand()
|
||||
add_fingerprint(user)
|
||||
if(!blood_DNA) return
|
||||
if(blood_overlay && (blood_DNA.len >= 1)) //updates blood overlay, if any
|
||||
overlays.Cut()//this might delete other item overlays as well but eeeeeeeh
|
||||
|
||||
var/icon/I = new /icon(src.icon, src.icon_state)
|
||||
I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD)
|
||||
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY)
|
||||
blood_overlay = I
|
||||
|
||||
overlays += blood_overlay
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/rsp
|
||||
name = "\improper Rapid-Seed-Producer (RSP)"
|
||||
desc = "A device used to rapidly deploy seeds."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "rcd"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 0.0
|
||||
var/matter = 0
|
||||
var/mode = 1
|
||||
w_class = 3
|
||||
|
||||
/obj/item/weapon/bananapeel
|
||||
name = "banana peel"
|
||||
desc = "A peel from a banana."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "banana_peel"
|
||||
item_state = "banana_peel"
|
||||
w_class = 1
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/weapon/corncob
|
||||
name = "corn cob"
|
||||
desc = "A reminder of meals gone by."
|
||||
icon = 'icons/obj/harvest.dmi'
|
||||
icon_state = "corncob"
|
||||
item_state = "corncob"
|
||||
w_class = 1
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
@@ -1,86 +0,0 @@
|
||||
//Refreshes the icon and sets the luminosity
|
||||
/obj/machinery/portable_atmospherics/hydroponics/update_icon()
|
||||
// Update name.
|
||||
if(seed)
|
||||
if(mechanical)
|
||||
name = "[base_name] (#[seed.uid])"
|
||||
else
|
||||
name = "[seed.seed_name]"
|
||||
else
|
||||
name = initial(name)
|
||||
|
||||
if(labelled)
|
||||
name += " ([labelled])"
|
||||
|
||||
overlays.Cut()
|
||||
// Updates the plant overlay.
|
||||
if(!isnull(seed))
|
||||
|
||||
if(mechanical && health <= (seed.get_trait(TRAIT_ENDURANCE) / 2))
|
||||
overlays += "over_lowhealth3"
|
||||
|
||||
if(dead)
|
||||
var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-dead"
|
||||
var/image/dead_overlay = plant_controller.plant_icon_cache["[ikey]"]
|
||||
if(!dead_overlay)
|
||||
dead_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]")
|
||||
dead_overlay.color = DEAD_PLANT_COLOUR
|
||||
overlays |= dead_overlay
|
||||
else
|
||||
if(!seed.growth_stages)
|
||||
seed.update_growth_stages()
|
||||
if(!seed.growth_stages)
|
||||
to_chat(world, "<span class='danger'>Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.</span>")
|
||||
return
|
||||
var/overlay_stage = 1
|
||||
if(age >= seed.get_trait(TRAIT_MATURATION))
|
||||
overlay_stage = seed.growth_stages
|
||||
else
|
||||
var/maturation = seed.get_trait(TRAIT_MATURATION)/seed.growth_stages
|
||||
if(maturation < 1)
|
||||
maturation = 1
|
||||
overlay_stage = maturation ? max(1,round(age/maturation)) : 1
|
||||
var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-[overlay_stage]"
|
||||
var/image/plant_overlay = plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"]
|
||||
if(!plant_overlay)
|
||||
plant_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]")
|
||||
plant_overlay.color = seed.get_trait(TRAIT_PLANT_COLOUR)
|
||||
plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] = plant_overlay
|
||||
overlays |= plant_overlay
|
||||
last_plant_ikey = ikey
|
||||
|
||||
if(harvest && overlay_stage == seed.growth_stages)
|
||||
ikey = "[seed.get_trait(TRAIT_PRODUCT_ICON)]"
|
||||
var/image/harvest_overlay = plant_controller.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"]
|
||||
if(!harvest_overlay)
|
||||
harvest_overlay = image('icons/obj/hydroponics_products.dmi', "[ikey]")
|
||||
harvest_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
plant_controller.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"] = harvest_overlay
|
||||
overlays |= harvest_overlay
|
||||
|
||||
//Draw the cover.
|
||||
if(closed_system)
|
||||
overlays += "hydrocover"
|
||||
|
||||
//Updated the various alert icons.
|
||||
if(mechanical)
|
||||
if(waterlevel <= 10)
|
||||
overlays += "over_lowwater3"
|
||||
if(nutrilevel <= 2)
|
||||
overlays += "over_lownutri3"
|
||||
if(weedlevel >= 5 || pestlevel >= 5 || toxins >= 40)
|
||||
overlays += "over_alert3"
|
||||
if(harvest)
|
||||
overlays += "over_harvest3"
|
||||
|
||||
// Update bioluminescence.
|
||||
if(seed)
|
||||
if(seed.get_trait(TRAIT_BIOLUM))
|
||||
var/clr
|
||||
if(seed.get_trait(TRAIT_BIOLUM_COLOUR))
|
||||
clr = seed.get_trait(TRAIT_BIOLUM_COLOUR)
|
||||
set_light(round(seed.get_trait(TRAIT_POTENCY)/10), l_color = clr)
|
||||
return
|
||||
|
||||
set_light(0)
|
||||
return
|
||||
@@ -22,7 +22,7 @@
|
||||
switch(loot)
|
||||
if(1 to 5) //5% chance
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/bottle/rum(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey(src)
|
||||
new /obj/item/weapon/lighter(src)
|
||||
if(6 to 10)
|
||||
@@ -41,11 +41,9 @@
|
||||
if(21 to 25)
|
||||
for(var/i in 1 to 5)
|
||||
new /obj/item/weapon/contraband/poster(src)
|
||||
if(26 to 30)
|
||||
if(26 to 35)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
|
||||
if(31 to 35)
|
||||
new /obj/item/seeds/cash(src)
|
||||
if(36 to 40)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
if(41 to 45)
|
||||
|
||||
@@ -119,12 +119,12 @@
|
||||
internalBeaker.name = "Grow-U-All Super Spray"
|
||||
|
||||
if(internalBeaker && internalBag)
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/HP
|
||||
var/obj/machinery/hydroponics/HP
|
||||
|
||||
//consider the appropriate target
|
||||
var/list/considered = list()
|
||||
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/tester in view(12,src))
|
||||
for(var/obj/machinery/hydroponics/tester in view(12,src))
|
||||
considered[tester] = 1
|
||||
|
||||
if(!tester.seed)
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
favoured_types = list(/obj/item/weapon/soap, /obj/item/weapon/reagent_containers/food/snacks/grown/banana, /obj/item/weapon/bananapeel)
|
||||
functions += "clowning"
|
||||
if("Botanist")
|
||||
favoured_types = list(/obj/machinery/portable_atmospherics/hydroponics, /obj/item/weapon/reagent_containers, /obj/item/weapon)
|
||||
favoured_types = list(/obj/machinery/hydroponics, /obj/item/weapon/reagent_containers, /obj/item/weapon)
|
||||
functions += "botany"
|
||||
restrictedJob = 1
|
||||
else
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
target_types += /obj/effect/decal/cleanable/blood/gibs/robot
|
||||
target_types += /obj/effect/decal/cleanable/crayon
|
||||
target_types += /obj/effect/decal/cleanable/liquid_fuel
|
||||
target_types += /obj/effect/decal/cleanable/molten_item
|
||||
target_types += /obj/effect/decal/cleanable/molten_object
|
||||
target_types += /obj/effect/decal/cleanable/tomato_smudge
|
||||
target_types += /obj/effect/decal/cleanable/egg_smudge
|
||||
target_types += /obj/effect/decal/cleanable/pie_smudge
|
||||
|
||||
@@ -127,11 +127,11 @@
|
||||
set desc = "Turn your food into nutrients for plants."
|
||||
|
||||
var/list/trays = list()
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/tray in range(1))
|
||||
for(var/obj/machinery/hydroponics/tray in range(1))
|
||||
if(tray.nutrilevel < 10)
|
||||
trays += tray
|
||||
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/target = input("Select a tray:") as null|anything in trays
|
||||
var/obj/machinery/hydroponics/target = input("Select a tray:") as null|anything in trays
|
||||
|
||||
if(!src || !target || target.nutrilevel == 10) return //Sanity check.
|
||||
|
||||
@@ -145,11 +145,11 @@
|
||||
set desc = "Clean the weeds out of soil or a hydroponics tray."
|
||||
|
||||
var/list/trays = list()
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/tray in range(1))
|
||||
for(var/obj/machinery/hydroponics/tray in range(1))
|
||||
if(tray.weedlevel > 0)
|
||||
trays += tray
|
||||
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/target = input("Select a tray:") as null|anything in trays
|
||||
var/obj/machinery/hydroponics/target = input("Select a tray:") as null|anything in trays
|
||||
|
||||
if(!src || !target || target.weedlevel == 0) return //Sanity check.
|
||||
|
||||
|
||||
@@ -711,6 +711,16 @@ atom/proc/create_reagents(max_vol)
|
||||
reagents = new/datum/reagents(max_vol)
|
||||
reagents.my_atom = src
|
||||
|
||||
/proc/get_random_reagent_id() // Returns a random reagent ID minus blacklisted reagents
|
||||
var/static/list/random_reagents = list()
|
||||
if(!random_reagents.len)
|
||||
for(var/thing in subtypesof(/datum/reagent))
|
||||
var/datum/reagent/R = thing
|
||||
if(initial(R.can_synth))
|
||||
random_reagents += initial(R.id)
|
||||
var/picked_reagent = pick(random_reagents)
|
||||
return picked_reagent
|
||||
|
||||
/datum/reagents/proc/get_reagent_from_id(id)
|
||||
var/datum/reagent/result = null
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
/datum/reagent/sacid/reaction_obj(obj/O, volume)
|
||||
if((istype(O,/obj/item) || istype(O,/obj/effect/glowshroom)) && prob(40))
|
||||
if(!O.unacidable)
|
||||
var/obj/effect/decal/cleanable/molten_item/I = new/obj/effect/decal/cleanable/molten_item(O.loc)
|
||||
var/obj/effect/decal/cleanable/molten_object/I = new/obj/effect/decal/cleanable/molten_object(O.loc)
|
||||
I.desc = "Looks like this was \an [O] some time ago."
|
||||
O.visible_message("<span class='warning'>[O] melts.</span>")
|
||||
qdel(O)
|
||||
@@ -617,7 +617,7 @@
|
||||
/datum/reagent/facid/reaction_obj(obj/O, volume)
|
||||
if((istype(O, /obj/item) || istype(O, /obj/effect/glowshroom)))
|
||||
if(!O.unacidable)
|
||||
var/obj/effect/decal/cleanable/molten_item/I = new/obj/effect/decal/cleanable/molten_item(O.loc)
|
||||
var/obj/effect/decal/cleanable/molten_object/I = new/obj/effect/decal/cleanable/molten_object(O.loc)
|
||||
I.desc = "Looks like this was \an [O] some time ago."
|
||||
O.visible_message("<span class='warning'>[O] melts.</span>")
|
||||
qdel(O)
|
||||
@@ -925,10 +925,9 @@
|
||||
alien_weeds.healthcheck()
|
||||
else if(istype(O, /obj/effect/glowshroom)) //even a small amount is enough to kill it
|
||||
qdel(O)
|
||||
else if(istype(O,/obj/effect/plant))
|
||||
if(prob(50))
|
||||
qdel(O) //Kills kudzu too.
|
||||
// Damage that is done to growing plants is separately at code/game/machinery/hydroponics at obj/item/hydroponics
|
||||
else if(istype(O,/obj/structure/spacevine))
|
||||
var/obj/structure/spacevine/SV = O
|
||||
SV.on_chem_effect(src)
|
||||
|
||||
/datum/reagent/atrazine/reaction_mob(mob/living/M, method=TOUCH, volume)
|
||||
if(iscarbon(M))
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/obj/machinery/sleeper,
|
||||
/obj/machinery/smartfridge/,
|
||||
/obj/machinery/biogenerator,
|
||||
/obj/machinery/portable_atmospherics/hydroponics,
|
||||
/obj/machinery/hydroponics,
|
||||
/obj/machinery/constructable_frame)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/New()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/afterattack(atom/A, mob/user)
|
||||
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/effect/proc_holder/spell))
|
||||
@@ -200,20 +200,8 @@
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone // -- Skie
|
||||
name = "Plant-B-Gone"
|
||||
desc = "Kills those pesky weeds!"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "plantbgone"
|
||||
item_state = "plantbgone"
|
||||
volume = 100
|
||||
list_reagents = list("atrazine" = 100)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone/afterattack(atom/A, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
if(istype(A, /obj/machinery/portable_atmospherics/hydroponics)) // We are targeting hydrotray
|
||||
return
|
||||
|
||||
if(istype(A, /obj/effect/blob)) // blob damage in blob code
|
||||
return
|
||||
|
||||
..()
|
||||
list_reagents = list("atrazine" = 100)
|
||||
@@ -43,7 +43,8 @@ other types of metals and chemistry for reagents).
|
||||
var/build_type = null //Flag as to what kind machine the design is built in. See defines.
|
||||
var/list/materials = list() //List of materials. Format: "id" = amount.
|
||||
var/construction_time //Amount of time required for building the object
|
||||
var/build_path = "" //The file path of the object that gets created
|
||||
var/build_path = null //The file path of the object that gets created
|
||||
var/list/make_reagents = list() //Reagents produced. Format: "id" = amount. Currently only supported by the biogenerator.
|
||||
var/locked = 0 //If true it will spawn inside a lockbox with currently sec access
|
||||
var/access_requirement = list(access_armory) //What special access requirements will the lockbox have? Defaults to armory.
|
||||
var/category = null //Primarily used for Mech Fabricators, but can be used for anything
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
id = "mini_hoe"
|
||||
build_type = AUTOLATHE
|
||||
materials = list(MAT_METAL = 50)
|
||||
build_path = /obj/item/weapon/minihoe
|
||||
build_path = /obj/item/weapon/cultivator
|
||||
category = list("initial","Miscellaneous")
|
||||
|
||||
/datum/design/plant_analyzer
|
||||
@@ -208,7 +208,7 @@
|
||||
id = "plant_analyzer"
|
||||
build_type = AUTOLATHE
|
||||
materials = list(MAT_METAL = 30, MAT_GLASS = 20)
|
||||
build_path = /obj/item/device/analyzer/plant_analyzer
|
||||
build_path = /obj/item/device/plant_analyzer
|
||||
category = list("initial","Miscellaneous")
|
||||
|
||||
/datum/design/shovel
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/seed_extractor
|
||||
category = list ("Misc. Machinery")
|
||||
category = list ("Hydroponics Machinery")
|
||||
|
||||
/datum/design/processor
|
||||
name = "Machine Design (Processor Board)"
|
||||
@@ -512,23 +512,12 @@
|
||||
build_path = /obj/item/weapon/circuitboard/gameboard
|
||||
category = list("Misc. Machinery")
|
||||
|
||||
|
||||
/datum/design/botany_extractor
|
||||
name = "Machine Design (Lysis-Isolation Centrifuge)"
|
||||
desc = "The circuit board for a lysis-isolation centrifuge."
|
||||
id = "botany_extractor"
|
||||
req_tech = list("biotech" = 3, "programming" = 3)
|
||||
/datum/design/plantgenes
|
||||
name = "Machine Design (Plant DNA Manipulator Board)"
|
||||
desc = "The circuit board for a plant DNA manipulator."
|
||||
id = "plantgenes"
|
||||
req_tech = list("programming" = 4, "biotech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS=1000, "sacid"=20)
|
||||
build_path = /obj/item/weapon/circuitboard/botany_extractor
|
||||
category = list("Hydroponics Machinery")
|
||||
|
||||
/datum/design/botany_editor
|
||||
name = "Machine Design (Bioballistic Delivery System)"
|
||||
desc = "The circuit board for a bioballistic delivery system."
|
||||
id = "botany_editor"
|
||||
req_tech = list("biotech" = 3, "programming" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS=1000, "sacid"=20)
|
||||
build_path = /obj/item/weapon/circuitboard/botany_editor
|
||||
category = list("Hydroponics Machinery")
|
||||
build_path = /obj/item/weapon/circuitboard/plantgenes
|
||||
category = list("Hydroponics Machinery")
|
||||
@@ -410,6 +410,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if(being_built)
|
||||
var/power = 2000
|
||||
var/amount=text2num(href_list["amount"])
|
||||
if(being_built.make_reagents.len)
|
||||
return 0
|
||||
amount = max(1, min(10, amount))
|
||||
for(var/M in being_built.materials)
|
||||
power += round(being_built.materials[M] * amount / 5)
|
||||
@@ -718,6 +720,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if(b_type & AUTOLATHE) lathe_types += "Autolathe"
|
||||
if(b_type & MECHFAB) lathe_types += "Mech Fabricator"
|
||||
if(b_type & PODFAB) lathe_types += "Spacepod Fabricator"
|
||||
if(b_type & BIOGENERATOR) lathe_types += "Biogenerator<BR>"
|
||||
var/list/materials = list()
|
||||
disk_data["materials"] = materials
|
||||
for(var/M in d_disk.blueprint.materials)
|
||||
|
||||
@@ -178,6 +178,21 @@ research holder datum.
|
||||
return
|
||||
..()
|
||||
|
||||
//Biogenerator files
|
||||
/datum/research/biogenerator/New()
|
||||
for(var/T in (subtypesof(/datum/tech)))
|
||||
possible_tech += new T(src)
|
||||
for(var/path in subtypesof(/datum/design))
|
||||
var/datum/design/D = new path(src)
|
||||
possible_designs += D
|
||||
if((D.build_type & BIOGENERATOR) && ("initial" in D.category))
|
||||
AddDesign2Known(D)
|
||||
|
||||
/datum/research/biogenerator/AddDesign2Known(datum/design/D)
|
||||
if(!(D.build_type & BIOGENERATOR))
|
||||
return
|
||||
..()
|
||||
|
||||
/***************************************************************
|
||||
** Technology Datums **
|
||||
** Includes all the various technoliges and what they make. **
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
/*/proc/spawn_diona_nymph_from_organ(var/obj/item/organ/organ)
|
||||
if(!istype(organ))
|
||||
return 0
|
||||
|
||||
//This is a terrible hack and I should be ashamed.
|
||||
var/datum/seed/diona = plant_controller.seeds["diona"]
|
||||
if(!diona)
|
||||
return 0
|
||||
|
||||
spawn(1) // So it has time to be thrown about by the gib() proc.
|
||||
var/mob/living/simple_animal/diona/D = new(get_turf(organ))
|
||||
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
|
||||
P.request_player(D, "A diona nymph has split off from its gestalt. ")
|
||||
spawn(60)
|
||||
if(D)
|
||||
if(!D.ckey || !D.client)
|
||||
D.death()
|
||||
return 1 */
|
||||
|
||||
/obj/item/organ/external/chest/diona
|
||||
name = "core trunk"
|
||||
max_damage = 200
|
||||
|
||||
Reference in New Issue
Block a user