diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index e934ab169f0a..3ec7fad220a0 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -164,8 +164,6 @@ #define VV_HK_MOD_MUTATIONS "quirkmut" #define VV_HK_MOD_QUIRKS "quirkmod" #define VV_HK_SET_SPECIES "setspecies" -#define VV_HK_ADD_SPLAT "add_splat" // DARKPACK EDIT ADD - SPLATS -#define VV_HK_REMOVE_SPLAT "remove_splat" // DARKPACK EDIT ADD - SPLATS #define VV_HK_PURRBATION "purrbation" #define VV_HK_APPLY_DNA_INFUSION "apply_dna_infusion" #define VV_HK_TURN_INTO_MMI "turn_into_mmi" diff --git a/code/__DEFINES/~darkpack/splats.dm b/code/__DEFINES/~darkpack/splats.dm index 81d9e7fa4d1c..ccdb0ba3296c 100644 --- a/code/__DEFINES/~darkpack/splats.dm +++ b/code/__DEFINES/~darkpack/splats.dm @@ -19,3 +19,11 @@ #define SPLAT_PRIO_SHIFTER 40 + SPLAT_PRIO_SPLAT #define SPLAT_PRIO_KINDRED 60 + SPLAT_PRIO_SPLAT + +#define VV_HK_ADD_SPLAT "add_splat" +#define VV_HK_REMOVE_SPLAT "remove_splat" + +#define VV_HK_GIVE_ACTION "give_action" +#define VV_HK_REMOVE_ACTION "remove_action" +#define VV_HK_GIVE_POWER "give_power" +#define VV_HK_REMOVE_POWER "remove_power" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ed834f938cae..32911efe2482 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1367,6 +1367,12 @@ GAME_VERB_HIDDEN(/mob, DisDblClick, ".dblclick", argu = null as anything, sec = VV_DROPDOWN_OPTION(VV_HK_REMOVE_SPELL, "Remove Spell") VV_DROPDOWN_OPTION(VV_HK_GIVE_MOB_ACTION, "Give Mob Ability") VV_DROPDOWN_OPTION(VV_HK_REMOVE_MOB_ACTION, "Remove Mob Ability") + // DARKPACK EDIT ADD START - SPLATS + VV_DROPDOWN_OPTION(VV_HK_GIVE_POWER, "Give Power") + VV_DROPDOWN_OPTION(VV_HK_REMOVE_POWER, "Remove Power") + VV_DROPDOWN_OPTION(VV_HK_GIVE_ACTION, "Give Action") + VV_DROPDOWN_OPTION(VV_HK_REMOVE_ACTION, "Remove Action") + // DARKPACK EDIT ADD END VV_DROPDOWN_OPTION(VV_HK_GIVE_DISEASE, "Give Disease") VV_DROPDOWN_OPTION(VV_HK_GODMODE, "Toggle Godmode") VV_DROPDOWN_OPTION(VV_HK_DROP_ALL, "Drop Everything") @@ -1419,6 +1425,20 @@ GAME_VERB_HIDDEN(/mob, DisDblClick, ".dblclick", argu = null as anything, sec = if(href_list[VV_HK_REMOVE_SPELL]) return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/remove_spell, src) + // DARKPACK EDIT ADD START - SPLATS + if(href_list[VV_HK_GIVE_ACTION]) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_action, src) + + if(href_list[VV_HK_REMOVE_ACTION]) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/remove_action, src) + + if(href_list[VV_HK_GIVE_POWER]) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_power, src) + + if(href_list[VV_HK_REMOVE_POWER]) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/remove_power, src) + // DARKPACK EDIT ADD END + if(href_list[VV_HK_GIVE_DISEASE]) return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_disease, src) diff --git a/modular_darkpack/modules/splats/code/powers/_power.dm b/modular_darkpack/modules/splats/code/powers/_power.dm index 2b6a9942b956..20e2e758dc8c 100644 --- a/modular_darkpack/modules/splats/code/powers/_power.dm +++ b/modular_darkpack/modules/splats/code/powers/_power.dm @@ -1,4 +1,5 @@ /datum/action/cooldown/power + abstract_type = /datum/action/cooldown/power cooldown_time = 1 TURNS // Good default. /// The level/rank at which this power is taken or can be taken at. diff --git a/modular_darkpack/modules/splats/code/powers/admin_verb_grant_action.dm b/modular_darkpack/modules/splats/code/powers/admin_verb_grant_action.dm new file mode 100644 index 000000000000..f64f6c101488 --- /dev/null +++ b/modular_darkpack/modules/splats/code/powers/admin_verb_grant_action.dm @@ -0,0 +1,58 @@ +ADMIN_VERB(give_action, R_FUN, "Give Action", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/action_recipient) + var/which = tgui_alert(user, "Chose by name or by type path?", "Chose option", list("Name", "Typepath")) + if(!which) + return + if(QDELETED(action_recipient)) + to_chat(user, span_warning("The intended action recipient no longer exists.")) + return + + var/static/list/action_list + if(!action_list) + action_list = list() + var/blacklist = valid_subtypesof(/datum/action/cooldown/power) + valid_subtypesof(/datum/action/cooldown/spell) + valid_subtypesof(/datum/action/cooldown/mob_cooldown) + for(var/datum/action/to_add as anything in valid_subtypesof(/datum/action) - blacklist) + var/action_name = to_add::name + if(which == "Name") + action_list[action_name] = to_add + else + action_list += to_add + + var/chosen_action = tgui_input_list(user, "Choose the action to give to [action_recipient]. Many actions wont function without further varediting.", "ABRAKADABRA", sort_list(action_list)) + if(isnull(chosen_action)) + return + var/datum/action/action_path = which == "Typepath" ? chosen_action : action_list[chosen_action] + if(!ispath(action_path)) + return + + if(QDELETED(action_recipient)) + to_chat(user, span_warning("The intended action recipient no longer exists.")) + return + + BLACKBOX_LOG_ADMIN_VERB("Give Action") + log_admin("[key_name(user)] gave [key_name(action_recipient)] the action [chosen_action].") + message_admins("[key_name_admin(user)] gave [key_name_admin(action_recipient)] the action [chosen_action].") + + var/datum/action/new_action = new action_path(action_recipient.mind || action_recipient) + + new_action.Grant(action_recipient) + +ADMIN_VERB(remove_action, R_FUN, "Remove Action", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/removal_target) + var/list/target_action_list = list() + for(var/datum/action/action in removal_target.actions) + target_action_list[action.name] = action + + if(!length(target_action_list)) + return + + var/chosen_action = tgui_input_list(user, "Choose the action to remove from [removal_target]", "ABRAKADABRA", sort_list(target_action_list)) + if(isnull(chosen_action)) + return + var/datum/action/to_remove = target_action_list[chosen_action] + if(!istype(to_remove)) + return + + qdel(to_remove) + log_admin("[key_name(user)] removed the action [chosen_action] from [key_name(removal_target)].") + message_admins("[key_name_admin(user)] removed the action [chosen_action] from [key_name_admin(removal_target)].") + BLACKBOX_LOG_ADMIN_VERB("Remove Action") + diff --git a/modular_darkpack/modules/splats/code/powers/admin_verbs.dm b/modular_darkpack/modules/splats/code/powers/admin_verbs.dm new file mode 100644 index 000000000000..d4a5e7a12a60 --- /dev/null +++ b/modular_darkpack/modules/splats/code/powers/admin_verbs.dm @@ -0,0 +1,55 @@ +ADMIN_VERB(give_power, R_FUN, "Give Power", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/power_recipient) + var/which = tgui_alert(user, "Chose by name or by type path?", "Chose option", list("Name", "Typepath")) + if(!which) + return + if(QDELETED(power_recipient)) + to_chat(user, span_warning("The intended power recipient no longer exists.")) + return + + var/list/power_list = list() + for(var/datum/action/cooldown/power/to_add as anything in valid_subtypesof(/datum/action/cooldown/power)) + var/power_name = to_add::name + if(which == "Name") + power_list[power_name] = to_add + else + power_list += to_add + + var/chosen_power = tgui_input_list(user, "Choose the power to give to [power_recipient]", "ABRAKADABRA", sort_list(power_list)) + if(isnull(chosen_power)) + return + var/datum/action/cooldown/power/power_path = which == "Typepath" ? chosen_power : power_list[chosen_power] + if(!ispath(power_path)) + return + + if(QDELETED(power_recipient)) + to_chat(user, span_warning("The intended power recipient no longer exists.")) + return + + BLACKBOX_LOG_ADMIN_VERB("Give Power") + log_admin("[key_name(user)] gave [key_name(power_recipient)] the power [chosen_power].") + message_admins("[key_name_admin(user)] gave [key_name_admin(power_recipient)] the power [chosen_power].") + + var/datum/action/cooldown/power/new_power = new power_path(power_recipient.mind || power_recipient) + + new_power.Grant(power_recipient) + +ADMIN_VERB(remove_power, R_FUN, "Remove Power", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/removal_target) + var/list/target_power_list = list() + for(var/datum/action/cooldown/power/power in removal_target.actions) + target_power_list[power.name] = power + + if(!length(target_power_list)) + return + + var/chosen_power = tgui_input_list(user, "Choose the power to remove from [removal_target]", "ABRAKADABRA", sort_list(target_power_list)) + if(isnull(chosen_power)) + return + var/datum/action/cooldown/power/to_remove = target_power_list[chosen_power] + if(!istype(to_remove)) + return + + qdel(to_remove) + log_admin("[key_name(user)] removed the power [chosen_power] from [key_name(removal_target)].") + message_admins("[key_name_admin(user)] removed the power [chosen_power] from [key_name_admin(removal_target)].") + BLACKBOX_LOG_ADMIN_VERB("Remove Power") + diff --git a/modular_darkpack/modules/werewolf_the_apocalypse/code/gifts/_gift.dm b/modular_darkpack/modules/werewolf_the_apocalypse/code/gifts/_gift.dm index dc5b3ff86fb0..e9cba21b249f 100644 --- a/modular_darkpack/modules/werewolf_the_apocalypse/code/gifts/_gift.dm +++ b/modular_darkpack/modules/werewolf_the_apocalypse/code/gifts/_gift.dm @@ -2,6 +2,7 @@ /datum/storyteller_roll/gift /datum/action/cooldown/power/gift + abstract_type = /datum/action/cooldown/power/gift background_icon = 'modular_darkpack/modules/werewolf_the_apocalypse/icons/werewolf_abilities.dmi' background_icon_state = "bg_gift" button_icon = 'modular_darkpack/modules/werewolf_the_apocalypse/icons/werewolf_abilities.dmi' diff --git a/tgstation.dme b/tgstation.dme index 6c8f50b39e4c..f69c14304e24 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -7923,6 +7923,8 @@ #include "modular_darkpack\modules\splats\code\splat_life.dm" #include "modular_darkpack\modules\splats\code\splat_management.dm" #include "modular_darkpack\modules\splats\code\powers\_power.dm" +#include "modular_darkpack\modules\splats\code\powers\admin_verb_grant_action.dm" +#include "modular_darkpack\modules\splats\code\powers\admin_verbs.dm" #include "modular_darkpack\modules\splats\code\powers\st_power_management.dm" #include "modular_darkpack\modules\splats\code\prefrences\pref_info.dm" #include "modular_darkpack\modules\splats\code\prefrences\splat_middleware.dm"