Adds the modsuit Chameleon Module (#23411)

* Adds the modsuit Chameleon Module

* Update code/datums/uplink_items/uplink_general.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/uplink_items/uplink_general.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* even clearer

* Update code/datums/uplink_items/uplink_general.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2024-02-27 18:17:34 -05:00
committed by GitHub
parent 112a606ae2
commit 6910d716dd
4 changed files with 90 additions and 1 deletions
+6 -1
View File
@@ -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)
+51
View File
@@ -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, "<span class='warning'>Your suit is already active!</span>")
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"