diff --git a/code/datums/components/gags_recolorable.dm b/code/datums/components/gags_recolorable.dm new file mode 100644 index 00000000000..7e36b73dbbc --- /dev/null +++ b/code/datums/components/gags_recolorable.dm @@ -0,0 +1,73 @@ +/datum/component/gags_recolorable + +/datum/component/gags_recolorable/RegisterWithParent() + RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/on_attackby) + +/datum/component/gags_recolorable/UnregisterFromParent() + UnregisterSignal(parent, COMSIG_PARENT_ATTACKBY) + +/datum/component/gags_recolorable/proc/on_attackby(datum/source, obj/item/attacking_item, mob/user) + SIGNAL_HANDLER + + if(!isatom(parent)) + return + + if(!istype(attacking_item, /obj/item/toy/crayon/spraycan)) + return + var/obj/item/toy/crayon/spraycan/can = attacking_item + + if(can.is_capped || can.check_empty()) + return + + INVOKE_ASYNC(src, .proc/open_ui, user, can) + return COMPONENT_NO_AFTERATTACK + +/datum/component/gags_recolorable/proc/open_ui(mob/user, obj/item/toy/crayon/spraycan/can) + var/atom/atom_parent = parent + var/list/allowed_configs = list() + var/config = initial(atom_parent.greyscale_config) + if(!config) + return + allowed_configs += "[config]" + if(ispath(atom_parent, /obj/item)) + var/obj/item/item = atom_parent + if(initial(item.greyscale_config_worn)) + allowed_configs += "[initial(item.greyscale_config_worn)]" + if(initial(item.greyscale_config_inhand_left)) + allowed_configs += "[initial(item.greyscale_config_inhand_left)]" + if(initial(item.greyscale_config_inhand_right)) + allowed_configs += "[initial(item.greyscale_config_inhand_right)]" + + var/datum/greyscale_modify_menu/spray_paint/menu = new( + atom_parent, user, allowed_configs, CALLBACK(src, .proc/recolor, user, can), + starting_icon_state = initial(atom_parent.icon_state), + starting_config = initial(atom_parent.greyscale_config), + starting_colors = atom_parent.greyscale_colors, + used_spraycan = can + ) + menu.ui_interact(user) + +/datum/component/gags_recolorable/proc/recolor(mob/user, obj/item/toy/crayon/spraycan/can, datum/greyscale_modify_menu/menu) + if(!isatom(parent)) + return + var/atom/atom_parent = parent + + if(can.is_capped || can.check_empty(user)) + menu.ui_close() + return + + can.use_charges() + if(can.pre_noise) + atom_parent.audible_message(span_hear("You hear spraying.")) + playsound(atom_parent.loc, 'sound/effects/spray.ogg', 5, TRUE, 5) + + atom_parent.set_greyscale(menu.split_colors) + + // If the item is a piece of clothing and is being worn, make sure it updates on the player + if(!isclothing(atom_parent)) + return + if(!ishuman(atom_parent.loc)) + return + var/obj/item/clothing/clothing_parent = atom_parent + var/mob/living/carbon/human/wearer = atom_parent.loc + wearer.update_clothing(clothing_parent.slot_flags) diff --git a/code/datums/greyscale/config_types/greyscale_configs.dm b/code/datums/greyscale/config_types/greyscale_configs.dm index 167a6e65263..577aedb64e3 100644 --- a/code/datums/greyscale/config_types/greyscale_configs.dm +++ b/code/datums/greyscale/config_types/greyscale_configs.dm @@ -542,3 +542,23 @@ /datum/greyscale_config/vape/open_high name = "Open Vape High" json_config = 'code/datums/greyscale/json_configs/vape_open_high.json' + +/datum/greyscale_config/heck_suit + name = "H.E.C.K. Suit" + icon_file = 'icons/obj/clothing/suits.dmi' + json_config = 'code/datums/greyscale/json_configs/heck_suit.json' + +/datum/greyscale_config/heck_suit/worn + name = "H.E.C.K. Suit Worn" + icon_file = 'icons/mob/clothing/suit.dmi' + json_config = 'code/datums/greyscale/json_configs/heck_suit_worn.json' + +/datum/greyscale_config/heck_helmet + name = "H.E.C.K. Helmet" + icon_file = 'icons/obj/clothing/hats.dmi' + json_config = 'code/datums/greyscale/json_configs/heck_helmet.json' + +/datum/greyscale_config/heck_helmet/worn + name = "H.E.C.K. Helmet Worn" + icon_file = 'icons/mob/clothing/head.dmi' + json_config = 'code/datums/greyscale/json_configs/heck_helmet_worn.json' diff --git a/code/datums/greyscale/json_configs/heck_helmet.json b/code/datums/greyscale/json_configs/heck_helmet.json new file mode 100644 index 00000000000..dd0649f3007 --- /dev/null +++ b/code/datums/greyscale/json_configs/heck_helmet.json @@ -0,0 +1,22 @@ +{ + "hostile_env": [ + { + "type": "icon_state", + "icon_state": "hostile_env_head", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_jaw", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_visor", + "blend_mode": "overlay", + "color_ids": [ 3 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/heck_helmet_worn.json b/code/datums/greyscale/json_configs/heck_helmet_worn.json new file mode 100644 index 00000000000..dd0649f3007 --- /dev/null +++ b/code/datums/greyscale/json_configs/heck_helmet_worn.json @@ -0,0 +1,22 @@ +{ + "hostile_env": [ + { + "type": "icon_state", + "icon_state": "hostile_env_head", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_jaw", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_visor", + "blend_mode": "overlay", + "color_ids": [ 3 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/heck_suit.json b/code/datums/greyscale/json_configs/heck_suit.json new file mode 100644 index 00000000000..72ad7f42b3d --- /dev/null +++ b/code/datums/greyscale/json_configs/heck_suit.json @@ -0,0 +1,30 @@ +{ + "hostile_env": [ + { + "type": "icon_state", + "icon_state": "hostile_env_plates", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_detail", + "blend_mode": "overlay", + "color_ids": [ 2 ] + } + ], + "hostile_env_t": [ + { + "type": "icon_state", + "icon_state": "hostile_env_plates", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_detail", + "blend_mode": "overlay", + "color_ids": [ 2 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/heck_suit_worn.json b/code/datums/greyscale/json_configs/heck_suit_worn.json new file mode 100644 index 00000000000..72ad7f42b3d --- /dev/null +++ b/code/datums/greyscale/json_configs/heck_suit_worn.json @@ -0,0 +1,30 @@ +{ + "hostile_env": [ + { + "type": "icon_state", + "icon_state": "hostile_env_plates", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_detail", + "blend_mode": "overlay", + "color_ids": [ 2 ] + } + ], + "hostile_env_t": [ + { + "type": "icon_state", + "icon_state": "hostile_env_plates", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hostile_env_detail", + "blend_mode": "overlay", + "color_ids": [ 2 ] + } + ] +} diff --git a/code/modules/admin/greyscale_modify_menu.dm b/code/modules/admin/greyscale_modify_menu.dm index 7efd3f0d044..6283869905b 100644 --- a/code/modules/admin/greyscale_modify_menu.dm +++ b/code/modules/admin/greyscale_modify_menu.dm @@ -308,3 +308,19 @@ This is highly likely to cause massive amounts of lag as every object in the gam current = parent parent = type2parent(current) config_owner_type = current + +/// Used for spray painting items in the gags_recolorable component +/datum/greyscale_modify_menu/spray_paint + var/obj/item/toy/crayon/spraycan/spraycan = null + +/datum/greyscale_modify_menu/spray_paint/New(atom/target, client/user, list/allowed_configs, datum/callback/apply_callback, starting_icon_state, starting_config, starting_colors, obj/item/toy/crayon/spraycan/used_spraycan) + ..() + spraycan = used_spraycan + +/datum/greyscale_modify_menu/spray_paint/ui_status(mob/user, datum/ui_state/state) + return min( + ui_status_only_living(user, target), + ui_status_user_is_abled(user, target), + ui_status_user_strictly_adjacent(user, target), + user.is_holding(spraycan)? UI_INTERACTIVE : UI_CLOSE + ) diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm index 7339c4e3292..4245ebbce4c 100644 --- a/code/modules/mining/lavaland/megafauna_loot.dm +++ b/code/modules/mining/lavaland/megafauna_loot.dm @@ -275,16 +275,21 @@ resistance_flags = FIRE_PROOF|LAVA_PROOF|ACID_PROOF transparent_protection = HIDEGLOVES|HIDESUITSTORAGE|HIDEJUMPSUIT|HIDESHOES allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/resonator, /obj/item/mining_scanner, /obj/item/t_scanner/adv_mining_scanner, /obj/item/gun/energy/recharge/kinetic_accelerator, /obj/item/pickaxe) + greyscale_colors = "#4d4d4d#808080" + greyscale_config = /datum/greyscale_config/heck_suit + greyscale_config_worn = /datum/greyscale_config/heck_suit/worn + flags_1 = IS_PLAYER_COLORABLE_1 /obj/item/clothing/suit/hooded/hostile_environment/Initialize(mapload) . = ..() AddElement(/datum/element/radiation_protected_clothing) + AddComponent(/datum/component/gags_recolorable) /obj/item/clothing/suit/hooded/hostile_environment/process(delta_time) . = ..() var/mob/living/carbon/wearer = loc if(istype(wearer) && DT_PROB(1, delta_time)) //cursed by bubblegum - if(DT_PROB(7.5, delta_time)) + if(prob(7.5)) new /datum/hallucination/oh_yeah(wearer) to_chat(wearer, span_colossus("[pick("I AM IMMORTAL.","I SHALL TAKE BACK WHAT'S MINE.","I SEE YOU.","YOU CANNOT ESCAPE ME FOREVER.","DEATH CANNOT HOLD ME.")]")) else @@ -305,12 +310,17 @@ flags_inv = HIDEMASK|HIDEEARS|HIDEFACE|HIDEEYES|HIDEHAIR|HIDEFACIALHAIR|HIDESNOUT flags_cover = HEADCOVERSMOUTH actions_types = list() + greyscale_colors = "#4d4d4d#808080#ff3300" + greyscale_config = /datum/greyscale_config/heck_helmet + greyscale_config_worn = /datum/greyscale_config/heck_helmet/worn + flags_1 = IS_PLAYER_COLORABLE_1 /obj/item/clothing/head/hooded/hostile_environment/Initialize(mapload) . = ..() update_appearance() AddComponent(/datum/component/butchering, 5, 150, null, null, null, TRUE, CALLBACK(src, .proc/consume)) AddElement(/datum/element/radiation_protected_clothing) + AddComponent(/datum/component/gags_recolorable) /obj/item/clothing/head/hooded/hostile_environment/equipped(mob/user, slot, initial = FALSE) . = ..() @@ -341,19 +351,6 @@ var/datum/client_colour/color = user.add_client_colour(/datum/client_colour/bloodlust) QDEL_IN(color, 1 SECONDS) -/obj/item/clothing/head/hooded/hostile_environment/update_overlays() - . = ..() - var/mutable_appearance/glass_overlay = mutable_appearance(icon, "hostile_env_glass") - glass_overlay.appearance_flags = RESET_COLOR - . += glass_overlay - -/obj/item/clothing/head/hooded/hostile_environment/worn_overlays(mutable_appearance/standing, isinhands) - . = ..() - if(!isinhands) - var/mutable_appearance/glass_overlay = mutable_appearance('icons/mob/clothing/head.dmi', "hostile_env_glass") - glass_overlay.appearance_flags = RESET_COLOR - . += glass_overlay - #define MAX_BLOOD_LEVEL 100 /obj/item/soulscythe diff --git a/icons/mob/clothing/head.dmi b/icons/mob/clothing/head.dmi index eab512f67bd..12a2bbac177 100644 Binary files a/icons/mob/clothing/head.dmi and b/icons/mob/clothing/head.dmi differ diff --git a/icons/mob/clothing/suit.dmi b/icons/mob/clothing/suit.dmi index 0b188403a73..b157afc3ef9 100644 Binary files a/icons/mob/clothing/suit.dmi and b/icons/mob/clothing/suit.dmi differ diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi index e18dd72998b..40fd2ccc8d5 100644 Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi index 97f5c8b6741..6120d5819aa 100644 Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ diff --git a/tgstation.dme b/tgstation.dme index ab5a3c6c6bd..f9e402e18ed 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -811,6 +811,7 @@ #include "code\datums\components\force_move.dm" #include "code\datums\components\fov_handler.dm" #include "code\datums\components\fullauto.dm" +#include "code\datums\components\gags_recolorable.dm" #include "code\datums\components\gas_leaker.dm" #include "code\datums\components\geiger_sound.dm" #include "code\datums\components\genetic_damage.dm"