Files
Paradise/code/modules/hydroponics/hydroitemdefines.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

361 lines
12 KiB
Plaintext

// Plant analyzer
/obj/item/plant_analyzer
name = "plant analyzer"
desc = "A versatile scanner for analyzing plants, plant produce, and seeds. Can be used on a bag holding unsorted seeds to quickly and thorougly sort them into usable packs."
icon = 'icons/obj/device.dmi'
icon_state = "hydro"
item_state = "analyzer"
w_class = WEIGHT_CLASS_TINY
slot_flags = SLOT_FLAG_BELT
origin_tech = "magnets=2;biotech=2"
materials = list(MAT_METAL = 210, MAT_GLASS = 40)
/obj/item/plant_analyzer/pre_attack(atom/target, mob/user, params)
if(!istype(target, /obj/item))
return ..()
var/found_unsorted_seeds = FALSE
var/depth = 0
for(var/obj/item/unsorted_seeds/unsorted in target)
found_unsorted_seeds = TRUE
if(!use_tool(target, user, 0.5 SECONDS))
break
depth++
unsorted.sort(depth)
if(found_unsorted_seeds)
return FALSE
return ..()
// *************************************
// Hydroponics Tools
// *************************************
/// -- Skie
/obj/item/reagent_containers/spray/weedspray
name = "weed spray"
desc = "It's a toxic mixture, in spray form, to kill small weeds."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "weedspray"
item_state = "plantbgone"
belt_icon = null
volume = 100
container_type = OPENCONTAINER
slot_flags = SLOT_FLAG_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 10
list_reagents = list("atrazine" = 100)
/obj/item/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
/// -- Skie
/obj/item/reagent_containers/spray/pestspray
name = "pest spray"
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "pestspray"
item_state = "plantbgone"
belt_icon = null
volume = 100
container_type = OPENCONTAINER
slot_flags = SLOT_FLAG_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 10
list_reagents = list("pestkiller" = 100)
/obj/item/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/cultivator
name = "cultivator"
desc = "It's used for removing weeds or scratching your back."
icon_state = "cultivator"
item_state = "cultivator"
belt_icon = "cultivator"
origin_tech = "engineering=2;biotech=2"
flags = CONDUCT
force = 5
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL = 200)
attack_verb = list("slashed", "sliced", "cut", "clawed")
hitsound = 'sound/weapons/bladeslice.ogg'
/obj/item/cultivator/rake
name = "rake"
icon_state = "rake"
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("slashed", "sliced", "bashed", "clawed")
hitsound = null
materials = null
flags = NONE
resistance_flags = FLAMMABLE
/obj/item/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."
lefthand_file = 'icons/mob/inhands/weapons_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons_righthand.dmi'
icon = 'icons/obj/weapons/melee.dmi'
icon_state = "hatchet"
item_state = "hatchet"
belt_icon = "hatchet"
flags = CONDUCT
force = 12
w_class = WEIGHT_CLASS_TINY
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 = TRUE
/obj/item/hatchet/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is chopping at [user.p_themselves()] 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/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/hatchet/wooden
desc = "A crude axe blade upon a short wooden handle."
icon_state = "woodhatchet"
materials = null
flags = NONE
/obj/item/scythe
name = "scythe"
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
icon = 'icons/obj/weapons/melee.dmi'
icon_state = "scythe0"
force = 13
throwforce = 5
throw_speed = 2
throw_range = 3
w_class = WEIGHT_CLASS_BULKY
flags = CONDUCT
armour_penetration_flat = 20
slot_flags = SLOT_FLAG_BACK
origin_tech = "materials=3;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
hitsound = 'sound/weapons/bladeslice.ogg'
sharp = TRUE
var/extend = TRUE
var/swiping = FALSE
/obj/item/scythe/bone
name = "bone scythe"
desc = "Perfect for harvesting. And it's not about plants."
icon_state = "bone_scythe"
force = 14
throw_range = 4
origin_tech = "materials=1;combat=2"
/obj/item/scythe/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is beheading [user.p_themselves()] with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting)
affecting.droplimb(1, DROPLIMB_SHARP)
playsound(loc, pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg'), 50, 1, -1)
return BRUTELOSS
/obj/item/scythe/pre_attack(atom/A, mob/living/user, params)
if(swiping || !istype(A, /obj/structure/spacevine) || get_turf(A) == get_turf(user))
return ..()
else
var/turf/user_turf = get_turf(user)
var/dir_to_target = get_dir(user_turf, get_turf(A))
swiping = TRUE
var/static/list/scythe_slash_angles = list(0, 45, 90, -45, -90)
for(var/i in scythe_slash_angles)
var/turf/T = get_step(user_turf, turn(dir_to_target, i))
for(var/obj/structure/spacevine/V in T)
if(user.Adjacent(V))
melee_attack_chain(user, V)
swiping = FALSE
/obj/item/scythe/tele
name = "telescopic scythe"
desc = "A sharp and curved blade on a collapsable fibre metal handle, this tool is the pinnacle of covert reaping technology."
icon_state = "tscythe0"
item_state = null //no sprite for folded version, like a tele-baton
force = 3
sharp = FALSE
w_class = WEIGHT_CLASS_SMALL
extend = FALSE
slot_flags = SLOT_FLAG_BELT
origin_tech = "materials=3;combat=3"
attack_verb = list("hit", "poked")
hitsound = "swing_hit"
/obj/item/scythe/tele/attack_self(mob/user)
extend = !extend
if(extend)
to_chat(user, "<span class='warning'>With a flick of your wrist, you extend the scythe. It's reaping time!</span>")
slot_flags = SLOT_FLAG_BACK //won't fit on belt, but can be worn on belt when extended
w_class = WEIGHT_CLASS_BULKY //won't fit in backpacks while extended
force = 15 //slightly better than 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 away for easy storage.</span>")
slot_flags = SLOT_FLAG_BELT //can be worn on belt again, but no longer makes sense to wear on the back
w_class = WEIGHT_CLASS_SMALL
force = 3
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
set_sharpness(extend)
update_icon(UPDATE_ICON_STATE)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.update_inv_l_hand()
H.update_inv_r_hand()
add_fingerprint(user)
/obj/item/scythe/tele/update_icon_state()
if(extend)
icon_state = "tscythe1"
item_state = "scythe0" //use the normal scythe in-hands
else
icon_state = "tscythe0"
item_state = null //no sprite for folded version, like a tele-baton
// *************************************
// Nutrient defines for hydroponics
// *************************************
/obj/item/reagent_containers/glass/bottle/nutrient
name = "jug of nutrient"
desc = "A decent sized plastic jug."
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug"
item_state = "plastic_jug"
w_class = WEIGHT_CLASS_TINY
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(1,2,5,10,20,40,80)
container_type = OPENCONTAINER
volume = 80
hitsound = 'sound/weapons/jug_empty_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_empty_impact.ogg'
force = 0.2
throwforce = 0.2
/obj/item/reagent_containers/glass/bottle/nutrient/Initialize(mapload)
. = ..()
add_lid()
/obj/item/reagent_containers/glass/bottle/nutrient/on_reagent_change()
. = ..()
update_icon(UPDATE_OVERLAYS)
if(reagents.total_volume)
hitsound = 'sound/weapons/jug_filled_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_filled_impact.ogg'
else
hitsound = 'sound/weapons/jug_empty_impact.ogg'
mob_throw_hit_sound = 'sound/weapons/jug_empty_impact.ogg'
/obj/item/reagent_containers/glass/bottle/nutrient/update_overlays()
. = ..()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "plastic_jug10")
var/percent = round((reagents.total_volume / volume) * 100)
switch(percent)
if(0 to 10)
filling.icon_state = "plastic_jug-10"
if(11 to 29)
filling.icon_state = "plastic_jug25"
if(30 to 45)
filling.icon_state = "plastic_jug40"
if(46 to 61)
filling.icon_state = "plastic_jug55"
if(62 to 77)
filling.icon_state = "plastic_jug70"
if(78 to 92)
filling.icon_state = "plastic_jug85"
if(93 to INFINITY)
filling.icon_state = "plastic_jug100"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
. += filling
if(!is_open_container())
. += "lid_jug"
/obj/item/reagent_containers/glass/bottle/nutrient/ez
name = "jug of E-Z-Nutrient"
desc = "Contains a basic fertilizer with no special traits."
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug_ez"
list_reagents = list("eznutrient" = 80)
/obj/item/reagent_containers/glass/bottle/nutrient/mut
name = "jug of Mutrient"
desc = "Contains a fertilizer that causes mild mutations with each harvest."
icon_state = "plastic_jug_mut"
list_reagents = list("mutrient" = 80)
/obj/item/reagent_containers/glass/bottle/nutrient/l4z
name = "jug 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 = "plastic_jug_l4z"
list_reagents = list("left4zednutrient" = 80)
/obj/item/reagent_containers/glass/bottle/nutrient/rh
name = "jug 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 = "plastic_jug_rh"
list_reagents = list("robustharvestnutrient" = 80)
/obj/item/reagent_containers/glass/bottle/nutrient/empty
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug"
/obj/item/reagent_containers/glass/bottle/nutrient/killer
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug_k"
w_class = WEIGHT_CLASS_TINY
/obj/item/reagent_containers/glass/bottle/nutrient/killer/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/reagent_containers/glass/bottle/nutrient/killer/weedkiller
name = "jug of weed killer"
desc = "Contains a herbicide."
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug_wk"
list_reagents = list("atrazine" = 80)
/obj/item/reagent_containers/glass/bottle/nutrient/killer/pestkiller
name = "jug of pest spray"
desc = "Contains a pesticide."
icon = 'icons/obj/chemical.dmi'
icon_state = "plastic_jug_pk"
list_reagents = list("pestkiller" = 80)