Files
Paradise/code/modules/hydroponics/growninedible.dm
T
3c043374d1 Botany rework V2 (#24342)
* Many botany QoL changes.

* Give observers a plant analyzer.

* Hooks should be executable.

* Completely new botany mutation mechanics.

* Minor fixes, changed vendor contents.

* Add charcoal to NutriMax extended inventory.

* Lint.

* Reset somatoray beam effects in a few more places.

* Mapped in seed sorting trays and mutrient.

* Slimmed down the seed sorting tray.

* Update unsorted seeds with analyzer, ghost-analyzer, and HUD support.

* Make english_list null-safe (and slightly faster).

* Fixed a mutation focus bug, added plant anayzer attackby to unsorted seeds.

* Made self-sufficient trays display their nutrient as Earthsblood.

* Improved descriptions and on-use texts.

* Added 5 dropers and 3 seed sorting trays to NutriMax.

* Mark stuff as notices, special case for duplicate doping.

* New way to get kudzu, QoL changes.

* Yield somatoray adds a message to the yield stat.
* Unsorted seeds produce a message when you try to put them in a tray or
  machine.
* Potassium iodide and pentetic acid will now neutralize the tray's
  mutagen.
* Using a plant bag on a seed extractor will now process plants into
  seeds if there are no seeds in it.

* Bonk.

* Don't try to extract no seeds.

* Butterfingers.

* Bonk more.

* Add seed sorting trays to perma.

* Upgraded Seed Extractor GUI.

* Do not drop that which you do not extract.

* Don't bug out when removing the last seed.

* You want a tgui rebuild? Have a tgui rebuild.

* Drop trait-adding threshold by 10.

Before:
Needs modified mutation level >50.
With the x2 from 9+ seeds, this happens at base mutation level 25.
With maximum mutation level of 35 (L4Z+mutagen+somatoray), chance was
20%.
Required either L4Z (yield set to 1), or a somatoray (external help) for
any chance.

After:
Needs modified mutation level >40.
With the x2 from 9+ seeds, this happens at base mutation level 20.
With maximum mutation level of 35 (L4Z+mutagen+somatoray), chance is
30%.
Can get 10% chance with mutation level 25 (Mut+mutagen).

* Renamed mutagen level -> mutagen tank

* Left-align seed extractor, more efficient icon sending.

* New sprite thanks to McRamon.

* tgui rebuild

---------

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
2024-04-15 20:29:49 +00:00

87 lines
2.3 KiB
Plaintext

// **********************
// Other harvested materials from plants (that are not food)
// **********************
/// Grown weapons
/obj/item/grown
name = "grown_weapon"
icon = 'icons/obj/hydroponics/harvest.dmi'
resistance_flags = FLAMMABLE
/// The seed of this plant. Starts as a type path, gets converted to an item on New()
var/obj/item/seeds/seed = null
/// The unsorted seed of this plant, if any. Used by the seed extractor.
var/obj/item/unsorted_seeds/unsorted_seed = null
/obj/item/grown/Initialize(mapload, obj/item/seeds/new_seed)
. = ..()
create_reagents(50)
if(istype(new_seed, /obj/item/seeds))
var/obj/item/seeds/S = new_seed
seed = S.Copy()
else if(istype(new_seed, /obj/item/unsorted_seeds))
var/obj/item/unsorted_seeds/S = new_seed
unsorted_seed = S.Copy()
seed = S.seed_data.original_seed.Copy()
else if(seed)
seed = new seed
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)
if(istype(src, seed.product)) // no adding reagents if it is just a trash item
seed.prepare_result(src)
transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5
add_juice()
/obj/item/grown/Destroy()
QDEL_NULL(seed)
return ..()
/obj/item/grown/attackby(obj/item/O, mob/user, params)
..()
if(istype(O, /obj/item/plant_analyzer))
send_plant_details(user)
/obj/item/grown/proc/add_juice()
if(reagents)
return 1
return 0
/obj/item/grown/after_slip(mob/living/carbon/human/H)
if(!seed)
return
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_slip(src, H)
/obj/item/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/grown/extinguish_light(force = FALSE)
if(!force)
return
if(seed.get_gene(/datum/plant_gene/trait/glow/shadow))
return
set_light(0)
/obj/item/grown/proc/send_plant_details(mob/user)
var/msg = "<span class='info'>This is \a </span><span class='name'>[src]</span>\n"
if(seed)
msg += seed.get_analyzer_text()
msg += "</span>"
to_chat(usr, msg)
return
/obj/item/grown/attack_ghost(mob/dead/observer/user)
if(!istype(user)) // Make sure user is actually an observer. Revenents also use attack_ghost, but do not have the toggle plant analyzer var.
return
if(user.plant_analyzer)
send_plant_details(user)