diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index 4dd886c1a7d..df5d21da916 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -23,9 +23,11 @@ used = TRUE /obj/item/book/granter/attack_self(mob/user) - if(reading == TRUE) + if(reading) to_chat(user, "You're already reading this!") return FALSE + if(!user.can_read(src)) + return FALSE return TRUE ///ACTION BUTTONS/// @@ -132,10 +134,10 @@ if(knownspell.type == S.type) if(user.mind) if(iswizard(user)) - to_chat(user,"You're already far more versed in this spell than this flimsy howto book can provide.") + to_chat(user,"You're already far more versed in this spell than this flimsy how-to book can provide.") else to_chat(user,"You've already read this one.") - return + return FALSE if(used == TRUE && oneuse == TRUE) recoil(user) else @@ -146,7 +148,7 @@ to_chat(user, "You stop reading...") reading = FALSE qdel(S) - return + return FALSE if(do_after(user,50, user)) to_chat(user, "You feel like you've experienced enough to cast [spellname]!") user.mind.AddSpell(S) diff --git a/code/game/objects/items/manuals.dm b/code/game/objects/items/manuals.dm index 6194c4d9ca1..5939f1b7e33 100644 --- a/code/game/objects/items/manuals.dm +++ b/code/game/objects/items/manuals.dm @@ -37,7 +37,7 @@

It really is that easy! Good luck! - + "} @@ -241,7 +241,7 @@ /obj/item/book/manual/wiki/attack_self() if(!dat) initialize_wikibook() - ..() + return ..() /obj/item/book/manual/wiki/proc/initialize_wikibook() var/wikiurl = CONFIG_GET(string/wikiurl) @@ -344,14 +344,14 @@ author = "Sir John Rose" title = "Barman Recipes: Mixing Drinks and Changing Lives" page_link = "Guide_to_food_and_drinks" - + /obj/item/book/manual/wiki/robotics_cyborgs name = "Robotics for Dummies" icon_state = "borgbook" author = "XISC" title = "Robotics for Dummies" page_link = "Guide_to_robotics" - + /obj/item/book/manual/wiki/research_and_development name = "Research and Development 101" icon_state = "rdbook" @@ -401,7 +401,7 @@ author = "the City-state of Atmosia" title = "Lexica Atmosia" page_link = "Guide_to_Atmospherics" - + /obj/item/book/manual/wiki/medicine name = "Medical Space Compendium, Volume 638" icon_state = "book8" diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index dcb328ae20d..3e1ae71f291 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -50,6 +50,8 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", " /obj/item/storage/book/bible/attack_self(mob/living/carbon/human/H) if(!istype(H)) return + if(!H.can_read(src)) + return FALSE // If H is the Chaplain, we can set the icon_state of the bible (but only once!) if(!SSreligion.bible_icon_state && H.job == "Chaplain") var/dat = "Pick Bible Style

Pick a bible style

" diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index 3d94af05c03..13a76d20370 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -193,7 +193,7 @@ // devils do not need to breathe /mob/living/carbon/true_devil/is_literate() - return 1 + return TRUE /mob/living/carbon/true_devil/ex_act(severity, ex_target) if(!ascended) diff --git a/code/modules/library/lib_codex_gigas.dm b/code/modules/library/lib_codex_gigas.dm index d3d95db974a..7a33e3afd99 100644 --- a/code/modules/library/lib_codex_gigas.dm +++ b/code/modules/library/lib_codex_gigas.dm @@ -21,12 +21,8 @@ var/currentSection = PRE_TITLE /obj/item/book/codex_gigas/attack_self(mob/user) - if(is_blind(user)) - to_chat(user, "As you are trying to read, you suddenly feel very stupid.") - return - if(!user.is_literate()) - to_chat(user, "You skim through the book but can't comprehend any of it.") - return + if(!user.can_read(src)) + return FALSE if(inUse) to_chat(user, "Someone else is reading it.") if(ishuman(user)) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 0b7e4176eae..e84af50422a 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -197,12 +197,9 @@ var/title //The real name of the book. var/window_size = null // Specific window size for the book, i.e: "1920x1080", Size x Width + /obj/item/book/attack_self(mob/user) - if(is_blind(user)) - to_chat(user, "As you are trying to read, you suddenly feel very stupid!") - return - if(ismonkey(user)) - to_chat(user, "You skim through the book but can't comprehend any of it.") + if(!user.can_read(src)) return if(dat) user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]") diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index af86f5ac17b..b76ae7fffa2 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -543,6 +543,8 @@ w_class = 2 /obj/item/book_of_babel/attack_self(mob/user) + if(!user.can_read(src)) + return FALSE to_chat(user, "You flip through the pages of the book, quickly and conveniently learning every language in existence. Somewhat less conveniently, the aging book crumbles to dust in the process. Whoops.") user.grant_all_languages(omnitongue=TRUE) new /obj/effect/decal/cleanable/ash(get_turf(user)) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ed9fd55a75e..057a85097ab 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -734,7 +734,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return IsAdminGhost(usr) /mob/dead/observer/is_literate() - return 1 + return TRUE /mob/dead/observer/vv_edit_var(var_name, var_value) . = ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ee0d139e416..4fc56f56c8c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -811,7 +811,7 @@ . += dna.species.check_weakness(weapon, attacker) /mob/living/carbon/human/is_literate() - return 1 + return TRUE /mob/living/carbon/human/can_hold_items() return TRUE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index d0e3fc8b1c6..768d6e685ad 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -399,7 +399,7 @@ return ..() /mob/living/silicon/is_literate() - return 1 + return TRUE /mob/living/silicon/get_inactive_held_item() return FALSE diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index d4cbd058f30..181f1be14b5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -889,7 +889,16 @@ /mob/proc/is_literate() - return 0 + return FALSE + +/mob/proc/can_read(obj/O) + if(is_blind(src)) + to_chat(src, "As you are trying to read [O], you suddenly feel very stupid!") + return + if(!is_literate()) + to_chat(src, "You try to read [O], but can't comprehend any of it.") + return + return TRUE /mob/proc/can_hold_items() return FALSE diff --git a/code/modules/spells/spell_types/mime.dm b/code/modules/spells/spell_types/mime.dm index e7501b2fdb6..85c4c0f5f29 100644 --- a/code/modules/spells/spell_types/mime.dm +++ b/code/modules/spells/spell_types/mime.dm @@ -138,7 +138,9 @@ remarks = list("...") /obj/item/book/granter/spell/mimery_blockade/attack_self(mob/user) - ..() + . = ..() + if(!.) + return if(!locate(/obj/effect/proc_holder/spell/targeted/mime/speak) in user.mind.spell_list) user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mime/speak) @@ -151,6 +153,8 @@ remarks = list("...") /obj/item/book/granter/spell/mimery_guns/attack_self(mob/user) - ..() + . = ..() + if(!.) + return if(!locate(/obj/effect/proc_holder/spell/targeted/mime/speak) in user.mind.spell_list) - user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mime/speak) \ No newline at end of file + user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mime/speak)