Reading books can help decrease brain damage (#22582)

* librarian has a purpose now

* i forgot to push this

* lewc review
This commit is contained in:
Contrabang
2023-09-30 08:37:49 -04:00
committed by GitHub
parent bee378f52a
commit dd9837401b
4 changed files with 28 additions and 0 deletions
+10
View File
@@ -558,3 +558,13 @@
#define RQ_NONEW_MESSAGES 0 // RQ_NONEWMESSAGES = no new message
#define RQ_NORMALPRIORITY 1 // RQ_NORMALPRIORITY = normal priority
#define RQ_HIGHPRIORITY 2 // RQ_HIGHPRIORITY = high priority
/**
* Reading books can help with brain damage!
* These are seperate times so that a user gains more benefits by reading more books,
* but also cant infinitely switch between 1000 books.
*/
/// The amount of time needed to pass to let a single book be read again for brain benefits
#define BRAIN_DAMAGE_BOOK_TIME 45 SECONDS
/// The amount of time a mob needs to wait between any book reading
#define BRAIN_DAMAGE_MOB_TIME 10 SECONDS
+2
View File
@@ -102,6 +102,8 @@
#define STATUS_EFFECT_CRYO_BEAM /datum/status_effect/cryo_beam //Chills target, freezes reagents in their blood, breaks if sight is lost.
#define STATUS_BOOKWYRM /datum/status_effect/bookwyrm
//#define STATUS_EFFECT_NECROPOLIS_CURSE /datum/status_effect/necropolis_curse
//#define CURSE_BLINDING 1 //makes the edges of the target's screen obscured
//#define CURSE_SPAWNING 2 //spawns creatures that attack the target only
+4
View File
@@ -736,3 +736,7 @@
/datum/status_effect/rev_protection/on_remove()
UnregisterSignal(owner, COMSIG_HUMAN_ATTACKED)
. = ..()
/datum/status_effect/bookwyrm
duration = BRAIN_DAMAGE_MOB_TIME
alert_type = null
+12
View File
@@ -55,6 +55,8 @@
var/carved = FALSE
///Item that is stored inside the book
var/obj/item/store
/// Cooldown for brain damage loss when reading
COOLDOWN_DECLARE(brain_damage_cooldown)
/obj/item/book/Initialize(mapload, datum/cachedbook/CB, _copyright = FALSE, _protected = FALSE)
. = ..()
@@ -137,6 +139,16 @@
if(!can_read(user))
return
if(isliving(user))
var/mob/living/L = user
// Books can be read every BRAIN_DAMAGE_BOOK_TIME, and has a minumum delay of BRAIN_DAMAGE_MOB_TIME between seperate book reads.
if(!L.has_status_effect(STATUS_BOOKWYRM) && COOLDOWN_FINISHED(src, brain_damage_cooldown))
if(prob(10))
to_chat(L, "<span class='notice'>You feel a bit smarter!</span>")
L.adjustBrainLoss(-1)
COOLDOWN_START(src, brain_damage_cooldown, BRAIN_DAMAGE_BOOK_TIME)
L.apply_status_effect(STATUS_BOOKWYRM)
show_content(user) //where all the magic happens
onclose(user, "book")