mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
## About The Pull Request just macro-izes all the usages of verbs in the codebase as a pre-requisite to my follow up pr that serializes all the verbs arguments so we can tgui-ify the command bar, so we can then put it on the onscreen map. this also basically does the same as #94487 so can easily be integrated into the verb queueing stuff... but does not actually do any verb queueing by itself. basically im just trying to be https://github.com/tgstation/tgstation/labels/Atomic ## Why It's Good For The Game it doesn't really do anything by itself but it does let us do more stuff ## Changelog 🆑 code: the backend to all verbs in the game has been played with, please report any issues to github /🆑 --------- Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
36 lines
1.5 KiB
Plaintext
36 lines
1.5 KiB
Plaintext
/*
|
|
* Attempts to grant the target all organs from a given DNA infuser entry.area
|
|
* Returns the entry if all organs were successfully replaced.
|
|
* If no infusion was picked, the infusion had no organs, or if one or more organs could not be granted, returns FALSE
|
|
*/
|
|
GAME_VERB_PROC(/client, grant_dna_infusion, "Apply DNA Infusion", "Debug", mob/living/carbon/human/target in world)
|
|
|
|
var/list/infusions = list()
|
|
for(var/datum/infuser_entry/path as anything in sort_list(subtypesof(/datum/infuser_entry), GLOBAL_PROC_REF(cmp_typepaths_asc)))
|
|
var/str = "[initial(path.name)] ([path])"
|
|
infusions[str] = path
|
|
|
|
var/datum/infuser_entry/picked_infusion = tgui_input_list(usr, "Select infusion", "Apply DNA Infusion", infusions)
|
|
|
|
if(isnull(picked_infusion))
|
|
return FALSE
|
|
|
|
// This is necessary because list propererties are not defined until initialization
|
|
picked_infusion = infusions[picked_infusion]
|
|
picked_infusion = new picked_infusion()
|
|
|
|
if(!length(picked_infusion.output_organs))
|
|
return FALSE
|
|
|
|
. = picked_infusion
|
|
for(var/obj/item/organ/infusion_organ as anything in picked_infusion.output_organs)
|
|
var/obj/item/organ/new_organ = new infusion_organ()
|
|
new_organ.replace_into(target)
|
|
if(new_organ.owner != target)
|
|
to_chat(usr, span_notice("[target] is unable to carry [new_organ]!"))
|
|
qdel(new_organ)
|
|
. = FALSE
|
|
continue
|
|
log_admin("[key_name(usr)] has added organ [new_organ.type] to [key_name(target)]")
|
|
message_admins("[key_name_admin(usr)] has added organ [new_organ.type] to [ADMIN_LOOKUPFLW(target)]")
|