-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
book.dm
302 lines (269 loc) · 12.1 KB
/
book.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
/obj/item/storage/book
name = "hollowed book"
desc = "I guess someone didn't like it."
icon = 'icons/obj/library.dmi'
icon_state ="book"
worn_icon_state = "book"
throw_speed = 2
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
resistance_flags = FLAMMABLE
var/title = "book"
/obj/item/storage/book/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 1
/obj/item/storage/book/attack_self(mob/user)
to_chat(user, "<span class='notice'>The pages of [title] have been cut out!</span>")
GLOBAL_LIST_INIT(biblenames, list("Bible", "Quran", "Scrapbook", "Burning Bible", "Clown Bible", "Banana Bible", "Creeper Bible", "White Bible", "Holy Light", "The God Delusion", "Tome", "The King in Yellow", "Ithaqua", "Scientology", "Melted Bible", "Necronomicon", "Insulationism", "Guru Granth Sahib"))
//If you get these two lists not matching in size, there will be runtimes and I will hurt you in ways you couldn't even begin to imagine
// if your bible has no custom itemstate, use one of the existing ones
GLOBAL_LIST_INIT(biblestates, list("bible", "koran", "scrapbook", "burning", "honk1", "honk2", "creeper", "white", "holylight", "atheist", "tome", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon", "insuls", "gurugranthsahib"))
GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", "honk1", "honk2", "creeper", "white", "holylight", "atheist", "tome", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon", "kingyellow", "gurugranthsahib"))
/mob/proc/bible_check() //The bible, if held, might protect against certain things
var/obj/item/storage/book/bible/B = locate() in src
if(is_holding(B))
return B
return 0
/obj/item/storage/book/bible
name = "bible"
desc = "Apply to head repeatedly."
icon = 'icons/obj/storage.dmi'
icon_state = "bible"
inhand_icon_state = "bible"
lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
var/mob/affecting = null
var/deity_name = "Christ"
force_string = "holy"
/obj/item/storage/book/bible/Initialize()
. = ..()
AddComponent(/datum/component/anti_magic, FALSE, TRUE)
/obj/item/storage/book/bible/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is offering [user.p_them()]self to [deity_name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/storage/book/bible/attack_self(mob/living/carbon/human/user)
if(GLOB.bible_icon_state)
return FALSE
if(user?.mind?.holy_role != HOLY_ROLE_HIGHPRIEST)
return FALSE
var/list/skins = list()
for(var/i in 1 to GLOB.biblestates.len)
var/image/bible_image = image(icon = 'icons/obj/storage.dmi', icon_state = GLOB.biblestates[i])
skins += list("[GLOB.biblenames[i]]" = bible_image)
var/choice = show_radial_menu(user, src, skins, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 40, require_near = TRUE)
if(!choice)
return FALSE
var/bible_index = GLOB.biblenames.Find(choice)
if(!bible_index)
return FALSE
icon_state = GLOB.biblestates[bible_index]
inhand_icon_state = GLOB.bibleitemstates[bible_index]
switch(icon_state)
if("honk1")
user.dna.add_mutation(CLOWNMUT)
user.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(user), ITEM_SLOT_MASK)
if("honk2")
user.dna.add_mutation(CLOWNMUT)
user.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(user), ITEM_SLOT_MASK)
if("insuls")
var/obj/item/clothing/gloves/color/fyellow/insuls = new
insuls.name = "insuls"
insuls.desc = "A mere copy of the true insuls."
insuls.siemens_coefficient = 0.99999
user.equip_to_slot(insuls, ITEM_SLOT_GLOVES)
GLOB.bible_icon_state = icon_state
GLOB.bible_inhand_icon_state = inhand_icon_state
SSblackbox.record_feedback("text", "religion_book", 1, "[choice]")
/**
* Checks if we are allowed to interact with a radial menu
*
* Arguments:
* * user The mob interacting with the menu
*/
/obj/item/storage/book/bible/proc/check_menu(mob/living/carbon/human/user)
if(GLOB.bible_icon_state)
return FALSE
if(!istype(user))
return FALSE
if(!user.is_holding(src))
return FALSE
if(!user.can_read(src))
return FALSE
if(user.incapacitated())
return FALSE
if(user.mind?.holy_role != HOLY_ROLE_HIGHPRIEST)
return FALSE
return TRUE
/obj/item/storage/book/bible/proc/bless(mob/living/L, mob/living/user)
if(GLOB.religious_sect)
return GLOB.religious_sect.sect_bless(L,user)
if(!ishuman(L))
return
var/mob/living/carbon/human/H = L
for(var/X in H.bodyparts)
var/obj/item/bodypart/BP = X
if(BP.status == BODYPART_ROBOTIC)
to_chat(user, "<span class='warning'>[src.deity_name] refuses to heal this metallic taint!</span>")
return 0
var/heal_amt = 10
var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1, null, BODYPART_ORGANIC)
if(hurt_limbs.len)
for(var/X in hurt_limbs)
var/obj/item/bodypart/affecting = X
if(affecting.heal_damage(heal_amt, heal_amt, null, BODYPART_ORGANIC))
H.update_damage_overlays()
H.visible_message("<span class='notice'>[user] heals [H] with the power of [deity_name]!</span>")
to_chat(H, "<span class='boldnotice'>May the power of [deity_name] compel you to be healed!</span>")
playsound(src.loc, "punch", 25, TRUE, -1)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
return 1
/obj/item/storage/book/bible/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
if (!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='danger'>[src] slips out of your hand and hits your head.</span>")
user.take_bodypart_damage(10)
user.Unconscious(400)
return
var/chaplain = 0
if(user.mind && (user.mind.holy_role))
chaplain = 1
if(!chaplain)
to_chat(user, "<span class='danger'>The book sizzles in your hands.</span>")
user.take_bodypart_damage(0,10)
return
if (!heal_mode)
return ..()
var/smack = TRUE
if (M.stat != DEAD)
if(chaplain && user == M)
to_chat(user, "<span class='warning'>You can't heal yourself!</span>")
return
if(prob(60) && bless(M, user))
smack = FALSE
else if(iscarbon(M))
var/mob/living/carbon/C = M
if(!istype(C.head, /obj/item/clothing/head/helmet))
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 60)
to_chat(C, "<span class='danger'>You feel dumber.</span>")
if(smack)
M.visible_message("<span class='danger'>[user] beats [M] over the head with [src]!</span>", \
"<span class='userdanger'>[user] beats [M] over the head with [src]!</span>")
playsound(src.loc, "punch", 25, TRUE, -1)
log_combat(user, M, "attacked", src)
else
M.visible_message("<span class='danger'>[user] smacks [M]'s lifeless corpse with [src].</span>")
playsound(src.loc, "punch", 25, TRUE, -1)
/obj/item/storage/book/bible/afterattack(atom/A, mob/user, proximity)
. = ..()
if(!proximity)
return
if(isfloorturf(A))
to_chat(user, "<span class='notice'>You hit the floor with the bible.</span>")
if(user.mind && (user.mind.holy_role))
for(var/obj/effect/rune/R in orange(2,user))
R.invisibility = 0
if(user?.mind?.holy_role)
if(A.reagents && A.reagents.has_reagent(/datum/reagent/water)) // blesses all the water in the holder
to_chat(user, "<span class='notice'>You bless [A].</span>")
var/water2holy = A.reagents.get_reagent_amount(/datum/reagent/water)
A.reagents.del_reagent(/datum/reagent/water)
A.reagents.add_reagent(/datum/reagent/water/holywater,water2holy)
if(A.reagents && A.reagents.has_reagent(/datum/reagent/fuel/unholywater)) // yeah yeah, copy pasted code - sue me
to_chat(user, "<span class='notice'>You purify [A].</span>")
var/unholy2clean = A.reagents.get_reagent_amount(/datum/reagent/fuel/unholywater)
A.reagents.del_reagent(/datum/reagent/fuel/unholywater)
A.reagents.add_reagent(/datum/reagent/water/holywater,unholy2clean)
if(istype(A, /obj/item/storage/book/bible) && !istype(A, /obj/item/storage/book/bible/syndicate))
to_chat(user, "<span class='notice'>You purify [A], conforming it to your belief.</span>")
var/obj/item/storage/book/bible/B = A
B.name = name
B.icon_state = icon_state
B.inhand_icon_state = inhand_icon_state
if(istype(A, /obj/item/cult_bastard) && !iscultist(user))
var/obj/item/cult_bastard/sword = A
to_chat(user, "<span class='notice'>You begin to exorcise [sword].</span>")
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = sword))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
for(var/obj/item/soulstone/SS in sword.contents)
SS.usability = TRUE
for(var/mob/living/simple_animal/shade/EX in SS)
SSticker.mode.remove_cultist(EX.mind, 1, 0)
EX.icon_state = "ghost1"
EX.name = "Purified [EX.name]"
SS.release_shades(user)
qdel(SS)
new /obj/item/nullrod/claymore(get_turf(sword))
user.visible_message("<span class='notice'>[user] purifies [sword]!</span>")
qdel(sword)
else if(istype(A, /obj/item/soulstone) && !iscultist(user))
var/obj/item/soulstone/SS = A
if(SS.purified)
return
to_chat(user, "<span class='notice'>You begin to exorcise [SS].</span>")
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = SS))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
SS.usability = TRUE
SS.purified = TRUE
SS.icon_state = "purified_soulstone"
for(var/mob/M in SS.contents)
if(M.mind)
SS.icon_state = "purified_soulstone2"
if(iscultist(M))
SSticker.mode.remove_cultist(M.mind, FALSE, FALSE)
for(var/mob/living/simple_animal/shade/EX in SS)
EX.icon_state = "ghost1"
EX.name = "Purified [initial(EX.name)]"
user.visible_message("<span class='notice'>[user] purifies [SS]!</span>")
else if(istype(A, /obj/item/nullrod/scythe/talking))
var/obj/item/nullrod/scythe/talking/sword = A
to_chat(user, "<span class='notice'>You begin to exorcise [sword]...</span>")
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = sword))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
for(var/mob/living/simple_animal/shade/S in sword.contents)
to_chat(S, "<span class='userdanger'>You were destroyed by the exorcism!</span>")
qdel(S)
sword.possessed = FALSE //allows the chaplain (or someone else) to reroll a new spirit for their sword
sword.name = initial(sword.name)
REMOVE_TRAIT(sword, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT) //in case the "sword" is a possessed dummy
user.visible_message("<span class='notice'>[user] exorcises [sword]!</span>", \
"<span class='notice'>You successfully exorcise [sword]!</span>")
/obj/item/storage/book/bible/booze
desc = "To be applied to the head repeatedly."
/obj/item/storage/book/bible/booze/PopulateContents()
new /obj/item/reagent_containers/food/drinks/bottle/whiskey(src)
/obj/item/storage/book/bible/syndicate
icon_state ="ebook"
deity_name = "The Syndicate"
throw_speed = 2
throwforce = 18
throw_range = 7
force = 18
hitsound = 'sound/weapons/sear.ogg'
damtype = BURN
name = "Syndicate Tome"
attack_verb_continuous = list("attacks", "burns", "blesses", "damns", "scorches")
attack_verb_simple = list("attack", "burn", "bless", "damn", "scorch")
var/uses = 1
/obj/item/storage/book/bible/syndicate/attack_self(mob/living/carbon/human/H)
if (uses)
H.mind.holy_role = HOLY_ROLE_PRIEST
uses -= 1
to_chat(H, "<span class='userdanger'>You try to open the book AND IT BITES YOU!</span>")
playsound(src.loc, 'sound/effects/snap.ogg', 50, TRUE)
H.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
to_chat(H, "<span class='notice'>Your name appears on the inside cover, in blood.</span>")
var/ownername = H.real_name
desc += "<span class='warning'>The name [ownername] is written in blood inside the cover.</span>"
/obj/item/storage/book/bible/syndicate/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
if (user.a_intent == INTENT_HELP)
return ..()
else
return ..(M,user,heal_mode = FALSE)
/obj/item/storage/book/bible/syndicate/add_blood_DNA(list/blood_dna)
return FALSE