diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index ffeb1cce2731..28249b0bd2e7 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -36,11 +36,24 @@ ADMIN_VERB(borg_panel, R_ADMIN, "Show Borg Panel", ADMIN_VERB_NO_DESCRIPTION, AD "scrambledcodes" = borg.scrambledcodes ) .["upgrades"] = list() - var/static/list/not_shown_upgrades = list(/obj/item/borg/upgrade/hypospray) - for (var/upgradetype in subtypesof(/obj/item/borg/upgrade)-not_shown_upgrades) //hypospray is a dummy parent for hypospray upgrades - var/obj/item/borg/upgrade/upgrade = upgradetype - if (initial(upgrade.model_type) && !is_type_in_list(borg.model, initial(upgrade.model_type))) // Upgrade requires a different model //HEY ASSHOLE, INITIAL DOESNT WORK WITH LISTS - continue + var/list/excluded_upgrades = list( + /obj/item/borg/upgrade/hypospray, //hypospray is a dummy parent for hypospray upgrades + /obj/item/borg/upgrade/transform, + /obj/item/borg/upgrade/rename, + /obj/item/borg_restart_board, + /obj/item/borg/upgrade/modkit, + ) + for (var/upgradetype in subtypesof(/obj/item/borg/upgrade)-excluded_upgrades) + var/obj/item/borg/upgrade/upgrade = new upgradetype() + if(upgrade.model_type) // Only show upgrades that can be given. Cannot initial() lists either. + // is_type_in_list() doesn't work, so this: + var/has_req_module = FALSE + for(var/req_model_type in upgrade.model_type) + if(borg.model.type == req_model_type) + has_req_module = TRUE + break + if(!has_req_module) + continue var/installed = FALSE if (locate(upgradetype) in borg) installed = TRUE @@ -64,7 +77,7 @@ ADMIN_VERB(borg_panel, R_ADMIN, "Show Borg Panel", ADMIN_VERB_NO_DESCRIPTION, AD .["ais"] += list(list("name" = ai.name, "ref" = REF(ai), "connected" = (borg.connected_ai == ai))) -/datum/borgpanel/ui_act(action, params) +/datum/borgpanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/maplestation.dme b/maplestation.dme index 8378a93bbe0d..90e44e15c70d 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6585,6 +6585,7 @@ #include "maplestation_modules\code\modules\mod\mod_control.dm" #include "maplestation_modules\code\modules\mod\modules\modules_general.dm" #include "maplestation_modules\code\modules\movespeed\modifiers\reagent.dm" +#include "maplestation_modules\code\modules\objects\robot_magic.dm" #include "maplestation_modules\code\modules\paperwork\clipboard.dm" #include "maplestation_modules\code\modules\paperwork\stamps.dm" #include "maplestation_modules\code\modules\pixel_shift\code\pixel_shift_component.dm" diff --git a/maplestation_modules/code/modules/magic/mana/living_mana.dm b/maplestation_modules/code/modules/magic/mana/living_mana.dm index 5169b609d71b..a90dd8b0a09a 100644 --- a/maplestation_modules/code/modules/magic/mana/living_mana.dm +++ b/maplestation_modules/code/modules/magic/mana/living_mana.dm @@ -1,3 +1,15 @@ +//Silicon stuff +/mob/living/silicon + has_initial_mana_pool = TRUE + +/mob/living/silicon/get_initial_mana_pool_type() + return /datum/mana_pool/mob/living/silicon + +/datum/mana_pool/mob/living/silicon + maximum_mana_capacity = 25 + + +//Carbon stuff /mob/living/carbon has_initial_mana_pool = TRUE diff --git a/maplestation_modules/code/modules/objects/robot_magic.dm b/maplestation_modules/code/modules/objects/robot_magic.dm new file mode 100644 index 000000000000..450b52ed2e82 --- /dev/null +++ b/maplestation_modules/code/modules/objects/robot_magic.dm @@ -0,0 +1,47 @@ + +/obj/item/borg/upgrade/magic + name = "borg magical focus" + desc = "A magical focus which allows borgs to create magic." + icon = 'maplestation_modules/icons/obj/devices/circuitry_n_data.dmi' + icon_state = "cyborg_magic_focus" + w_class = WEIGHT_CLASS_SMALL + + has_initial_mana_pool = TRUE + ///the mana pool from the borg that the upgrade is inside. Set to null when not in a borg. + var/datum/mana_pool/borg_mana_pool = null + +//mana pool stuff for the magic borg upgrade +/datum/mana_pool/borg_focus + maximum_mana_capacity = CARBON_BASE_MANA_CAPACITY //same as carbons! + +/obj/item/borg/upgrade/magic/get_initial_mana_pool_type() + return /datum/mana_pool/borg_focus + +/obj/item/borg/upgrade/magic/action(mob/living/silicon/robot/borg) + . = ..() + if(.) + //add the spells to the borg's actions + var/list/list_value = borg.client.prefs.read_preference(/datum/preference/spellbook) + for (var/datum/spellbook_item/entry in spellbook_list_to_datums(list_value)) + entry.apply(borg, list_value[entry.type]) + + //store the borg's current mana pool for returning it when the module is removed + if (borg.mana_pool != null) //incase the borg has no mana pool + borg_mana_pool = borg.mana_pool + + //put the upgrade's magic pool into the borg. + borg.initialize_mana_pool_if_possible() + + borg.set_mana_pool(mana_pool) + +/obj/item/borg/upgrade/magic/deactivate(mob/living/silicon/robot/borg) + . = ..() + if(.) + //removes the spells + for (var/datum/action/cooldown/spell/action_to_remove in borg.actions) + action_to_remove.Remove(borg) + //resets the mana pool to before + borg.set_mana_pool(borg_mana_pool) + borg.initialize_mana_pool_if_possible() + borg_mana_pool = null //removes the borg's mana pool var from the upgrade as this upgrade being removed from the borg + diff --git a/maplestation_modules/icons/obj/devices/circuitry_n_data.dmi b/maplestation_modules/icons/obj/devices/circuitry_n_data.dmi new file mode 100644 index 000000000000..f28ca937b623 Binary files /dev/null and b/maplestation_modules/icons/obj/devices/circuitry_n_data.dmi differ