/* * Photo */ /obj/item/photo name = "photo" icon = 'icons/obj/items_and_weapons.dmi' icon_state = "photo" item_state = "paper" w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE max_integrity = 50 grind_results = list(/datum/reagent/iodine = 4) var/datum/picture/picture var/scribble //Scribble on the back. /obj/item/photo/Initialize(mapload, datum/picture/P, datum_name = TRUE, datum_desc = TRUE) set_picture(P, datum_name, datum_desc, TRUE) return ..() /obj/item/photo/proc/set_picture(datum/picture/P, setname, setdesc, name_override = FALSE) if(!istype(P)) return picture = P update_icon() if(P.caption) scribble = P.caption if(setname && P.picture_name) if(name_override) name = P.picture_name else name = "photo - [P.picture_name]" if(setdesc && P.picture_desc) desc = P.picture_desc /obj/item/photo/update_icon_state() if(!istype(picture) || !picture.picture_image) return var/icon/I = picture.get_small_icon() if(I) icon = I /obj/item/photo/suicide_act(mob/living/carbon/user) user.visible_message("[user] is taking one last look at \the [src]! It looks like [user.p_theyre()] giving in to death!")//when you wanna look at photo of waifu one last time before you die... if (user.gender == MALE) playsound(user, 'sound/voice/human/manlaugh1.ogg', 50, 1)//EVERY TIME I DO IT MAKES ME LAUGH else if (user.gender == FEMALE) playsound(user, 'sound/voice/human/womanlaugh.ogg', 50, 1) return OXYLOSS /obj/item/photo/attack_self(mob/user) user.examinate(src) /obj/item/photo/attackby(obj/item/P, mob/user, params) if(try_burn(P, user)) return if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) if(!user.is_literate()) to_chat(user, "You scribble illegibly on [src]!") return var/txt = stripped_input(user, "What would you like to write on the back?", "Photo Writing", "", 128) if(txt && user.canUseTopic(src, BE_CLOSE)) scribble = txt ..() /obj/item/photo/proc/try_burn(obj/item/I, mob/living/user) var/ignition_message = I.ignition_effect(src, user) if(!ignition_message) return . = TRUE if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10) && Adjacent(user)) user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ "You miss [src] and accidentally light yourself on fire!") if(user.is_holding(I)) //checking if they're holding it in case TK is involved user.dropItemToGround(I) user.adjust_fire_stacks(1) user.IgniteMob() return if(user.is_holding(src)) //no TK shit here. user.dropItemToGround(src) user.visible_message(ignition_message) add_fingerprint(user) fire_act(I.get_temperature()) /obj/item/photo/examine(mob/user) . = ..() if(in_range(src, user)) show(user) else . += "You need to get closer to get a good look at this photo!" /obj/item/photo/proc/show(mob/user) if(!istype(picture) || !picture.picture_image) to_chat(user, "[src] seems to be blank...") return user << browse_rsc(picture.picture_image, "tmp_photo.png") user << browse("[name]" \ + "" \ + "" \ + "[scribble ? "
Written on the back:
[scribble]" : ""]"\ + "", "window=photo_showing;size=480x608") onclose(user, "[name]") /obj/item/photo/verb/rename() set name = "Rename photo" set category = "Object" set src in usr var/mob/living/L = usr if(!istype(L)) return var/n_name = stripped_input(usr, "What would you like to label the photo?", "Photo Labelling", "", MAX_NAME_LEN) //loc.loc check is for making possible renaming photos in clipboards if(n_name && (loc == usr || loc.loc && loc.loc == usr) && CHECK_MOBILITY(L, MOBILITY_USE)) name = "photo[(n_name ? text("- '[n_name]'") : null)]" add_fingerprint(usr)