From 387c884bd71adbf499f1b278b2b1977a42541d14 Mon Sep 17 00:00:00 2001 From: ToasterBiome Date: Fri, 11 Feb 2022 19:13:20 -0600 Subject: [PATCH] stuff --- code/datums/components/anti_magic.dm | 7 +++++-- code/game/objects/items/storage/book.dm | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/datums/components/anti_magic.dm b/code/datums/components/anti_magic.dm index c573b38837d9..86724591adc9 100644 --- a/code/datums/components/anti_magic.dm +++ b/code/datums/components/anti_magic.dm @@ -7,8 +7,9 @@ var/blocks_self = TRUE var/datum/callback/reaction var/datum/callback/expire + var/special_role = 0 -/datum/component/anti_magic/Initialize(_magic = FALSE, _holy = FALSE, _psychic = FALSE, _allowed_slots, _charges, _blocks_self = TRUE, datum/callback/_reaction, datum/callback/_expire) +/datum/component/anti_magic/Initialize(_magic = FALSE, _holy = FALSE, _psychic = FALSE, _allowed_slots, _charges, _blocks_self = TRUE, datum/callback/_reaction, datum/callback/_expire, _special_role = 0) if(isitem(parent)) RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip) RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop) @@ -27,12 +28,14 @@ blocks_self = _blocks_self reaction = _reaction expire = _expire + special_role = _special_role /datum/component/anti_magic/proc/on_equip(datum/source, mob/equipper, slot) if(!CHECK_BITFIELD(allowed_slots, slotdefine2slotbit(slot))) //Check that the slot is valid for antimagic UnregisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC) return - RegisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC, .proc/protect, TRUE) + if(equipper.mind?.holy_role >= special_role) //CONVERT OR DIE + RegisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC, .proc/protect, TRUE) /datum/component/anti_magic/proc/on_drop(datum/source, mob/user) UnregisterSignal(user, COMSIG_MOB_RECEIVE_MAGIC) diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index f31025e42764..b72fe4aaac8e 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", /obj/item/storage/book/bible/Initialize() . = ..() - AddComponent(/datum/component/anti_magic, FALSE, TRUE) + AddComponent(/datum/component/anti_magic, FALSE, TRUE, FALSE, null, null, TRUE, null, null, HOLY_ROLE_PRIEST) /obj/item/storage/book/bible/suicide_act(mob/user) user.visible_message(span_suicide("[user] is offering [user.p_them()]self to [deity_name]! It looks like [user.p_theyre()] trying to commit suicide!"))