Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/~darkpack/splats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
20 changes: 20 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions modular_darkpack/modules/splats/code/powers/_power.dm
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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")

55 changes: 55 additions & 0 deletions modular_darkpack/modules/splats/code/powers/admin_verbs.dm
Original file line number Diff line number Diff line change
@@ -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")

Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading