mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Refactor/rewrite of custom item spawning.
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user