/
constructs.dm
535 lines (476 loc) · 20.1 KB
/
constructs.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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
/mob/living/simple_animal/hostile/construct
name = "Construct"
real_name = "Construct"
desc = ""
gender = NEUTER
mob_biotypes = NONE
speak_emote = list("hisses")
response_help_continuous = "thinks better of touching"
response_help_simple = "think better of touching"
response_disarm_continuous = "flails at"
response_disarm_simple = "flail at"
response_harm_continuous = "punches"
response_harm_simple = "punch"
speak_chance = 1
icon = 'icons/mob/nonhuman-player/cult.dmi'
speed = 0
combat_mode = TRUE
stop_automated_movement = 1
status_flags = CANPUSH
attack_sound = 'sound/weapons/punch1.ogg'
see_in_dark = 7
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_plas" = 0, "max_plas" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
maxbodytemp = INFINITY
healable = 0
faction = list("cult")
pressure_resistance = 100
unique_name = 1
AIStatus = AI_OFF //normal constructs don't have AI
loot = list(/obj/item/ectoplasm)
del_on_death = TRUE
initial_language_holder = /datum/language_holder/construct
death_message = "collapses in a shattered heap."
var/list/construct_spells = list()
var/playstyle_string = "<span class='big bold'>You are a generic construct!</span><b> Your job is to not exist, and you should probably adminhelp this.</b>"
var/master = null
var/seeking = FALSE
/// Whether this construct can repair other constructs or cult buildings.
var/can_repair = FALSE
/// Whether this construct can repair itself. Works independently of can_repair.
var/can_repair_self = FALSE
/// Theme controls color. THEME_CULT is red THEME_WIZARD is purple and THEME_HOLY is blue
var/theme = THEME_CULT
/mob/living/simple_animal/hostile/construct/Initialize(mapload)
. = ..()
AddElement(/datum/element/simple_flying)
ADD_TRAIT(src, TRAIT_HEALS_FROM_CULT_PYLONS, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
for(var/spell in construct_spells)
var/datum/action/new_spell = new spell(src)
new_spell.Grant(src)
var/spellnum = 1
for(var/datum/action/spell as anything in actions)
if(!(type in construct_spells))
continue
var/pos = 2 + spellnum * 31
if(construct_spells.len >= 4)
pos -= 31 * (construct_spells.len - 4)
spell.default_button_position = "6:[pos],4:-2" // Set the default position to this random position
spellnum++
update_action_buttons()
if(icon_state)
add_overlay("glow_[icon_state]_[theme]")
/mob/living/simple_animal/hostile/construct/Login()
. = ..()
if(!. || !client)
return FALSE
to_chat(src, playstyle_string)
/mob/living/simple_animal/hostile/construct/examine(mob/user)
var/t_He = p_they(TRUE)
var/t_s = p_s()
var/text_span
switch(theme)
if(THEME_CULT)
text_span = "cult"
if(THEME_WIZARD)
text_span = "purple"
if(THEME_HOLY)
text_span = "blue"
. = list("<span class='[text_span]'>This is [icon2html(src, user)] \a <b>[src]</b>!\n[desc]")
if(health < maxHealth)
if(health >= maxHealth/2)
. += span_warning("[t_He] look[t_s] slightly dented.")
else
. += span_warning("<b>[t_He] look[t_s] severely dented!</b>")
. += "</span>"
/mob/living/simple_animal/hostile/construct/attack_animal(mob/living/simple_animal/user, list/modifiers)
if(isconstruct(user)) //is it a construct?
var/mob/living/simple_animal/hostile/construct/doll = user
if(!doll.can_repair || (doll == src && !doll.can_repair_self))
return ..()
if(theme != doll.theme)
return ..()
if(health < maxHealth)
adjustHealth(-5)
if(src != user)
Beam(user, icon_state="sendbeam", time = 4)
user.visible_message(span_danger("[user] repairs some of \the <b>[src]'s</b> dents."), \
span_cult("You repair some of <b>[src]'s</b> dents, leaving <b>[src]</b> at <b>[health]/[maxHealth]</b> health."))
else
user.visible_message(span_danger("[user] repairs some of [p_their()] own dents."), \
span_cult("You repair some of your own dents, leaving you at <b>[user.health]/[user.maxHealth]</b> health."))
else
if(src != user)
to_chat(user, span_cult("You cannot repair <b>[src]'s</b> dents, as [p_they()] [p_have()] none!"))
else
to_chat(user, span_cult("You cannot repair your own dents, as you have none!"))
else if(src != user)
return ..()
/mob/living/simple_animal/hostile/construct/narsie_act()
return
/mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE)
return 0
/////////////////Juggernaut///////////////
/mob/living/simple_animal/hostile/construct/juggernaut
name = "Juggernaut"
real_name = "Juggernaut"
desc = "A massive, armored construct built to spearhead attacks and soak up enemy fire."
icon_state = "juggernaut"
icon_living = "juggernaut"
maxHealth = 150
health = 150
response_harm_continuous = "harmlessly punches"
response_harm_simple = "harmlessly punch"
harm_intent_damage = 0
obj_damage = 90
melee_damage_lower = 25
melee_damage_upper = 25
attack_verb_continuous = "smashes their armored gauntlet into"
attack_verb_simple = "smash your armored gauntlet into"
speed = 2.5
environment_smash = ENVIRONMENT_SMASH_WALLS
attack_sound = 'sound/weapons/punch3.ogg'
status_flags = 0
mob_size = MOB_SIZE_LARGE
force_threshold = 10
construct_spells = list(
/datum/action/cooldown/spell/forcewall/cult,
/datum/action/cooldown/spell/basic_projectile/juggernaut,
/datum/action/innate/cult/create_rune/wall,
)
playstyle_string = "<b>You are a Juggernaut. Though slow, your shell can withstand heavy punishment, \
create shield walls, rip apart enemies and walls alike, and even deflect energy weapons.</b>"
/mob/living/simple_animal/hostile/construct/juggernaut/hostile //actually hostile, will move around, hit things
AIStatus = AI_ON
environment_smash = ENVIRONMENT_SMASH_STRUCTURES //only token destruction, don't smash the cult wall NO STOP
/mob/living/simple_animal/hostile/construct/juggernaut/bullet_act(obj/projectile/P)
if(istype(P, /obj/projectile/energy) || istype(P, /obj/projectile/beam))
var/reflectchance = 40 - round(P.damage/3)
if(prob(reflectchance))
apply_damage(P.damage * 0.5, P.damage_type)
visible_message(span_danger("The [P.name] is reflected by [src]'s armored shell!"), \
span_userdanger("The [P.name] is reflected by your armored shell!"))
// Find a turf near or on the original location to bounce to
if(P.starting)
var/new_x = P.starting.x + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3)
var/new_y = P.starting.y + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3)
var/turf/curloc = get_turf(src)
// redirect the projectile
P.original = locate(new_x, new_y, P.z)
P.starting = curloc
P.firer = src
P.yo = new_y - curloc.y
P.xo = new_x - curloc.x
var/new_angle_s = P.Angle + rand(120,240)
while(new_angle_s > 180) // Translate to regular projectile degrees
new_angle_s -= 360
P.set_angle(new_angle_s)
return BULLET_ACT_FORCE_PIERCE // complete projectile permutation
return ..()
//////////////////////////Juggernaut-alts////////////////////////////
/mob/living/simple_animal/hostile/construct/juggernaut/angelic
theme = THEME_HOLY
loot = list(/obj/item/ectoplasm/angelic)
/mob/living/simple_animal/hostile/construct/juggernaut/mystic
theme = THEME_WIZARD
loot = list(/obj/item/ectoplasm/mystic)
/mob/living/simple_animal/hostile/construct/juggernaut/noncult
////////////////////////Wraith/////////////////////////////////////////////
/mob/living/simple_animal/hostile/construct/wraith
name = "Wraith"
real_name = "Wraith"
desc = "A wicked, clawed shell constructed to assassinate enemies and sow chaos behind enemy lines."
icon_state = "wraith"
icon_living = "wraith"
maxHealth = 65
health = 65
melee_damage_lower = 20
melee_damage_upper = 20
retreat_distance = 2 //AI wraiths will move in and out of combat
attack_verb_continuous = "slashes"
attack_verb_simple = "slash"
attack_sound = 'sound/weapons/bladeslice.ogg'
attack_vis_effect = ATTACK_EFFECT_SLASH
construct_spells = list(
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift,
/datum/action/innate/cult/create_rune/tele,
)
playstyle_string = "<b>You are a Wraith. Though relatively fragile, you are fast, deadly, \
can phase through walls, and your attacks will lower the cooldown on phasing.</b>"
// Accomplishing various things gives you a refund on jaunt, to jump in and out.
/// The seconds refunded per attack
var/attack_refund = 1 SECONDS
/// The seconds refunded when putting a target into critical
var/crit_refund = 5 SECONDS
/mob/living/simple_animal/hostile/construct/wraith/AttackingTarget() //refund jaunt cooldown when attacking living targets
var/prev_stat
var/mob/living/living_target = target
if(isliving(living_target) && !IS_CULTIST(living_target))
prev_stat = living_target.stat
. = ..()
if(. && isnum(prev_stat))
var/datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift/jaunt = locate() in actions
if(!jaunt)
return
var/total_refund = 0 SECONDS
// they're dead, and you killed them - full refund
if(QDELETED(living_target) || (living_target.stat == DEAD && prev_stat != DEAD))
total_refund += jaunt.cooldown_time
// you knocked them into critical
else if(HAS_TRAIT(living_target, TRAIT_CRITICAL_CONDITION) && prev_stat == CONSCIOUS)
total_refund += crit_refund
if(living_target.stat != DEAD && prev_stat != DEAD)
total_refund += attack_refund
jaunt.next_use_time -= total_refund
jaunt.UpdateButtons()
/mob/living/simple_animal/hostile/construct/wraith/hostile //actually hostile, will move around, hit things
AIStatus = AI_ON
//////////////////////////Wraith-alts////////////////////////////
/mob/living/simple_animal/hostile/construct/wraith/angelic
theme = THEME_HOLY
construct_spells = list(
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift/angelic,
/datum/action/innate/cult/create_rune/tele,
)
loot = list(/obj/item/ectoplasm/angelic)
/mob/living/simple_animal/hostile/construct/wraith/mystic
theme = THEME_WIZARD
construct_spells = list(
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift/mystic,
/datum/action/innate/cult/create_rune/tele,
)
loot = list(/obj/item/ectoplasm/mystic)
/mob/living/simple_animal/hostile/construct/wraith/noncult
/////////////////////////////Artificer/////////////////////////
/mob/living/simple_animal/hostile/construct/artificer
name = "Artificer"
real_name = "Artificer"
desc = "A bulbous construct dedicated to building and maintaining the Cult of Nar'Sie's armies."
icon_state = "artificer"
icon_living = "artificer"
maxHealth = 50
health = 50
response_harm_continuous = "viciously beats"
response_harm_simple = "viciously beat"
harm_intent_damage = 5
obj_damage = 60
melee_damage_lower = 5
melee_damage_upper = 5
retreat_distance = 10
minimum_distance = 10 //AI artificers will flee like fuck
attack_verb_continuous = "rams"
attack_verb_simple = "ram"
environment_smash = ENVIRONMENT_SMASH_WALLS
attack_sound = 'sound/weapons/punch2.ogg'
construct_spells = list(
/datum/action/cooldown/spell/conjure/cult_floor,
/datum/action/cooldown/spell/conjure/cult_wall,
/datum/action/cooldown/spell/conjure/soulstone,
/datum/action/cooldown/spell/conjure/construct/lesser,
/datum/action/cooldown/spell/aoe/magic_missile/lesser,
/datum/action/innate/cult/create_rune/revive,
)
playstyle_string = "<b>You are an Artificer. You are incredibly weak and fragile, \
but you are able to construct fortifications, use magic missile, and repair allied constructs, shades, \
and yourself (by clicking on them). Additionally, <i>and most important of all,</i> you can create new constructs \
by producing soulstones to capture souls, and shells to place those soulstones into.</b>"
can_repair = TRUE
can_repair_self = TRUE
///The health HUD applied to this mob.
var/health_hud = DATA_HUD_MEDICAL_ADVANCED
/mob/living/simple_animal/hostile/construct/artificer/Initialize(mapload)
. = ..()
var/datum/atom_hud/datahud = GLOB.huds[health_hud]
datahud.show_to(src)
/mob/living/simple_animal/hostile/construct/artificer/Found(atom/A) //what have we found here?
if(isconstruct(A)) //is it a construct?
var/mob/living/simple_animal/hostile/construct/C = A
if(C.health < C.maxHealth) //is it hurt? let's go heal it if it is
return TRUE
return FALSE
/mob/living/simple_animal/hostile/construct/artificer/CanAttack(atom/the_target)
if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it
return FALSE
if(Found(the_target) || ..()) //If we Found it or Can_Attack it normally, we Can_Attack it as long as it wasn't invisible
return TRUE //as a note this shouldn't be added to base hostile mobs because it'll mess up retaliate hostile mobs
return FALSE
/mob/living/simple_animal/hostile/construct/artificer/MoveToTarget(list/possible_targets)
..()
if(isliving(target))
var/mob/living/L = target
if(isconstruct(L) && L.health >= L.maxHealth) //is this target an unhurt construct? stop trying to heal it
LoseTarget()
return
if(L.health <= melee_damage_lower+melee_damage_upper) //ey bucko you're hurt as fuck let's go hit you
retreat_distance = null
minimum_distance = 1
/mob/living/simple_animal/hostile/construct/artificer/Aggro()
..()
if(isconstruct(target)) //oh the target is a construct no need to flee
retreat_distance = null
minimum_distance = 1
/mob/living/simple_animal/hostile/construct/artificer/LoseAggro()
..()
retreat_distance = initial(retreat_distance)
minimum_distance = initial(minimum_distance)
/mob/living/simple_animal/hostile/construct/artificer/hostile //actually hostile, will move around, hit things, heal other constructs
AIStatus = AI_ON
environment_smash = ENVIRONMENT_SMASH_STRUCTURES //only token destruction, don't smash the cult wall NO STOP
/////////////////////////////Artificer-alts/////////////////////////
/mob/living/simple_animal/hostile/construct/artificer/angelic
desc = "A bulbous construct dedicated to building and maintaining holy armies."
theme = THEME_HOLY
loot = list(/obj/item/ectoplasm/angelic)
construct_spells = list(
/datum/action/cooldown/spell/conjure/soulstone/purified,
/datum/action/cooldown/spell/conjure/construct/lesser,
/datum/action/cooldown/spell/aoe/magic_missile/lesser,
/datum/action/innate/cult/create_rune/revive,
)
/mob/living/simple_animal/hostile/construct/artificer/mystic
theme = THEME_WIZARD
loot = list(/obj/item/ectoplasm/mystic)
construct_spells = list(
/datum/action/cooldown/spell/conjure/cult_floor,
/datum/action/cooldown/spell/conjure/cult_wall,
/datum/action/cooldown/spell/conjure/soulstone/mystic,
/datum/action/cooldown/spell/conjure/construct/lesser,
/datum/action/cooldown/spell/aoe/magic_missile/lesser,
/datum/action/innate/cult/create_rune/revive,
)
/mob/living/simple_animal/hostile/construct/artificer/noncult
construct_spells = list(
/datum/action/cooldown/spell/conjure/cult_floor,
/datum/action/cooldown/spell/conjure/cult_wall,
/datum/action/cooldown/spell/conjure/soulstone/noncult,
/datum/action/cooldown/spell/conjure/construct/lesser,
/datum/action/cooldown/spell/aoe/magic_missile/lesser,
/datum/action/innate/cult/create_rune/revive,
)
/////////////////////////////Harvester/////////////////////////
/mob/living/simple_animal/hostile/construct/harvester
name = "Harvester"
real_name = "Harvester"
desc = "A long, thin construct built to herald Nar'Sie's rise. It'll be all over soon."
icon_state = "harvester"
icon_living = "harvester"
maxHealth = 40
health = 40
sight = SEE_MOBS | SEE_BLACKNESS
melee_damage_lower = 15
melee_damage_upper = 20
attack_verb_continuous = "butchers"
attack_verb_simple = "butcher"
attack_sound = 'sound/weapons/bladeslice.ogg'
attack_vis_effect = ATTACK_EFFECT_SLASH
construct_spells = list(
/datum/action/cooldown/spell/aoe/area_conversion,
/datum/action/cooldown/spell/forcewall/cult,
)
playstyle_string = "<B>You are a Harvester. You are incapable of directly killing humans, but your attacks will remove their limbs: \
Bring those who still cling to this world of illusion back to the Geometer so they may know Truth. Your form and any you are pulling can pass through runed walls effortlessly.</B>"
can_repair = TRUE
/mob/living/simple_animal/hostile/construct/harvester/Bump(atom/AM)
. = ..()
if(istype(AM, /turf/closed/wall/mineral/cult) && AM != loc) //we can go through cult walls
var/atom/movable/stored_pulling = pulling
if(stored_pulling)
stored_pulling.setDir(get_dir(stored_pulling.loc, loc))
stored_pulling.forceMove(loc)
forceMove(AM)
if(stored_pulling)
start_pulling(stored_pulling, supress_message = TRUE) //drag anything we're pulling through the wall with us by magic
/mob/living/simple_animal/hostile/construct/harvester/AttackingTarget()
if(iscarbon(target))
var/mob/living/carbon/C = target
if(HAS_TRAIT(C, TRAIT_NODISMEMBER))
return ..() //ATTACK!
var/list/parts = list()
var/undismembermerable_limbs = 0
for(var/X in C.bodyparts)
var/obj/item/bodypart/BP = X
if(BP.body_part != HEAD && BP.body_part != CHEST)
if(BP.dismemberable)
parts += BP
else
undismembermerable_limbs++
if(!LAZYLEN(parts))
if(undismembermerable_limbs) //they have limbs we can't remove, and no parts we can, attack!
return ..()
C.Paralyze(60)
visible_message(span_danger("[src] knocks [C] down!"))
to_chat(src, span_cultlarge("\"Bring [C.p_them()] to me.\""))
return FALSE
do_attack_animation(C)
var/obj/item/bodypart/BP = pick(parts)
BP.dismember()
return FALSE
. = ..()
/mob/living/simple_animal/hostile/construct/harvester/Initialize(mapload)
. = ..()
var/datum/action/innate/seek_prey/seek = new()
seek.Grant(src)
seek.Activate()
///////////////////////Master-Tracker///////////////////////
/datum/action/innate/seek_master
name = "Seek your Master"
desc = "You and your master share a soul-link that informs you of their location"
background_icon_state = "bg_demon"
buttontooltipstyle = "cult"
button_icon_state = "cult_mark"
var/tracking = FALSE
var/mob/living/simple_animal/hostile/construct/the_construct
/datum/action/innate/seek_master/Grant(mob/living/C)
the_construct = C
..()
/datum/action/innate/seek_master/Activate()
var/datum/antagonist/cult/C = owner.mind.has_antag_datum(/datum/antagonist/cult)
if(!C)
return
var/datum/objective/eldergod/summon_objective = locate() in C.cult_team.objectives
if(summon_objective.check_completion())
the_construct.master = C.cult_team.blood_target
if(!the_construct.master)
to_chat(the_construct, "<span class='cult italic'>You have no master to seek!</span>")
the_construct.seeking = FALSE
return
if(tracking)
tracking = FALSE
the_construct.seeking = FALSE
to_chat(the_construct, "<span class='cult italic'>You are no longer tracking your master.</span>")
return
else
tracking = TRUE
the_construct.seeking = TRUE
to_chat(the_construct, "<span class='cult italic'>You are now tracking your master.</span>")
/datum/action/innate/seek_prey
name = "Seek the Harvest"
desc = "None can hide from Nar'Sie, activate to track a survivor attempting to flee the red harvest!"
icon_icon = 'icons/mob/actions/actions_cult.dmi'
background_icon_state = "bg_demon"
buttontooltipstyle = "cult"
button_icon_state = "cult_mark"
/datum/action/innate/seek_prey/Activate()
if(GLOB.cult_narsie == null)
return
var/mob/living/simple_animal/hostile/construct/harvester/the_construct = owner
if(the_construct.seeking)
desc = "None can hide from Nar'Sie, activate to track a survivor attempting to flee the red harvest!"
button_icon_state = "cult_mark"
the_construct.seeking = FALSE
to_chat(the_construct, "<span class='cult italic'>You are now tracking Nar'Sie, return to reap the harvest!</span>")
return
else
if(LAZYLEN(GLOB.cult_narsie.souls_needed))
the_construct.master = pick(GLOB.cult_narsie.souls_needed)
var/mob/living/real_target = the_construct.master //We can typecast this way because Narsie only allows /mob/living into the souls list
to_chat(the_construct, "<span class='cult italic'>You are now tracking your prey, [real_target.real_name] - harvest [real_target.p_them()]!</span>")
else
to_chat(the_construct, "<span class='cult italic'>Nar'Sie has completed her harvest!</span>")
return
desc = "Activate to track Nar'Sie!"
button_icon_state = "sintouch"
the_construct.seeking = TRUE