diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index fdfb9f0e3e..9ddb6b8903 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -993,6 +993,20 @@ var/global/floorIsLava = 0 else return "Error: Invalid sabotage target: [target]" */ + +/datum/admins/proc/spawn_fruit() + set category = "Debug" + set desc = "(seed index) Spawn the product of a seed." + set name = "Spawn Fruit" + + if(!check_rights(R_SPAWN)) return + + var/seedtype = input("Select a seed type", "Spawn Fruit") as null|anything in seed_types + if(!seedtype || !seed_types[seedtype]) + return + var/datum/seed/S = seed_types[seedtype] + S.harvest(usr,0,0,1) + /datum/admins/proc/spawn_atom(var/object as text) set category = "Debug" set desc = "(atom path) Spawn an atom" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 823fb69f80..0835c311fa 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -107,6 +107,7 @@ var/list/admin_verbs_fun = list( /client/proc/editappear ) var/list/admin_verbs_spawn = list( + /datum/admins/proc/spawn_fruit, /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ /client/proc/respawn_character ) diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 490481fdd1..dfc510b649 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -624,7 +624,7 @@ proc/populate_seed_list() 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) +/datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample,var/force_amount) if(!user) return @@ -633,8 +633,8 @@ proc/populate_seed_list() if(!isnull(products) && products.len && yield > 0) got_product = 1 - if(!got_product && !harvest_sample) - user << "\red You fail to harvest anything useful." + if(!force_amount && !got_product && !harvest_sample) + user << "You fail to harvest anything useful." else user << "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name]." @@ -651,13 +651,16 @@ proc/populate_seed_list() return var/total_yield = 0 - if(yield > -1) - if(isnull(yield_mod) || yield_mod < 1) - yield_mod = 0 - total_yield = yield - else - total_yield = yield + rand(yield_mod) - total_yield = max(1,total_yield) + if(!isnull(force_amount)) + total_yield = force_amount + else + if(yield > -1) + if(isnull(yield_mod) || yield_mod < 1) + yield_mod = 0 + total_yield = yield + else + total_yield = yield + rand(yield_mod) + total_yield = max(1,total_yield) currently_querying = list() for(var/i = 0;i