mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 22:12:58 +01:00
Mrakiizar Book Tweaks (#13092)
This commit is contained in:
@@ -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 = "<center><img src='talisman.png'></center><br/><br/>"
|
||||
@@ -33,4 +34,4 @@
|
||||
/obj/item/paper/talisman/proc/use()
|
||||
uses--
|
||||
if(uses <= 0)
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -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("<b>[user]</b> 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("<b>[user]</b> 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"
|
||||
|
||||
@@ -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, "<span class='[L.written_style] [reader_understands ? "understood" : "scramble"]'>[L.short && reader_understands ? "([L.short]) [content]" : content]</span>")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user