diff --git a/code/__DEFINES/atmospherics/atmos_piping.dm b/code/__DEFINES/atmospherics/atmos_piping.dm index 6b6631a56fd..188798f95d2 100644 --- a/code/__DEFINES/atmospherics/atmos_piping.dm +++ b/code/__DEFINES/atmospherics/atmos_piping.dm @@ -72,6 +72,9 @@ /// Additional information of the tank. #define TANK_RESULTS_MISC 2 +/// Color used by omni-color pipes +#define ATMOS_COLOR_OMNI COLOR_VERY_LIGHT_GRAY + //MULTIPIPES //IF YOU EVER CHANGE THESE CHANGE SPRITES TO MATCH. //layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm index 635af1b0290..4ea49e9010d 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -152,6 +152,11 @@ /// From /datum/component/tether/UnregisterFromParent() #define COMSIG_ATOM_TETHER_SNAPPED "atom_tether_snapped" +/// From /atom/proc/update_atom_colour() : (color_changed) +#define COMSIG_ATOM_COLOR_UPDATED "atom_color_updated" + /// Cancels update_appearance call in case you are somehow forced to call it manually to prevent dupe calls + #define COMPONENT_CANCEL_COLOR_APPEARANCE_UPDATE (1<<0) + /// From /obj/item/organ/stomach/on_life() : (obj/item/organ/stomach/stomach, mob/living/carbon/owner, seconds_per_tick) #define COMSIG_ATOM_STOMACH_DIGESTED "atom_stomach_digested" #define COMPONENT_CANCEL_DIGESTION (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index b275ddad696..e9f99214ca8 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -191,6 +191,8 @@ #define COMSIG_ITEM_ATTACK_EFFECT "item_effect_attacked" /// Called by /obj/item/proc/worn_overlays(list/overlays, mutable_appearance/standing, isinhands, icon_file) #define COMSIG_ITEM_GET_WORN_OVERLAYS "item_get_worn_overlays" +/// Called by /obj/item/proc/separate_worn_overlays(list/overlays, mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) +#define COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS "item_get_separate_worn_overlays" ///from base of [/obj/item/proc/tool_check_callback]: (mob/living/user) #define COMSIG_TOOL_IN_USE "tool_in_use" diff --git a/code/__HELPERS/piping_colors_lists.dm b/code/__HELPERS/piping_colors_lists.dm index 8b92e2d530a..1c58b35a908 100644 --- a/code/__HELPERS/piping_colors_lists.dm +++ b/code/__HELPERS/piping_colors_lists.dm @@ -1,6 +1,6 @@ ///All colors available to pipes and atmos components GLOBAL_LIST_INIT(pipe_paint_colors, list( - "omni" = COLOR_VERY_LIGHT_GRAY, + "omni" = ATMOS_COLOR_OMNI, "green" = COLOR_VIBRANT_LIME, "blue" = COLOR_BLUE, "red" = COLOR_RED, @@ -22,7 +22,7 @@ GLOBAL_LIST_INIT(pipe_colors_ordered, sort_list(list( COLOR_CYAN = -3, COLOR_DARK = -2, COLOR_VIBRANT_LIME = -1, - COLOR_VERY_LIGHT_GRAY = 0, + ATMOS_COLOR_OMNI = 0, COLOR_ENGINEERING_ORANGE = 1, COLOR_PURPLE = 2, COLOR_RED = 3, @@ -32,7 +32,7 @@ GLOBAL_LIST_INIT(pipe_colors_ordered, sort_list(list( ///Names shown in the examine for every colored atmos component GLOBAL_LIST_INIT(pipe_color_name, sort_list(list( - COLOR_VERY_LIGHT_GRAY = "omni", + ATMOS_COLOR_OMNI = "omni", COLOR_BLUE = "blue", COLOR_RED = "red", COLOR_VIBRANT_LIME = "green", diff --git a/code/datums/components/acid.dm b/code/datums/components/acid.dm index dea0002663d..ff63ed985a2 100644 --- a/code/datums/components/acid.dm +++ b/code/datums/components/acid.dm @@ -1,4 +1,4 @@ -GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/effects/acid.dmi', "default")) +GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/effects/acid.dmi', "default", appearance_flags = RESET_COLOR|KEEP_APART)) /** * Component representing acid applied to an object. diff --git a/code/datums/components/burning.dm b/code/datums/components/burning.dm index 7264689d13c..bd011537bcc 100644 --- a/code/datums/components/burning.dm +++ b/code/datums/components/burning.dm @@ -1,4 +1,4 @@ -GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/effects/fire.dmi', "fire", appearance_flags = RESET_COLOR)) +GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/effects/fire.dmi', "fire", appearance_flags = RESET_COLOR|KEEP_APART)) /** * Component representing an atom being on fire. diff --git a/code/datums/components/clothing_dirt.dm b/code/datums/components/clothing_dirt.dm index a6cfcf88ff4..eed2eab5fb4 100644 --- a/code/datums/components/clothing_dirt.dm +++ b/code/datums/components/clothing_dirt.dm @@ -20,7 +20,7 @@ RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(on_clean)) RegisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_overlays_updated)) - RegisterSignal(parent, COMSIG_ITEM_GET_WORN_OVERLAYS, PROC_REF(on_worn_overlays)) + RegisterSignal(parent, COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS, PROC_REF(on_separate_worn_overlays)) /datum/component/clothing_dirt/UnregisterFromParent() var/obj/item/clothing/clothing = parent @@ -37,6 +37,7 @@ COMSIG_MOB_UNEQUIPPED_ITEM, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_ATOM_UPDATE_OVERLAYS, + COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS, )) return ..() @@ -70,13 +71,13 @@ dirt_overlay.color = dirt_color overlays += dirt_overlay -/datum/component/clothing_dirt/proc/on_worn_overlays(obj/item/source, list/overlays, mutable_appearance/standing, isinhands, icon_file) +/datum/component/clothing_dirt/proc/on_separate_worn_overlays(obj/item/source, list/overlays, mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) SIGNAL_HANDLER if (isinhands || !dirtiness || !dirt_state || !(source.flags_cover & PEPPERPROOF)) return - var/mutable_appearance/dirt_overlay = mutable_appearance(source.worn_icon, dirt_state, appearance_flags = KEEP_APART|RESET_COLOR) + var/mutable_appearance/dirt_overlay = mutable_appearance(source.worn_icon, dirt_state) dirt_overlay.color = dirt_color overlays += dirt_overlay diff --git a/code/datums/components/crafting/atmospheric.dm b/code/datums/components/crafting/atmospheric.dm index 610c745501c..82e817be072 100644 --- a/code/datums/components/crafting/atmospheric.dm +++ b/code/datums/components/crafting/atmospheric.dm @@ -52,7 +52,7 @@ /datum/crafting_recipe/spec_pipe/on_craft_completion(mob/user, atom/result) var/obj/item/pipe/crafted_pipe = result crafted_pipe.pipe_type = pipe_type - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY + crafted_pipe.pipe_color = ATMOS_COLOR_OMNI crafted_pipe.setDir(user.dir) crafted_pipe.update() diff --git a/code/datums/components/hat_stabilizer.dm b/code/datums/components/hat_stabilizer.dm index 08569b1ff87..17df363f8f2 100644 --- a/code/datums/components/hat_stabilizer.dm +++ b/code/datums/components/hat_stabilizer.dm @@ -36,7 +36,8 @@ RegisterSignal(source, COMSIG_ATOM_ATTACK_HAND_SECONDARY, PROC_REF(on_secondary_attack_hand)) // Overlays - RegisterSignals(source, list(COMSIG_MODULE_GENERATE_WORN_OVERLAY, COMSIG_ITEM_GET_WORN_OVERLAYS), PROC_REF(get_worn_overlays)) + RegisterSignal(source, COMSIG_MODULE_GENERATE_WORN_OVERLAY, PROC_REF(get_worn_overlays)) + RegisterSignal(source, COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS, PROC_REF(get_separate_worn_overlays)) RegisterSignal(source, COMSIG_QDELETING, PROC_REF(on_qdel)) @@ -59,7 +60,7 @@ remove_hat() UnregisterSignal(parent, list(COMSIG_ATOM_EXAMINE, COMSIG_ATOM_ATTACKBY, COMSIG_ATOM_ATTACK_HAND_SECONDARY, COMSIG_MODULE_GENERATE_WORN_OVERLAY, - COMSIG_ITEM_GET_WORN_OVERLAYS, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_QDELETING, + COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_QDELETING, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) /datum/component/hat_stabilizer/proc/on_equip(datum/source, mob/equipper, slot) @@ -102,20 +103,39 @@ base_examine += span_notice("There's nothing placed on [parent]. Yet.") /datum/component/hat_stabilizer/proc/get_worn_overlays(atom/movable/source, list/overlays, mutable_appearance/standing, isinhands, icon_file) + SIGNAL_HANDLER + if(isinhands) + return + if(!attached_hat) + return + var/mutable_appearance/worn_overlay = attached_hat.build_worn_icon(default_layer = ABOVE_BODY_FRONT_HEAD_LAYER - 0.1, default_icon_file = 'icons/mob/clothing/head/default.dmi') + worn_overlay.appearance_flags |= RESET_COLOR + // loose hats are slightly angled + if(loose_hat) + var/matrix/tilt_trix = matrix(worn_overlay.transform) + var/angle = 5 + tilt_trix.Turn(angle * pick(1, -1)) + worn_overlay.transform = tilt_trix + worn_overlay.pixel_y = pixel_z_offset + attached_hat.worn_y_offset + overlays += worn_overlay + +/datum/component/hat_stabilizer/proc/get_separate_worn_overlays(atom/movable/source, list/overlays, mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) SIGNAL_HANDLER if (isinhands) return - if(attached_hat) - var/mutable_appearance/worn_overlay = attached_hat.build_worn_icon(default_layer = ABOVE_BODY_FRONT_HEAD_LAYER-0.1, default_icon_file = 'icons/mob/clothing/head/default.dmi') - worn_overlay.appearance_flags |= RESET_COLOR - // loose hats are slightly angled - if(loose_hat) - var/matrix/tilt_trix = matrix(worn_overlay.transform) - var/angle = 5 - tilt_trix.Turn(angle * pick(1, -1)) - worn_overlay.transform = tilt_trix - worn_overlay.pixel_z = pixel_z_offset + attached_hat.worn_y_offset - overlays += worn_overlay + if(!attached_hat) + return + var/mutable_appearance/worn_overlay = attached_hat.build_worn_icon(default_layer = ABOVE_BODY_FRONT_HEAD_LAYER - 0.1, default_icon_file = 'icons/mob/clothing/head/default.dmi') + for (var/mutable_appearance/overlay in worn_overlay.overlays) + overlay.layer = ABOVE_BODY_FRONT_HEAD_LAYER - 0.1 + // loose hats are slightly angled + if(loose_hat) + var/matrix/tilt_trix = matrix(worn_overlay.transform) + var/angle = 5 + tilt_trix.Turn(angle * pick(1, -1)) + worn_overlay.transform = tilt_trix + worn_overlay.pixel_z = pixel_z_offset + attached_hat.worn_y_offset + overlays += worn_overlay /datum/component/hat_stabilizer/proc/on_qdel(atom/movable/source) SIGNAL_HANDLER diff --git a/code/datums/elements/decals/blood.dm b/code/datums/elements/decals/blood.dm index 3d16df0c612..9410558a60a 100644 --- a/code/datums/elements/decals/blood.dm +++ b/code/datums/elements/decals/blood.dm @@ -1,35 +1,43 @@ /datum/element/decal/blood + /// Whenever the parent atom has a color filter applied to it, and thus needs additional overlay handling + var/uses_filter = FALSE -/datum/element/decal/blood/Attach(datum/target, _icon, _icon_state, _dir, _plane, _layer, _alpha, _color, _smoothing, _cleanable=CLEAN_TYPE_BLOOD, _description, mutable_appearance/_pic) - if(!isitem(target)) +/datum/element/decal/blood/Attach(datum/target, _icon, _icon_state, _dir, _plane, _layer, _alpha, _color, _smoothing, _cleanable=CLEAN_TYPE_BLOOD, _description, mutable_appearance/_pic, _uses_filter) + if (!isitem(target)) return ELEMENT_INCOMPATIBLE + var/obj/item/as_item = target + if (_uses_filter != !isnull(as_item.cached_color_filter)) + as_item.AddElement(type, _icon, _icon_state, _dir, _plane, _layer, _alpha, _color, _smoothing, _cleanable, _description, _pic, !isnull(as_item.cached_color_filter)) + return + + uses_filter = _uses_filter . = ..() - RegisterSignal(target, COMSIG_ATOM_GET_EXAMINE_NAME, PROC_REF(get_examine_name), TRUE) + RegisterSignal(as_item, COMSIG_ATOM_GET_EXAMINE_NAME, PROC_REF(get_examine_name), TRUE) + RegisterSignal(as_item, COMSIG_ATOM_COLOR_UPDATED, PROC_REF(on_color_update), TRUE) /datum/element/decal/blood/Detach(atom/source) - UnregisterSignal(source, COMSIG_ATOM_GET_EXAMINE_NAME) - if(isitem(source)) + UnregisterSignal(source, list(COMSIG_ATOM_GET_EXAMINE_NAME, COMSIG_ATOM_COLOR_UPDATED)) + if (isitem(source)) var/obj/item/source_item = source REMOVE_KEEP_TOGETHER(source_item, type) return ..() /datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _plane, _layer, _color, _alpha, _smoothing, source) - var/obj/item/I = source - ADD_KEEP_TOGETHER(I, type) - var/icon = I.icon - var/icon_state = I.icon_state - if(!icon || !icon_state) - // It's something which takes on the look of other items, probably - icon = I.icon - icon_state = I.icon_state - var/icon/icon_for_size = icon(icon, icon_state) + var/obj/item/as_item = source + ADD_KEEP_TOGETHER(as_item, type) + var/icon/icon_for_size = icon(as_item.icon, as_item.icon_state) var/scale_factor_x = icon_for_size.Width()/ICON_SIZE_X var/scale_factor_y = icon_for_size.Height()/ICON_SIZE_Y - var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = KEEP_APART|RESET_COLOR) //MA of the blood that we apply + var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = RESET_COLOR) //MA of the blood that we apply blood_splatter.transform = blood_splatter.transform.Scale(scale_factor_x, scale_factor_y) blood_splatter.blend_mode = BLEND_INSET_OVERLAY blood_splatter.color = _color + if (uses_filter) + blood_splatter.appearance_flags |= KEEP_APART + if (!as_item.render_target) + as_item.render_target = "blood_target_[REF(as_item)]" + blood_splatter.add_filter("blood_cutout", -1, alpha_mask_filter(render_source = as_item.render_target)) pic = blood_splatter return TRUE @@ -37,3 +45,13 @@ SIGNAL_HANDLER override[EXAMINE_POSITION_BEFORE] = "blood-stained" + +/datum/element/decal/blood/proc/on_color_update(obj/item/source, color_updated) + SIGNAL_HANDLER + + if (!color_updated || uses_filter == !isnull(source.cached_color_filter)) + return + + Detach(source) + source.AddElement(type, pic.icon, base_icon_state, directional, pic.plane, pic.layer, pic.alpha, pic.color, smoothing, cleanable, description, null, !isnull(source.cached_color_filter)) + return COMPONENT_CANCEL_COLOR_APPEARANCE_UPDATE diff --git a/code/datums/records/record.dm b/code/datums/records/record.dm index 4c40a85d5fc..9785ac8ffcb 100644 --- a/code/datums/records/record.dm +++ b/code/datums/records/record.dm @@ -228,7 +228,7 @@ var/mutable_appearance/appearance = character_appearance appearance.setDir(orientation) if(add_height_chart) - appearance.underlays += mutable_appearance('icons/obj/machines/photobooth.dmi', "height_chart", alpha = 125, appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM) + appearance.underlays += mutable_appearance('icons/obj/machines/photobooth.dmi', "height_chart", alpha = 125, appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM|KEEP_APART) picture_image = getFlatIcon(appearance) else picture_image = character_appearance diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm index 91577046210..d79c74a614f 100644 --- a/code/datums/status_effects/debuffs/debuffs.dm +++ b/code/datums/status_effects/debuffs/debuffs.dm @@ -386,7 +386,7 @@ name = "Crusher mark underlay" icon = 'icons/effects/effects.dmi' icon_state = "shield" - appearance_flags = TILE_BOUND|LONG_GLIDE|RESET_COLOR|PIXEL_SCALE + appearance_flags = TILE_BOUND|LONG_GLIDE|RESET_COLOR|PIXEL_SCALE|KEEP_APART vis_flags = VIS_UNDERLAY mouse_opacity = MOUSE_OPACITY_TRANSPARENT diff --git a/code/game/atom/atom_color.dm b/code/game/atom/atom_color.dm index 4b20a004228..3c01429efc4 100644 --- a/code/game/atom/atom_color.dm +++ b/code/game/atom/atom_color.dm @@ -16,7 +16,7 @@ */ var/list/atom_colours /// Currently used color filter - cached because its applied to all of our overlays because BYOND is horrific - var/cached_color_filter + var/list/cached_color_filter ///Adds an instance of colour_type to the atom's atom_colours list /atom/proc/add_atom_colour(coloration, colour_priority) @@ -35,7 +35,6 @@ atom_colours[colour_priority] = list(coloration, color_type) update_atom_colour() - ///Removes an instance of colour_type from the atom's atom_colours list /atom/proc/remove_atom_colour(colour_priority, coloration) if(!atom_colours) @@ -94,13 +93,14 @@ ///Resets the atom's color to null, and then sets it to the highest priority colour available /atom/proc/update_atom_colour() var/old_filter = cached_color_filter + var/old_color = color color = null cached_color_filter = null remove_filter(ATOM_PRIORITY_COLOR_FILTER) REMOVE_KEEP_TOGETHER(src, ATOM_COLOR_TRAIT) if (!atom_colours) - if (old_filter) + if (!(SEND_SIGNAL(src, COMSIG_ATOM_COLOR_UPDATED, old_color || old_filter) & COMPONENT_CANCEL_COLOR_APPEARANCE_UPDATE) && old_filter) update_appearance() return @@ -115,7 +115,7 @@ break ADD_KEEP_TOGETHER(src, ATOM_COLOR_TRAIT) - if (cached_color_filter != old_filter) + if (!(SEND_SIGNAL(src, COMSIG_ATOM_COLOR_UPDATED, old_color != color || old_filter != cached_color_filter) & COMPONENT_CANCEL_COLOR_APPEARANCE_UPDATE) && cached_color_filter != old_filter) update_appearance() /// Same as update_atom_color, but simplifies overlay coloring diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 1e1d4f5fe63..e27af79c89c 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -96,7 +96,7 @@ Buildable meters /obj/item/pipe/quaternary/pipe/crafted/Initialize(mapload, _pipe_type, _dir, obj/machinery/atmospherics/make_from, device_color, device_init_dir = SOUTH) . = ..() pipe_type = /obj/machinery/atmospherics/pipe/smart - pipe_color = COLOR_VERY_LIGHT_GRAY + pipe_color = ATMOS_COLOR_OMNI p_init_dir = ALL_CARDINALS setDir(SOUTH) update() diff --git a/code/game/objects/effects/particle_holder.dm b/code/game/objects/effects/particle_holder.dm index 4b3d3585ce1..46048c136d1 100644 --- a/code/game/objects/effects/particle_holder.dm +++ b/code/game/objects/effects/particle_holder.dm @@ -3,7 +3,7 @@ /obj/effect/abstract/particle_holder name = "particle holder" desc = "How are you reading this? Please make a bug report :)" - appearance_flags = KEEP_APART|KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE //movable appearance_flags plus KEEP_APART and KEEP_TOGETHER + appearance_flags = KEEP_APART|KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE|RESET_COLOR //movable appearance_flags plus KEEP_APART and KEEP_TOGETHER vis_flags = VIS_INHERIT_PLANE layer = ABOVE_ALL_MOB_LAYER mouse_opacity = MOUSE_OPACITY_TRANSPARENT diff --git a/code/game/objects/effects/shared_particle_holder.dm b/code/game/objects/effects/shared_particle_holder.dm index 2fe0c976479..c4b3a21af3c 100644 --- a/code/game/objects/effects/shared_particle_holder.dm +++ b/code/game/objects/effects/shared_particle_holder.dm @@ -7,7 +7,7 @@ GLOBAL_LIST_EMPTY(shared_particles) /obj/effect/abstract/shared_particle_holder name = "shared particle holder" desc = "How are you reading this? Please make a bug report :)" - appearance_flags = KEEP_APART|KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE + appearance_flags = KEEP_APART|KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE|RESET_COLOR vis_flags = VIS_INHERIT_PLANE layer = ABOVE_ALL_MOB_LAYER mouse_opacity = MOUSE_OPACITY_TRANSPARENT diff --git a/code/game/objects/items/busts_and_figurines.dm b/code/game/objects/items/busts_and_figurines.dm index 53af3228ffd..592302cab67 100644 --- a/code/game/objects/items/busts_and_figurines.dm +++ b/code/game/objects/items/busts_and_figurines.dm @@ -128,8 +128,8 @@ /obj/item/maneki_neko/Initialize(mapload) . = ..() //Not compatible with greyscale configs because it's animated. - color = pick_weight(list(COLOR_WHITE = 3, COLOR_GOLD = 2, COLOR_DARK = 1)) - var/mutable_appearance/neko_overlay = mutable_appearance(icon, "maneki-neko-overlay", appearance_flags = RESET_COLOR) + add_atom_colour(pick_weight(list(COLOR_WHITE = 3, COLOR_GOLD = 2, COLOR_DARK = 1)), FIXED_COLOUR_PRIORITY) + var/mutable_appearance/neko_overlay = mutable_appearance(icon, "maneki-neko-overlay", appearance_flags = RESET_COLOR|KEEP_APART) add_overlay(neko_overlay) AddElement(/datum/element/art, GOOD_ART) AddElement(/datum/element/beauty, 800) diff --git a/code/game/objects/items/etherealdiscoball.dm b/code/game/objects/items/etherealdiscoball.dm index 4eca1dc2fc0..d26b8cd7ec5 100644 --- a/code/game/objects/items/etherealdiscoball.dm +++ b/code/game/objects/items/etherealdiscoball.dm @@ -72,6 +72,4 @@ /obj/structure/etherealball/update_overlays() . = ..() - var/mutable_appearance/base_overlay = mutable_appearance(icon, "ethdisco_base") - base_overlay.appearance_flags = RESET_COLOR - . += base_overlay + . += mutable_appearance(icon, "ethdisco_base", appearance_flags = RESET_COLOR|KEEP_APART) diff --git a/code/game/objects/items/mail.dm b/code/game/objects/items/mail.dm index 7cad2543ba8..5d444a511d1 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -84,7 +84,7 @@ pixel_x = stamp_offset_x, pixel_y = stamp_offset_y + bonus_stamp_offset ) - stamp_image.appearance_flags |= RESET_COLOR + stamp_image.appearance_flags |= RESET_COLOR|KEEP_APART bonus_stamp_offset -= 5 . += stamp_image @@ -95,7 +95,7 @@ pixel_x = stamp_offset_x + rand(-3, 1), pixel_y = stamp_offset_y + rand(bonus_stamp_offset + 3, 1) ) - postmark_image.appearance_flags |= RESET_COLOR + postmark_image.appearance_flags |= RESET_COLOR|KEEP_APART . += postmark_image /obj/item/mail/attackby(obj/item/W, mob/user, params) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 5290f22e008..c44f4f3e41c 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -136,11 +136,15 @@ if(QDELETED(src)) // take_damage() can send our obj to an early grave, let's stop here if that happens return if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE) && !(resistance_flags & FIRE_PROOF)) - AddComponent(/datum/component/burning, custom_fire_overlay || GLOB.fire_overlay, burning_particles) + AddComponent(/datum/component/burning, custom_fire_overlay() || GLOB.fire_overlay, burning_particles) SEND_SIGNAL(src, COMSIG_ATOM_FIRE_ACT, exposed_temperature, exposed_volume) return TRUE return ..() +/// Returns a custom fire overlay, if any +/obj/proc/custom_fire_overlay() + return custom_fire_overlay + /// Should be called when the atom is destroyed by fire, comparable to acid_melt() proc /obj/proc/burn() deconstruct(FALSE) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 74919fd71d0..46cf3987381 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -27,7 +27,7 @@ /// A multiplier to an object's force when used against a structure, vehicle, machine, or robot. var/demolition_mod = 1 - /// Custom fire overlay icon, will just use the default overlay if this is null + /// Cached custom fire overlay var/custom_fire_overlay /// Particles this obj uses when burning, if any var/burning_particles diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index f473294b71e..d6523ca74c2 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -41,12 +41,11 @@ if(.) return - opening = TRUE if(!density) - var/srcturf = get_turf(src) - for(var/mob/living/obstacle in srcturf) //Stop people from using this as a shield - opening = FALSE + for(var/mob/living/obstacle in get_turf(src)) //Stop people from using this as a shield return + + opening = TRUE update_appearance() addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/structure/falsewall, toggle_open)), 0.5 SECONDS) @@ -433,6 +432,5 @@ girder_icon_state += "_[density ? "opening" : "closing"]" else if(!density) girder_icon_state += "_open" - var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', girder_icon_state, layer = LOW_OBJ_LAYER-0.01) - girder_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR + var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', girder_icon_state, layer = LOW_OBJ_LAYER-0.01, appearance_flags = RESET_ALPHA | RESET_COLOR | KEEP_APART) underlays += girder_underlay diff --git a/code/game/objects/structures/maintenance.dm b/code/game/objects/structures/maintenance.dm index bf96397507a..ed9e38eb590 100644 --- a/code/game/objects/structures/maintenance.dm +++ b/code/game/objects/structures/maintenance.dm @@ -177,8 +177,7 @@ at the cost of risking a vicious bite.**/ overlayicon = "altar_pants2" if(ALTAR_STAGETHREE) overlayicon = "altar_pants3" - var/mutable_appearance/pants_overlay = mutable_appearance(icon, overlayicon) - pants_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/pants_overlay = mutable_appearance(icon, overlayicon, appearance_flags = RESET_COLOR|KEEP_APART) pants_overlay.color = pants_color . += pants_overlay diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index c5a2f8fe423..426e13b8142 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -595,7 +595,7 @@ GLOBAL_LIST_EMPTY(station_turfs) SET_PLANE(I, GAME_PLANE, src) I.layer = OBJ_LAYER I.appearance = AM.appearance - I.appearance_flags = RESET_COLOR|RESET_ALPHA|RESET_TRANSFORM + I.appearance_flags = RESET_COLOR|RESET_ALPHA|RESET_TRANSFORM|KEEP_APART I.loc = src I.setDir(AM.dir) I.alpha = 128 diff --git a/code/modules/antagonists/cult/datums/cult_team.dm b/code/modules/antagonists/cult/datums/cult_team.dm index 927ab734bde..70c4b12aeb0 100644 --- a/code/modules/antagonists/cult/datums/cult_team.dm +++ b/code/modules/antagonists/cult/datums/cult_team.dm @@ -154,7 +154,7 @@ var/area/target_area = get_area(new_target) blood_target_image = image('icons/effects/mouse_pointers/cult_target.dmi', new_target, "glow", ABOVE_MOB_LAYER) - blood_target_image.appearance_flags = RESET_COLOR + blood_target_image.appearance_flags = RESET_COLOR|KEEP_APART blood_target_image.pixel_x = -new_target.pixel_x blood_target_image.pixel_y = -new_target.pixel_y diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index f3877a1424d..d529d4357f2 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -28,7 +28,7 @@ ///Bitflag of the initialized directions (NORTH | SOUTH | EAST | WEST) var/initialize_directions = NONE ///The color of the pipe - var/pipe_color = COLOR_VERY_LIGHT_GRAY + var/pipe_color = ATMOS_COLOR_OMNI ///What layer the pipe is in (from 1 to 5, default 3) var/piping_layer = PIPING_LAYER_DEFAULT ///The flags of the pipe/component (PIPING_ALL_LAYER | PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY | PIPING_CARDINAL_AUTONORMALIZE) @@ -342,7 +342,7 @@ return FALSE //if the target does not have the same color and it does not have all color connection flag[which allows it to be connected regardless of color] & one of the pipes is not gray[allowing for connection regardless] then we are out - if(target.pipe_color != pipe_color && !((target.pipe_flags | pipe_flags) & PIPING_ALL_COLORS) && target.pipe_color != COLOR_VERY_LIGHT_GRAY && pipe_color != COLOR_VERY_LIGHT_GRAY) + if(target.pipe_color != pipe_color && !((target.pipe_flags | pipe_flags) & PIPING_ALL_COLORS) && target.pipe_color != ATMOS_COLOR_OMNI && pipe_color != ATMOS_COLOR_OMNI) return FALSE return TRUE @@ -523,7 +523,7 @@ * * piping_layer - the piping_layer the device is in, used inside PIPING_LAYER_SHIFT * * trinary - if TRUE we also use PIPING_FORWARD_SHIFT on layer 1 and 5 for trinary devices (filters and mixers) */ -/obj/machinery/atmospherics/proc/get_pipe_image(iconfile, iconstate, direction, color = COLOR_VERY_LIGHT_GRAY, piping_layer = 3, trinary = FALSE) +/obj/machinery/atmospherics/proc/get_pipe_image(iconfile, iconstate, direction, color = ATMOS_COLOR_OMNI, piping_layer = 3, trinary = FALSE) var/image/pipe_overlay = image(iconfile, iconstate, dir = direction) pipe_overlay.color = color PIPING_LAYER_SHIFT(pipe_overlay, piping_layer) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index 84237309374..58e1f619a73 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -29,6 +29,7 @@ cut_overlays() if(showpipe) var/image/cap = get_pipe_image(icon, "dpvent_cap", dir, pipe_color, piping_layer = piping_layer) + cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) if(!on || !is_operational) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 40fd80e047d..6001042453b 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -78,14 +78,14 @@ continue var/obj/machinery/atmospherics/node = nodes[i] var/node_dir = get_dir(src, node) - var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "intact_[node_dir]_[underlay_pipe_layer]") - pipe_appearance.color = node.pipe_color + var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "intact_[node_dir]_[underlay_pipe_layer]", appearance_flags = RESET_COLOR|KEEP_APART) + pipe_appearance.color = (node.pipe_color == ATMOS_COLOR_OMNI || istype(node, /obj/machinery/atmospherics/pipe/color_adapter)) ? pipe_color : node.pipe_color underlays += pipe_appearance connected |= node_dir for(var/direction in GLOB.cardinals) if((initialize_directions & direction) && !(connected & direction)) - var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "exposed_[direction]_[underlay_pipe_layer]") + var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "exposed_[direction]_[underlay_pipe_layer]", appearance_flags = RESET_COLOR|KEEP_APART) pipe_appearance.color = pipe_color underlays += pipe_appearance diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 8f7aa4a2d57..41fb240c846 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -52,7 +52,9 @@ if(!(direction & initialize_directions)) continue - . += get_pipe_image(icon, "cap", direction, pipe_color, piping_layer, TRUE) + var/image/cap = get_pipe_image(icon, "cap", direction, pipe_color, piping_layer, TRUE) + cap.appearance_flags |= RESET_COLOR|KEEP_APART + . += cap /obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes() var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index c0b584d9029..95a2a47b931 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -77,7 +77,9 @@ cut_overlays() if(showpipe) // everything is already shifted so don't shift the cap - add_overlay(get_pipe_image(icon, "inje_cap", initialize_directions, pipe_color)) + var/image/cap = get_pipe_image(icon, "inje_cap", initialize_directions, pipe_color) + cap.appearance_flags |= RESET_COLOR|KEEP_APART + add_overlay(cap) else PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm index 4ac0e959e40..a68876b797f 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -19,6 +19,7 @@ cut_overlays() if(showpipe) var/image/cap = get_pipe_image(icon, "vent_cap", initialize_directions, pipe_color) + cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) else PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm index f47d6d5b069..e14d010ab4b 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -34,6 +34,7 @@ cut_overlays() if(showpipe) var/image/cap = get_pipe_image(icon, "connector_cap", initialize_directions, pipe_color) + cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) else PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index cb49e572fd1..df4bfd21af8 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -129,7 +129,9 @@ if(!initial(icon)) return var/mutable_appearance/thermo_overlay = new(initial(icon)) - . += get_pipe_image(thermo_overlay, "pipe", dir, pipe_color, piping_layer) + var/image/pipe = get_pipe_image(thermo_overlay, "pipe", dir, pipe_color, piping_layer) + pipe.appearance_flags |= RESET_COLOR|KEEP_APART + . += pipe /obj/machinery/atmospherics/components/unary/thermomachine/examine(mob/user) . = ..() diff --git a/code/modules/atmospherics/machinery/pipes/color_adapter.dm b/code/modules/atmospherics/machinery/pipes/color_adapter.dm index 06812aaa649..a33376c16cc 100644 --- a/code/modules/atmospherics/machinery/pipes/color_adapter.dm +++ b/code/modules/atmospherics/machinery/pipes/color_adapter.dm @@ -47,7 +47,12 @@ for(var/i in 1 to device_type) if(!nodes[i]) continue - var/image/pipe = get_pipe_image('icons/obj/pipes_n_cables/manifold.dmi', "pipe-3", get_dir(src, nodes[i]), nodes[i].pipe_color) + var/applied_color = nodes[i].pipe_color + var/node_dir = get_dir(src, nodes[i]) + if (istype(nodes[i], /obj/machinery/atmospherics/pipe/color_adapter) && ((node_dir & (SOUTH|EAST)) || nodes[i].pipe_color == ATMOS_COLOR_OMNI) && pipe_color != ATMOS_COLOR_OMNI) + applied_color = pipe_color + var/image/pipe = get_pipe_image('icons/obj/pipes_n_cables/manifold.dmi', "pipe-3", node_dir, applied_color) + pipe.appearance_flags |= RESET_COLOR|KEEP_APART PIPING_LAYER_DOUBLE_SHIFT(pipe, piping_layer) pipe.layer = layer + 0.01 . += pipe diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm index fdf831889ca..135d222a92e 100644 --- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm +++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm @@ -63,17 +63,20 @@ if(istype(machine_check, /obj/machinery/atmospherics/pipe/layer_manifold)) for(var/i in PIPING_LAYER_MIN to PIPING_LAYER_MAX) - . += get_attached_image(get_dir(src, machine_check), i, COLOR_VERY_LIGHT_GRAY) + . += get_attached_image(get_dir(src, machine_check), i, machine_check.pipe_color == pipe_color ? pipe_color : ATMOS_COLOR_OMNI) return if(istype(machine_check, /obj/machinery/atmospherics/components/unary/airlock_pump)) . += get_attached_image(get_dir(src, machine_check), 4, COLOR_BLUE) //. += get_attached_image(get_dir(src, machine_check), 2, COLOR_RED) // Only the distro node is added currently to the pipenet, it doesn't merge the pipenet with the waste node return - . += get_attached_image(get_dir(src, machine_check), machine_check.piping_layer, machine_check.pipe_color) + var/passed_color = machine_check.pipe_color + if(istype(machine_check, /obj/machinery/atmospherics/pipe/color_adapter) || machine_check.pipe_color == ATMOS_COLOR_OMNI) + passed_color = pipe_color + . += get_attached_image(get_dir(src, machine_check), machine_check.piping_layer, passed_color) /obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_image(p_dir, p_layer, p_color) var/working_layer = FLOAT_LAYER - HAS_TRAIT(src, TRAIT_UNDERFLOOR) ? 1 : 0.01 - var/mutable_appearance/muta = mutable_appearance('icons/obj/pipes_n_cables/layer_manifold_underlays.dmi', "intact_[p_dir]_[p_layer]", layer = working_layer, appearance_flags = RESET_COLOR) + var/mutable_appearance/muta = mutable_appearance('icons/obj/pipes_n_cables/layer_manifold_underlays.dmi', "intact_[p_dir]_[p_layer]", layer = working_layer, appearance_flags = RESET_COLOR|KEEP_APART) muta.color = p_color return muta diff --git a/code/modules/atmospherics/machinery/pipes/mapping.dm b/code/modules/atmospherics/machinery/pipes/mapping.dm index dce09be9092..35f5e521ec5 100644 --- a/code/modules/atmospherics/machinery/pipes/mapping.dm +++ b/code/modules/atmospherics/machinery/pipes/mapping.dm @@ -80,7 +80,7 @@ HELPER_PARTIAL_NAMED(/obj/machinery/atmospherics/pipe/multiz/##Type, "adapter", Name, Color) \ HELPER(yellow, COLOR_YELLOW) -HELPER(general, COLOR_VERY_LIGHT_GRAY) +HELPER(general, ATMOS_COLOR_OMNI) HELPER(cyan, COLOR_CYAN) HELPER(green, COLOR_VIBRANT_LIME) HELPER(orange, COLOR_ENGINEERING_ORANGE) diff --git a/code/modules/atmospherics/machinery/pipes/multiz.dm b/code/modules/atmospherics/machinery/pipes/multiz.dm index ebe29531316..c1062e49a38 100644 --- a/code/modules/atmospherics/machinery/pipes/multiz.dm +++ b/code/modules/atmospherics/machinery/pipes/multiz.dm @@ -42,7 +42,8 @@ /obj/machinery/atmospherics/pipe/multiz/update_overlays() . = ..() - pipe.color = front_node ? front_node.pipe_color : rgb(255, 255, 255) + pipe.appearance_flags |= RESET_COLOR|KEEP_APART + pipe.color = front_node ? front_node.pipe_color : ATMOS_COLOR_OMNI pipe.icon_state = "pipe-[piping_layer]" . += pipe center.pixel_x = PIPING_LAYER_P_X * (piping_layer - PIPING_LAYER_DEFAULT) diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index 7d990e1ace5..1c9a0c169a6 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -47,9 +47,13 @@ . = ..() if(isinhands) return - if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves") + +/obj/item/clothing/gloves/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) + . = ..() + if(isinhands) + return if(GET_ATOM_BLOOD_DNA_LENGTH(src)) . += mutable_appearance('icons/effects/blood.dmi', "gloveblood") diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index e4ae1b981cb..a8690c1f10c 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -54,16 +54,17 @@ R.visible_message(span_notice("[src] lands neatly on top of [R]!"), span_notice("[src] lands perfectly on top of you.")) R.place_on_head(src) //hats aren't designed to snugly fit borg heads or w/e so they'll always manage to knock eachother off - - - /obj/item/clothing/head/worn_overlays(mutable_appearance/standing, isinhands = FALSE) . = ..() if(isinhands) return - if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedhelmet") + +/obj/item/clothing/head/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) + . = ..() + if(isinhands) + return if(GET_ATOM_BLOOD_DNA_LENGTH(src)) if(clothing_flags & LARGE_WORN_ICON) . += mutable_appearance('icons/effects/64x64.dmi', "helmetblood_large") diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index cb6112bffd2..35675909f17 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -28,14 +28,17 @@ /obj/item/clothing/mask/worn_overlays(mutable_appearance/standing, isinhands = FALSE) . = ..() - if(isinhands) + if(isinhands || !(body_parts_covered & HEAD)) return + if(damaged_clothes) + . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - if(body_parts_covered & HEAD) - if(damaged_clothes) - . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - if(GET_ATOM_BLOOD_DNA_LENGTH(src)) - . += mutable_appearance('icons/effects/blood.dmi', "maskblood") +/obj/item/clothing/mask/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) + . = ..() + if(isinhands || !(body_parts_covered & HEAD)) + return + if(GET_ATOM_BLOOD_DNA_LENGTH(src)) + . += mutable_appearance('icons/effects/blood.dmi', "maskblood") /obj/item/clothing/mask/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED) ..() diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 61dadbe96e6..cbeddc9c3fe 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(clown_mask_options, list( LAZYADD(gas_filters, inserted_filter) has_filter = TRUE -/obj/item/clothing/mask/gas/worn_overlays(mutable_appearance/standing, isinhands) +/obj/item/clothing/mask/gas/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) . = ..() if(!isinhands && cig) . += cig.build_worn_icon(default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/clothing/mask.dmi') diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 3993bfb60f6..ef3af29be06 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -9,14 +9,17 @@ /obj/item/clothing/neck/worn_overlays(mutable_appearance/standing, isinhands = FALSE) . = ..() - if(isinhands) + if(isinhands || !(body_parts_covered & HEAD)) return + if(damaged_clothes) + . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - if(body_parts_covered & HEAD) - if(damaged_clothes) - . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - if(GET_ATOM_BLOOD_DNA_LENGTH(src)) - . += mutable_appearance('icons/effects/blood.dmi', "maskblood") +/obj/item/clothing/neck/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file) + . = ..() + if(isinhands || !(body_parts_covered & HEAD)) + return + if(GET_ATOM_BLOOD_DNA_LENGTH(src)) + . += mutable_appearance('icons/effects/blood.dmi', "maskblood") /obj/item/clothing/neck/bowtie name = "bow tie" diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 9fab851d18e..82b483532f0 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -56,9 +56,13 @@ . = ..() if(isinhands) return - if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedshoe") + +/obj/item/clothing/shoes/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) + . = ..() + if(isinhands) + return if(GET_ATOM_BLOOD_DNA_LENGTH(src)) if(clothing_flags & LARGE_WORN_ICON) . += mutable_appearance('icons/effects/64x64.dmi', "shoeblood_large") diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index 59af4d1c5f6..0ccdfb5430b 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -180,15 +180,16 @@ ///By the by, helmets have the update_icon_updates_onmob element, so we don't have to call mob.update_worn_head() /obj/item/clothing/head/helmet/space/plasmaman/worn_overlays(mutable_appearance/standing, isinhands) + . = ..() + if(!isinhands && !up) + . += mutable_appearance('icons/mob/clothing/head/plasmaman_head.dmi', visor_icon) + +/obj/item/clothing/head/helmet/space/plasmaman/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) . = ..() if(!isinhands && smile) var/mutable_appearance/smiley = mutable_appearance('icons/mob/clothing/head/plasmaman_head.dmi', smile_state) smiley.color = smile_color . += smiley - if(!isinhands && !up) - . += mutable_appearance('icons/mob/clothing/head/plasmaman_head.dmi', visor_icon) - else - cut_overlays() /obj/item/clothing/head/helmet/space/plasmaman/wash(clean_types) . = ..() diff --git a/code/modules/clothing/suits/_suits.dm b/code/modules/clothing/suits/_suits.dm index b8d77df4ad1..3e9bee36e09 100644 --- a/code/modules/clothing/suits/_suits.dm +++ b/code/modules/clothing/suits/_suits.dm @@ -24,8 +24,6 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damaged[blood_overlay_type]") - if(GET_ATOM_BLOOD_DNA_LENGTH(src)) - . += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood") var/mob/living/carbon/human/wearer = loc if(!ishuman(wearer) || !wearer.w_uniform) @@ -38,6 +36,13 @@ if(displayed.above_suit) . += undershirt.accessory_overlay +/obj/item/clothing/suit/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) + . = ..() + if(isinhands) + return + if(GET_ATOM_BLOOD_DNA_LENGTH(src)) + . += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood") + /obj/item/clothing/suit/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED) ..() if(ismob(loc)) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 7423b844d51..2bce69db4c6 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -100,11 +100,16 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform") - if(GET_ATOM_BLOOD_DNA_LENGTH(src)) - . += mutable_appearance('icons/effects/blood.dmi', "uniformblood") if(accessory_overlay) . += accessory_overlay +/obj/item/clothing/under/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) + . = ..() + if(isinhands) + return + if(GET_ATOM_BLOOD_DNA_LENGTH(src)) + . += mutable_appearance('icons/effects/blood.dmi', "uniformblood") + /obj/item/clothing/under/attackby(obj/item/attacking_item, mob/user, params) if(repair_sensors(attacking_item, user)) return TRUE diff --git a/code/modules/fishing/fish/types/air_space.dm b/code/modules/fishing/fish/types/air_space.dm index 1a1d809526b..8e53f00d46b 100644 --- a/code/modules/fishing/fish/types/air_space.dm +++ b/code/modules/fishing/fish/types/air_space.dm @@ -200,7 +200,7 @@ if(status == FISH_DEAD) eyes.icon_state += "_dead" else - eyes.appearance_flags = RESET_COLOR + eyes.appearance_flags = RESET_COLOR|KEEP_APART . += eyes ///Determines the speed at which the carp grows based on how big it's diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index b1895d08ab8..e51222d6397 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -483,15 +483,13 @@ var/line_color = line?.line_color || default_line_color /// Line part by the rod. if(reel_overlay) - var/mutable_appearance/reel_appearance = mutable_appearance(icon, reel_overlay) - reel_appearance.appearance_flags = RESET_COLOR + var/mutable_appearance/reel_appearance = mutable_appearance(icon, reel_overlay, appearance_flags = RESET_COLOR|KEEP_APART) reel_appearance.color = line_color . += reel_appearance // Line & hook is also visible when only bait is equipped but it uses default appearances then if(hook || bait) - var/mutable_appearance/line_overlay = mutable_appearance(icon, "line_overlay") - line_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/line_overlay = mutable_appearance(icon, "line_overlay", appearance_flags = RESET_COLOR|KEEP_APART) line_overlay.color = line_color . += line_overlay . += hook?.rod_overlay_icon_state || "hook_overlay" @@ -512,14 +510,12 @@ /obj/item/fishing_rod/proc/get_fishing_worn_overlays(mutable_appearance/standing, isinhands, icon_file) . = list() var/line_color = line?.line_color || default_line_color - var/mutable_appearance/reel_overlay = mutable_appearance(icon_file, "reel_overlay") - reel_overlay.appearance_flags |= RESET_COLOR + var/mutable_appearance/reel_overlay = mutable_appearance(icon_file, "reel_overlay", appearance_flags = RESET_COLOR|KEEP_APART) reel_overlay.color = line_color . += reel_overlay /// if we don't have anything hooked show the dangling hook & line if(isinhands && !fishing_line) - var/mutable_appearance/line_overlay = mutable_appearance(icon_file, "line_overlay") - line_overlay.appearance_flags |= RESET_COLOR + var/mutable_appearance/line_overlay = mutable_appearance(icon_file, "line_overlay", appearance_flags = RESET_COLOR|KEEP_APART) line_overlay.color = line_color . += line_overlay . += mutable_appearance(icon_file, "hook_overlay") diff --git a/code/modules/food_and_drinks/restaurant/_venue.dm b/code/modules/food_and_drinks/restaurant/_venue.dm index 7425b7b3555..8a88f9eb5a6 100644 --- a/code/modules/food_and_drinks/restaurant/_venue.dm +++ b/code/modules/food_and_drinks/restaurant/_venue.dm @@ -92,7 +92,7 @@ food_image.pixel_x = 16 SET_PLANE_EXPLICIT(food_image, HUD_PLANE, customer_pawn) food_image.plane = HUD_PLANE - food_image.appearance_flags = RESET_COLOR + food_image.appearance_flags = RESET_COLOR|KEEP_APART customer_pawn.hud_to_show_on_hover = customer_pawn.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/food_demands, "food_thoughts", food_image) return order diff --git a/code/modules/food_and_drinks/restaurant/customers/_customer.dm b/code/modules/food_and_drinks/restaurant/customers/_customer.dm index 653ce81b7d4..b4f3ab2e055 100644 --- a/code/modules/food_and_drinks/restaurant/customers/_customer.dm +++ b/code/modules/food_and_drinks/restaurant/customers/_customer.dm @@ -183,9 +183,7 @@ /datum/customer_data/french/get_overlays(mob/living/basic/robot_customer/customer) if(customer.ai_controller.blackboard[BB_CUSTOMER_LEAVING]) - var/mutable_appearance/flag = mutable_appearance(customer.icon, "french_flag") - flag.appearance_flags = RESET_COLOR - return flag + return mutable_appearance(customer.icon, "french_flag", appearance_flags = RESET_COLOR|KEEP_APART) @@ -231,9 +229,7 @@ /datum/customer_data/japanese/get_overlays(mob/living/basic/robot_customer/customer) //leaving and eaten if(type == /datum/customer_data/japanese && customer.ai_controller.blackboard[BB_CUSTOMER_LEAVING] && customer.ai_controller.blackboard[BB_CUSTOMER_EATING]) - var/mutable_appearance/you_won_my_heart = mutable_appearance('icons/effects/effects.dmi', "love_hearts") - you_won_my_heart.appearance_flags = RESET_COLOR - return you_won_my_heart + return mutable_appearance('icons/effects/effects.dmi', "love_hearts", appearance_flags = RESET_COLOR|KEEP_APART) /datum/customer_data/japanese/salaryman clothing_sets = list("japanese_salary") @@ -317,26 +313,15 @@ var/list/underlays = list() var/datum/sprite_accessory/moth_wings/wings = get_wings(customer) - - var/mutable_appearance/wings_behind = mutable_appearance(icon = 'icons/mob/human/species/moth/moth_wings.dmi', icon_state = "m_moth_wings_[wings.icon_state]_BEHIND") - wings_behind.appearance_flags = RESET_COLOR - underlays += wings_behind - + underlays += mutable_appearance(icon = 'icons/mob/human/species/moth/moth_wings.dmi', icon_state = "m_moth_wings_[wings.icon_state]_BEHIND", appearance_flags = RESET_COLOR|KEEP_APART) return underlays /datum/customer_data/moth/get_overlays(mob/living/basic/robot_customer/customer) var/list/overlays = list() var/datum/sprite_accessory/moth_wings/wings = get_wings(customer) - - var/mutable_appearance/wings_front = mutable_appearance(icon = 'icons/mob/human/species/moth/moth_wings.dmi', icon_state = "m_moth_wings_[wings.icon_state]_FRONT") - wings_front.appearance_flags = RESET_COLOR - overlays += wings_front - - var/mutable_appearance/jetpack = mutable_appearance(icon = customer.icon, icon_state = "mothbot_jetpack") - jetpack.appearance_flags = RESET_COLOR - overlays += jetpack - + overlays += mutable_appearance(icon = 'icons/mob/human/species/moth/moth_wings.dmi', icon_state = "m_moth_wings_[wings.icon_state]_FRONT", appearance_flags = RESET_COLOR|KEEP_APART) + overlays += mutable_appearance(icon = customer.icon, icon_state = "mothbot_jetpack", appearance_flags = RESET_COLOR|KEEP_APART) return overlays /datum/customer_data/mexican diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 278ec19228e..0cc9d78bc39 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -845,8 +845,7 @@ if(!.) return - googly = mutable_appearance('icons/obj/service/hydroponics/harvest.dmi', "eyes") - googly.appearance_flags = RESET_COLOR + googly = mutable_appearance('icons/obj/service/hydroponics/harvest.dmi', "eyes", appearance_flags = RESET_COLOR|KEEP_APART) our_plant.add_overlay(googly) /// Makes the plant embed on thrown impact. diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 7092c8c0f76..c800d192c1d 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -111,17 +111,15 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) var/obj/effect/extraction_holder/holder_obj = new(get_turf(thing)) holder_obj.appearance = thing.appearance thing.forceMove(holder_obj) - var/mutable_appearance/balloon2 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_expand", layer = VEHICLE_LAYER) + var/mutable_appearance/balloon2 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_expand", layer = VEHICLE_LAYER, appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM | KEEP_APART) balloon2.pixel_y = 10 - balloon2.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM holder_obj.add_overlay(balloon2) addtimer(CALLBACK(src, PROC_REF(create_balloon), thing, user, holder_obj, balloon2), 0.4 SECONDS) return ITEM_INTERACT_SUCCESS /obj/item/extraction_pack/proc/create_balloon(atom/movable/thing, mob/living/user, obj/effect/extraction_holder/holder_obj, mutable_appearance/balloon2) - var/mutable_appearance/balloon = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_balloon", layer = VEHICLE_LAYER) + var/mutable_appearance/balloon = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_balloon", layer = VEHICLE_LAYER, appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM | KEEP_APART) balloon.pixel_y = 10 - balloon.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM holder_obj.cut_overlay(balloon2) holder_obj.add_overlay(balloon) playsound(holder_obj.loc, 'sound/items/fulton/fultext_deploy.ogg', vol = 50, vary = TRUE, extrarange = -3) @@ -162,9 +160,8 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) sleep(7 SECONDS) - var/mutable_appearance/balloon3 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_retract", layer = VEHICLE_LAYER) + var/mutable_appearance/balloon3 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_retract", layer = VEHICLE_LAYER, appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM | KEEP_APART) balloon3.pixel_y = 10 - balloon3.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM holder_obj.cut_overlay(balloon) holder_obj.add_overlay(balloon3) diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index 22a20064370..78e9afa900c 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -297,7 +297,7 @@ 'icons/mob/effects/onfire.dmi', fire_icon, -HIGHEST_LAYER, - appearance_flags = RESET_COLOR, + appearance_flags = RESET_COLOR|KEEP_APART, ) return GLOB.fire_appearances[fire_icon] diff --git a/code/modules/mob/living/basic/blob_minions/blobbernaut.dm b/code/modules/mob/living/basic/blob_minions/blobbernaut.dm index a548a30be6a..3db90eedd9b 100644 --- a/code/modules/mob/living/basic/blob_minions/blobbernaut.dm +++ b/code/modules/mob/living/basic/blob_minions/blobbernaut.dm @@ -72,9 +72,8 @@ // take 2.5% of max health as damage when not near the blob or if the naut has no factory, 5% if both apply_damage(maxHealth * BLOBMOB_BLOBBERNAUT_HEALTH_DECAY * damage_sources * seconds_per_tick, damagetype = TOX) // We reduce brute damage - var/mutable_appearance/harming = mutable_appearance('icons/mob/nonhuman-player/blob.dmi', "nautdamage", MOB_LAYER + 0.01) - harming.appearance_flags = RESET_COLOR - harming.color = atom_colours[FIXED_COLOUR_PRIORITY] || COLOR_WHITE + var/mutable_appearance/harming = mutable_appearance('icons/mob/nonhuman-player/blob.dmi', "nautdamage", MOB_LAYER + 0.01, appearance_flags = RESET_COLOR|KEEP_APART) + harming = color_atom_overlay(harming) harming.dir = dir flick_overlay_view(harming, 0.8 SECONDS) return TRUE diff --git a/code/modules/mob/living/basic/bots/repairbot/repairbot.dm b/code/modules/mob/living/basic/bots/repairbot/repairbot.dm index 21cadcb7637..c9695e339a2 100644 --- a/code/modules/mob/living/basic/bots/repairbot/repairbot.dm +++ b/code/modules/mob/living/basic/bots/repairbot/repairbot.dm @@ -3,8 +3,8 @@ name = "\improper Repairbot" desc = "I can fix it!" icon = 'icons/mob/silicon/aibots.dmi' - icon_state = "repairbot_base" - base_icon_state = "repairbot_base" + icon_state = "repairbot1" + base_icon_state = "repairbot" pass_flags = parent_type::pass_flags | PASSTABLE layer = BELOW_MOB_LAYER anchored = FALSE @@ -95,8 +95,8 @@ START_PROCESSING(SSobj, src) /mob/living/basic/bot/repairbot/proc/set_color(new_color) - add_atom_colour(new_color, FIXED_COLOUR_PRIORITY) toolbox_color = new_color + update_appearance() /mob/living/basic/bot/repairbot/attackby(obj/item/potential_stack, mob/living/carbon/human/user, list/modifiers) if(!istype(potential_stack, /obj/item/stack)) @@ -263,22 +263,20 @@ /mob/living/basic/bot/repairbot/update_overlays() . = ..() - . += mutable_appearance(icon, "repairbot[bot_mode_flags & BOT_MODE_ON]", appearance_flags = RESET_COLOR) + var/mutable_appearance/our_box = mutable_appearance(icon, "repairbot_box", BELOW_MOB_LAYER - 0.02) + our_box.color = toolbox_color + . += our_box if(our_glass) - var/mutable_appearance/glass = mutable_appearance(icon, "repairbot_glass_overlay", BELOW_MOB_LAYER - 0.02, appearance_flags = RESET_COLOR) + var/mutable_appearance/glass = mutable_appearance(icon, "repairbot_glass_overlay", BELOW_MOB_LAYER - 0.02, appearance_flags = RESET_COLOR|KEEP_APART) glass.pixel_x = -6 glass.pixel_y = -5 . += glass if(our_iron) - var/mutable_appearance/iron = mutable_appearance(icon, "repairbot_iron_overlay", BELOW_MOB_LAYER - 0.02, appearance_flags = RESET_COLOR) + var/mutable_appearance/iron = mutable_appearance(icon, "repairbot_iron_overlay", BELOW_MOB_LAYER - 0.02, appearance_flags = RESET_COLOR|KEEP_APART) iron.pixel_y = -5 iron.pixel_x = 7 . += iron -/mob/living/basic/bot/repairbot/update_icon_state() - . = ..() - icon_state = base_icon_state - /mob/living/basic/bot/repairbot/generate_speak_list() return neutral_voicelines + emagged_voicelines @@ -358,7 +356,8 @@ /mob/living/basic/bot/repairbot/mob_pickup(mob/living/user) var/obj/item/carried_repairbot/carried = new(get_turf(src)) carried.set_bot(src) - carried.add_atom_colour(toolbox_color, FIXED_COLOUR_PRIORITY) + if(carried.icon_state == "toolbox_default") + carried.add_atom_colour(toolbox_color, FIXED_COLOUR_PRIORITY) user.visible_message(span_warning("[user] scoops up [src]!")) user.put_in_hands(carried) @@ -374,6 +373,7 @@ /obj/item/carried_repairbot/proc/set_bot(mob/living/basic/bot/repairbot/repairbot) var/obj/item/bot_toolbox = repairbot.toolbox + name = repairbot.name icon = bot_toolbox::icon icon_state = bot_toolbox::icon_state lefthand_file = bot_toolbox::lefthand_file diff --git a/code/modules/mob/living/basic/drone/drone_tools.dm b/code/modules/mob/living/basic/drone/drone_tools.dm index 5dbcb3f0816..de8c7de979a 100644 --- a/code/modules/mob/living/basic/drone/drone_tools.dm +++ b/code/modules/mob/living/basic/drone/drone_tools.dm @@ -49,14 +49,11 @@ random_color = FALSE -/obj/item/screwdriver/drone/worn_overlays(mutable_appearance/standing, isinhands = FALSE, icon_file) +/obj/item/screwdriver/drone/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) . = ..() if(!isinhands) return - - var/mutable_appearance/head = mutable_appearance(icon_file, "screwdriver_head") - head.appearance_flags = RESET_COLOR - . += head + . += mutable_appearance(icon_file, "screwdriver_head", appearance_flags = RESET_COLOR) /obj/item/wrench/drone name = "built-in wrench" diff --git a/code/modules/mob/living/basic/space_fauna/robot_customer.dm b/code/modules/mob/living/basic/space_fauna/robot_customer.dm index 667adb7d268..27e20122087 100644 --- a/code/modules/mob/living/basic/space_fauna/robot_customer.dm +++ b/code/modules/mob/living/basic/space_fauna/robot_customer.dm @@ -46,7 +46,7 @@ icon = customer_info.base_icon icon_state = customer_info.base_icon_state name = "[pick(customer_info.name_prefixes)]-bot" - color = rgb(rand(80,255), rand(80,255), rand(80,255)) + add_atom_colour(rgb(rand(80,255), rand(80,255), rand(80,255)), FIXED_COLOUR_PRIORITY) clothes_set = pick(customer_info.clothing_sets) update_appearance(UPDATE_ICON) @@ -82,13 +82,8 @@ underlays.Cut() underlays += new_underlays - var/mutable_appearance/features = mutable_appearance(icon, "[icon_state]_features") - features.appearance_flags = RESET_COLOR - . += features - - var/mutable_appearance/clothes = mutable_appearance(icon, clothes_set) - clothes.appearance_flags = RESET_COLOR - . += clothes + . += mutable_appearance(icon, "[icon_state]_features", appearance_flags = RESET_COLOR|KEEP_APART) + . += mutable_appearance(icon, clothes_set, appearance_flags = RESET_COLOR|KEEP_APART) var/bonus_overlays = customer_info.get_overlays(src) if(bonus_overlays) diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 4fb50a6f942..2960580fec7 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -286,7 +286,7 @@ 'icons/mob/effects/onfire.dmi', fire_icon, -HIGHEST_LAYER, - appearance_flags = RESET_COLOR, + appearance_flags = RESET_COLOR|KEEP_APART, ) return GLOB.fire_appearances[fire_icon] @@ -446,9 +446,9 @@ /mob/living/carbon/proc/update_hud_back(obj/item/I) return -//Overlays for the worn overlay so you can overlay while you overlay -//eg: ammo counters, primed grenade flashing, etc. -//"icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file +/// Overlays for the worn overlay so you can overlay while you overlay +/// eg: ammo counters, primed grenade flashing, etc. +/// "icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file /obj/item/proc/worn_overlays(mutable_appearance/standing, isinhands = FALSE, icon_file) SHOULD_CALL_PARENT(TRUE) RETURN_TYPE(/list) @@ -458,6 +458,13 @@ . += emissive_blocker(standing.icon, standing.icon_state, src, alpha = standing.alpha) SEND_SIGNAL(src, COMSIG_ITEM_GET_WORN_OVERLAYS, ., standing, isinhands, icon_file) +/// worn_overlays to use when you'd want to use KEEP_APART. Don't use KEEP_APART neither there nor here, as it would break floating overlays +/obj/item/proc/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands = FALSE, icon_file) + SHOULD_CALL_PARENT(TRUE) + RETURN_TYPE(/list) + . = list() + SEND_SIGNAL(src, COMSIG_ITEM_GET_SEPARATE_WORN_OVERLAYS, ., standing, draw_target, isinhands, icon_file) + ///Checks to see if any bodyparts need to be redrawn, then does so. update_limb_data = TRUE redraws the limbs to conform to the owner. ///Returns an integer representing the number of limbs that were updated. /mob/living/carbon/proc/update_body_parts(update_limb_data) diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 104ea031486..dfa7353303a 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -810,7 +810,7 @@ generate/load female uniform sprites matching all previously decided variables var/mob/living/carbon/wearer = loc var/is_digi = istype(wearer) && (wearer.bodyshape & BODYSHAPE_DIGITIGRADE) && !wearer.is_digitigrade_squished() - var/mutable_appearance/standing // this is the actual resulting MA + var/mutable_appearance/draw_target // MA of the item itself, not the final result var/icon/building_icon // used to construct an icon across multiple procs before converting it to MA if(female_uniform) building_icon = wear_female_version( @@ -827,16 +827,24 @@ generate/load female uniform sprites matching all previously decided variables greyscale_colors = greyscale_colors, ) if(building_icon) - standing = mutable_appearance(building_icon, layer = -layer2use) - - // no special handling done, default it - standing ||= mutable_appearance(file2use, t_state, layer = -layer2use) + draw_target = mutable_appearance(building_icon) + else + draw_target = mutable_appearance(file2use, t_state) //Get the overlays for this item when it's being worn //eg: ammo counters, primed grenade flashes, etc. - var/list/worn_overlays = worn_overlays(standing, isinhands, file2use) + var/list/worn_overlays = worn_overlays(draw_target, isinhands, file2use) if(length(worn_overlays)) - standing.overlays += worn_overlays + draw_target.overlays += worn_overlays + draw_target = color_atom_overlay(draw_target) + + // Okay so this has to be done because some overlays, like blood, want to be KEEP_APART + // but KEEP_APART breaks float layering, so what we need to do is make fake KEEP_APART for us to use + var/mutable_appearance/standing = mutable_appearance(layer = -layer2use, appearance_flags = KEEP_TOGETHER) + standing.overlays += draw_target + var/list/separate_overlays = separate_worn_overlays(standing, draw_target, isinhands, file2use) + if(length(separate_overlays)) + standing.overlays += separate_overlays standing = center_image(standing, isinhands ? inhand_x_dimension : worn_x_dimension, isinhands ? inhand_y_dimension : worn_y_dimension) @@ -846,7 +854,6 @@ generate/load female uniform sprites matching all previously decided variables standing.pixel_z += offsets[2] standing.alpha = alpha - standing = color_atom_overlay(standing) return standing diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 20b231b148f..911fbbcd450 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1048,7 +1048,7 @@ 'icons/mob/effects/onfire.dmi', fire_icon, -HIGHEST_LAYER, - appearance_flags = RESET_COLOR, + appearance_flags = RESET_COLOR|KEEP_APART, ) GLOB.fire_appearances[fire_icon] = new_fire_overlay diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 4798752969a..582fff71599 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -1156,11 +1156,7 @@ Pass a positive integer as an argument to override a bot's default speed. var/list/path_images = active_hud_list[DIAG_PATH_HUD] LAZYCLEARLIST(path_images) if(length(newpath)) - var/mutable_appearance/path_image = new /mutable_appearance() - path_image.icon = path_image_icon - path_image.icon_state = path_image_icon_state - path_image.layer = BOT_PATH_LAYER - path_image.appearance_flags = RESET_COLOR|RESET_TRANSFORM + var/mutable_appearance/path_image = mutable_appearance(path_image_icon, path_image_icon_state, BOT_PATH_LAYER, appearance_flags = RESET_COLOR|RESET_TRANSFORM|KEEP_APART) path_image.color = path_image_color for(var/i in 1 to newpath.len) var/turf/T = newpath[i] diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 093f54a5c57..d3411904fdc 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -192,9 +192,9 @@ //Repairbot assemblies /obj/item/bot_assembly/repairbot - desc = "It's a toolbox with tiles sticking out the top." name = "Repairbot Chasis" - icon_state = "repairbot_base" + desc = "It's a toolbox with tiles sticking out the top." + icon_state = "repairbot_box" throwforce = 10 created_name = "Repairbot" ///the toolbox our repairbot is made of @@ -221,9 +221,9 @@ /obj/item/bot_assembly/repairbot/update_overlays() . = ..() if(build_step >= ASSEMBLY_FIRST_STEP) - . += mutable_appearance(icon, "repairbot_base_sensor", appearance_flags = RESET_COLOR) + . += mutable_appearance(icon, "repairbot_base_sensor", appearance_flags = RESET_COLOR|KEEP_APART) if(build_step >= ASSEMBLY_SECOND_STEP) - . += mutable_appearance(icon, "repairbot_base_arms", appearance_flags = RESET_COLOR) + . += mutable_appearance(icon, "repairbot_base_arms", appearance_flags = RESET_COLOR|KEEP_APART) /obj/item/bot_assembly/repairbot/attackby(obj/item/item, mob/user, params) ..() diff --git a/code/modules/mod/modules/module_kinesis.dm b/code/modules/mod/modules/module_kinesis.dm index 733e5ab40d9..436d3dc9e87 100644 --- a/code/modules/mod/modules/module_kinesis.dm +++ b/code/modules/mod/modules/module_kinesis.dm @@ -162,8 +162,7 @@ ADD_TRAIT(grabbed_atom, TRAIT_NO_FLOATING_ANIM, REF(src)) RegisterSignal(grabbed_atom, COMSIG_MOVABLE_SET_ANCHORED, PROC_REF(on_setanchored)) playsound(grabbed_atom, 'sound/items/weapons/contractor_baton/contractorbatonhit.ogg', 75, TRUE) - kinesis_icon = mutable_appearance(icon = 'icons/effects/effects.dmi', icon_state = "kinesis", layer = grabbed_atom.layer - 0.1) - kinesis_icon.appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM + kinesis_icon = mutable_appearance(icon = 'icons/effects/effects.dmi', icon_state = "kinesis", layer = grabbed_atom.layer - 0.1, appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM|KEEP_APART) kinesis_icon.overlays += emissive_appearance(icon = 'icons/effects/effects.dmi', icon_state = "kinesis", offset_spokesman = grabbed_atom) grabbed_atom.add_overlay(kinesis_icon) kinesis_beam = mod.wearer.Beam(grabbed_atom, "kinesis") diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index 6cb96b7d99c..21ae23ee46d 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -441,8 +441,7 @@ . = ..() if(!active) return - var/mutable_appearance/light_icon = mutable_appearance(overlay_icon_file, "module_light_on", layer = standing.layer + 0.2) - light_icon.appearance_flags = RESET_COLOR + var/mutable_appearance/light_icon = mutable_appearance(overlay_icon_file, "module_light_on", layer = standing.layer + 0.2, appearance_flags = RESET_COLOR) light_icon.color = light_color . += light_icon diff --git a/code/modules/modular_computers/file_system/programs/virtual_pet.dm b/code/modules/modular_computers/file_system/programs/virtual_pet.dm index 8df6647ed9b..b00c88ee0e3 100644 --- a/code/modules/modular_computers/file_system/programs/virtual_pet.dm +++ b/code/modules/modular_computers/file_system/programs/virtual_pet.dm @@ -214,18 +214,19 @@ GLOBAL_LIST_EMPTY(virtual_pets_list) /datum/computer_file/program/virtual_pet/proc/alter_profile_picture() var/image/pet_preview = image(icon = 'icons/ui/virtualpet/pet_state.dmi', icon_state = "pet_preview") - if(LAZYACCESS(pet.atom_colours, FIXED_COLOUR_PRIORITY)) - pet_preview.color = pet.atom_colours[FIXED_COLOUR_PRIORITY] + if(pet.cached_color_filter) + pet_preview.color = apply_matrix_to_color(COLOR_WHITE, pet.cached_color_filter["color"], pet.cached_color_filter["space"] || COLORSPACE_RGB) + else if (pet.color) + pet_preview.color = pet.color if(length(selected_hat)) var/mutable_appearance/our_selected_hat = selected_hat["appearance"] - var/mutable_appearance/hat_preview = mutable_appearance(our_selected_hat.icon, our_selected_hat.icon_state) + var/mutable_appearance/hat_preview = mutable_appearance(our_selected_hat.icon, our_selected_hat.icon_state, appearance_flags = RESET_COLOR|KEEP_APART) hat_preview.pixel_y = -9 + selected_hat["worn_offset"] var/list/spec_hat = special_hat_placement[selected_hat["type"]]?["south"] if(spec_hat) hat_preview.pixel_w += spec_hat[1] hat_preview.pixel_z += spec_hat[2] - hat_preview.appearance_flags = RESET_COLOR pet_preview.add_overlay(hat_preview) profile_picture = getFlatIcon(pet_preview, no_anim = TRUE) @@ -504,7 +505,7 @@ GLOBAL_LIST_EMPTY(virtual_pets_list) else selected_hat["type"] = chosen_type var/state_to_use = initial(chosen_type.worn_icon_state) || initial(chosen_type.icon_state) - var/mutable_appearance/selected_hat_appearance = mutable_appearance(initial(chosen_type.worn_icon), state_to_use, appearance_flags = RESET_COLOR) + var/mutable_appearance/selected_hat_appearance = mutable_appearance(initial(chosen_type.worn_icon), state_to_use, appearance_flags = RESET_COLOR|KEEP_APART) selected_hat["worn_offset"] = initial(chosen_type.worn_y_offset) var/list/scale_list = special_hat_placement[chosen_type]?["scale"] if(scale_list) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 7a027eb8c75..ef05d31ba22 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -17,7 +17,6 @@ icon_state = "paper" inhand_icon_state = "paper" worn_icon_state = "paper" - custom_fire_overlay = "paper_onfire_overlay" throwforce = 0 w_class = WEIGHT_CLASS_TINY throw_range = 1 @@ -86,6 +85,11 @@ LAZYREMOVE(SSpersistence.queued_message_bottles, src) return ..() +/obj/item/paper/custom_fire_overlay() + if (!custom_fire_overlay) + custom_fire_overlay = mutable_appearance('icons/obj/service/bureaucracy.dmi', "paper_onfire_overlay", appearance_flags = RESET_COLOR|KEEP_APART) + return custom_fire_overlay + /// Determines whether this paper has been written or stamped to. /obj/item/paper/proc/is_empty() return !(LAZYLEN(raw_text_inputs) || LAZYLEN(raw_stamp_data)) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 41c285d46a5..8a7cf61e4d2 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/service/bureaucracy.dmi' icon_state = "paperplane" base_icon_state = "paperplane" - custom_fire_overlay = "paperplane_onfire" throw_range = 7 throw_speed = 1 throwforce = 0 @@ -48,6 +47,11 @@ internal_paper = null return ..() +/obj/item/paperplane/custom_fire_overlay() + if (!custom_fire_overlay) + custom_fire_overlay = mutable_appearance('icons/obj/service/bureaucracy.dmi', "paperplane_onfire", appearance_flags = RESET_COLOR|KEEP_APART) + return custom_fire_overlay + /obj/item/paperplane/suicide_act(mob/living/user) var/obj/item/organ/eyes/eyes = user.get_organ_slot(ORGAN_SLOT_EYES) user.Stun(20 SECONDS) diff --git a/code/modules/reagents/reagent_containers/cups/glassbottle.dm b/code/modules/reagents/reagent_containers/cups/glassbottle.dm index 2f54bede78c..d1655730c99 100644 --- a/code/modules/reagents/reagent_containers/cups/glassbottle.dm +++ b/code/modules/reagents/reagent_containers/cups/glassbottle.dm @@ -625,7 +625,7 @@ list_reagents = list(/datum/reagent/consumable/ethanol/bitters = 30) drink_type = ALCOHOL //allows for single unit dispensing - possible_transfer_amounts = list(1, 2, 3, 4, 5) + possible_transfer_amounts = list(1, 2, 3, 4, 5) amount_per_transfer_from_this = 5 /obj/item/reagent_containers/cup/glass/bottle/curacao @@ -948,7 +948,7 @@ log_bomber(user, "has primed a", src, "for detonation") to_chat(user, span_info("You light [src] on fire.")) - add_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay) + add_overlay(custom_fire_overlay() || GLOB.fire_overlay) if(!isGlass) addtimer(CALLBACK(src, PROC_REF(explode)), 5 SECONDS) @@ -970,7 +970,7 @@ to_chat(user, span_danger("The flame's spread too far on it!")) return to_chat(user, span_info("You snuff out the flame on [src].")) - cut_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay) + cut_overlay(custom_fire_overlay() || GLOB.fire_overlay) active = FALSE return return ..() diff --git a/code/modules/research/xenobiology/vatgrowing/petri_dish.dm b/code/modules/research/xenobiology/vatgrowing/petri_dish.dm index df2fa619cc3..2ff71feff24 100644 --- a/code/modules/research/xenobiology/vatgrowing/petri_dish.dm +++ b/code/modules/research/xenobiology/vatgrowing/petri_dish.dm @@ -39,8 +39,7 @@ if(!sample) return var/reagentcolor = sample.sample_color - var/mutable_appearance/base_overlay = mutable_appearance(icon, "petri_dish_overlay") - base_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/base_overlay = mutable_appearance(icon, "petri_dish_overlay", appearance_flags = RESET_COLOR|KEEP_APART) base_overlay.color = reagentcolor . += base_overlay var/mutable_appearance/overlay2 = mutable_appearance(icon, "petri_dish_overlay2") diff --git a/code/modules/research/xenobiology/vatgrowing/swab.dm b/code/modules/research/xenobiology/vatgrowing/swab.dm index 1027647b4c2..4236c9c7ac9 100644 --- a/code/modules/research/xenobiology/vatgrowing/swab.dm +++ b/code/modules/research/xenobiology/vatgrowing/swab.dm @@ -14,6 +14,5 @@ /obj/item/swab/proc/update_swab_icon(overlays, list/swabbed_items) if(LAZYLEN(swabbed_items)) var/datum/biological_sample/sample = LAZYACCESS(swabbed_items, 1) //Use the first one as our target - var/mutable_appearance/swab_overlay = mutable_appearance(icon, "swab_[sample.sample_color]") - swab_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/swab_overlay = mutable_appearance(icon, "swab_[sample.sample_color]", appearance_flags = RESET_COLOR|KEEP_APART) overlays += swab_overlay diff --git a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm index 78a1e15b1cc..1ab0be77d65 100644 --- a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm +++ b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm @@ -148,8 +148,7 @@ if(!reagents.total_volume) return var/reagentcolor = mix_color_from_reagents(reagents.reagent_list) - var/mutable_appearance/base_overlay = mutable_appearance(icon, "vat_reagent") - base_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/base_overlay = mutable_appearance(icon, "vat_reagent", appearance_flags = RESET_COLOR|KEEP_APART) base_overlay.color = reagentcolor . += base_overlay if(biological_sample && is_operational) diff --git a/code/modules/surgery/organs/internal/ears/_ears.dm b/code/modules/surgery/organs/internal/ears/_ears.dm index ed4cdfec9d2..b1a39823437 100644 --- a/code/modules/surgery/organs/internal/ears/_ears.dm +++ b/code/modules/surgery/organs/internal/ears/_ears.dm @@ -195,7 +195,15 @@ // Construct image of inner ears, apply to base ears as an overlay feature_key += "inner" var/mutable_appearance/inner_ears = ..() - inner_ears.appearance_flags = RESET_COLOR + inner_ears.appearance_flags = RESET_COLOR|KEEP_APART + if(limb.cached_color_filter) + inner_ears.color = limb.color + inner_ears = filter_appearance_recursive(inner_ears, limb.cached_color_filter) + if(limb.owner) + if(limb.owner.color) + inner_ears.color = limb.owner.color + if(limb.owner.cached_color_filter) + inner_ears = filter_appearance_recursive(inner_ears, limb.owner.cached_color_filter) feature_key = initial(feature_key) base_ears.overlays += inner_ears diff --git a/icons/mob/silicon/aibots.dmi b/icons/mob/silicon/aibots.dmi index b0bc6261f6d..fa4c11f891a 100644 Binary files a/icons/mob/silicon/aibots.dmi and b/icons/mob/silicon/aibots.dmi differ diff --git a/icons/turf/walls/false_walls.dmi b/icons/turf/walls/false_walls.dmi index 1b02b4bdbe6..74b72633bb4 100644 Binary files a/icons/turf/walls/false_walls.dmi and b/icons/turf/walls/false_walls.dmi differ