diff --git a/code/datums/uplink_items/uplink_general.dm b/code/datums/uplink_items/uplink_general.dm index 2634cd51b5e..ac104013547 100644 --- a/code/datums/uplink_items/uplink_general.dm +++ b/code/datums/uplink_items/uplink_general.dm @@ -660,6 +660,13 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) item = /obj/item/mod/module/plate_compression cost = 10 +/datum/uplink_item/suits/chameleon_module + name = "MODsuit Chameleon Module" + desc = "A module using chameleon technology to disguise an undeployed modsuit as another object. Note: the disguise will not work once the modsuit is deployed, but can be toggled again when retracted." + reference = "MSCM" + item = /obj/item/mod/module/chameleon + cost = 10 + /datum/uplink_item/suits/noslip name = "MODsuit Anti-Slip Module" desc = "A MODsuit module preventing the user from slipping on water. Already installed in the uplink modsuits." diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index d1695082d25..7df7d6a3b12 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -648,3 +648,29 @@ /obj/item/stamp/chameleon/broken/Initialize(mapload) . = ..() chameleon_action.emp_randomise(INFINITY) + +/datum/action/item_action/chameleon/change/modsuit/update_item(obj/item/picked_item) + . = ..() + if(ismodcontrol(target)) + var/obj/item/mod/control/C = target + if(C.current_disguise) //backup check + for(var/obj/item/mod/module/chameleon/toreturn in C.contents) + toreturn.return_look() + return + C.current_disguise = TRUE + C.item_state = initial(picked_item.item_state) + for(var/obj/item/mod/module/chameleon/tosignal in C.contents) + tosignal.RegisterSignal(C, COMSIG_MOD_ACTIVATE, TYPE_PROC_REF(/obj/item/mod/module/chameleon, return_look)) + +/datum/action/item_action/chameleon/change/modsuit/select_look(mob/user) + if(ismodcontrol(target)) + var/obj/item/mod/control/C = target + if(C.current_disguise) //backup check + for(var/obj/item/mod/module/chameleon/toreturn in C.contents) + toreturn.return_look() + return + if(C.active || C.activating) + to_chat(C.wearer, "Your suit is already active!") + return + ..() + diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index aa03bc2605a..6cd38c1bec9 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -90,6 +90,10 @@ var/list/mod_overlays = list() /// Is the jetpack on so we should make ion effects? var/jetpack_active = FALSE + /// Cham option for when the cham module is installed. + var/datum/action/item_action/chameleon/change/modsuit/chameleon_action + /// Is the control unit disquised? + var/current_disguise = FALSE /obj/item/mod/control/serialize() var/list/data = ..() @@ -482,7 +486,8 @@ return ..() /obj/item/mod/control/update_icon_state() - icon_state = "[skin]-[base_icon_state][active ? "-sealed" : ""]" + if(current_disguise) + icon_state = "[skin]-[base_icon_state][active ? "-sealed" : ""]" return ..() /obj/item/mod/control/proc/set_wearer(mob/living/carbon/human/user) diff --git a/code/modules/mod/modules/modules_antag.dm b/code/modules/mod/modules/modules_antag.dm index bb7c9138ba3..24d21dda348 100644 --- a/code/modules/mod/modules/modules_antag.dm +++ b/code/modules/mod/modules/modules_antag.dm @@ -410,6 +410,57 @@ /obj/item/mod/module/ert_camera/on_suit_deactivation(deleting = FALSE) QDEL_NULL(camera) +///Chameleon - lets the suit disguise as any item that would fit on that slot. +/obj/item/mod/module/chameleon + name = "MOD chameleon module" + desc = "A module using chameleon technology to disguise the suit as another object." + icon_state = "chameleon" + module_type = MODULE_USABLE + complexity = 2 + incompatible_modules = list(/obj/item/mod/module/chameleon) + cooldown_time = 0.5 SECONDS + allow_flags = MODULE_ALLOW_INACTIVE + origin_tech = "materials=6;bluespace=5;syndicate=1" + +/obj/item/mod/module/chameleon/on_install() + mod.chameleon_action = new(mod) + mod.chameleon_action.chameleon_type = /obj/item/storage/backpack + mod.chameleon_action.chameleon_name = "Backpack" + mod.chameleon_action.initialize_disguises() + + +/obj/item/mod/module/chameleon/on_uninstall(deleting = FALSE) + if(mod.current_disguise) + return_look() + QDEL_NULL(mod.chameleon_action) + +/obj/item/mod/module/chameleon/on_use() + if(mod.active || mod.activating) + to_chat(mod.wearer, "Your suit is already active!") + return + . = ..() + if(!.) + return + if(mod.current_disguise) + return_look() + return + mod.chameleon_action.select_look(mod.wearer) + mod.current_disguise = TRUE + RegisterSignal(mod, COMSIG_MOD_ACTIVATE, PROC_REF(return_look)) + +/obj/item/mod/module/chameleon/proc/return_look() + mod.current_disguise = FALSE + mod.name = "[mod.theme.name] [initial(mod.name)]" + mod.desc = "[initial(mod.desc)] [mod.theme.desc]" + mod.icon_state = "[mod.skin]-control" + var/list/mod_skin = mod.theme.skins[mod.skin] + mod.icon = mod_skin[MOD_ICON_OVERRIDE] || 'icons/obj/clothing/modsuit/mod_clothing.dmi' + mod.icon_override = mod_skin[MOD_ICON_OVERRIDE] || 'icons/mob/clothing/modsuit/mod_clothing.dmi' + mod.lefthand_file = initial(mod.lefthand_file) + mod.righthand_file = initial(mod.righthand_file) + mod.wearer.update_inv_back() + UnregisterSignal(mod, COMSIG_MOD_ACTIVATE) + ///Energy Shield - Gives you a rechargeable energy shield that nullifies attacks. /obj/item/mod/module/energy_shield name = "MOD energy shield module"