From 4c0da7d43b8b2e7bc69ffd1fbbdbc0a565927be6 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 21 May 2023 22:07:43 +0100 Subject: [PATCH] [MIRROR] Book patches [MDB IGNORE] (#21321) * Book patches (#75565) ## About The Pull Request 1. Fixes #75555 knives already have their `sharpness = SHARP_EDGED` so there's no need to explicitly type check for them and overall that if condition was just a mind blender, so it's better now 2. Fixes #75577 bibles can convert other bibles again and will not attempt to store it inside. Carrying over the fix that was implemented in #73137 ## Changelog :cl: fix: wire cutter's can carve out book's again. fix: bibles can convert other bibles /:cl: --------- Co-authored-by: carlarctg <53100513+carlarctg@ users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Book patches --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: carlarctg <53100513+carlarctg@ users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> --- code/modules/library/bibles.dm | 3 +++ code/modules/library/book.dm | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/code/modules/library/bibles.dm b/code/modules/library/bibles.dm index 830d5c65f19..5a22b95db17 100644 --- a/code/modules/library/bibles.dm +++ b/code/modules/library/bibles.dm @@ -246,6 +246,9 @@ GLOBAL_LIST_INIT(bibleitemstates, list( playsound(target_mob, SFX_PUNCH, 25, TRUE, -1) log_combat(user, target_mob, "attacked", src) +/obj/item/book/bible/attackby_storage_insert(datum/storage, atom/storage_holder, mob/user) + return !istype(storage_holder, /obj/item/book/bible) + /obj/item/book/bible/afterattack(atom/bible_smacked, mob/user, proximity_flag, click_parameters) . = ..() if(!proximity_flag) diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index 268a2cfb10f..1736a328850 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -177,15 +177,15 @@ return FALSE if(!user.combat_mode) return FALSE - if(!((carving_item.sharpness & SHARP_EDGED) && (carving_item.tool_behaviour != TOOL_KNIFE) && (carving_item.tool_behaviour != TOOL_WIRECUTTER))) - return FALSE - //i hate balloon alerts i hate them so god damn much - balloon_alert(user, "carving out...") - if(!do_after(user, 3 SECONDS, target = src)) - balloon_alert(user, "interrupted!") - return FALSE - carve_out(carving_item, user) - return TRUE + //special check for wirecutter's because they don't have a sharp edge + if((carving_item.sharpness & SHARP_EDGED) || (carving_item.tool_behaviour == TOOL_WIRECUTTER)) + balloon_alert(user, "carving out...") + if(!do_after(user, 3 SECONDS, target = src)) + balloon_alert(user, "interrupted!") + return FALSE + carve_out(carving_item, user) + return TRUE + return FALSE /// Called when the book gets carved successfully /obj/item/book/proc/carve_out(obj/item/carving_item, mob/living/user)