diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 1e01adef4b7..49ec8cd590f 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -10,7 +10,13 @@ var/list/ui_users = list() var/broken_icon_state = "mirror_broke" + /// what to show when a ghost Boo!'s this mirror + var/icon/spooked_icon + /// Whether a mirror can be Boo!'d or not. Magic mirrors are animated, so this is used to stop them from looking weird + var/can_be_spooked = TRUE + /obj/structure/mirror/organ + can_be_spooked = FALSE /obj/structure/mirror/Initialize(mapload, newdir = SOUTH, building = FALSE) . = ..() @@ -25,6 +31,7 @@ if(WEST) pixel_x = 32 GLOB.mirrors += src + spooked_icon = update_spooked_icon(icon("icons/mob/human.dmi", "husk_s"), SOUTH, 8, 0) /obj/structure/mirror/Destroy() QDEL_LIST_ASSOC_VAL(ui_users) @@ -86,6 +93,32 @@ if(BURN) playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, TRUE) +/obj/structure/mirror/get_spooked() + if(!can_be_spooked || broken) + return + flicker_ghost(spooked_icon) + return TRUE + +/// This proc sets the icon that will show up in the mirror when spooked +/// * icon_to_show - which icon +/// * offset_dir - you might want to move the icon so it appears in the mirror +/// * offset_pixels - how many pixels you need to move the icon +/// * wrap - if the icon should wrap around +/obj/structure/mirror/proc/update_spooked_icon(icon/icon_to_show, offset_dir, offset_pixels, wrap) + var/icon/our_icon = icon_to_show + our_icon.Shift(offset_dir,offset_pixels,wrap) + var/icon/alpha_mask = new("icons/obj/watercloset.dmi", "mirror_mask") + our_icon.AddAlphaMask(alpha_mask) + var/icon/added_icons = new("icons/obj/watercloset.dmi", "mirror") + added_icons.Blend(our_icon, ICON_OVERLAY) + return added_icons + +/// Shows the icon in the mirror with its mask +/obj/structure/mirror/proc/flicker_ghost(icon/icon_to_show) + icon = icon_to_show + sleep(rand(5,10)) + icon = initial(icon) + return /obj/item/mounted/mirror name = "mirror" @@ -105,6 +138,7 @@ var/options = list("Name", "Body", "Voice") var/organ_warn = FALSE var/actually_magical = TRUE + can_be_spooked = FALSE /obj/structure/mirror/magic/Initialize(mapload, newdir, building) . = ..() @@ -187,4 +221,3 @@ options = list("Body") organ_warn = TRUE actually_magical = FALSE - diff --git a/icons/obj/watercloset.dmi b/icons/obj/watercloset.dmi index 9564291cc8c..705ac571530 100644 Binary files a/icons/obj/watercloset.dmi and b/icons/obj/watercloset.dmi differ