Added a fruit spawning debug proc.

This commit is contained in:
Zuhayr
2015-01-24 10:37:23 +10:30
parent 4791ef2b74
commit b791c92c6e
3 changed files with 28 additions and 10 deletions

View File

@@ -993,6 +993,20 @@ var/global/floorIsLava = 0
else else
return "Error: Invalid sabotage target: [target]" 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) /datum/admins/proc/spawn_atom(var/object as text)
set category = "Debug" set category = "Debug"
set desc = "(atom path) Spawn an atom" set desc = "(atom path) Spawn an atom"

View File

@@ -107,6 +107,7 @@ var/list/admin_verbs_fun = list(
/client/proc/editappear /client/proc/editappear
) )
var/list/admin_verbs_spawn = list( var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_fruit,
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/client/proc/respawn_character /client/proc/respawn_character
) )

View File

@@ -624,7 +624,7 @@ proc/populate_seed_list()
return (P ? P : 0) return (P ? P : 0)
//Place the plant products at the feet of the user. //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) if(!user)
return return
@@ -633,8 +633,8 @@ proc/populate_seed_list()
if(!isnull(products) && products.len && yield > 0) if(!isnull(products) && products.len && yield > 0)
got_product = 1 got_product = 1
if(!got_product && !harvest_sample) if(!force_amount && !got_product && !harvest_sample)
user << "\red You fail to harvest anything useful." user << "<span class='danger'>You fail to harvest anything useful.</span>"
else else
user << "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name]." user << "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name]."
@@ -651,13 +651,16 @@ proc/populate_seed_list()
return return
var/total_yield = 0 var/total_yield = 0
if(yield > -1) if(!isnull(force_amount))
if(isnull(yield_mod) || yield_mod < 1) total_yield = force_amount
yield_mod = 0 else
total_yield = yield if(yield > -1)
else if(isnull(yield_mod) || yield_mod < 1)
total_yield = yield + rand(yield_mod) yield_mod = 0
total_yield = max(1,total_yield) total_yield = yield
else
total_yield = yield + rand(yield_mod)
total_yield = max(1,total_yield)
currently_querying = list() currently_querying = list()
for(var/i = 0;i<total_yield;i++) for(var/i = 0;i<total_yield;i++)