Refactor/rewrite of custom item spawning.

This commit is contained in:
Zuhayr
2015-05-12 15:13:43 +09:30
parent ed60b17f8d
commit 59af7e5c4d
6 changed files with 189 additions and 93 deletions

View File

@@ -1010,6 +1010,46 @@ var/global/floorIsLava = 0
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(usr,0,0,1)
/datum/admins/proc/spawn_custom_item()
set category = "Debug"
set desc = "Spawn a custom item."
set name = "Spawn Custom Item"
if(!check_rights(R_SPAWN)) return
var/owner = input("Select a ckey.", "Spawn Custom Item") as null|anything in custom_items
if(!owner|| !custom_items[owner])
return
var/list/possible_items = custom_items[owner]
var/datum/custom_item/item_to_spawn = input("Select an item to spawn.", "Spawn Custom Item") as null|anything in possible_items
if(!item_to_spawn)
return
item_to_spawn.spawn_item(get_turf(usr))
/datum/admins/proc/check_custom_items()
set category = "Debug"
set desc = "Check the custom item list."
set name = "Check Custom Items"
if(!check_rights(R_SPAWN)) return
if(!custom_items)
usr << "Custom item list is null."
return
if(!custom_items.len)
usr << "Custom item list not populated."
return
for(var/assoc_key in custom_items)
usr << "[assoc_key] has:"
var/list/current_items = custom_items[assoc_key]
for(var/datum/custom_item/item in current_items)
usr << "- name: [item.name] icon: [item.item_icon] path: [item.item_path] desc: [item.item_desc]"
/datum/admins/proc/spawn_plant()
set category = "Debug"
set desc = "Spawn a spreading plant effect."