Files
Paradise/code/modules/hydroponics/seed_packets.dm
FalseIncarnate 4ad00d93a5 Botany Atmospheric Interactions
Re-enables botany's interactions with atmospheric conditions and gases.

Seeds can now consume and exude gases as part of their growth process.
Most seeds do not have this functionality, however it can be found on
random seeds.

Random seeds will occasionally require a gas to grow, or will produce a
gas while planted. Possible gases are Oxygen (O2), Nitrogen (N2), Carbon
Dioxide (CO2), or Plasma gas.

If a plant that affects a gas is planted, it will attempt to interact
with the environment differently depending on conditions as detailed
below:

- Tray lid down: Will always utilize the air of it's tile for atmos
interaction.
- Tray lid up, nothing connected/inserted: Will utilize the air of it's
tile for atmos interaction.
- Tray lid up, tray connected to a connector port pipe: Will attempt to
utilize the air of the pipe network the connector is part of, allowing
you to utilize canisters or direct feeds into the station's piping. If
there are no gases at all (0 total moles) in the network, it will create
an empty gas_mixture at 20C (standard room temp) in the network before
attempting atmos interactions.
- Tray lid up, tank inserted into tray: Will attempt to utilize the
contents of the inserted tank for atmos interaction. If the tank is
completely empty (0 total moles), it will create a new empty gas_mixture
at 20C before attempting atmos interactions.
- Tray lid up, tank inserted AND connector port: Will attempt to utilize
the contents of the inserted tank for atmos interaction. If the tank is
completely empty (0 total moles), it will create a new empty gas_mixture
at 20C before attempting atmos interactions. (Pretty much just ignores
the connector port)

In case it wasn't apparent from the above mentions, you can now insert
any portable tank (emergency oxygen, plasma tank, pretty much any tank
that could be hooked up to internals) into a hydroponics tray. You can
remove them with the previously added eject internal tank verb. There is
currently no visual indication of whether or not there is a tank
inserted (the tray icons are already cluttered with the sheer number of
overlays, and I didn't want to sprite another monstrosity like my past
spriting attempts yielded)

When utilizing an inserted tank for the plant's atmos interactions, it
will attempt to use distribution pressure set on the tank for the
atmospheric pressure inside the closed lid. If the tank's internal
pressure drops lower than the distribution pressure, it will use the
tank's internal pressure instead.

The alter temperature trait is now functional, and will heat/cool the
air used for the plant's atmos interactions. This means it can heat/cool
the surrounding air, inserted tanks, or the contents of a connected pipe
network.

Plant analyzers have had their readouts updated to report what (if any)
gases the plant consumes or produces during it's life. Also edited the
alter temperature trait's message on the plant analyzer to not
incorrectly refer to the change in "degrees Kelvin".

There may be a bit of wonkiness with open-air atmos interaction and gas
redistribution, which would be an issue with LINDA's processing and not
the changes in this PR.

Also, a major reminder that atmos grief is a bannable offense, and
releasing plasma-producing vines into the halls will be considered equal
to causing an atmos flood from atmospherics and dealt with accordingly.
2015-05-23 07:43:31 -04:00

307 lines
6.2 KiB
Plaintext

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.0
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)
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/shandseed
seed_type = "shand"
/obj/item/seeds/mtearseed
seed_type = "mtear"
/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/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/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"