From a3d7faeb722f8ac8e5763e1896ca1687e0a67171 Mon Sep 17 00:00:00 2001 From: Geeves Date: Fri, 18 Feb 2022 13:48:59 +0200 Subject: [PATCH] Mrakiizar Book Tweaks (#13092) --- code/game/gamemodes/cult/items/talisman.dm | 3 +- code/modules/customitems/item_defines.dm | 63 ++++++++++++++++++++- code/modules/paperwork/paper.dm | 16 ++++-- icons/obj/custom_items/mrakiizar_book.dmi | Bin 1543 -> 1779 bytes 4 files changed, 72 insertions(+), 10 deletions(-) diff --git a/code/game/gamemodes/cult/items/talisman.dm b/code/game/gamemodes/cult/items/talisman.dm index e0bc85b3384..b19084233ce 100644 --- a/code/game/gamemodes/cult/items/talisman.dm +++ b/code/game/gamemodes/cult/items/talisman.dm @@ -1,5 +1,6 @@ /obj/item/paper/talisman icon_state = "paper_talisman" + can_change_icon_state = FALSE var/uses = 1 var/datum/rune/rune info = "


" @@ -33,4 +34,4 @@ /obj/item/paper/talisman/proc/use() uses-- if(uses <= 0) - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index c4ffd3e03bc..a8557a117e2 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -2216,11 +2216,68 @@ All custom items with worn sprites must follow the contained sprite system: http icon_state = "mrakiizar_book" item_state = "mrakiizar_book" contained_sprite = TRUE + var/open_state = "mrakiizar_book1" + var/list/open_states = list("mrakiizar_book1", "mrakiizar_book2", "mrakiizar_book3", "mrakiizar_book4") /obj/item/journal/fluff/mrakiizar_book/update_icon() - ..() - if(open) - icon_state = pick("mrakiizar_book1","mrakiizar_book2","mrakiizar_book3","mrakiizar_book4") + if(!open) + icon_state = "mrakiizar_book_closed" + else + icon_state = open_state + + if(closed_desc) + desc = open ? initial(desc) + closed_desc : initial(desc) + +/obj/item/journal/fluff/mrakiizar_book/attack_hand(mob/user) + if(open && user.a_intent == I_HURT) + if(!LAZYLEN(indices)) + to_chat(user, SPAN_WARNING("There aren't any indices to rip a paper out of!")) + return + + var/list/viable_indices = list() + for(var/index in indices) + var/obj/item/folder/embedded/E = indices[index] + if(!(locate(/obj/item/paper) in E)) + continue + viable_indices += index + + if(!length(viable_indices)) + to_chat(user, SPAN_WARNING("None of the indices in \the [src] contain a paper!")) + return + + var/selected_folder = input(user, "Select an index to rip a paper out of.", "Rip Index Select") as null|anything in viable_indices + if(isnull(selected_folder)) + return + + var/obj/item/folder/embedded/E = indices[selected_folder] + var/list/papers = list() + + for(var/obj/item/paper/P in E) + papers += P + + var/obj/item/paper/selected_paper = input(user, "Select a paper to rip out.", "Rip Paper Select") as null|anything in papers + if(isnull(selected_paper)) + return + + user.visible_message(SPAN_WARNING("[user] rips \the [selected_paper] out of \the [src]."), SPAN_NOTICE("You rip \the [selected_paper] out of \the [src]."), range = 5) + if(selected_paper.can_change_icon_state) + selected_paper.icon = icon + selected_paper.base_state = "torn" + selected_paper.update_icon() + user.put_in_hands(selected_paper) + E.handle_post_remove() + playsound(loc, 'sound/items/poster_ripped.ogg', 50, FALSE) + return + return ..() + +/obj/item/journal/fluff/mrakiizar_book/CtrlClick(mob/user) + if(open && Adjacent(user)) + open_state = next_in_list(icon_state, open_states) + user.visible_message("[user] flips a page in \the [src].", SPAN_NOTICE("You flip a page in \the [src]."), range = 3) + playsound(loc, 'sound/items/pickup/paper.ogg', 50, FALSE) + update_icon() + return + return ..() /obj/item/clothing/accessory/fluff/jaquelyn_necklace //Shrapnel Necklace - Jaquelyn Roberts - roostercat12 name = "shrapnel necklace" diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 7f50dff2d3b..35b432c5dbf 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -8,6 +8,7 @@ gender = NEUTER icon = 'icons/obj/bureaucracy.dmi' icon_state = "paper" + var/base_state = "paper" item_state = "paper" contained_sprite = 1 throwforce = 0 @@ -42,8 +43,11 @@ drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' + var/can_change_icon_state = TRUE + /obj/item/paper/Initialize(mapload, text, title) . = ..() + base_state = initial(icon_state) if (text || title) set_content(title, text ? text : info) else @@ -79,12 +83,12 @@ updateinfolinks() /obj/item/paper/update_icon() - if(icon_state == "paper_talisman") + if(!can_change_icon_state) return else if (info && length(trim(info))) - icon_state = "[initial(icon_state)]_words" + icon_state = "[base_state]_words" else - icon_state = "[initial(icon_state)]" + icon_state = "[base_state]" /obj/item/paper/proc/update_space(var/new_text) if(new_text) @@ -131,7 +135,7 @@ return var/n_name = sanitizeSafe(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text, MAX_NAME_LEN) - + if(use_check_and_message(usr, USE_ALLOW_NON_ADJACENT)) return @@ -184,7 +188,7 @@ if (user.a_intent == I_HELP && old_name && (icon_state == "paper_plane" || icon_state == "paper_swan")) user.visible_message(SPAN_NOTICE("\The [user] unfolds \the [src]."), SPAN_NOTICE("You unfold \the [src]."), "You hear paper rustling.") playsound(src, 'sound/bureaucracy/paperfold.ogg', 50, 1) - icon_state = initial(icon_state) + icon_state = base_state throw_range = initial(throw_range) name = old_name old_name = null @@ -409,7 +413,7 @@ . = replacetext(., written_lang_regex.match, "") else content = L.scramble(content) - + if(!language_check) // Refer to paper/proc/show_content to edit the spans here. . = replacetext(., written_lang_regex.match, "[L.short && reader_understands ? "([L.short]) [content]" : content]") diff --git a/icons/obj/custom_items/mrakiizar_book.dmi b/icons/obj/custom_items/mrakiizar_book.dmi index e9af53007d38309539450feb5e0917e86ed3ce5b..5c589e46512b89551f377444de99af595ab1e3e2 100644 GIT binary patch delta 1740 zcmV;-1~d7G4D$^oiBL{Q4GJ0x0000DNk~Le0002M0001>2m=5B0B!b@ZvX%QPLU-m zJh5Us#EoT!m0OBtLUFl!hFxcCs;pl)LP>Xyd3kyN|Nq(9*}J>DA|z#800001bW%=J z06^y0W&i*Hy^(+wf4dHYFbqZKkDP*gaT~7 z(mB3^9kXkBt7=xDii<)5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