/
narsie.dm
358 lines (287 loc) · 8.7 KB
/
narsie.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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
var/global/narsie_behaviour = "CultStation13"
var/global/narsie_cometh = 0
var/global/list/narsie_list = list()
/obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer
name = "Nar-Sie"
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
icon = 'icons/obj/narsie.dmi'
icon_state = "narsie-small"
pixel_x = -236
pixel_y = -256
current_size = 9 //It moves/eats like a max-size singulo, aside from range. --NEO.
contained = 0 // Are we going to move around?
dissipate = 0 // Do we lose energy over time?
grav_pull = 10 //How many tiles out do we pull?
consume_range = 3 //How many tiles out do we eat
/obj/singularity/narsie/New()
..()
narsie_list.Add(src)
/obj/singularity/narsie/Destroy()
narsie_list.Remove(src)
..()
/obj/singularity/narsie/large
name = "Nar-Sie"
icon = 'icons/obj/narsie.dmi'
icon_state = "narsie"//mobs perceive the geometer of blood through their see_narsie proc
// Pixel stuff centers Narsie.
pixel_x = -236
pixel_y = -256
light_range = 1
light_color = "#3e0000"
current_size = 6
consume_range = 6 // How many tiles out do we eat.
var/announce=1
var/cause_hell = 1
/obj/singularity/narsie/large/New()
..()
if(announce)
to_world(SPAN_SIZE(15, SPAN_COLOR("red", "<b>[uppertext(name)] HAS RISEN</b>")))
sound_to(world, sound('sound/effects/wind/wind_5_1.ogg'))
narsie_spawn_animation()
if(!narsie_cometh)//so we don't initiate Hell more than one time.
if(cause_hell)
SetUniversalState(/datum/universal_state/hell)
narsie_cometh = 1
spawn(10 SECONDS)
if(evacuation_controller)
evacuation_controller.call_evacuation(null, TRUE, 1)
evacuation_controller.evac_no_return = 0 // Cannot recall
/obj/singularity/narsie/Process()
eat()
if (!target || prob(5))
pickcultist()
move()
if (prob(25))
mezzer()
/obj/singularity/narsie/large/eat()
for (var/turf/A in orange(consume_range, src))
consume(A)
/obj/singularity/narsie/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(M.stat == CONSCIOUS)
if(M.status_flags & GODMODE)
continue
if(!iscultist(M))
to_chat(M, SPAN_DANGER(" You feel your sanity crumble away in an instant as you gaze upon [src.name]..."))
M.apply_effect(3, EFFECT_STUN)
/obj/singularity/narsie/large/Bump(atom/A)
if(!cause_hell) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
qdel(A)
/obj/singularity/narsie/large/Bumped(atom/A)
if(!cause_hell) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
qdel(A)
/obj/singularity/narsie/move(force_move = 0)
if(!move_self)
return 0
var/movement_dir = pick(GLOB.alldirs - last_failed_movement)
if(force_move)
movement_dir = force_move
if(target && prob(60))
movement_dir = get_dir(src,target)
spawn(0)
step(src, movement_dir)
spawn(1)
step(src, movement_dir)
return 1
/obj/singularity/narsie/large/move(force_move = 0)
if(!move_self)
return 0
var/movement_dir = pick(GLOB.alldirs - last_failed_movement)
if(force_move)
movement_dir = force_move
if(target && prob(60))
movement_dir = get_dir(src,target)
spawn(0)
step(src, movement_dir)
narsiefloor(get_turf(loc))
for(var/mob/M in GLOB.player_list)
if(M.client)
M.see_narsie(src,movement_dir)
spawn(10)
step(src, movement_dir)
narsiefloor(get_turf(loc))
for(var/mob/M in GLOB.player_list)
if(M.client)
M.see_narsie(src,movement_dir)
return 1
/obj/singularity/narsie/proc/narsiefloor(turf/T)//leaving "footprints"
if(!(istype(T, /turf/simulated/wall/cult)||istype(T, /turf/space)))
if(T.icon_state != "cult-narsie")
T.desc = "Something that goes beyond your understanding went this way."
T.icon = 'icons/turf/flooring/cult.dmi'
T.icon_state = "cult-narsie"
T.set_light(1)
/obj/singularity/narsie/proc/narsiewall(turf/T)
T.desc = "An opening has been made on that wall, but who can say if what you seek truly lies on the other side?"
T.icon = 'icons/turf/walls.dmi'
T.icon_state = "cult-narsie"
T.set_opacity(0)
T.set_density(0)
set_light(1, 1)
/obj/singularity/narsie/large/consume(atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO
//NEW BEHAVIOUR
if(narsie_behaviour == "CultStation13")
//MOB PROCESSING
new_narsie(A)
//OLD BEHAVIOUR
else if(narsie_behaviour == "Nar-Singulo")
old_narsie(A)
/obj/singularity/narsie/proc/new_narsie(atom/A)
if (ismob(A) && (get_dist(A, src) <= 7))
var/mob/M = A
if(M.status_flags & GODMODE)
return 0
M.cultify()
//TURF PROCESSING
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM in A.contents)
if (dist <= consume_range)
consume(AM)
continue
if (dist <= consume_range && !istype(A, /turf/space))
var/turf/T = A
if(T.holy)
T.holy = 0 //Nar-Sie doesn't give a shit about sacred grounds.
T.cultify()
/obj/singularity/narsie/proc/old_narsie(atom/A)
if(!(A.singuloCanEat()))
return 0
if (istype(A, /mob/living))
var/mob/living/C2 = A
if(C2.status_flags & GODMODE)
return 0
C2.dust() // Changed from gib(), just for less lag.
else if (isobj(A))
qdel(A)
if (A)
qdel(A)
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM2 in A.contents)
if (AM2 == src) // This is the snowflake.
continue
if (dist <= consume_range)
consume(AM2)
continue
if (dist <= consume_range && !istype(A, get_base_turf_by_area(A)))
var/turf/T2 = A
T2.ChangeTurf(get_base_turf_by_area(A))
/obj/singularity/narsie/consume(atom/A) //This one is for the small ones.
if(!(A.singuloCanEat()))
return 0
if (istype(A, /mob/living))
var/mob/living/C2 = A
if(C2.status_flags & GODMODE)
return 0
C2.dust() // Changed from gib(), just for less lag.
else if (isobj(A))
qdel(A)
if (A)
qdel(A)
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM2 in A.contents)
if (AM2 == src) // This is the snowflake.
continue
if (dist <= consume_range)
consume(AM2)
continue
if (dist > consume_range)
if(!(AM2.singuloCanEat()))
continue
if (INVISIBILITY_ABSTRACT == AM2.invisibility)
continue
addtimer(new Callback(AM2, /atom/proc/singularity_pull, src, current_size), 0)
if (dist <= consume_range && !istype(A, get_base_turf_by_area(A)))
var/turf/T2 = A
T2.ChangeTurf(get_base_turf_by_area(A))
/obj/singularity/narsie/ex_act(severity) //No throwing bombs at it either. --NEO
return
/obj/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO
var/list/cultists = list()
for(var/datum/mind/cult_nh_mind in GLOB.cult.current_antagonists)
if(!cult_nh_mind.current)
continue
if(cult_nh_mind.current.stat)
continue
if(get_z(cult_nh_mind.current) != z)
continue
cultists += cult_nh_mind.current
if(length(cultists))
acquire(pick(cultists))
return
//If there was living cultists, it picks one to follow.
for(var/mob/living/carbon/human/food in GLOB.alive_mobs)
if(food.stat)
continue
var/turf/pos = get_turf(food)
if(!pos) //Catches failure of get_turf.
continue
if(pos.z != src.z)
continue
cultists += food
if(length(cultists))
acquire(pick(cultists))
return
//no living cultists, pick a living human instead.
for(var/mob/observer/ghost/ghost in GLOB.player_list)
if(!ghost.client)
continue
var/turf/pos = get_turf(ghost)
if(pos.z != src.z)
continue
cultists += ghost
if(length(cultists))
acquire(pick(cultists))
return
//no living humans, follow a ghost instead.
/obj/singularity/narsie/proc/acquire(mob/food)
var/capname = uppertext(name)
to_chat(target, SPAN_NOTICE("<b>[capname] HAS LOST INTEREST IN YOU.</b>"))
target = food
if (ishuman(target))
to_chat(target, SPAN_DANGER("[capname] HUNGERS FOR YOUR SOUL."))
else
to_chat(target, SPAN_DANGER("[capname] HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL."))
/obj/singularity/narsie/on_capture()
chained = 1
move_self = 0
icon_state ="narsie-small-chains"
/obj/singularity/narsie/on_release()
chained = 0
move_self = 1
icon_state ="narsie-small"
/obj/singularity/narsie/large/on_capture()
chained = 1
move_self = 0
icon_state ="narsie-chains"
for(var/mob/M in SSmobs.mob_list)//removing the client image of nar-sie while it is chained
if(M.client)
M.see_narsie(src)
/obj/singularity/narsie/large/on_release()
chained = 0
move_self = 1
icon_state ="narsie"
/**
* Wizard narsie.
*/
/obj/singularity/narsie/wizard
grav_pull = 0
/obj/singularity/narsie/wizard/eat()
for (var/turf/T in trange(consume_range, src))
consume(T)
/obj/singularity/narsie/proc/narsie_spawn_animation()
icon = 'icons/obj/narsie_spawn_anim.dmi'
dir = SOUTH
move_self = 0
flick("narsie_spawn_anim",src)
sleep(11)
move_self = 1
icon = initial(icon)