[MIRROR] Completely removes proc_holders from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code. [MDB IGNORE] (#14666)

* Completely removes `proc_holders` from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code.

* our changes

* yes

* 0

* Update blackmesa.dmm

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-07-01 21:33:30 +02:00
committed by GitHub
parent f507824ee7
commit c68fea7cba
405 changed files with 12842 additions and 11487 deletions

View File

@@ -389,8 +389,6 @@
min_val = 0
integer = FALSE // It is in hours, but just in case one wants to specify minutes.
/datum/config_entry/flag/sdql_spells
/datum/config_entry/flag/native_fov
/datum/config_entry/flag/disallow_title_music

View File

@@ -92,10 +92,22 @@ SUBSYSTEM_DEF(statpanels)
if(target.mob)
var/mob/target_mob = target.mob
if((target.stat_tab in target.spell_tabs) || !length(target.spell_tabs) && (length(target_mob.mob_spell_list) || length(target_mob.mind?.spell_list)))
if(num_fires % default_wait == 0)
set_spells_tab(target, target_mob)
// Handle the action panels of the stat panel
var/update_actions = FALSE
// We're on a spell tab, update the tab so we can see cooldowns progressing and such
if(target.stat_tab in target.spell_tabs)
update_actions = TRUE
// We're not on a spell tab per se, but we have cooldown actions, and we've yet to
// set up our spell tabs at all
if(!length(target.spell_tabs) && locate(/datum/action/cooldown) in target_mob.actions)
update_actions = TRUE
if(update_actions && num_fires % default_wait == 0)
set_action_tabs(target, target_mob)
// Handle the examined turf of the stat panel
if(target_mob?.listed_turf && num_fires % default_wait == 0)
if(!target_mob.TurfAdjacent(target_mob.listed_turf) || isnull(target_mob.listed_turf))
@@ -167,14 +179,15 @@ SUBSYSTEM_DEF(statpanels)
sdql2A += sdql2B
target.stat_panel.send_message("update_sdql2", sdql2A)
/datum/controller/subsystem/statpanels/proc/set_spells_tab(client/target, mob/target_mob)
var/list/proc_holders = target_mob.get_proc_holders()
/// Set up the various action tabs.
/datum/controller/subsystem/statpanels/proc/set_action_tabs(client/target, mob/target_mob)
var/list/actions = target_mob.get_actions_for_statpanel()
target.spell_tabs.Cut()
for(var/proc_holder_list as anything in proc_holders)
target.spell_tabs |= proc_holder_list[1]
for(var/action_data in actions)
target.spell_tabs |= action_data[1]
target.stat_panel.send_message("update_spells", list(spell_tabs = target.spell_tabs, proc_holders_encoded = proc_holders))
target.stat_panel.send_message("update_spells", list(spell_tabs = target.spell_tabs, actions = actions))
/datum/controller/subsystem/statpanels/proc/set_turf_examine_tab(client/target, mob/target_mob)
var/list/overrides = list()
@@ -240,10 +253,22 @@ SUBSYSTEM_DEF(statpanels)
return TRUE
var/mob/target_mob = target.mob
if((target.stat_tab in target.spell_tabs) || !length(target.spell_tabs) && (length(target_mob.mob_spell_list) || length(target_mob.mind?.spell_list)))
set_spells_tab(target, target_mob)
// Handle actions
var/update_actions = FALSE
if(target.stat_tab in target.spell_tabs)
update_actions = TRUE
if(!length(target.spell_tabs) && locate(/datum/action/cooldown) in target_mob.actions)
update_actions = TRUE
if(update_actions)
set_action_tabs(target, target_mob)
return TRUE
// Handle turfs
if(target_mob?.listed_turf)
if(!target_mob.TurfAdjacent(target_mob.listed_turf))
target.stat_panel.send_message("removed_listedturf")